Security/ Package Name changes 01/29701/3
authorst782s <statta@research.att.com>
Tue, 30 Jan 2018 22:29:36 +0000 (17:29 -0500)
committerst782s <statta@research.att.com>
Thu, 1 Feb 2018 20:10:02 +0000 (15:10 -0500)
Issue-ID: PORTAL-174, PORTAL-157, PORTAL-156, PORTAL-148, PORTAL-145,
PORTAL-140, PORTAL-133, PORTAL-121, PORTAL-111, PORTAL-88

Includes security fixes, Role Centralization, replace certain ECOMP
occurrences etc

Change-Id: I3c8b706709c6b92e646e3cbe50c2d660e8a46ef4
Signed-off-by: st782s <statta@research.att.com>
1399 files changed:
.gitignore
deliveries/.env
deliveries/Apps_Users_OnBoarding_Script.sql
deliveries/Dockerfile.mariadb
deliveries/Dockerfile.portal [new file with mode: 0644]
deliveries/Dockerfile.portalapps [deleted file]
deliveries/Dockerfile.sdk [new file with mode: 0644]
deliveries/Dockerfile.widgetms
deliveries/build_portalapps_dockers.sh
deliveries/docker-compose.yml
deliveries/local-dev-host-clone.sh [new file with mode: 0644]
deliveries/local-dev-host-pull.sh [new file with mode: 0644]
deliveries/local-dev-host-start.sh [new file with mode: 0644]
deliveries/os_docker_base.sh
deliveries/os_docker_push.sh
deliveries/os_docker_release.sh
deliveries/properties_simpledemo/ONAPPORTALSDK/logback.xml
deliveries/properties_simpledemo/ONAPPORTALSDK/system.properties
deliveries/properties_simpledemo/ONAPWIDGETMS/application.properties
deliveries/properties_simpledemo/ONAPWIDGETMS/application.yml [new file with mode: 0644]
deliveries/start-apache-tomcat.sh [new file with mode: 0644]
deliveries/start-apps-cmd.sh [deleted file]
deliveries/start-wms.sh [moved from deliveries/start-wms-cmd.sh with 100% similarity, mode: 0644]
deliveries/wait-for.sh [deleted file]
docs/conf.py [deleted file]
ecomp-portal-BE-common/.gitignore
ecomp-portal-BE-common/pom.xml
ecomp-portal-BE-common/src/main/java/jarutil/ExtractJar.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/command/EPLoginBean.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/command/PostSearchBean.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanup.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/PortalCentralAccessConfiguration.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/SwaggerConfig.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/SwaggerMVCConfig.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPFusionBaseController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPRestrictedBaseController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPRestrictedRESTfulBaseController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPUnRestrictedBaseController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/sessionmgt/SessionCommunicationController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/externalsystemapproval/model/ExternalSystemRoleApproval.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/externalsystemapproval/model/ExternalSystemUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/model/Result.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppCatalogController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppContactUsController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/AuditLogController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BEPropertyReaderController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthAccountController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthenticationController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/CommonWidgetController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ConsulClientController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/EncryptAdminController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAccessRolesController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/FunctionalMenuController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/GetAccessController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/HealthCheckController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ManifestController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/MicroserviceProxyController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RoleManageController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/RolesApprovalSystemController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerAuxController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SchedulerController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/SharedContextRestController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/TicketEventController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserNotificationController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/UserRolesController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/WidgetsController.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AdminUserApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AdminUserApplications.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/App.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppContactUs.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppIdAndNameTransportModel.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppsResponse.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/BEProperty.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/BasicAuthCredentials.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralV2RoleFunction.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralizedApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPAppRoleFunction.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPEndpoint.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPEndpointAccount.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppCatalogRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequestDetail.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppsManualSortPreference.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppsSortPreference.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserNotification.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPWidgetsManualSortPreference.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAppRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAppRoleId.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAuditLog.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalRoleDetails.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalSystemAccess.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppID.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/GetAccessResult.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/GetAccessResultId.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceData.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceParameter.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/PersUserAppSelection.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/PersUserWidgetSelection.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/RoleApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/SharedContext.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserIdRoleId.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/Widget.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetCatalog.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetCatalogParameter.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetParameterResult.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetServiceHeaders.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppCatalogItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppContactUsItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/CommonWidgetsEnum.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/PortalRestResponse.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/PortalRestStatusEnum.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/SearchResultItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/DeleteDomainObjectFailedException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/DuplicateRecordException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/ExternalAuthSystemException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InactiveApplicationException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidApplicationException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidRoleException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidUserException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/NoHealthyServiceException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/RoleFunctionException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/SecurityVulnerabilitiesException.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/interceptor/PortalResourceInterceptor.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/HealthMonitor.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/UserContextListener.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/UserSessionListener.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPAuditLog.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPMetricsLog.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/ApplicationCodes.properties [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/EPAppMessagesEnum.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/EPErrorCodesEnum.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/logic/EPLogUtil.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/RestObject.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerProperties.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerResponseWrapper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInt.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterface.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterfaceFactory.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterfaceIfc.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerUtil.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/client/HttpBasicClient.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/client/HttpsBasicClient.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/policy/rest/RequestDetails.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/GetTimeSlotsRestObject.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/PostCreateNewVnfRestObject.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/PostSubmitVnfChangeRestObject.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/RestObject.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/util/CustomJacksonJaxBJsonProvider.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/GetTimeSlotsWrapper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/PostCreateNewVnfWrapper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/PostSubmitVnfChangeTimeSlotsWrapper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/SchedulerResponseWrapper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/RestObject.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxResponseWrapper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInt.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterface.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterfaceFactory.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterfaceIfc.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxUtil.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppContactUsService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppContactUsServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ConsulHealthService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ConsulHealthServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/DashboardSearchService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/DashboardSearchServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppCommonServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAuditService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAuditServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLdapService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLdapServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLeftMenuService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLoginService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLoginServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceCentralizedImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/FunctionalMenuService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/FunctionalMenuServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/GetAccessService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/GetAccessServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ManifestService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ManifestServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserAppService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserAppServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserWidgetService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserWidgetServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PortalAdminService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PortalAdminServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SharedContextService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SharedContextServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/TicketEventService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserNotificationService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserNotificationServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesCommonServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetParameterService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetParameterServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AllAppsWithRolesForUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/Analytics.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppCatalogPersonalization.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppNameIdIsAdmin.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppWithRolesForUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppsListWithAdminRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BulkUploadRoleFunction.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BulkUploadUserRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRolesList.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRoleFunction.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralUserApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2Role.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2User.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2UserApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CommonWidget.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CommonWidgetMeta.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPAppsManualPreference.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPAppsSortPreference.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPDeleteAppsManualSortPref.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPUserAppCurrentRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPWidgetsSortPreference.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EcompUserAppRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EcompUserRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItemExtVO.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItemVO.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpRoleNotificationItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EventWidget.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EventWidgetMeta.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessPerms.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessPermsDetail.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessRolePerms.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessUserRoleDetail.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAuthUserRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalRequestFieldsValidator.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalRoleDescription.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FavoritesFunctionalMenuItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FieldsValidator.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItemWithRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/GlobalRoleWithApplicationRoleFunction.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/LocalRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingWidget.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdminUserRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ProfileDetail.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RemoteRole.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RemoteUserWithRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RoleInAppForUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RolesInAppForUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/UserApplicationRoles.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/UserWithNameSurnameTitle.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/WidgetCatalogPersonalization.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/CustomLoggingFilter.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EPCommonSystemProperties.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompPortalUtils.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompVersion.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/HashMapFromList.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/ParallelExecutor.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/PortalConstants.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/EPProfileService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/EPProfileServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/CoreTimeoutHandler.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/ManageService.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/SessionCommunication.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/TimeoutHandler.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/util/EPUserUtils.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/util/SystemType.java [new file with mode: 0644]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/NotificationCleanup.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/NotificationCleanupConfig.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/PortalCentralAccessConfiguration.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/SwaggerConfig.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/SwaggerMVCConfig.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/externalsystemapproval/model/ExternalSystemRoleApproval.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/externalsystemapproval/model/ExternalSystemUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/model/Result.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppsControllerExternalRequest.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AuditLogController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BEPropertyReaderController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BasicAuthAccountController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BasicAuthenticationController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ConsulClientController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAccessRolesController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceProxyController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/PolicyController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/RoleManageController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/RolesApprovalSystemController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/SchedulerController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/TicketEventController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserNotificationController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WebAnalyticsExtAppController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogMarkupController.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/CentralRoleFunction.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPAppRoleFunction.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalRoleDetails.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/exceptions/NoHealthyServiceException.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/RestObject.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerProperties.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerResponseWrapper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInt.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterface.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterfaceFactory.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterfaceIfc.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerUtil.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/client/HttpBasicClient.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/client/HttpsBasicClient.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyProperties.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyResponseWrapper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInt.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterface.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterfaceFactory.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterfaceIfc.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyUtil.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/RestObject.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/rest/RequestDetails.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/properties/VidProperties.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/GetTimeSlotsRestObject.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/PostCreateNewVnfRestObject.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/PostSubmitVnfChangeRestObject.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/RestObject.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/util/CustomJacksonJaxBJsonProvider.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/GetTimeSlotsWrapper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/PostCreateNewVnfWrapper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/PostSubmitVnfChangeTimeSlotsWrapper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/SchedulerResponseWrapper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthAccountService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthAccountServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthenticationCredentialService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAppCommonServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLeftMenuService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLeftMenuServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceCentralizedImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserWidgetService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserWidgetServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/TicketEventService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserNotificationService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserNotificationServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetParameterService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetParameterServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/Analytics.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BulkUploadRoleFunction.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BulkUploadUserRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRolesList.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralUserApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPAppsManualPreference.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPAppsSortPreference.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPDeleteAppsManualSortPref.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPUserAppCurrentRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPWidgetsSortPreference.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EcompUserAppRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EcompUserRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItemExtVO.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItemVO.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpRoleNotificationItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessPerms.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsDetail.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessRolePerms.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserRoleDetail.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalRequestFieldsValidator.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalRoleDescription.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemWithRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ProfileDetail.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/WidgetCatalogPersonalization.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/PortalConstants.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/EPProfileService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/util/SystemType.java [deleted file]
ecomp-portal-BE-common/src/main/java/org/openecomp/portalsdk/core/lm/FusionLicenseManagerUtils.java [deleted file]
ecomp-portal-BE-common/src/main/webapp/WEB-INF/defs/definitions.xml
ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/defs/definitions.xml
ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/EP.hbm.xml
ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/Fusion.hbm.xml
ecomp-portal-BE-common/src/main/webapp/WEB-INF/fusion/orm/Workflow.hbm.xml
ecomp-portal-BE-common/src/main/webapp/WEB-INF/jsp/error.jsp
ecomp-portal-BE-common/src/main/webapp/WEB-INF/jsp/index.jsp
ecomp-portal-BE-common/src/main/webapp/WEB-INF/web.xml
ecomp-portal-BE-common/src/main/webapp/index.jsp
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/command/EPLoginBeanTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/command/PostSearchBeanTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/config/NotificationCleanupTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/config/PortalCentralAccessConfigurationTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppCatalogControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppContactUsControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerExternalRequestTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppsControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AuditLogControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/BEPropertyReaderControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/BasicAuthAccountControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/CommonWidgetControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ConsulClientControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/DashboardControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/EPFusionBaseControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/EPRestrictedBaseControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAccessRolesControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/FunctionalMenuControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/GetAccessControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ManifestControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceProxyControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/PolicyControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RoleManageControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RolesApprovalSystemControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SchedulerControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SessionCommunicationControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextRestClient.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextRestControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextTestProperties.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/TicketEventControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserNotificationControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserRolesControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/shared-context-test.properties [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/MockEPUser.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/PopulateSampleTestData.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/RemoveSampleTestData.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/RestURLsTestSuite.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AdminUserAppTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AdminUserApplicationsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AppContactUsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/CentralRoleFunctionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/CentralV2RoleFunctionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppRoleFunctionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPEndpointAccountTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPEndpointTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppCatalogRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequestDetailTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppsManualSortPreferenceTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppsSortPreferenceTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserNotificationTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPWidgetsManualSortPreferenceTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EcompAppRoleIdTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EcompAppRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalRoleDetailsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemRoleApprovalTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppIDTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/GetAccessResultIdTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/MicroserviceDataTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/MicroserviceParameterTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/PersUserAppSelectionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/PersUserWidgetSelectionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ResultTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/SharedContextTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/UserIdRoleIdTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetCatalogParameterTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetCatalogTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetParameterResultTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NoHealthyServiceExceptionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/framework/ApplicationCommonContextTestSuite.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppCatalogItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppCategoryFunctionsItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppContactUsItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/SearchResultItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/AppContactUsServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/DashboardSearchServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceCentralizedImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/FunctionalMenuMockServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/FunctionalMenuServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/GetAccessServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ManifestServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/PersUserAppServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AnalyticsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppCatalogPersonalizationTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppNameIdIsAdminTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppWithRolesForUserTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppsListWithAdminRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BulkUploadRoleFunctionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BulkUploadUserRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRolesListTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralAppTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPAppsManualPreferenceTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPAppsSortPreferenceTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPDeleteAppsManualSortPrefTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPUserAppCurrentRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPWidgetsSortPreferenceTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EcompUserAppRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemExtVOTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemVOTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpRoleNotificationItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessPermsDetailTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessPermsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessRolePermsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessUserRoleDetailTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessUserTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalRoleDescriptionTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/FunctionalMenuItemTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/FunctionalMenuRoleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/RemoteUserWithRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/RoleInAppForUserTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/UserApplicationRolesTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/UserWithNameSurnameTitleTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/WidgetCatalogPersonalizationTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java [new file with mode: 0644]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/command/EPLoginBeanTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/command/PostSearchBeanTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/config/NotificationCleanupTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/config/PortalCentralAccessConfigurationTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppCatalogControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppContactUsControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppsControllerExternalRequestTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppsControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AuditLogControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/BEPropertyReaderControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/BasicAuthAccountControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/CommonWidgetControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ConsulClientControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/DashboardControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/EPFusionBaseControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/EPRestrictedBaseControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAccessRolesControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/FunctionalMenuControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/GetAccessControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ManifestControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/MicroserviceControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/MicroserviceProxyControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/PolicyControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/RoleManageControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/RolesApprovalSystemControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SchedulerControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SessionCommunicationControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/TicketEventControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserNotificationControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserRolesControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/WebAnalyticsExtAppControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogMarkupControllerTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/core/MockEPUser.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AdminUserAppTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AdminUserApplicationsTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AppContactUsTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/CentralRoleFunctionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPAppRoleFunctionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPAppTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPEndpointAccountTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPEndpointTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetailTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreferenceTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreferenceTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserNotificationTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreferenceTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EcompAppRoleIdTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EcompAppRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalRoleDetailsTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccessTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalSystemRoleApprovalTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppIDTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/GetAccessResultIdTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/MicroserviceDataTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/MicroserviceParameterTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/PersUserAppSelectionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelectionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ResultTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/SharedContextTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/UserIdRoleIdTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameterTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetCatalogTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetParameterResultTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/exceptions/NoHealthyServiceExceptionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/lm/FusionLicenseManagerImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/lm/LicenseableClassImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppCatalogItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppCategoryFunctionsItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppContactUsItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/SearchResultItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceCentralizedImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/FunctionalMenuMockServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/GetAccessServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/LicenseableClassImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/ManifestServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImplTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AnalyticsTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalizationTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdminTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUserTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BulkUploadRoleFunctionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BulkUploadUserRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRolesListTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralAppTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserAppTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPAppsManualPreferenceTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPAppsSortPreferenceTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPDeleteAppsManualSortPrefTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPUserAppCurrentRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPWidgetsSortPreferenceTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EcompUserAppRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemExtVOTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemVOTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpRoleNotificationItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsDetailTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessRolePermsTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserRoleDetailTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalRoleDescriptionTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRoleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/RoleInAppForUserTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/UserApplicationRolesTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitleTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/WidgetCatalogPersonalizationTest.java [deleted file]
ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java [deleted file]
ecomp-portal-BE-os/.gitignore
ecomp-portal-BE-os/README.md
ecomp-portal-BE-os/pom.xml
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/LoginStrategy.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/OpenIdConnectLoginStrategy.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/SimpleLoginStrategy.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ECOMPLogoutController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginService.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPWelcomeController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/OpenCollaborationController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/PeerBroadcastSocket.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/AppsOSController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/DashboardSearchResultController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAspect.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchService.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/TicketEventServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserRolesServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserService.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/utils/EPSystemProperties.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogJob.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogRegistry.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/Register.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/RegistryAdapter.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/SessionMgtRegistry.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/FunctionalMenuHandler.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/InitUebHandler.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/MainUebHandler.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/WidgetNotificationHandler.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/onap/portalapp/util/SessionCookieUtil.java [new file with mode: 0644]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginService.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPLoginController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPWelcomeController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/AppsOSController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/TicketEventServiceImpl.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserService.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallServiceImpl.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java [deleted file]
ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java [deleted file]
ecomp-portal-BE-os/src/main/resources/key.properties [new file with mode: 0644]
ecomp-portal-BE-os/src/main/resources/logback.xml
ecomp-portal-BE-os/src/main/resources/openid-connect.properties
ecomp-portal-BE-os/src/main/resources/portal.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/quartz.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_app_fusion.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_db_fusion.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/raptor_pdf.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/scheduler.properties [new file with mode: 0644]
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/sql.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/system.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/defs/definitions.xml
ecomp-portal-BE-os/src/main/webapp/WEB-INF/fusion/conf/fusion.properties
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/error.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/index.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/login.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-admin.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-home.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-login.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/jsp/oid-user.jsp
ecomp-portal-BE-os/src/main/webapp/WEB-INF/oid-context.xml
ecomp-portal-BE-os/src/main/webapp/WEB-INF/web.xml
ecomp-portal-BE-os/src/main/webapp/app/fusion/external/ds2/css/digital-ng-library/ecomp-ionicons.css
ecomp-portal-BE-os/src/main/webapp/index.jsp
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SimpleLoginStrategyTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/AppsOSControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ECOMPLogoutControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/LoginControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPLoginControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPWelcomeControllerTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerOSTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockEPUser.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java [new file with mode: 0644]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SimpleLoginStrategyTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/AppsOSControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ECOMPLogoutControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/LoginControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPLoginControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPWelcomeControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerOSTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockEPUser.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/SearchServiceImplTest.java [deleted file]
ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java [deleted file]
ecomp-portal-DB-common/EcompPortalDDLMySql_1707_Common.sql [deleted file]
ecomp-portal-DB-common/EcompPortalDDLMySql_1710_Common.sql [deleted file]
ecomp-portal-DB-common/EcompPortalDMLMySql_1707_Common.sql [deleted file]
ecomp-portal-DB-common/EcompPortalDMLMySql_1710_Common.sql [deleted file]
ecomp-portal-DB-common/PortalDDLMySql_2_1_Common.sql [new file with mode: 0644]
ecomp-portal-DB-common/PortalDMLMySql_2_1_Common.sql [new file with mode: 0644]
ecomp-portal-DB-common/README.md
ecomp-portal-DB-os/EcompPortalDDLMySql_1707_OS.sql [deleted file]
ecomp-portal-DB-os/EcompPortalDDLMySql_1710_OS.sql [deleted file]
ecomp-portal-DB-os/EcompPortalDMLMySql_1707_OS.sql [deleted file]
ecomp-portal-DB-os/EcompPortalDMLMySql_1710_OS.sql [deleted file]
ecomp-portal-DB-os/PortalDDLMySql_2_1_OS.sql [new file with mode: 0644]
ecomp-portal-DB-os/PortalDMLMySql_2_1_OS.sql [new file with mode: 0644]
ecomp-portal-DB-os/README.md
ecomp-portal-FE-common/client/app/directives/auto-focus/auto-focus.directive.js
ecomp-portal-FE-common/client/app/directives/b2b-leftnav-ext/b2b-leftnav-ext.directive.js
ecomp-portal-FE-common/client/app/directives/b2b-leftnav-ext/b2b-leftnav-ext.less
ecomp-portal-FE-common/client/app/directives/b2b-leftnav-ext/b2b-leftnav-ext.tpl.html
ecomp-portal-FE-common/client/app/directives/file-upload/file-upload.directive.js
ecomp-portal-FE-common/client/app/directives/image-upload/image-upload.directive.js
ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.directive.js
ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.less
ecomp-portal-FE-common/client/app/directives/left-menu/left-menu.tpl.html
ecomp-portal-FE-common/client/app/directives/multiple-select/multiple-select.directive.js
ecomp-portal-FE-common/client/app/directives/multiple-select/multiple-select.less
ecomp-portal-FE-common/client/app/directives/multiple-select/multiple-select.tpl.html
ecomp-portal-FE-common/client/app/directives/multiple-select/multiple-select2.directive.js
ecomp-portal-FE-common/client/app/directives/multiple-select/multiple-select2.tpl.html
ecomp-portal-FE-common/client/app/directives/multiple-select/mutliple-select2.less
ecomp-portal-FE-common/client/app/directives/right-click-menu/right-click-menu.directive.js
ecomp-portal-FE-common/client/app/directives/right-click/ng-right-click-directive.js
ecomp-portal-FE-common/client/app/directives/scroll-top/scroll-top.directive.js
ecomp-portal-FE-common/client/app/directives/search-users/search-users.controller.js
ecomp-portal-FE-common/client/app/directives/search-users/search-users.controller.spec.js
ecomp-portal-FE-common/client/app/directives/search-users/search-users.directive.js
ecomp-portal-FE-common/client/app/filters/elipsis/elipsis.filter.js
ecomp-portal-FE-common/client/app/filters/elipsis/elipsis.filter.spec.js
ecomp-portal-FE-common/client/app/filters/pagination-start-from/start-from.filter.js
ecomp-portal-FE-common/client/app/filters/trusted-url/trusted-url.filter.js
ecomp-portal-FE-common/client/app/router.js
ecomp-portal-FE-common/client/app/services/admins/admins.service.js
ecomp-portal-FE-common/client/app/services/applications/applications.service.js
ecomp-portal-FE-common/client/app/services/audit-log/audit-log.service.js
ecomp-portal-FE-common/client/app/services/base64/base64.service.js
ecomp-portal-FE-common/client/app/services/basic-auth-account/basic-auth-account.service.js
ecomp-portal-FE-common/client/app/services/be-property-reader/be-property-reader.service.js
ecomp-portal-FE-common/client/app/services/catalog/catalog.service.js
ecomp-portal-FE-common/client/app/services/confirm-box/confirm-box.service.js
ecomp-portal-FE-common/client/app/services/contact-us/contact-us.service.js
ecomp-portal-FE-common/client/app/services/dashboard/dashboard.service.js
ecomp-portal-FE-common/client/app/services/error-messages/error-messages.service.js
ecomp-portal-FE-common/client/app/services/external-request-access-service/external-request-access-service.js
ecomp-portal-FE-common/client/app/services/functionalMenu/functionalMenu.service.js
ecomp-portal-FE-common/client/app/services/global-constants/global-constants.js
ecomp-portal-FE-common/client/app/services/manifest/manifest.service.js
ecomp-portal-FE-common/client/app/services/menus/menus.service.js
ecomp-portal-FE-common/client/app/services/microservice/microservice.service.js
ecomp-portal-FE-common/client/app/services/notification/notification.service.js
ecomp-portal-FE-common/client/app/services/portal-admins/portal-admins.service.js
ecomp-portal-FE-common/client/app/services/role/role.service.js
ecomp-portal-FE-common/client/app/services/scheduler/scheduler.service.js [new file with mode: 0644]
ecomp-portal-FE-common/client/app/services/support/getAccess/get-access.service.js
ecomp-portal-FE-common/client/app/services/userbar/userbar.update.service.js
ecomp-portal-FE-common/client/app/services/users/users.service.js
ecomp-portal-FE-common/client/app/services/utils/utils.service.js
ecomp-portal-FE-common/client/app/services/widgets-catalog/widgets-catalog.service.js
ecomp-portal-FE-common/client/app/services/widgets/widgets.service.js
ecomp-portal-FE-common/client/app/styles/appDS2.less
ecomp-portal-FE-common/client/app/styles/buttons.less
ecomp-portal-FE-common/client/app/styles/ecomp-general.less
ecomp-portal-FE-common/client/app/styles/form.less
ecomp-portal-FE-common/client/app/styles/mixins.less
ecomp-portal-FE-common/client/app/styles/ng-dialog.less
ecomp-portal-FE-common/client/app/styles/reset.less
ecomp-portal-FE-common/client/app/styles/select2.less
ecomp-portal-FE-common/client/app/styles/spinner.less
ecomp-portal-FE-common/client/app/styles/sprites.less
ecomp-portal-FE-common/client/app/styles/variables.less
ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.html
ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.js
ecomp-portal-FE-common/client/app/views/account-onboarding/account-add-details/account-add-details.less
ecomp-portal-FE-common/client/app/views/account-onboarding/account-onboarding.controller.js
ecomp-portal-FE-common/client/app/views/account-onboarding/account-onboarding.less
ecomp-portal-FE-common/client/app/views/account-onboarding/account-onboarding.tpl.html
ecomp-portal-FE-common/client/app/views/admins/add-admin-dialogs/new-admin.controller.js
ecomp-portal-FE-common/client/app/views/admins/add-admin-dialogs/new-admin.controller.spec.js
ecomp-portal-FE-common/client/app/views/admins/add-admin-dialogs/new-admin.modal.html
ecomp-portal-FE-common/client/app/views/admins/add-admin-dialogs/new-admin.modal.less
ecomp-portal-FE-common/client/app/views/admins/admins.controller.js
ecomp-portal-FE-common/client/app/views/admins/admins.controller.spec.js
ecomp-portal-FE-common/client/app/views/admins/admins.less
ecomp-portal-FE-common/client/app/views/admins/admins.tpl.html
ecomp-portal-FE-common/client/app/views/applications/application-details-dialog/application-details.modal.less
ecomp-portal-FE-common/client/app/views/applications/applications.less
ecomp-portal-FE-common/client/app/views/catalog/add-catalog-dialogs/new-catalog.modal.less
ecomp-portal-FE-common/client/app/views/catalog/catalog.controller.js
ecomp-portal-FE-common/client/app/views/catalog/catalog.less
ecomp-portal-FE-common/client/app/views/catalog/catalog.tpl.html
ecomp-portal-FE-common/client/app/views/catalog/catalogconfirmation.controller.js
ecomp-portal-FE-common/client/app/views/catalog/information-box.tpl.html
ecomp-portal-FE-common/client/app/views/confirmation-box/admin-confirmation-box.tpl.html
ecomp-portal-FE-common/client/app/views/confirmation-box/confirmation-box.controller.js
ecomp-portal-FE-common/client/app/views/confirmation-box/confirmation-box.less
ecomp-portal-FE-common/client/app/views/confirmation-box/confirmation-box.tpl.html
ecomp-portal-FE-common/client/app/views/confirmation-box/dragdrop-confirmation-box.tpl.html
ecomp-portal-FE-common/client/app/views/confirmation-box/information-box.tpl.html
ecomp-portal-FE-common/client/app/views/confirmation-box/reload-page-confirm.html
ecomp-portal-FE-common/client/app/views/dashboard/dashboard-widget-manage.html
ecomp-portal-FE-common/client/app/views/dashboard/dashboard-widget-parameter-manage.html
ecomp-portal-FE-common/client/app/views/dashboard/dashboard-widget-parameters.controller.js
ecomp-portal-FE-common/client/app/views/dashboard/dashboard-widget-parameters.controller.less
ecomp-portal-FE-common/client/app/views/dashboard/dashboard-widget.controller.js
ecomp-portal-FE-common/client/app/views/dashboard/dashboard-widget.controller.less
ecomp-portal-FE-common/client/app/views/dashboard/dashboard.controller.js
ecomp-portal-FE-common/client/app/views/dashboard/dashboard.controller.spec.js
ecomp-portal-FE-common/client/app/views/dashboard/dashboard.less
ecomp-portal-FE-common/client/app/views/dashboard/dashboard.tpl.html
ecomp-portal-FE-common/client/app/views/dashboard/newsticker.controller.js
ecomp-portal-FE-common/client/app/views/errors/error.controller.js
ecomp-portal-FE-common/client/app/views/errors/error.tpl.html
ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js
ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.delete.modal.html
ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/menu-details.modal.html
ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu-dialog/modal-details.modal.less
ecomp-portal-FE-common/client/app/views/functionalMenu/functionalMenu.less
ecomp-portal-FE-common/client/app/views/header/header.controller.js
ecomp-portal-FE-common/client/app/views/header/header.controller.spec.js
ecomp-portal-FE-common/client/app/views/header/header.less
ecomp-portal-FE-common/client/app/views/header/header.tpl.html
ecomp-portal-FE-common/client/app/views/microservice-onboarding/microservice-add-details/microservice-add-details.html
ecomp-portal-FE-common/client/app/views/microservice-onboarding/microservice-add-details/microservice-add-details.js
ecomp-portal-FE-common/client/app/views/microservice-onboarding/microservice-add-details/microservice-add-details.less
ecomp-portal-FE-common/client/app/views/microservice-onboarding/microservice-onboarding.controller.js
ecomp-portal-FE-common/client/app/views/microservice-onboarding/microservice-onboarding.less
ecomp-portal-FE-common/client/app/views/microservice-onboarding/microservice-onboarding.tpl.html
ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.controller.js
ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.less
ecomp-portal-FE-common/client/app/views/notification-history/notificationhistory.tpl.html
ecomp-portal-FE-common/client/app/views/portal-admin/new-portal-admin/new-portal-admin.controller.js
ecomp-portal-FE-common/client/app/views/portal-admin/new-portal-admin/new-portal-admin.controller.spec.js
ecomp-portal-FE-common/client/app/views/portal-admin/new-portal-admin/new-portal-admin.modal.html
ecomp-portal-FE-common/client/app/views/portal-admin/new-portal-admin/new-portal-admin.modal.less
ecomp-portal-FE-common/client/app/views/portal-admin/portal-admin-controller.js
ecomp-portal-FE-common/client/app/views/portal-admin/portal-admin.tpl.html
ecomp-portal-FE-common/client/app/views/portal-admin/portal-admins.less
ecomp-portal-FE-common/client/app/views/role/popup_createedit_role.html [new file with mode: 0644]
ecomp-portal-FE-common/client/app/views/role/popup_modal_rolefunction.html
ecomp-portal-FE-common/client/app/views/role/role-controller.js
ecomp-portal-FE-common/client/app/views/role/role-create-edit-popup-controller.js [new file with mode: 0644]
ecomp-portal-FE-common/client/app/views/role/role-function-list-controller.js
ecomp-portal-FE-common/client/app/views/role/role-list-controller.js
ecomp-portal-FE-common/client/app/views/role/role.html
ecomp-portal-FE-common/client/app/views/role/role.less
ecomp-portal-FE-common/client/app/views/role/role_childrole_popup.html
ecomp-portal-FE-common/client/app/views/role/role_function_list.html
ecomp-portal-FE-common/client/app/views/role/role_functions_popup.html
ecomp-portal-FE-common/client/app/views/role/role_list.html
ecomp-portal-FE-common/client/app/views/role/rolefunctionpopupController.js
ecomp-portal-FE-common/client/app/views/role/rolepopupmodelController.js
ecomp-portal-FE-common/client/app/views/scheduler/scheduler.controller.js [new file with mode: 0644]
ecomp-portal-FE-common/client/app/views/scheduler/scheduler.less [new file with mode: 0644]
ecomp-portal-FE-common/client/app/views/scheduler/scheduler.tpl.html [new file with mode: 0644]
ecomp-portal-FE-common/client/app/views/search/search.less
ecomp-portal-FE-common/client/app/views/sidebar/sidebar.controller.js
ecomp-portal-FE-common/client/app/views/sidebar/sidebar.less
ecomp-portal-FE-common/client/app/views/sidebar/sidebar.tpl.html
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.less
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us-manage/contact-us-manage.html
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.js
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.controller.spec.js
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.less
ecomp-portal-FE-common/client/app/views/support/contact-us/contact-us.tpl.html
ecomp-portal-FE-common/client/app/views/support/get-access/get-access.controller.js
ecomp-portal-FE-common/client/app/views/support/get-access/get-access.controller.spec.js
ecomp-portal-FE-common/client/app/views/support/get-access/get-access.less
ecomp-portal-FE-common/client/app/views/support/get-access/get-access.tpl.html
ecomp-portal-FE-common/client/app/views/tabs/tabframe.html
ecomp-portal-FE-common/client/app/views/tabs/tabs.controller.js
ecomp-portal-FE-common/client/app/views/tabs/tabs.controller.spec.js
ecomp-portal-FE-common/client/app/views/tabs/tabs.less
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.Json.details.controller.js
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.controller.js
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.json.details.modal.page.html
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.json.details.modal.page.less
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.less
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.modal.controller.js
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.modal.less
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.modal.page.html
ecomp-portal-FE-common/client/app/views/user-notifications-admin/user.notifications.tpl.html
ecomp-portal-FE-common/client/app/views/userbar/userbar.less
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.ack.html
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.confirm.html
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.controller.js
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.html
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/bulk-user.modal.less
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.js
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.controller.spec.js
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.html
ecomp-portal-FE-common/client/app/views/users/new-user-dialogs/new-user.modal.less
ecomp-portal-FE-common/client/app/views/users/users.controller.js
ecomp-portal-FE-common/client/app/views/users/users.less
ecomp-portal-FE-common/client/app/views/users/users.tpl.html
ecomp-portal-FE-common/client/app/views/widget-catalog/widget-catalog.controller.js
ecomp-portal-FE-common/client/app/views/widget-catalog/widget-catalog.controller.spec.js
ecomp-portal-FE-common/client/app/views/widget-catalog/widget-catalog.less
ecomp-portal-FE-common/client/app/views/widget-catalog/widget-catalog.tpl.html
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-details-dialog/widget-details.controller.js
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-details-dialog/widget-details.controller.spec.js
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-details-dialog/widget-details.modal.html
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-details-dialog/widget-details.modal.less
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-onboarding.controller.js
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-onboarding.controller.spec.js
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-onboarding.less
ecomp-portal-FE-common/client/app/views/widget-onboarding/widget-onboarding.tpl.html
ecomp-portal-FE-common/client/app/views/widgets/widget-details-dialog/widget-details.controller.js
ecomp-portal-FE-common/client/app/views/widgets/widget-details-dialog/widget-details.controller.spec.js
ecomp-portal-FE-common/client/app/views/widgets/widget-details-dialog/widget-details.modal.html
ecomp-portal-FE-common/client/app/views/widgets/widget-details-dialog/widget-details.modal.less
ecomp-portal-FE-common/client/app/views/widgets/widgets.controller.js
ecomp-portal-FE-common/client/app/views/widgets/widgets.controller.spec.js
ecomp-portal-FE-common/client/app/views/widgets/widgets.less
ecomp-portal-FE-common/client/app/views/widgets/widgets.tpl.html
ecomp-portal-FE-common/client/bower_components_external/b2b/js/b2b-angular/b2b-library.min.js
ecomp-portal-FE-common/pom.xml
ecomp-portal-FE-os/client/bower_components_external/ionicons-2.0.1/css/ecomp-ionicons.css
ecomp-portal-FE-os/client/configurations/dev.json
ecomp-portal-FE-os/client/configurations/integ.json
ecomp-portal-FE-os/client/index.html
ecomp-portal-FE-os/client/src/app.js
ecomp-portal-FE-os/client/src/app.less
ecomp-portal-FE-os/client/src/directives/right-menu/right-menu.directive.js
ecomp-portal-FE-os/client/src/directives/right-menu/right-menu.less
ecomp-portal-FE-os/client/src/directives/right-menu/right-menu.tpl.html
ecomp-portal-FE-os/client/src/directives/search-users/search-users.controller.js
ecomp-portal-FE-os/client/src/directives/search-users/search-users.less
ecomp-portal-FE-os/client/src/directives/search-users/search-users.tpl.html
ecomp-portal-FE-os/client/src/router.js
ecomp-portal-FE-os/client/src/services/recommendation/recommendation.service.js
ecomp-portal-FE-os/client/src/services/support/session/session.service.js
ecomp-portal-FE-os/client/src/services/userProfile/userProfile.service.js
ecomp-portal-FE-os/client/src/styles/ecomp-abs.less
ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.js
ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.controller.spec.js
ecomp-portal-FE-os/client/src/views/applications/application-details-dialog/application-details.modal.html
ecomp-portal-FE-os/client/src/views/applications/applications.controller.js
ecomp-portal-FE-os/client/src/views/applications/applications.controller.spec.js
ecomp-portal-FE-os/client/src/views/applications/applications.tpl.html
ecomp-portal-FE-os/client/src/views/catalog/get-accessswitch.html
ecomp-portal-FE-os/client/src/views/dashboard/dashboard-extension.tpl.html
ecomp-portal-FE-os/client/src/views/footer/footer.controller.js
ecomp-portal-FE-os/client/src/views/footer/footer.controller.spec.js
ecomp-portal-FE-os/client/src/views/footer/footer.less
ecomp-portal-FE-os/client/src/views/footer/footer.tpl.html
ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu-dialog/menu-details.delete.modal.html
ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu.controller.js
ecomp-portal-FE-os/client/src/views/functionalMenu/functionalMenu.tpl.html
ecomp-portal-FE-os/client/src/views/functionalMenu/jqTreeContextMenu.js
ecomp-portal-FE-os/client/src/views/header/header-extension.tpl.html
ecomp-portal-FE-os/client/src/views/header/header-logo.html
ecomp-portal-FE-os/client/src/views/header/profile-edit-dialogs/profile-edit.controller.js
ecomp-portal-FE-os/client/src/views/header/profile-edit-dialogs/profile-edit.modal.html
ecomp-portal-FE-os/client/src/views/header/profile-edit-dialogs/profile-edit.modal.less
ecomp-portal-FE-os/client/src/views/headerRecommendation/headerRecommendations.controller.js
ecomp-portal-FE-os/client/src/views/headerRecommendation/headerRecommendations.tpl.html
ecomp-portal-FE-os/client/src/views/search/search.controller.js
ecomp-portal-FE-os/client/src/views/search/search.controller.spec.js
ecomp-portal-FE-os/client/src/views/search/search.tpl.html
ecomp-portal-FE-os/client/src/views/support/contact-us/contact-us-table-header.html [new file with mode: 0644]
ecomp-portal-FE-os/client/src/views/support/contact-us/contact-us.aux.html
ecomp-portal-FE-os/client/src/views/support/get-access/get-accessinfo.html
ecomp-portal-FE-os/client/src/views/tabs/tabs.tpl.html
ecomp-portal-FE-os/client/src/views/userbar/userbar.controller.js
ecomp-portal-FE-os/client/src/views/userbar/userbar.tpl.html
ecomp-portal-FE-os/client/utils/test-utils/test-utils.js
ecomp-portal-FE-os/pom.xml
ecomp-portal-widget-ms/common-widgets/.gitignore
ecomp-portal-widget-ms/common-widgets/pom.xml
ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js [new file with mode: 0644]
ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html [new file with mode: 0644]
ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css [new file with mode: 0644]
ecomp-portal-widget-ms/pom.xml
ecomp-portal-widget-ms/widget-ms/pom.xml
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/DatabaseFileUploadController.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/HealthController.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/controller/WidgetsCatalogController.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/App.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceData.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/MicroserviceParameter.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetCatalog.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/hibernate/HibernateConfiguration.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/StorageService.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/WidgetCatalogService.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/InitializationServiceImpl.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/MicroserviceServiceImpl.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/StorageServiceImpl.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/AuthorizationUtil.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/UnzipUtil.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/DatabaseFileUploadController.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/WidgetsCatalogController.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceData.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/RoleApp.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetCatalog.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/WidgetCatalogService.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/InitializationServiceImpl.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/MicroserviceServiceImpl.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/StorageServiceImpl.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/UnzipUtil.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/main/resources/logback.xml
ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetFileControllerTest.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/service/WidgetCatalogServiceTest.java [new file with mode: 0644]
ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetFileControllerTest.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java [deleted file]
ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/service/WidgetCatalogServiceTest.java [deleted file]
pom.xml
version.properties

index 869cc6a..1d90390 100644 (file)
@@ -3,4 +3,5 @@
 /.settings
 /dmaapbc
 /sdk
 /.settings
 /dmaapbc
 /sdk
-/target
+/target/*/*.*
+/target/*
index 0a3230d..fc7c94c 100644 (file)
@@ -1,15 +1,22 @@
 # Environment settings
 # used by docker-compose AND by other shell scripts
 # Environment settings
 # used by docker-compose AND by other shell scripts
+# The name ".env" is required by docker-compose
 
 # Following are ALSO used in demo/boot/portal_vm_init.sh
 
 # Following are ALSO used in demo/boot/portal_vm_init.sh
-EP_IMG_NAME=onap/portal-apps
+EP_IMG_NAME=onap/portal-app
+SDK_IMG_NAME=onap/portal-sdk
 DB_IMG_NAME=onap/portal-db
 WMS_IMG_NAME=onap/portal-wms
 # Deployed with portal; built elsewhere
 CLI_IMG_NAME=onap/cli
 
 DB_IMG_NAME=onap/portal-db
 WMS_IMG_NAME=onap/portal-wms
 # Deployed with portal; built elsewhere
 CLI_IMG_NAME=onap/cli
 
-# Tag all images with this
-PORTAL_TAG=1.3.0
+# This is the first portion of the Docker image tag
+# that is published to the ONAP registry.
+PORTAL_VERSION=2.1
+
+# This is used during builds and in docker-compose;
+# it is never published to the ONAP registry.
+PORTAL_TAG=beijing
 
 # Name of directory in apps container (NOT host)
 WEBAPPS_DIR=/opt/apache-tomcat-8.0.37/webapps
 
 # Name of directory in apps container (NOT host)
 WEBAPPS_DIR=/opt/apache-tomcat-8.0.37/webapps
@@ -25,5 +32,5 @@ EXTRA_HOST_NAME=""
 # Export shell environment variables on hosts with no DNS;
 # a line is added to docker container's /etc/hosts.
 # For example:
 # Export shell environment variables on hosts with no DNS;
 # a line is added to docker container's /etc/hosts.
 # For example:
-#EXTRA_HOST_IP="-i 135.207.161.163"
+#EXTRA_HOST_IP="-i 10.11.12.13"
 #EXTRA_HOST_NAME="-n portal.api.simpledemo.openecomp.org"
 #EXTRA_HOST_NAME="-n portal.api.simpledemo.openecomp.org"
index 6e720b5..8e7cc3c 100644 (file)
@@ -2,7 +2,7 @@
 USE portal;
  
 SET FOREIGN_KEY_CHECKS=1; 
 USE portal;
  
 SET FOREIGN_KEY_CHECKS=1; 
-
 -- Apps; note that the IDs are used below.
 
 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 
 -- Apps; note that the IDs are used below.
 
 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 
@@ -68,8 +68,8 @@ insert into fn_role values(1000,'System Administrator','Y',1,2,1); -- SDK from 9
 insert into fn_role values(1001,'Standard User','Y',1,2,16); -- SDK
 insert into fn_role values(1002,'System Administrator','Y',1,3,1); -- DMaap from 999 to 1
 insert into fn_role values(1003,'Standard User','Y',1,3,16); -- DMaap
 insert into fn_role values(1001,'Standard User','Y',1,2,16); -- SDK
 insert into fn_role values(1002,'System Administrator','Y',1,3,1); -- DMaap from 999 to 1
 insert into fn_role values(1003,'Standard User','Y',1,3,16); -- DMaap
-insert into fn_role values(1004,'System Administrator','Y',1,4,1); -- SDC from 999 to 1
-insert into fn_role values(1005,'Standard User','Y',1,4,16); -- SDC
+insert into fn_role values(1004,'ADMIN','Y',1,4,0); -- SDC from 999 to 1
+insert into fn_role values(1005,'TESTOR','Y',1,4,1); -- SDC
 insert into fn_role values(1006,'System Administrator','Y',1,5,1); -- Policy from 999 to 1
 insert into fn_role values(1007,'Standard User','Y',1,5,16); -- Policy 
 insert into fn_role values(1008,'System Administrator','Y',1,6,1); -- VID from 999 to 1
 insert into fn_role values(1006,'System Administrator','Y',1,5,1); -- Policy from 999 to 1
 insert into fn_role values(1007,'Standard User','Y',1,5,16); -- Policy 
 insert into fn_role values(1008,'System Administrator','Y',1,6,1); -- VID from 999 to 1
@@ -86,9 +86,13 @@ INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1006,NULL,5);
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1008,NULL,6);
 
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1006,NULL,5);
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (1,1008,NULL,6);
 
-INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (3,1004,NULL,4);
-
-INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (4,1004,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (2,1004,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (3,1005,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (4,1005,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (5,1005,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (6,1005,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (7,1005,NULL,4);
+INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (8,1005,NULL,4);
 
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (9,999,NULL,1);
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (9,1008,NULL,6);
 
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (9,999,NULL,1);
 INSERT INTO `fn_user_role` (`user_id`,`role_id`,`priority`,`app_id`) VALUES (9,1008,NULL,6);
index 9424815..347cc1e 100644 (file)
@@ -1,24 +1,22 @@
 FROM mariadb:latest
 
 FROM mariadb:latest
 
-ARG PORTAL_SCRIPT_DIR=${PORTAL_SCRIPT_DIR}
-ARG SDK_SCRIPT_DIR=${SDK_SCRIPT_DIR}
+ARG DB_SCRIPT_DIR=${DB_SCRIPT_DIR}
 
 # constant
 #Add config file
 COPY my.cnf /etc/mysql/my.cnf
 
 # constant
 #Add config file
 COPY my.cnf /etc/mysql/my.cnf
-#ADD cluster.cnf /etc/mysql/conf.d
 
 # Scripts are executed in alphabetical order
 
 
 # Scripts are executed in alphabetical order
 
-# Portal DDL and DML at 1710
-COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDDLMySql_1710_Common.sql /docker-entrypoint-initdb.d/
-COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDDLMySql_1710_OS.sql     /docker-entrypoint-initdb.d/
-COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDMLMySql_1710_Common.sql /docker-entrypoint-initdb.d/
-COPY ${PORTAL_SCRIPT_DIR}/EcompPortalDMLMySql_1710_OS.sql     /docker-entrypoint-initdb.d/
-COPY Apps_Users_OnBoarding_Script.sql                         /docker-entrypoint-initdb.d/EcompPortalDMLMySql_1710_z_apps_users.sql
+# Portal DDL and DML at v2.1
+COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_2_1_Common.sql /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/PortalDDLMySql_2_1_OS.sql     /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_2_1_Common.sql /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/PortalDMLMySql_2_1_OS.sql     /docker-entrypoint-initdb.d/
+# Do not copy the onboarding script here; it's mounted as a volume
 
 
-# SDK App DDL and DML unchanged since 1707
-COPY ${SDK_SCRIPT_DIR}/EcompSdkDDLMySql_1710_Common.sql       /docker-entrypoint-initdb.d/
-COPY ${SDK_SCRIPT_DIR}/EcompSdkDDLMySql_1710_OS.sql           /docker-entrypoint-initdb.d/
-COPY ${SDK_SCRIPT_DIR}/EcompSdkDMLMySql_1710_Common.sql       /docker-entrypoint-initdb.d/
-COPY ${SDK_SCRIPT_DIR}/EcompSdkDMLMySql_1710_OS.sql           /docker-entrypoint-initdb.d/
+# SDK App DDL and DML
+COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_1710_Common.sql       /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDDLMySql_1710_OS.sql           /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_1710_Common.sql       /docker-entrypoint-initdb.d/
+COPY ${DB_SCRIPT_DIR}/EcompSdkDMLMySql_1710_OS.sql           /docker-entrypoint-initdb.d/
diff --git a/deliveries/Dockerfile.portal b/deliveries/Dockerfile.portal
new file mode 100644 (file)
index 0000000..81eeb65
--- /dev/null
@@ -0,0 +1,55 @@
+# Dockerfile for image with ONAP Portal
+
+# Yields an image 823 MB
+FROM frolvlad/alpine-oraclejdk8:slim
+# Yields an image 1.4 GB
+# FROM openjdk:8-jdk
+
+# Arguments are supplied by build.sh script
+# the defaults below only support testing
+ARG PORTAL_WAR=build/ecompportal-be-os.war
+ARG FE_DIR=build/public
+ARG HTTP_PROXY
+ARG HTTPS_PROXY
+
+# Just variables, never passed in
+ARG TOMCAT=apache-tomcat-8.0.37
+ARG TOMCATTAR=${TOMCAT}.tar.gz
+ARG TOMCATHOME=/opt/${TOMCAT}
+ARG PORTALCONTEXT=ONAPPORTAL
+
+ENV http_proxy $HTTP_PROXY
+ENV https_proxy $HTTPS_PROXY
+RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
+    if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
+
+# Install Tomcat.  This image already has curl.
+WORKDIR /tmp
+RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
+RUN tar -xzf ${TOMCATTAR}
+RUN rm ${TOMCATTAR}
+# Remove manager and sample apps
+RUN rm -fr ${TOMCAT}/webapps/[a-z]*
+RUN mkdir -p /opt
+RUN mv ${TOMCAT} /opt
+
+WORKDIR ${TOMCATHOME}/webapps
+RUN mkdir ${PORTALCONTEXT}
+
+# Portal has many parts
+COPY $PORTAL_WAR ${PORTALCONTEXT}
+RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
+COPY ${FE_DIR} ${PORTALCONTEXT}/public
+
+VOLUME ${TOMCATHOME}/logs
+
+# Switch back to root
+WORKDIR /
+
+# Define commonly used ENV variables
+ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
+# Install the launch script
+COPY start-apache-tomcat.sh /
+
+# Define default command
+CMD /start-apache-tomcat.sh
diff --git a/deliveries/Dockerfile.portalapps b/deliveries/Dockerfile.portalapps
deleted file mode 100644 (file)
index 17677aa..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# Dockerfile for image with ONAP applications:
-# Portal app, Portal-SDK app.
-
-# Yields an image 823 MB
-FROM frolvlad/alpine-oraclejdk8:slim
-# Yields an image 1.4 GB
-# FROM openjdk:8-jdk
-
-# Arguments are supplied by build.sh script
-# the defaults below only support testing
-ARG PORTAL_WAR=build/ecompportal-be-os.war
-ARG FE_DIR=build/public
-ARG SDK_WAR=build/epsdk-app-os.war
-ARG HTTP_PROXY
-ARG HTTPS_PROXY
-
-# Just variables, never passed in
-ARG TOMCAT=apache-tomcat-8.0.37
-ARG TOMCATTAR=${TOMCAT}.tar.gz
-ARG TOMCATHOME=/opt/${TOMCAT}
-ARG PORTALCONTEXT=ONAPPORTAL
-ARG SDKCONTEXT=ONAPPORTALSDK
-
-ENV http_proxy $HTTP_PROXY
-ENV https_proxy $HTTPS_PROXY
-RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
-    if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
-
-# Install Tomcat.  This image already has curl.
-WORKDIR /tmp
-RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
-RUN tar -xzf ${TOMCATTAR}
-RUN rm ${TOMCATTAR}
-# Remove manager and sample apps
-RUN rm -fr ${TOMCAT}/webapps/[a-z]*
-RUN mkdir -p /opt
-RUN mv ${TOMCAT} /opt
-
-WORKDIR ${TOMCATHOME}/webapps
-RUN mkdir ${PORTALCONTEXT} && mkdir ${SDKCONTEXT}
-
-# Portal has many parts
-COPY $PORTAL_WAR ${PORTALCONTEXT}
-RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
-COPY ${FE_DIR} ${PORTALCONTEXT}/public
-
-# SDK app has only a war
-COPY $SDK_WAR ${SDKCONTEXT}
-RUN cd ${SDKCONTEXT} && unzip -q *.war && rm *.war
-
-VOLUME ${TOMCATHOME}/logs
-
-# Switch back to root
-WORKDIR /
-
-# Define commonly used ENV variables
-ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
-# Install the wait script
-COPY wait-for.sh /
-# Install the launch script
-COPY start-apps-cmd.sh /
-
-# Define default command
-CMD /start-apps-cmd.sh
diff --git a/deliveries/Dockerfile.sdk b/deliveries/Dockerfile.sdk
new file mode 100644 (file)
index 0000000..d560387
--- /dev/null
@@ -0,0 +1,53 @@
+# Dockerfile for image with ONAP Portal SDK demo app
+
+# Yields an image 823 MB
+FROM frolvlad/alpine-oraclejdk8:slim
+# Yields an image 1.4 GB
+# FROM openjdk:8-jdk
+
+# Arguments are supplied by build.sh script
+# the defaults below only support testing
+ARG SDK_WAR=build/epsdk-app-os.war
+ARG HTTP_PROXY
+ARG HTTPS_PROXY
+
+# Just variables, never passed in
+ARG TOMCAT=apache-tomcat-8.0.37
+ARG TOMCATTAR=${TOMCAT}.tar.gz
+ARG TOMCATHOME=/opt/${TOMCAT}
+ARG SDKCONTEXT=ONAPPORTALSDK
+
+ENV http_proxy $HTTP_PROXY
+ENV https_proxy $HTTPS_PROXY
+RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
+    if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
+
+# Install Tomcat.  This image already has curl.
+WORKDIR /tmp
+RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
+RUN tar -xzf ${TOMCATTAR}
+RUN rm ${TOMCATTAR}
+# Remove manager and sample apps
+RUN rm -fr ${TOMCAT}/webapps/[a-z]*
+RUN mkdir -p /opt
+RUN mv ${TOMCAT} /opt
+
+WORKDIR ${TOMCATHOME}/webapps
+RUN mkdir ${SDKCONTEXT}
+
+# SDK app has only a war
+COPY $SDK_WAR ${SDKCONTEXT}
+RUN cd ${SDKCONTEXT} && unzip -q *.war && rm *.war
+
+VOLUME ${TOMCATHOME}/logs
+
+# Switch back to root
+WORKDIR /
+
+# Define commonly used ENV variables
+ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
+# Install the launch script
+COPY start-apache-tomcat.sh /
+
+# Define default command
+CMD /start-apache-tomcat.sh
index 72a11bb..c7c42a2 100644 (file)
@@ -10,10 +10,8 @@ ARG WMS_JAR=build/widget-ms.jar
 COPY ${WMS_JAR} /app.jar
 RUN sh -c 'touch /app.jar'
 
 COPY ${WMS_JAR} /app.jar
 RUN sh -c 'touch /app.jar'
 
-# Wait script, which depends on nc
-COPY wait-for.sh /
 # Launch script
 # Launch script
-COPY start-wms-cmd.sh /
+COPY start-wms.sh /
 
 # Define default command
 
 # Define default command
-CMD /start-wms-cmd.sh
+CMD /start-wms.sh
index 4d4aa83..d4f8968 100755 (executable)
@@ -7,89 +7,86 @@
 # Stop on error; show output
 set -e -x
 
 # Stop on error; show output
 set -e -x
 
-# This reuses the docker-compose file
+# This reuses the docker-compose environment file
 echo "Set image tag name variables"
 source $(dirname $0)/.env
 
 echo "Set image tag name variables"
 source $(dirname $0)/.env
 
-# Work standalone AND in the ONAP Jenkins.
+# Check for Jenkins build number
+if [ -n "$BUILD_NUMBER" ]; then
+    echo "Using Jenkins build number $BUILD_NUMBER"
+else
+    # This indicates a non-Jenkins build
+    export BUILD_NUMBER="999"
+fi
+
+# Must work when called by ONAP Jenkins AND local builds.
 # Pick up Jenkins settings for this script.
 # Use -B for batch operation to skip download progress output
 if [ -n "$MVN" ]; then
 # Pick up Jenkins settings for this script.
 # Use -B for batch operation to skip download progress output
 if [ -n "$MVN" ]; then
-    export MVN="${MVN} -B -gs ${GLOBAL_SETTINGS_FILE} -s ${SETTINGS_FILE}"
+    export MVN="${MVN} -B -gs ${GLOBAL_SETTINGS_FILE} -s ${SETTINGS_FILE} -Dbuild.number=$BUILD_NUMBER"
 else
     # Force refresh of snapshots
 else
     # Force refresh of snapshots
-    MVN="mvn -B -U"
+    MVN="mvn -B -U -Dbuild.number=$BUILD_NUMBER"
 fi
 
 # This expects to start in the deliveries folder; make sure
 fi
 
 # This expects to start in the deliveries folder; make sure
-PORTAL_DOCKERFILE=Dockerfile.portalapps
+PORTAL_DOCKERFILE=Dockerfile.portal
 if [ ! -f $PORTAL_DOCKERFILE ] ; then
     echo "Failed to find file ${PORTAL_DOCKERFILE}; must start in deliveries folder; exiting"
     exit 1
 fi
 if [ ! -f $PORTAL_DOCKERFILE ] ; then
     echo "Failed to find file ${PORTAL_DOCKERFILE}; must start in deliveries folder; exiting"
     exit 1
 fi
+SDK_DOCKERFILE=Dockerfile.sdk
 
 # Store directory names as variables
 
 # Store directory names as variables
-# This is the Docker Project area.
-DELIV="$(pwd)"
+# This is the deliveries area.
+DELIVDIR="$(pwd)"
 # parent directory, for finding source projects
 cd ..
 # parent directory, for finding source projects
 cd ..
-BASE="$(pwd)"
-cd $DELIV
+BASEDIR="$(pwd)"
+cd $DELIVDIR
 
 # Relative path of temp directory
 BUILD_REL="build"
 # Absolute path of temp directory
 
 # Relative path of temp directory
 BUILD_REL="build"
 # Absolute path of temp directory
-BUILD_ABS=$DELIV/$BUILD_REL
-rm -fr $BUILD_REL
-mkdir $BUILD_REL
+BUILD_ABS=$DELIVDIR/$BUILD_REL
 
 
-# Copy DDL/DML to required directories
+# Build Java projects.
+# (use env var toskip when debugging Docker build problems)
+if [ "$SKIP_JAVA_BUILD" = "please" ]; then
 
 
-# RELATIVE PATHS to local directories with database scripts
-# bcos Docker looks within this build area only
-SCR_BASE=$BUILD_REL/scripts
-PORTAL_SCRIPT_DIR=$SCR_BASE/ecomp-portal-DB-os
-SDK_SCRIPT_DIR=$SCR_BASE/epsdk-app-os
-mkdir -p ${PORTAL_SCRIPT_DIR} ${SDK_SCRIPT_DIR}
+       echo "SKIPPING JAVA BUILD!"
 
 
-# copy over DB scripts for the dockerfiles
-# Portal
-cp $BASE/ecomp-portal-DB-common/*.sql ${PORTAL_SCRIPT_DIR}
-cp $BASE/ecomp-portal-DB-os/*.sql ${PORTAL_SCRIPT_DIR}
-# SDK app
-cp $BASE/sdk/ecomp-sdk/epsdk-app-common/db-scripts/*.sql ${SDK_SCRIPT_DIR}
-cp $BASE/sdk/ecomp-sdk/epsdk-app-os/db-scripts/*.sql ${SDK_SCRIPT_DIR}
+else
+       echo "Starting Java build."
 
 
-# build database docker
-DB_DOCKER_CMD="
-  docker build -t ${DB_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
-    --build-arg PORTAL_SCRIPT_DIR=${PORTAL_SCRIPT_DIR}
-    --build-arg SDK_SCRIPT_DIR=${SDK_SCRIPT_DIR}
-    -f Dockerfile.mariadb .
-"
-echo "Build mariadb docker image"
-$DB_DOCKER_CMD
+       # Clean out and recreate
+       rm -fr $BUILD_REL
+       mkdir $BUILD_REL
 
 
-echo "Build all jar and war files in Portal"
-cd $BASE
-${MVN} clean install
+       echo "Build jar and war files"
+       cd $BASEDIR
+       ${MVN} clean install
+
+       echo "Build Portal-SDK app"
+       cd $BASEDIR/sdk/ecomp-sdk/epsdk-app-os
+       ${MVN} clean package
+
+       echo "Java build complete."
+fi
 
 echo "Copy Portal app BE"
 
 echo "Copy Portal app BE"
-cd $BASE/ecomp-portal-BE-os
-cp target/ecompportal-be-os.war $BUILD_ABS
+cp $BASEDIR/ecomp-portal-BE-os/target/portal-be-os.war $BUILD_ABS
 
 echo "Copy Portal app FE"
 
 echo "Copy Portal app FE"
-cd $BASE/ecomp-portal-FE-os/
-cp -r dist/public $BUILD_ABS
+cp -r $BASEDIR/ecomp-portal-FE-os/dist/public $BUILD_ABS
 
 echo "Copy Portal widget-ms"
 
 echo "Copy Portal widget-ms"
-cd $BASE/ecomp-portal-widget-ms
-cp widget-ms/target/widget-ms.jar $BUILD_ABS
+cp $BASEDIR/ecomp-portal-widget-ms/widget-ms/target/widget-ms.jar $BUILD_ABS
+
+echo "Copy Portal-SDK app build results"
+cp $BASEDIR/sdk/ecomp-sdk/epsdk-app-os/target/epsdk-app-os.war $BUILD_ABS
 
 
-echo "Build and copy Portal-SDK app"
-cd $BASE/sdk/ecomp-sdk/epsdk-app-os
-${MVN} clean package
-cp target/epsdk-app-os.war $BUILD_ABS
+# Build Docker images
 
 PROXY_ARGS=""
 if [ $HTTP_PROXY ]; then
 
 PROXY_ARGS=""
 if [ $HTTP_PROXY ]; then
@@ -99,18 +96,47 @@ if [ $HTTPS_PROXY ]; then
     PROXY_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
 fi
 
     PROXY_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
 fi
 
+# must work in delivery directory
+cd $DELIVDIR
+
+# Copy DDL/DML to required directories
+# RELATIVE PATHS to local directories with database scripts
+# bcos Docker looks within this build area only
+DB_SCRIPT_DIR=$BUILD_REL/db-scripts
+mkdir -p ${DELIVDIR}/${DB_SCRIPT_DIR}
+# Portal
+cp $BASEDIR/ecomp-portal-DB-common/*.sql ${DB_SCRIPT_DIR}
+cp $BASEDIR/ecomp-portal-DB-os/*.sql ${DB_SCRIPT_DIR}
+# SDK app
+cp $BASEDIR/sdk/ecomp-sdk/epsdk-app-common/db-scripts/*.sql ${DB_SCRIPT_DIR}
+cp $BASEDIR/sdk/ecomp-sdk/epsdk-app-os/db-scripts/*.sql ${DB_SCRIPT_DIR}
+
+echo "Build mariadb docker image"
+DB_DOCKER_CMD="
+  docker build -t ${DB_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
+    --build-arg DB_SCRIPT_DIR=${DB_SCRIPT_DIR}
+    -f Dockerfile.mariadb .
+"
+$DB_DOCKER_CMD
+
 echo "Build portal docker image"
 echo "Build portal docker image"
-cd $DELIV
 PORTAL_DOCKER_CMD="
   docker build -t ${EP_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
     --build-arg FE_DIR=$BUILD_REL/public
 PORTAL_DOCKER_CMD="
   docker build -t ${EP_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
     --build-arg FE_DIR=$BUILD_REL/public
-    --build-arg PORTAL_WAR=$BUILD_REL/ecompportal-be-os.war
-    --build-arg SDK_WAR=$BUILD_REL/epsdk-app-os.war
+    --build-arg PORTAL_WAR=$BUILD_REL/portal-be-os.war
     -f $PORTAL_DOCKERFILE .
 "
 $PORTAL_DOCKER_CMD
 
     -f $PORTAL_DOCKERFILE .
 "
 $PORTAL_DOCKER_CMD
 
-echo "Bbuild widget-ms docker image"
+echo "Build sdk demo app docker image"
+SDK_DOCKER_CMD="
+  docker build -t ${SDK_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
+    --build-arg SDK_WAR=$BUILD_REL/epsdk-app-os.war
+    -f $SDK_DOCKERFILE .
+"
+$SDK_DOCKER_CMD
+
+echo "Build widget-ms docker image"
 WMS_DOCKER_CMD="
   docker build -t ${WMS_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
     --build-arg WMS_JAR=$BUILD_REL/widget-ms.jar
 WMS_DOCKER_CMD="
   docker build -t ${WMS_IMG_NAME}:${PORTAL_TAG} ${PROXY_ARGS}
     --build-arg WMS_JAR=$BUILD_REL/widget-ms.jar
index a5db547..4e5879e 100644 (file)
@@ -30,6 +30,8 @@ services:
     volumes:
       # Just specify a path and let the Engine create a volume
       - /var/lib/mysql
     volumes:
       # Just specify a path and let the Engine create a volume
       - /var/lib/mysql
+      # Inject the onboarding script at start time
+      - ./Apps_Users_OnBoarding_Script.sql:/docker-entrypoint-initdb.d/zzz_apps_users_onboarding.sql
     logging:
       driver: json-file
     healthcheck:
     logging:
       driver: json-file
     healthcheck:
@@ -49,14 +51,13 @@ services:
         condition: service_healthy
     volumes:
       - ${PROPS_DIR}/ONAPWIDGETMS/application.properties:/application.properties
         condition: service_healthy
     volumes:
       - ${PROPS_DIR}/ONAPWIDGETMS/application.properties:/application.properties
+      - ${PROPS_DIR}/ONAPWIDGETMS/application.yml:/application.yml
     command:
     command:
-      - /start-wms-cmd.sh
+      - /start-wms.sh
     logging:
       driver: json-file
 
     logging:
       driver: json-file
 
-  # Environment variables here CANNOT override the database URL because
-  # two apps use identical configuration keys with different values
-  portal-apps:
+  portal-app:
     image: ${EP_IMG_NAME}:${PORTAL_TAG}
     ports:
       - 8989:8080
     image: ${EP_IMG_NAME}:${PORTAL_TAG}
     ports:
       - 8989:8080
@@ -76,16 +77,34 @@ services:
       - ${PROPS_DIR}/ONAPPORTAL/portal.properties:${WEBAPPS_DIR}/ONAPPORTAL/WEB-INF/classes/portal.properties
       - ${PROPS_DIR}/ONAPPORTAL/openid-connect.properties:${WEBAPPS_DIR}/ONAPPORTAL/WEB-INF/classes/openid-connect.properties
       - ${PROPS_DIR}/ONAPPORTAL/logback.xml:${WEBAPPS_DIR}/ONAPPORTAL/WEB-INF/classes/logback.xml
       - ${PROPS_DIR}/ONAPPORTAL/portal.properties:${WEBAPPS_DIR}/ONAPPORTAL/WEB-INF/classes/portal.properties
       - ${PROPS_DIR}/ONAPPORTAL/openid-connect.properties:${WEBAPPS_DIR}/ONAPPORTAL/WEB-INF/classes/openid-connect.properties
       - ${PROPS_DIR}/ONAPPORTAL/logback.xml:${WEBAPPS_DIR}/ONAPPORTAL/WEB-INF/classes/logback.xml
-      - ${PROPS_DIR}/ONAPPORTALSDK/fusion.properties:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/fusion/conf/fusion.properties
-      - ${PROPS_DIR}/ONAPPORTALSDK/system.properties:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/conf/system.properties
-      - ${PROPS_DIR}/ONAPPORTALSDK/portal.properties:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/classes/portal.properties
-      - ${PROPS_DIR}/ONAPPORTALSDK/logback.xml:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/classes/logback.xml
       - ${LOGS_DIR}:/opt/apache-tomcat-8.0.37/logs
     command:
       - ${LOGS_DIR}:/opt/apache-tomcat-8.0.37/logs
     command:
-      - /start-apps-cmd.sh
+      - /start-apache-tomcat.sh
       # see comments in .env file
       # see comments in .env file
+      - -i
       - $EXTRA_HOST_IP
       - $EXTRA_HOST_IP
+      - -n
       - $EXTRA_HOST_NAME
     logging:
       driver: json-file
 
       - $EXTRA_HOST_NAME
     logging:
       driver: json-file
 
+  portal-sdk:
+    image: ${SDK_IMG_NAME}:${PORTAL_TAG}
+    ports:
+      - 8990:8080
+    links:
+      - portal-db
+      - portal-wms
+    depends_on:
+      portal-db:
+        condition: service_healthy
+    volumes:
+      - ${PROPS_DIR}/ONAPPORTALSDK/fusion.properties:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/fusion/conf/fusion.properties
+      - ${PROPS_DIR}/ONAPPORTALSDK/system.properties:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/conf/system.properties
+      - ${PROPS_DIR}/ONAPPORTALSDK/portal.properties:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/classes/portal.properties
+      - ${PROPS_DIR}/ONAPPORTALSDK/logback.xml:${WEBAPPS_DIR}/ONAPPORTALSDK/WEB-INF/classes/logback.xml
+      - ${LOGS_DIR}:/opt/apache-tomcat-8.0.37/logs
+    command:
+      - /start-apache-tomcat.sh
+    logging:
+      driver: json-file
diff --git a/deliveries/local-dev-host-clone.sh b/deliveries/local-dev-host-clone.sh
new file mode 100644 (file)
index 0000000..36fdacc
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Sets up a new build area for Portal projects on on a dev/test host such as vm-ep-dev3
+
+USER=attuid-goes-here
+git clone https://${USER}@codecloud.web.att.com/scm/st_quantum/lf_portal.git
+cd lf_portal
+git clone https://${USER}@codecloud.web.att.com/scm/st_quantum/lf_portal_sdk.git sdk
diff --git a/deliveries/local-dev-host-pull.sh b/deliveries/local-dev-host-pull.sh
new file mode 100644 (file)
index 0000000..acb344b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Refreshes an existing build area for Portal projects on on a dev/test host such as vm-ep-dev3
+
+set -x
+git pull 
+cd sdk
+git pull
diff --git a/deliveries/local-dev-host-start.sh b/deliveries/local-dev-host-start.sh
new file mode 100644 (file)
index 0000000..4230c39
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Starts docker containers for ONAP Portal in test environment
+# For development use only; this does NOT pull from git nor build.
+
+# be verbose
+set -x
+
+# Get variables from docker-compose environment file
+source .env
+
+# Define local subdirectory with host-specific property files
+# The leading "./" is required for docker-compose
+export PROPS_DIR=./properties_vm-ep-dev11
+if [ ! -d $PROPS_DIR ] ; then
+    echo "Failed to find directory $PROPS_DIR"
+    exit 1
+fi
+echo "Using properties directory $PROPS_DIR"
+
+# Constants as of Oct 2017, Amsterdam release
+NEXUS_REPO=nexus3.onap.org:10001
+CLI_IMG_VERSION=1.1-STAGING-latest
+
+# Pull and tag the CLI image, which is provided elsewhere.
+# Authenticate like this; the username and password are NOT stored here.
+docker login -u username -p password $NEXUS_REPO 
+docker pull $NEXUS_REPO/$CLI_IMG_NAME:${CLI_IMG_VERSION}
+docker tag $NEXUS_REPO/$CLI_IMG_NAME:${CLI_IMG_VERSION} $CLI_IMG_NAME:$PORTAL_TAG
+
+# Create local logs directory
+# The leading "./" is required for docker-compose
+export LOGS_DIR=./logs
+mkdir -p $LOGS_DIR
+
+# Make inter-app communication work in dev3
+export EXTRA_HOST_IP="135.207.161.175"
+export EXTRA_HOST_NAME="portal.api.simpledemo.onap.org"
+
+# (re)start containers
+docker-compose down
+docker-compose up -d 
index 3f11000..7361704 100755 (executable)
@@ -18,9 +18,6 @@ fi
 # this into os_docker_push, os_docker_release scripts
 NEXUS_REPO=nexus3.onap.org:10003
 
 # this into os_docker_push, os_docker_release scripts
 NEXUS_REPO=nexus3.onap.org:10003
 
-# Establish environment variables
-source $(dirname $0)/.env
-
 # Build the containers
 ./build_portalapps_dockers.sh
 
 # Build the containers
 ./build_portalapps_dockers.sh
 
index 30bd3dc..3903519 100755 (executable)
@@ -4,8 +4,16 @@
 # be verbose
 set -x
 
 # be verbose
 set -x
 
+# Establish environment variables
+source $(dirname $0)/.env
+
+if [ -z "$PORTAL_VERSION" ]; then
+    echo "PORTAL_VERSION not set"
+    exit 1
+fi
+
 TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
 TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-export VERSION="1.3.0-SNAPSHOT-${TIMESTAMP}"
+export VERSION="${PORTAL_VERSION}-${TIMESTAMP}"
 export LATEST="latest"
 
 exec ./os_docker_base.sh
 export LATEST="latest"
 
 exec ./os_docker_base.sh
index 45a1450..2a22fef 100755 (executable)
@@ -4,8 +4,16 @@
 # be verbose
 set -x
 
 # be verbose
 set -x
 
+# Establish environment variables
+source $(dirname $0)/.env
+
+if [ -z "$PORTAL_VERSION" ]; then
+    echo "PORTAL_VERSION not set"
+    exit 1
+fi
+
 TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
 TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-export VERSION="1.3.0-STAGING-${TIMESTAMP}"
-export LATEST="1.3-STAGING-latest"
+export VERSION="${PORTAL_VERSION}-STAGING-${TIMESTAMP}"
+export LATEST="${PORTAL_VERSION}-STAGING-latest"
 
 exec ./os_docker_base.sh
 
 exec ./os_docker_base.sh
index 32a790c..8daf2cc 100644 (file)
   <!-- 
   Logback files for the ONAP Portal SDK Application 
   are created in directory ${catalina.base}/logs/${componentName}
   <!-- 
   Logback files for the ONAP Portal SDK Application 
   are created in directory ${catalina.base}/logs/${componentName}
-  e.g., apache-tomcat-8.0.35/logs/epsdk_app/application.log  
+  e.g., apache-tomcat-8.0.35/logs/onapsdk/application.log  
   -->
   <!--<jmxConfigurator /> -->
 
   <!--  specify the component name -->
   -->
   <!--<jmxConfigurator /> -->
 
   <!--  specify the component name -->
-  <property name="componentName" value="epsdk_app"></property>
+  <property name="componentName" value="onapsdk"></property>
   
   <!--  specify the base path of the log directory -->
   <property name="logDirPrefix" value="${catalina.base}/logs"></property>
   
   <!--  specify the base path of the log directory -->
   <property name="logDirPrefix" value="${catalina.base}/logs"></property>
index 5bdd072..c80d2f0 100644 (file)
@@ -62,3 +62,6 @@ guard_notebook_url=
 
 #authenticate user server
 authenticate_user_server=http://portal.onap.org:8383/openid-connect-server-webapp/allUsers
 
 #authenticate user server
 authenticate_user_server=http://portal.onap.org:8383/openid-connect-server-webapp/allUsers
+
+#cookie domain
+cookie_domain = onap.org
index 7240a61..547a882 100644 (file)
@@ -31,5 +31,3 @@ account.user.password=6APqvG4AU2rfLgCvMdySwQ==
 #server.ssl.keyStoreType=PKCS12
 #server.ssl.keyAlias=widget-microservice
 
 #server.ssl.keyStoreType=PKCS12
 #server.ssl.keyAlias=widget-microservice
 
-## Jasypt Properties
-jasypt.encryptor.password=EncryptionKey
diff --git a/deliveries/properties_simpledemo/ONAPWIDGETMS/application.yml b/deliveries/properties_simpledemo/ONAPWIDGETMS/application.yml
new file mode 100644 (file)
index 0000000..d655bc9
--- /dev/null
@@ -0,0 +1,3 @@
+jasypt:
+  encryptor:
+    password: EncryptionKey
diff --git a/deliveries/start-apache-tomcat.sh b/deliveries/start-apache-tomcat.sh
new file mode 100644 (file)
index 0000000..db39248
--- /dev/null
@@ -0,0 +1,54 @@
+#!/bin/sh
+# Starts the Apache-Tomcat web container.
+# If arguments "-i ip.2.3.4" AND "-n name" are present, adds an entry to /etc/hosts;
+# this was added as a workaround for missing DNS in the CSIT environment.
+
+hostip=""
+hostname=""
+while [ $# -gt 0 ]; do
+    key="$1"
+    case $key in
+        -i|--ip)
+        hostip="$2"
+        echo "$0: option -i value is $hostip"
+        shift # past argument
+        shift # past value
+        ;;
+        -n|--name)
+        hostname="$2"
+        echo "$0: option -n value is $hostname"
+        shift # past argument
+        shift # past value
+        ;;
+        *)
+        echo "$0: ignoring argument $key"
+       shift
+        ;;
+    esac
+done
+
+# Optionally add to /etc/hosts
+# Docker-compose supplies arguments ""
+if [ ${#hostip} -lt 3 -o ${#hostname} -lt 3 ]; then
+    echo "$0: values for IP (-i) and/or name (-n) are empty or short"
+else
+    echo "$0: using IP-name arguments $hostip $hostname"
+    grep $hostname /etc/hosts
+    ret_code=$?
+    if [ $ret_code != 0 ]; then
+        echo "$0: extending hosts with $hostname"
+        echo "$hostip $hostname" >> /etc/hosts
+    else
+        echo "$0: hosts already has $hostname"
+    fi
+fi
+
+BASE=/opt/apache-tomcat-8.0.37
+if [ ! -d $BASE ] ; then
+    echo "$0: $BASE not found or not a directory"
+    exit 1
+fi
+echo "$0: Starting server from $BASE"
+LOGFILE=${BASE}/logs/catalina.out
+echo "`date`:<--------------------    Starting     -------------------->" >> $LOGFILE
+exec ${BASE}/bin/catalina.sh run  2>&1 | tee -a $LOGFILE
diff --git a/deliveries/start-apps-cmd.sh b/deliveries/start-apps-cmd.sh
deleted file mode 100755 (executable)
index 7d3a8ad..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-# Starts the Apache-Tomcat web container with the Portal, EPSDK and DMaaP BC web apps.
-# If arguments "-i ip.2.3.4" AND "-n name" are present, adds an entry to /etc/hosts;
-# this was added as a workaround for missing DNS in the CSIT environment.
-
-hostip=""
-hostname=""
-while [ $# -gt 0 ]; do
-    key="$1"
-    case $key in
-        -i|--ip)
-        hostip="$2"
-        shift # past argument
-        shift # past value
-        ;;
-        -n|--name)
-        hostname="$2"
-        shift # past argument
-        shift # past value
-        ;;
-        *)
-        echo "$0: ignoring argument $key"
-       shift
-        ;;
-    esac
-done
-
-# Optionally add to /etc/hosts
-if [ -z "${hostip}" -o -z "${hostname}" ]; then
-    echo "$0: Arguments for IP and name not found, continuing."
-else
-    echo "$0: Using IP-name arguments $hostip $hostname"
-    grep $hostname /etc/hosts
-    ret_code=$?
-    if [ $ret_code != 0 ]; then
-        echo "$hostip $hostname" >> /etc/hosts
-    fi
-fi
-
-BASE=/opt/apache-tomcat-8.0.37
-if [ ! -d $BASE ] ; then
-    echo "$0: $BASE not found or not a directory"
-    exit 1
-fi
-echo "$0: Starting server from $BASE"
-LOGFILE=${BASE}/logs/catalina.out
-echo "`date`:<--------------------    Starting     -------------------->" >> $LOGFILE
-exec ${BASE}/bin/catalina.sh run  2>&1 | tee -a $LOGFILE
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from deliveries/start-wms-cmd.sh
rename to deliveries/start-wms.sh
diff --git a/deliveries/wait-for.sh b/deliveries/wait-for.sh
deleted file mode 100755 (executable)
index 2525821..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-# https://github.com/Eficode/wait-for.git
-# MIT License
-
-TIMEOUT=15
-QUIET=0
-
-echoerr() {
-  if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi
-}
-
-usage() {
-  exitcode="$1"
-  cat << USAGE >&2
-Usage:
-  $cmdname host:port [-t timeout] [-- command args]
-  -q | --quiet                        Do not output any status messages
-  -t TIMEOUT | --timeout=timeout      Timeout in seconds, zero for no timeout
-  -- COMMAND ARGS                     Execute command with args after the test finishes
-USAGE
-  exit "$exitcode"
-}
-
-wait_for() {
-  command="$*"
-  if [ "$QUIET" -ne 1 ]; then echo "$0: probing host $HOST port $PORT"; fi
-  for i in `seq $TIMEOUT` ; do
-    nc -z "$HOST" "$PORT" > /dev/null 2>&1
-    result=$?
-    if [ $result -eq 0 ] ; then
-      if [ "$QUIET" -ne 1 ]; then echo "$0: operation succeeded on try $i"; fi
-      if [ -n "$command" ] ; then
-        if [ "$QUIET" -ne 1 ]; then echo "$0: exec-ing command $command"; fi
-        exec $command
-      fi
-      exit 0
-    fi
-    if [ "$QUIET" -ne 1 ]; then echo "$0: sleeping after try $i"; fi
-    sleep 1
-  done
-  echo "$0: Operation timed out" >&2
-  exit 1
-}
-
-while [ $# -gt 0 ]
-do
-  case "$1" in
-    *:* )
-    HOST=$(printf "%s\n" "$1"| cut -d : -f 1)
-    PORT=$(printf "%s\n" "$1"| cut -d : -f 2)
-    shift 1
-    ;;
-    -q | --quiet)
-    QUIET=1
-    shift 1
-    ;;
-    -t)
-    TIMEOUT="$2"
-    if [ "$TIMEOUT" = "" ]; then break; fi
-    shift 2
-    ;;
-    --timeout=*)
-    TIMEOUT="${1#*=}"
-    shift 1
-    ;;
-    --)
-    shift
-    break
-    ;;
-    --help)
-    usage 0
-    ;;
-    *)
-    echoerr "Unknown argument: $1"
-    usage 1
-    ;;
-  esac
-done
-
-if [ "$HOST" = "" -o "$PORT" = "" ]; then
-  echoerr "Error: you need to provide a host and port to test."
-  usage 2
-fi
-
-wait_for "$@"
diff --git a/docs/conf.py b/docs/conf.py
deleted file mode 100644 (file)
index 394b2d6..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Acumos Common Data Service documentation build configuration file, created by
-# sphinx-quickstart on Wed Nov  8 08:11:26 2017.
-#
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
-
-
-# -- General configuration ------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#
-# needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.graphviz', 'sphinx.ext.todo', 'sphinx.ext.imgmath', 'sphinx.ext.viewcode', 'sphinx.ext.ifconfig', 'sphinx.ext.todo', 'sphinxcontrib.swaggerdoc' ]
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix(es) of source filenames.
-# You can specify multiple suffix as a list of string:
-#
-# source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'Acumos Common Data Service'
-copyright = u'2017, Acumos'
-author = u'Acumos'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = u''
-# The full version, including alpha/beta/rc tags.
-release = u''
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#
-# This is also used if you do content translation via gettext catalogs.
-# Usually you set "language" from the command line for these cases.
-language = None
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-# This patterns also effect to html_static_path and html_extra_path
-exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = False
-
-
-# -- Options for HTML output ----------------------------------------------
-
-# The theme to use for HTML and HTML Help pages.  See the documentation for
-# a list of builtin themes.
-#
-html_theme = 'alabaster'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#
-# html_theme_options = {}
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# Custom sidebar templates, must be a dictionary that maps document names
-# to template names.
-#
-# This is required for the alabaster theme
-# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
-html_sidebars = {
-    '**': [
-        'relations.html',  # needs 'show_related': True theme option to display
-        'searchbox.html',
-    ]
-}
-
-
-# -- Options for HTMLHelp output ------------------------------------------
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'AcumosCommonDataServicedoc'
-
-
-# -- Options for LaTeX output ---------------------------------------------
-
-latex_elements = {
-    # The paper size ('letterpaper' or 'a4paper').
-    #
-    # 'papersize': 'letterpaper',
-
-    # The font size ('10pt', '11pt' or '12pt').
-    #
-    # 'pointsize': '10pt',
-
-    # Additional stuff for the LaTeX preamble.
-    #
-    # 'preamble': '',
-
-    # Latex figure (float) alignment
-    #
-    # 'figure_align': 'htbp',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-#  author, documentclass [howto, manual, or own class]).
-latex_documents = [
-    (master_doc, 'AcumosCommonDataService.tex', u'Acumos Common Data Service Documentation',
-     u'Acumos', 'manual'),
-]
-
-
-# -- Options for manual page output ---------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
-    (master_doc, 'acumoscommondataservice', u'Acumos Common Data Service Documentation',
-     [author], 1)
-]
-
-
-# -- Options for Texinfo output -------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-#  dir menu entry, description, category)
-texinfo_documents = [
-    (master_doc, 'AcumosCommonDataService', u'Acumos Common Data Service Documentation',
-     author, 'AcumosCommonDataService', 'One line description of project.',
-     'Miscellaneous'),
-]
-
-
-
index ae81c23..e92d1a0 100644 (file)
@@ -3,5 +3,6 @@
 .classpath
 .project
 .settings/
 .classpath
 .project
 .settings/
-/logs
-/debug-logs
+/debug-logs/
+/logs/
+/bin/
index 3d1db4d..d791779 100644 (file)
@@ -1,13 +1,14 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
+
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>1.3.0</version>
+               <version>2.2</version>
        </parent>
 
        </parent>
 
-       <artifactId>ecompportal-be-common</artifactId>
+       <artifactId>portal-be-common</artifactId>
        <packaging>war</packaging>
 
        <properties>
        <packaging>war</packaging>
 
        <properties>
                                        </execution>
                                </executions>
                        </plugin>
                                        </execution>
                                </executions>
                        </plugin>
+                       
+                       <plugin>
+                       <groupId>org.apache.maven.plugins</groupId>
+                       <artifactId>maven-jar-plugin</artifactId>
+                       <version>3.0.0</version>
+                       <executions>
+                         <execution>
+                           <goals>
+                             <goal>test-jar</goal>
+                           </goals>
+                         </execution>
+                       </executions>
+               </plugin>
 
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
 
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                        <version>${jacocoVersion}</version>
                        <classifier>runtime</classifier>
                </dependency>
                        <version>${jacocoVersion}</version>
                        <classifier>runtime</classifier>
                </dependency>
+               <dependency>
+             <groupId>org.owasp.esapi</groupId>
+             <artifactId>esapi</artifactId>
+             <version>2.1.0.1</version>
+        </dependency>
+        <dependency>
+                   <groupId>org.springframework.security</groupId>
+                   <artifactId>spring-security-core</artifactId>
+                   <version>${springframework.version}</version>
+           </dependency>
+           <dependency>
+               <groupId>org.springframework.security</groupId>
+               <artifactId>spring-security-web</artifactId>
+               <version>${springframework.version}</version>
+        </dependency>
+           <dependency>
+                   <groupId>org.springframework.security</groupId>
+                   <artifactId>spring-security-config</artifactId>
+                   <version>${springframework.version}</version>
+           </dependency>
+               
        </dependencies>
 
        </dependencies>
 
-       <!-- No deployment descriptor. -->
-
 </project>
 </project>
index 4e06921..50e2720 100644 (file)
@@ -2,11 +2,11 @@
  * ============LICENSE_START==========================================
  * ONAP Portal
  * ===================================================================
  * ============LICENSE_START==========================================
  * ONAP Portal
  * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * 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”);
+ * 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
  *
  * you may not use this software except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -19,7 +19,7 @@
  * limitations under the License.
  *
  * Unless otherwise specified, all documentation contained herein is licensed
  * limitations under the License.
  *
  * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+ * 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
  *
  * you may not use this documentation except in compliance with the License.
  * You may obtain a copy of the License at
  *
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/command/EPLoginBean.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/command/EPLoginBean.java
new file mode 100644 (file)
index 0000000..99677b3
--- /dev/null
@@ -0,0 +1,204 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.command;
+
+import java.util.Set;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalsdk.core.domain.support.FusionCommand;
+
+public class EPLoginBean extends FusionCommand {
+    private String loginId;
+    private String loginPwd;
+    private String hrid;
+    private String orgUserId;
+    private String siteAccess;
+    private String loginErrorMessage;
+
+    private EPUser user;
+    private Set<?>  menu;
+    private Set<?>  businessDirectMenu;
+
+    /**
+     * getLoginId
+     *
+     * @return String
+     */
+    public String getLoginId() {
+        return loginId;
+    }
+
+    /**
+     * getLoginPwd
+     *
+     * @return String
+     */
+    public String getLoginPwd() {
+        return loginPwd;
+    }
+
+    /**
+     * getMenu
+     *
+     * @return Set
+     */
+    public Set<?> getMenu() {
+        return menu;
+    }
+
+    /**
+     * getUser
+     *
+     * @return User
+     */
+    public EPUser getUser() {
+        return user;
+    }
+
+    /**
+     * getHrid
+     *
+     * @return String
+     */
+    public String getHrid() {
+        return hrid;
+    }
+
+    /**
+     * getSiteAccess
+     *
+     * @return String
+     */
+    public String getSiteAccess() {
+        return siteAccess;
+    }
+
+    /**
+     * getBusinessDirectMenu
+     *
+     * @return Set
+     */
+    public Set<?> getBusinessDirectMenu() {
+        return businessDirectMenu;
+    }
+
+    /**
+     * getLoginErrorMessage
+     *
+     * @return String
+     */
+    public String getLoginErrorMessage() {
+        return loginErrorMessage;
+    }
+
+    public String getOrgUserId() {
+        return orgUserId;
+    }
+
+    /**
+     * setLoginId
+     *
+     * @param loginId String
+     */
+    public void setLoginId(String loginId) {
+        this.loginId = loginId;
+    }
+
+    /**
+     * setLoginPwd
+     *
+     * @param loginPwd String
+     */
+    public void setLoginPwd(String loginPwd) {
+        this.loginPwd = loginPwd;
+    }
+
+    public void setMenu(Set<?> menu) {
+        this.menu = menu;
+    }
+
+    /**
+     * setUser
+     *
+     * @param user User
+     */
+    public void setUser(EPUser user) {
+        this.user = user;
+    }
+
+    /**
+     * setHrid
+     *
+     * @param hrid String
+     */
+    public void setHrid(String hrid) {
+        this.hrid = hrid;
+    }
+
+    /**
+     * setSiteAccess
+     *
+     * @param siteAccess String
+     */
+    public void setSiteAccess(String siteAccess) {
+        this.siteAccess = siteAccess;
+    }
+
+    /**
+     * setBusinessDirectMenu
+     *
+     * @param businessDirectMenu Set
+     */
+    public void setBusinessDirectMenu(Set<?> businessDirectMenu) {
+        this.businessDirectMenu = businessDirectMenu;
+    }
+
+    /**
+     * setLoginErrorMessage
+     *
+     * @param loginErrorMessage String
+     */
+    public void setLoginErrorMessage(String loginErrorMessage) {
+        this.loginErrorMessage = loginErrorMessage;
+    }
+
+    public void setOrgUserId(String orgUserId) {
+        this.orgUserId = orgUserId;
+    }
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/command/PostSearchBean.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/command/PostSearchBean.java
new file mode 100644 (file)
index 0000000..6fc8f2a
--- /dev/null
@@ -0,0 +1,391 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.command;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalsdk.core.command.support.SearchBase;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+@JsonSerialize
+public class PostSearchBean extends SearchBase {
+
+    private EPUser     user     = null;
+    private EPUser     userOrig = null;
+    private String[] selected;
+    private String[] postHrid;
+    private String[] postOrgUserId;
+    private String[] postFirstName;
+    private String[] postLastName;
+    private String[] postOrgCode;
+    private String[] postPhone;
+    private String[] postEmail;
+    private String[] postAddress1;
+    private String[] postAddress2;
+    private String[] postCity;
+    private String[] postState;
+    private String[] postZipCode;
+    private String[] postLocationClli;
+    private String[] postBusinessCountryCode;
+    private String[] postBusinessCountryName;
+    private String[] postDepartment;
+    private String[] postDepartmentName;
+    private String[] postBusinessUnit;
+    private String[] postBusinessUnitName;
+    private String[] postJobTitle;
+    private String[] postOrgManagerUserId;
+    private String[] postCommandChain;
+    private String[] postCompanyCode;
+    private String[] postCompany;
+    private String[] postCostCenter;
+    private String[] postSiloStatus;
+    private String[] postFinancialLocCode;
+
+
+    public PostSearchBean() {
+      this(null);
+    } // PostSearchBean
+
+    public PostSearchBean(List<?> items) {
+      super(items);
+
+      user     = new EPUser();
+      userOrig = new EPUser();
+
+      setSortBy1("");
+      setSortBy1Orig("");
+
+      //setSortByList(...);
+    }  // PostSearchBean
+
+
+    public String getFirstName()                      { return user.getFirstName(); }
+    public String getLastName()                       { return user.getLastName(); }
+    public String getHrid()                           { return user.getHrid(); }
+    public String getOrgUserId()                      { return user.getOrgUserId(); }
+    public String getOrgCode()                        { return user.getOrgCode(); }
+    public String getEmail()                          { return user.getEmail(); }
+    public String getOrgManagerUserId()                  { return user.getOrgManagerUserId(); }
+    
+    public String getFirstNameOrig()                  { return user.getFirstName(); }
+    public String getLastNameOrig()                   { return user.getLastName(); }
+    public String getHridOrig()                       { return user.getHrid(); }
+    public String getOrgUserIdOrig()                  { return user.getOrgUserId(); }
+    public String getOrgCodeOrig()                    { return user.getOrgCode(); }
+    public String getEmailOrig()                      { return user.getEmail(); }
+    public String getOrgManagerUserIdOrig()              { return user.getOrgManagerUserId(); }
+    
+    
+    public EPUser getUser()                             { return user; }
+
+    public String[] getPostEmail() {
+        return postEmail;
+    }
+
+    public String[] getPostFirstName() {
+        return postFirstName;
+    }
+
+    public String[] getPostHrid() {
+        return postHrid;
+    }
+
+    public String[] getPostLastName() {
+        return postLastName;
+    }
+
+    public String[] getPostOrgCode() {
+        return postOrgCode;
+    }
+
+    public String[] getPostPhone() {
+        return postPhone;
+    }
+
+    public String[] getPostOrgUserId() {
+        return postOrgUserId;
+    }
+
+    public String[] getSelected() {
+        return selected;
+    }
+
+    public String[] getPostAddress1() {
+        return postAddress1;
+    }
+
+    public String[] getPostBusinessCountryCode() {
+        return postBusinessCountryCode;
+    }
+
+    public String[] getPostCity() {
+        return postCity;
+    }
+
+    public String[] getPostCommandChain() {
+        return postCommandChain;
+    }
+
+    public String[] getPostCompany() {
+        return postCompany;
+    }
+
+    public String[] getPostCompanyCode() {
+        return postCompanyCode;
+    }
+
+    public String[] getPostDepartment() {
+        return postDepartment;
+    }
+
+    public String[] getPostDepartmentName() {
+        return postDepartmentName;
+    }
+
+    public String[] getPostBusinessCountryName() {
+        return postBusinessCountryName;
+    }
+
+    public String[] getPostJobTitle() {
+        return postJobTitle;
+    }
+
+    public String[] getPostLocationClli() {
+        return postLocationClli;
+    }
+
+    public String[] getPostManagerUserId() {
+        return postOrgManagerUserId;
+    }
+
+    public String[] getPostState() {
+        return postState;
+    }
+
+    public String[] getPostZipCode() {
+        return postZipCode;
+    }
+
+    public void setFirstName(String value)            { user.setFirstName(value); }
+    public void setLastName(String value)             { user.setLastName(value); }
+    public void setHrid(String value)                 { user.setHrid(value); }
+    public void setOrgUserId(String value)            { user.setOrgUserId(value); }
+    public void setOrgCode(String value)              { user.setOrgCode(value); }
+    public void setEmail(String value)                { user.setEmail(value); }
+    public void setOrgManagerUserId(String value)     { user.setOrgManagerUserId(value); }
+    
+    public void setFirstNameOrig(String value)        { userOrig.setFirstName(value); }
+    public void setLastNameOrig(String value)         { userOrig.setLastName(value); }
+    public void setHridOrig(String value)             { userOrig.setHrid(value); }
+    public void setOrgUserIdOrig(String value)        { userOrig.setOrgUserId(value); }
+    public void setOrgCodeOrig(String value)          { userOrig.setOrgCode(value); }
+    public void setEmailOrig(String value)            { userOrig.setEmail(value); }
+    public void setOrgManagerUserIdOrig(String value) { userOrig.setOrgManagerUserId(value); }
+    
+    public void setUser(EPUser value)                   { this.user = value; }
+
+    public void setPostEmail(String[] postEmail) {
+        this.postEmail = postEmail;
+    }
+
+    public void setPostFirstName(String[] postFirstName) {
+        this.postFirstName = postFirstName;
+    }
+
+    public void setPostHrid(String[] postHrid) {
+        this.postHrid = postHrid;
+    }
+
+    public void setPostLastName(String[] postLastName) {
+        this.postLastName = postLastName;
+    }
+
+    public void setPostOrgCode(String[] postOrgCode) {
+        this.postOrgCode = postOrgCode;
+    }
+
+    public void setPostPhone(String[] postPhone) {
+        this.postPhone = postPhone;
+    }
+
+    public void setPostUserId(String[] postOrgUserId) {
+        this.postOrgUserId = postOrgUserId;
+    }
+
+    public void setSelected(String[] selected) {
+        this.selected = selected;
+    }
+
+    public void setPostAddress1(String[] postAddress1) {
+        this.postAddress1 = postAddress1;
+    }
+
+    public void setPostBusinessCountryCode(String[] postBusinessCountryCode) {
+        this.postBusinessCountryCode = postBusinessCountryCode;
+    }
+
+    public void setPostCity(String[] postCity) {
+        this.postCity = postCity;
+    }
+
+    public void setPostCommandChain(String[] postCommandChain) {
+        this.postCommandChain = postCommandChain;
+    }
+
+    public void setPostCompany(String[] postCompany) {
+        this.postCompany = postCompany;
+    }
+
+    public void setPostCompanyCode(String[] postCompanyCode) {
+        this.postCompanyCode = postCompanyCode;
+    }
+
+    public void setPostDepartment(String[] postDepartment) {
+        this.postDepartment = postDepartment;
+    }
+
+    public void setPostDepartmentName(String[] postDepartmentName) {
+        this.postDepartmentName = postDepartmentName;
+    }
+
+    public void setPostBusinessCountryName(String[] postBusinessCountryName) {
+        this.postBusinessCountryName = postBusinessCountryName;
+    }
+
+    public void setPostJobTitle(String[] postJobTitle) {
+        this.postJobTitle = postJobTitle;
+    }
+
+    public void setPostLocationClli(String[] postLocationClli) {
+        this.postLocationClli = postLocationClli;
+    }
+
+    public void setPostManagerUserId(String[] postOrgManagerUserId) {
+        this.postOrgManagerUserId = postOrgManagerUserId;
+    }
+
+    public void setPostState(String[] postState) {
+        this.postState = postState;
+    }
+
+    public void setPostZipCode(String[] postZipCode) {
+        this.postZipCode = postZipCode;
+    }
+    
+    public String[] getPostAddress2() {
+               return postAddress2;
+       }
+
+       public void setPostAddress2(String[] postAddress2) {
+               this.postAddress2 = postAddress2;
+       }
+
+       public EPUser getUserOrig() {
+               return userOrig;
+       }
+
+       public void setUserOrig(EPUser userOrig) {
+               this.userOrig = userOrig;
+       }
+
+       public String[] getPostBusinessUnit() {
+               return postBusinessUnit;
+       }
+
+       public void setPostBusinessUnit(String[] postBusinessUnit) {
+               this.postBusinessUnit = postBusinessUnit;
+       }
+
+       public String[] getPostBusinessUnitName() {
+               return postBusinessUnitName;
+       }
+
+       public void setPostBusinessUnitName(String[] postBusinessUnitName) {
+               this.postBusinessUnitName = postBusinessUnitName;
+       }
+
+       public String[] getPostCostCenter() {
+               return postCostCenter;
+       }
+
+       public void setPostCostCenter(String[] postCostCenter) {
+               this.postCostCenter = postCostCenter;
+       }
+
+       public String[] getPostSiloStatus() {
+               return postSiloStatus;
+       }
+
+       public void setPostSiloStatus(String[] postSiloStatus) {
+               this.postSiloStatus = postSiloStatus;
+       }
+
+       public String[] getPostFinancialLocCode() {
+               return postFinancialLocCode;
+       }
+
+       public void setPostFinancialLocCode(String[] postFinancialLocCode) {
+               this.postFinancialLocCode = postFinancialLocCode;
+       }
+
+       public void resetSearch() {
+          super.resetSearch();
+          setUser(new EPUser());
+       } // resetSearch
+
+
+       public boolean isCriteriaUpdated() {
+          if(user==null&&userOrig==null)
+            return false;
+          else if(user==null||userOrig==null)
+            return true;
+          else
+            return (! (
+                Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))&&
+                Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))&&
+                //Utilities.nvl(user.getHrid()).equals(Utilities.nvl(userOrig.getHrid()))&&
+                Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))&&
+                Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))&&
+                Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))&&
+                Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId()))&&
+                true));
+       } // isCriteriaUpdated
+
+}      // PostSearchBean
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java
new file mode 100644 (file)
index 0000000..f509dd2
--- /dev/null
@@ -0,0 +1,74 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import java.util.regex.Pattern;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
+import org.springframework.security.web.util.matcher.RegexRequestMatcher;
+import org.springframework.security.web.util.matcher.RequestMatcher;
+
+
+@Configuration
+@EnableWebSecurity
+public class ExternalSecurityConfig extends WebSecurityConfigurerAdapter {
+       @Override
+       protected void configure(HttpSecurity http) throws Exception {
+               RequestMatcher csrfRequestMatcher = new RequestMatcher() {
+                       private RegexRequestMatcher requestMatcher = new RegexRequestMatcher("/portalApi/.*", null);
+                       private Pattern allowedMethods = Pattern.compile("^(GET|HEAD|TRACE|OPTIONS)$");
+                       @Override
+                       public boolean matches(HttpServletRequest request) {
+                               if(allowedMethods.matcher(request.getMethod()).matches())
+                           return false;
+                       
+                               if(requestMatcher.matches(request))
+                                       return true;
+                               
+                               return false;
+                       }
+               };
+               http.csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()).requireCsrfProtectionMatcher(csrfRequestMatcher);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanup.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanup.java
new file mode 100644 (file)
index 0000000..60148f9
--- /dev/null
@@ -0,0 +1,58 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import java.util.TimerTask;
+
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+public class NotificationCleanup extends TimerTask {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(NotificationCleanup.class);
+
+       @Override
+       public void run() {
+               logger.debug(EELFLoggerDelegate.debugLogger, "run: cleaning the ep-notification table");
+               UserNotificationService notificationService = NotificationCleanupConfig.getApplicationContext()
+                               .getBean(UserNotificationService.class);
+               notificationService.deleteNotificationsFromEpUserNotificationTable();
+               notificationService.deleteNotificationsFromEpRoleNotificationTable();
+               notificationService.deleteNotificationsFromEpNotificationTable();
+       }
+
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java
new file mode 100644 (file)
index 0000000..1cf4091
--- /dev/null
@@ -0,0 +1,80 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.annotation.PostConstruct;
+
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class NotificationCleanupConfig implements ApplicationContextAware {
+       
+       // Once every 10 minutes should be adequate
+       public final static int CLEANUP_PERIOD_MINUTES = 10;
+       
+       private static ApplicationContext applicationContext;
+
+       public void setApplicationContext(ApplicationContext context) throws BeansException {
+               applicationContext = context;
+       }
+
+       public static ApplicationContext getApplicationContext() {
+               return applicationContext;
+
+       }
+
+       @PostConstruct
+       public void StartSchedular() {
+               TimerTask task = new NotificationCleanup();
+               Timer timer = new Timer();
+               timer.schedule(task, 1000, CLEANUP_PERIOD_MINUTES * 60 * 1000);
+       }
+
+       @Bean
+       public NotificationCleanupConfig getConfig() {
+               return new NotificationCleanupConfig();
+       }
+
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/PortalCentralAccessConfiguration.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/PortalCentralAccessConfiguration.java
new file mode 100644 (file)
index 0000000..f19f238
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
+import org.onap.portalapp.portal.service.EPRoleFunctionServiceImpl;
+import org.onap.portalsdk.core.service.CentralAccessCondition;
+import org.onap.portalsdk.core.service.LocalAccessCondition;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Conditional;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class PortalCentralAccessConfiguration {
+
+       
+          @Bean
+          @Conditional(LocalAccessCondition.class)
+          public EPRoleFunctionService ePRoleFunctionServiceImpl() {
+             return  new EPRoleFunctionServiceImpl();
+          }
+          
+         
+          @Bean
+          @Conditional(CentralAccessCondition.class)
+          public EPRoleFunctionService ePRoleFunctionServiceCentralizedImpl() {
+             return  new EPRoleFunctionServiceCentralizedImpl();
+          }
+          
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/SwaggerConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/SwaggerConfig.java
new file mode 100644 (file)
index 0000000..96aaaeb
--- /dev/null
@@ -0,0 +1,76 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import springfox.documentation.builders.ApiInfoBuilder;
+import springfox.documentation.builders.PathSelectors;
+import springfox.documentation.builders.RequestHandlerSelectors;
+import springfox.documentation.service.ApiInfo;
+import springfox.documentation.spi.DocumentationType;
+import springfox.documentation.spring.web.plugins.Docket;
+import springfox.documentation.swagger2.annotations.EnableSwagger2;
+
+@Configuration
+@EnableSwagger2
+public class SwaggerConfig {
+
+    @Bean
+    public Docket api(){
+        return new Docket(DocumentationType.SWAGGER_2)
+            .select()
+            .apis(RequestHandlerSelectors.any())
+            .paths(PathSelectors.regex("/auxapi/.*"))
+            .build()
+            .apiInfo(apiInfo());
+    }
+
+    private ApiInfo apiInfo() {
+        return new ApiInfoBuilder()
+            .title("ONAP Portal API")
+            .description("ONAP Portal API Documentation")
+            .version("2.1")
+            .termsOfServiceUrl("http://www.onap.org")
+            .license("Apache 2.0")
+            .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0")
+            .build();
+    }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/SwaggerMVCConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/SwaggerMVCConfig.java
new file mode 100644 (file)
index 0000000..668c3f3
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+@Configuration
+@EnableWebMvc
+public class SwaggerMVCConfig extends WebMvcConfigurerAdapter {
+
+    @Override 
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
+        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
+    }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPFusionBaseController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPFusionBaseController.java
new file mode 100644 (file)
index 0000000..a425812
--- /dev/null
@@ -0,0 +1,122 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.controller.FusionBaseController;
+import org.onap.portalsdk.core.domain.MenuData;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.ModelAttribute;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Controller
+public abstract class EPFusionBaseController extends FusionBaseController {
+       
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPFusionBaseController.class);
+               
+       @Override
+       public boolean isAccessible() {
+               return true;
+       }
+
+       public boolean isRESTfulCall() {
+               return true;
+       }
+
+       @ModelAttribute("menu")
+       public Map<String, Object> messages(HttpServletRequest request) {
+               HttpSession session = null;
+               Map<String, Object> model = new HashMap<String, Object>();
+               session = request.getSession();
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (session != null && user != null) {
+                       @SuppressWarnings("unchecked")
+                       Set<MenuData> menuResult = (Set<MenuData>) session
+                                       .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
+                       try {
+                               model = setMenu(menuResult);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "messages failed", e);
+                       }
+               }
+               
+               return model;
+       }
+
+       public Map<String, Object> setMenu(Set<MenuData> menuResult) throws Exception {
+               ObjectMapper mapper = new ObjectMapper();
+               List<List<MenuData>> childItemList = new ArrayList<List<MenuData>>();
+               
+               List<MenuData> parentList = new ArrayList<MenuData>();
+               
+               Map<String, Object> model = new HashMap<String, Object>();
+               for (MenuData menu : menuResult) {
+                       MenuData parentData = new MenuData();
+                       parentData.setLabel(menu.getLabel());
+                       parentData.setAction(menu.getAction());
+                       parentData.setImageSrc(menu.getImageSrc());
+                       parentList.add(parentData);
+                       List<MenuData> tempList = new ArrayList<MenuData>();
+                       for (Object o : menu.getChildMenus()) {
+                               MenuData m = (MenuData) o;
+                               MenuData data = new MenuData();
+                               data.setLabel(m.getLabel());
+                               data.setAction(m.getAction());
+                               data.setImageSrc(m.getImageSrc());
+                               tempList.add(data);
+                       }
+                       childItemList.add(tempList);
+               }
+               model.put("childItemList",  mapper.writeValueAsString(childItemList));
+               model.put("parentList", mapper.writeValueAsString(parentList));
+               return model;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPRestrictedBaseController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPRestrictedBaseController.java
new file mode 100644 (file)
index 0000000..8293124
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+public class EPRestrictedBaseController extends EPFusionBaseController{
+       
+       protected String viewName;
+       private String exceptionView;
+       
+       @Override
+       public boolean isAccessible() {
+               return false;
+       }
+       
+       @Override
+       public boolean isRESTfulCall(){
+               return false;
+       }
+       
+       protected String getViewName() {
+               return viewName;
+       }
+       
+       protected void setViewName(String viewName) {
+               this.viewName = viewName;
+       }
+
+       public String getExceptionView() {
+        return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
+       }
+
+       public void setExceptionView(String exceptionView) {
+               this.exceptionView = exceptionView;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPRestrictedRESTfulBaseController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPRestrictedRESTfulBaseController.java
new file mode 100644 (file)
index 0000000..1532f68
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+public class EPRestrictedRESTfulBaseController extends EPFusionBaseController{
+       
+       protected String viewName;
+       private String exceptionView;
+       
+       @Override
+       public boolean isAccessible() {
+               return false;
+       }
+       
+       @Override
+       public boolean isRESTfulCall(){
+               return true;
+       }
+       
+       protected String getViewName() {
+               return viewName;
+       }
+       
+       protected void setViewName(String viewName) {
+               this.viewName = viewName;
+       }
+
+       public String getExceptionView() {
+        return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
+       }
+
+       public void setExceptionView(String exceptionView) {
+               this.exceptionView = exceptionView;
+       }
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPUnRestrictedBaseController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/controller/EPUnRestrictedBaseController.java
new file mode 100644 (file)
index 0000000..7d0c18f
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+public class EPUnRestrictedBaseController extends EPFusionBaseController{
+       protected String viewName;
+       
+       @Override
+       public boolean isAccessible() {
+               return true;
+       }
+       
+       @Override
+       public boolean isRESTfulCall(){
+               return false;
+       }
+       
+       protected String getViewName() {
+               return viewName;
+       }
+
+       protected void setViewName(String viewName) {
+               this.viewName = viewName;
+       }
+}
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
new file mode 100644 (file)
index 0000000..e17c67c
--- /dev/null
@@ -0,0 +1,90 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller.sessionmgt;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedRESTfulBaseController;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.service.sessionmgt.ManageService;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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 io.swagger.annotations.ApiOperation;
+
+
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class SessionCommunicationController  extends EPRestrictedRESTfulBaseController {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunicationController.class);
+       
+       @Autowired
+       private ManageService manageService;
+               
+       protected boolean isAuxRESTfulCall(){
+               return true;
+       }
+       
+       @ApiOperation(value = "Gets session slot-check interval, a duration in milliseconds.",
+    response = Integer.class)
+       @RequestMapping(value={"/getSessionSlotCheckInterval"}, method = RequestMethod.GET, 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)
+       public Boolean extendSessionTimeOuts(HttpServletRequest request, HttpServletResponse response, @RequestParam String sessionMap) throws Exception {
+               manageService.extendSessionTimeOuts(sessionMap);
+               
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/externalsystemapproval/model/ExternalSystemRoleApproval.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/externalsystemapproval/model/ExternalSystemRoleApproval.java
new file mode 100644 (file)
index 0000000..5c6ca1a
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.externalsystemapproval.model;
+
+import java.io.Serializable;
+
+public class ExternalSystemRoleApproval implements Serializable {
+
+       private static final long serialVersionUID = 6048830318039958615L;
+
+       private String roleName;
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/externalsystemapproval/model/ExternalSystemUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/externalsystemapproval/model/ExternalSystemUser.java
new file mode 100644 (file)
index 0000000..47128ca
--- /dev/null
@@ -0,0 +1,92 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.externalsystemapproval.model;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ExternalSystemUser {
+
+       private String loginId;
+       
+       private String applicationName;
+       
+       private String myloginrequestId;
+       
+       private List<ExternalSystemRoleApproval> roles;
+
+       public ExternalSystemUser() {
+               roles = new ArrayList<ExternalSystemRoleApproval>();
+       }
+
+       public String getApplicationName() {
+               return applicationName;
+       }
+
+       public void setApplicationName(String applicationName) {
+               this.applicationName = applicationName;
+       }
+
+       public String getLoginId() {
+               return loginId;
+       }
+
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+
+       public List<ExternalSystemRoleApproval> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<ExternalSystemRoleApproval> roles) {
+               this.roles = roles;
+       }
+
+       public String getMyloginrequestId() {
+               return myloginrequestId;
+       }
+
+       public void setMyloginrequestId(String myloginrequestId) {
+               this.myloginrequestId = myloginrequestId;
+       }
+       
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/model/Result.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/model/Result.java
new file mode 100644 (file)
index 0000000..ce50d56
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.model;
+
+public class Result {
+       private String result;
+       
+       public Result(String result) {
+               this.result = result;
+       }
+
+       public String getResult() {
+               return result;
+       }
+
+       public void setResult(String result) {
+               this.result = result;
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..80a236d
--- /dev/null
@@ -0,0 +1,148 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.PersUserAppService;
+import org.onap.portalapp.portal.transport.AppCatalogPersonalization;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+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;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class AppCatalogController extends EPRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppCatalogController.class);
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+       @Autowired
+       private EPAppService appService;
+       @Autowired
+       private PersUserAppService persUserAppService;
+
+       /**
+        * RESTful service method to fetch all enabled applications, with details
+        * about which are accessible to the current user, selected by the current
+        * user.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @throws IOException If sendError fails
+        * @return List of items suitable for display
+        */
+       @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.GET, produces = "application/json")
+       public List<AppCatalogItem> getAppCatalog(HttpServletRequest request, HttpServletResponse response)
+                       throws IOException {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<AppCatalogItem> appCatalog = null;
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getAppCatalog");
+                       } else {
+                               if (adminRolesService.isSuperAdmin(user))
+                                       appCatalog = appService.getAdminAppCatalog(user);
+                               else
+                                       appCatalog = appService.getUserAppCatalog(user);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getAppCatalog", "GET result =", appCatalog);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppCatalog failed", e);
+                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
+               }
+               return appCatalog;
+       }
+
+       /**
+        * RESTful service to accept a user's action made on the application
+        * catalog.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param persRequest
+        *            JSON with data including application ID
+        * @param response
+        *            HttpServletResponse
+        * @return FieldsValidator
+        * @throws IOException If sendError fails
+        */
+       @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putAppCatalogSelection(HttpServletRequest request,
+                       @RequestBody AppCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
+               FieldsValidator result = new FieldsValidator();
+               EPApp app = appService.getApp(persRequest.getAppId());
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (app == null || user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "putAppCatalogSelection");
+                       } else {
+                               persUserAppService.setPersUserAppValue(user, app, persRequest.getSelect(), persRequest.getPending());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putAppCatalogSelection failed", e);
+                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
+               }
+               result.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+               return result;
+       }
+
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..409b75d
--- /dev/null
@@ -0,0 +1,242 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.json.JSONObject;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
+import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
+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.AppContactUsService;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+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.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;
+
+@RestController
+@RequestMapping("/portalApi/contactus")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class AppContactUsController extends EPRestrictedBaseController {
+
+       static final String FAILURE = "failure";
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppContactUsController.class);
+
+       @Autowired
+       private AppContactUsService contactUsService;
+
+       /**
+        * Answers a JSON object with three items from the system.properties file:
+        * user self-help ticket URL, email for feedback, and Portal info link.
+        * 
+        * @param request HttpServletRequest
+        * @return PortalRestResponse
+        */
+       @RequestMapping(value = "/feedback", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<String> getPortalDetails(HttpServletRequest request) {
+               PortalRestResponse<String> portalRestResponse = null;
+               try {
+                       final String ticketUrl = SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL);
+                       final String portalInfoUrl = SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL);
+                       final String feedbackEmail = SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS);
+                       HashMap<String, String> map = new HashMap<String, String>();
+                       map.put(EPCommonSystemProperties.USH_TICKET_URL, ticketUrl);
+                       map.put(EPCommonSystemProperties.PORTAL_INFO_URL, portalInfoUrl);
+                       map.put(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS, feedbackEmail);
+                       JSONObject j = new JSONObject(map);
+                       String contactUsPortalResponse = j.toString();
+                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                                       contactUsPortalResponse);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE, e.getMessage());
+               }
+               return portalRestResponse;
+       }
+
+       /**
+        * Answers the contents of the contact-us table, extended with the
+        * application name.
+        * 
+        * @param request HttpServletRequest
+        * @return PortalRestResponse<List<AppContactUsItem>>
+        */
+       @RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<AppContactUsItem>> getAppContactUsList(HttpServletRequest request) {
+               PortalRestResponse<List<AppContactUsItem>> portalRestResponse = null;
+               try {
+                       List<AppContactUsItem> contents = contactUsService.getAppContactUs();
+                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.OK, "success",
+                                       contents);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppContactUsList failed", e);
+                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.ERROR,
+                                       e.getMessage(), null);
+               }
+               return portalRestResponse;
+       }
+
+       /**
+        * Answers a list of objects, one per application, extended with available
+        * data on how to contact that app's organization (possibly none).
+        * 
+        * @param request HttpServletRequest
+        * @return PortalRestResponse<List<AppContactUsItem>>
+        */
+       @RequestMapping(value = "/allapps", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<AppContactUsItem>> getAppsAndContacts(HttpServletRequest request) {
+               PortalRestResponse<List<AppContactUsItem>> portalRestResponse = null;
+               try {
+                       List<AppContactUsItem> contents = contactUsService.getAppsAndContacts();
+                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.OK, "success",
+                                       contents);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAllAppsAndContacts failed", e);
+                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.ERROR,
+                                       e.getMessage(), null);
+               }
+               return portalRestResponse;
+       }
+
+       /**
+        * Sorts by category name.
+        */
+       private Comparator<AppCategoryFunctionsItem> appCategoryFunctionsItemComparator = new Comparator<AppCategoryFunctionsItem>() {
+               @Override
+               public int compare(AppCategoryFunctionsItem o1, AppCategoryFunctionsItem o2) {
+                       return o1.getCategory().compareTo(o2.getCategory());
+               }
+       };
+       
+       /**
+        * Answers a list of objects with category-application-function details. Not
+        * all applications participate in the functional menu.
+        * 
+        * @param request HttpServletRequest
+        * @return PortalRestResponse<List<AppCategoryFunctionsItem>>
+        */
+       @RequestMapping(value = "/functions", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<AppCategoryFunctionsItem>> getAppCategoryFunctions(HttpServletRequest request) {
+               PortalRestResponse<List<AppCategoryFunctionsItem>> portalRestResponse = null;
+               try {
+                       List<AppCategoryFunctionsItem> contents = contactUsService.getAppCategoryFunctions();
+                       // logger.debug(EELFLoggerDelegate.debugLogger,
+                       // "getAppCategoryFunctions: result list size is " +
+                       // contents.size());
+                       Collections.sort(contents, appCategoryFunctionsItemComparator);
+                       portalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>(PortalRestStatusEnum.OK,
+                                       "success", contents);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppCategoryFunctions failed", e);
+                       // TODO build JSON error
+                       portalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>(PortalRestStatusEnum.ERROR,
+                                       e.getMessage(), null);
+               }
+               return portalRestResponse;
+       }
+
+       /**
+        * Accepts a new application's contact us details.
+        * 
+        * @param contactUs AppContactUsItem
+        * @return PortalRestResponse<String>
+        */
+       @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> save(@RequestBody AppContactUsItem contactUs) {
+
+               if (contactUs == null || contactUs.getAppName() == null)
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE,
+                                       "AppName cannot be null or empty");
+
+               String saveAppContactUs = FAILURE;
+               try {
+                       saveAppContactUs = contactUsService.saveAppContactUs(contactUs);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveAppContactUs, e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveAppContactUs, "");
+       }
+
+       @RequestMapping(value = "/saveAll", method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> save(@RequestBody List<AppContactUsItem> contactUsList) {
+
+               String saveAppContactUs = FAILURE;
+               try {
+                       saveAppContactUs = contactUsService.saveAppContactUs(contactUsList);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveAppContactUs, e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveAppContactUs, "");
+       }
+
+       /**
+        * Deletes the specified application's contact-us details entry from the
+        * table.
+        * 
+        * @param id app ID
+        * @return PortalRestResponse<String>
+        */
+       @RequestMapping(value = "/delete/{appid}", method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> delete(@PathVariable("appid") Long id) {
+
+               String saveAppContactUs = FAILURE;
+               try {
+                       saveAppContactUs = contactUsService.deleteContactUs(id);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveAppContactUs, e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveAppContactUs, "");
+       }
+
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..3ddfc7c
--- /dev/null
@@ -0,0 +1,812 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.AdminUserApplications;
+import org.onap.portalapp.portal.domain.AppIdAndNameTransportModel;
+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.UserRoles;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.EPLeftMenuService;
+import org.onap.portalapp.portal.transport.EPAppsManualPreference;
+import org.onap.portalapp.portal.transport.EPAppsSortPreference;
+import org.onap.portalapp.portal.transport.EPDeleteAppsManualSortPref;
+import org.onap.portalapp.portal.transport.EPWidgetsSortPreference;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.LocalRole;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.AppUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+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;
+
+@RestController
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class AppsController extends EPRestrictedBaseController {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class);
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+
+       @Autowired
+       private EPAppService appService;
+
+       @Autowired
+       private EPLeftMenuService leftMenuService;
+
+       /**
+        * RESTful service method to fetch all Applications available to current
+        * user
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List<EcompApp>
+        */
+       @RequestMapping(value = { "/portalApi/userApps" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EcompApp> getUserApps(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EcompApp> ecompApps = null;
+
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getUserApps");
+                       } else {
+                               ecompApps = appService.transformAppsToEcompApps(appService.getUserApps(user));
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApps", "GET result =", ecompApps);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserApps failed", e);
+               }
+
+               return ecompApps;
+       }
+
+       /**
+        * RESTful service method to fetch all applications accessible to the
+        * current user, with personalizations.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List<EcompApp>
+        * @throws IOException
+        *             if sendError fails
+        */
+       @RequestMapping(value = { "/portalApi/persUserApps" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EcompApp> getPersUserApps(HttpServletRequest request, HttpServletResponse response) throws IOException {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EcompApp> ecompApps = null;
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getPersUserApps");
+                       } else {
+                               List<EPApp> apps = null;
+                               if (adminRolesService.isSuperAdmin(user))
+                                       apps = appService.getPersAdminApps(user);
+                               else
+                                       apps = appService.getPersUserApps(user);
+                               ecompApps = appService.transformAppsToEcompApps(apps);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userPersApps", "GET result =", ecompApps);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getPersUserApps failed", e);
+                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
+               }
+               return ecompApps;
+       }
+
+       /**
+        * RESTful service method to fetch applications for which the current user
+        * is an Administrator
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List<AppIdAndNameTransportModel>
+        */
+       @RequestMapping(value = { "/portalApi/adminApps" }, method = RequestMethod.GET, produces = "application/json")
+       public List<AppIdAndNameTransportModel> getAdminApps(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<AppIdAndNameTransportModel> adminApps = null;
+
+               try {
+                       if (!adminRolesService.isAccountAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getAdminApps");
+                       } else {
+                               adminApps = appService.getAdminApps(user);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminApps", "GET result =", adminApps);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAdminApps failed", e);
+               }
+
+               return adminApps;
+       }
+
+       /**
+        * RESTful service method to fetch Applications for user who is super admin
+        * and/or app admin.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List<AppIdAndNameTransportModel>
+        */
+       @RequestMapping(value = {
+                       "/portalApi/appsForSuperAdminAndAccountAdmin" }, method = RequestMethod.GET, produces = "application/json")
+       public List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(HttpServletRequest request,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<AppIdAndNameTransportModel> adminApps = null;
+
+               try {
+                       if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getAdminApps");
+                       } else {
+                               adminApps = appService.getAppsForSuperAdminAndAccountAdmin(user);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/appsForSuperAdminAndAccountAdmin",
+                                               "GET result =", adminApps);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsForSuperAdminAndAccountAdmin failed", e);
+               }
+
+               return adminApps;
+       }
+
+       /**
+        * RESTful service method to fetch left menu items from the user's session.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return JSON with left menu
+        */
+       @SuppressWarnings({ "rawtypes", "unchecked" })
+       @RequestMapping(value = { "/portalApi/leftmenuItems" }, method = RequestMethod.GET, produces = "application/json")
+       public String getLeftMenuItems(HttpServletRequest request, HttpServletResponse response) {
+               String menuList = null;
+               Set menuSet = (Set) AppUtils.getSession(request)
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
+
+               Set roleFunctionSet = (Set) AppUtils.getSession(request)
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
+
+               EPUser user = EPUserUtils.getUserSession(request);
+
+               try {
+                       menuList = leftMenuService.getLeftMenuItems(user, menuSet, roleFunctionSet);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/leftmenuItems", "GET result =", menuList);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getLeftMenuItems failed", e);
+               }
+               return menuList;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/userAppsOrderBySortPref" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EcompApp> getUserAppsOrderBySortPref(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EcompApp> ecompApps = null;
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getUserAppsOrderBySortPref");
+                       } else {
+                               String usrSortPref = request.getParameter("mparams");
+                               if (usrSortPref.equals("")) {
+                                       usrSortPref = "N";
+                               }
+                               switch (usrSortPref) {
+                               case "N":
+                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByName(user));
+                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
+                                                       ecompApps);
+                                       break;
+                               case "L":
+                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByLastUsed(user));
+                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
+                                                       ecompApps);
+                                       break;
+                               case "F":
+                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByMostUsed(user));
+                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
+                                                       ecompApps);
+                                       break;
+                               case "M":
+                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByManual(user));
+                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
+                                                       ecompApps);
+                                       break;
+                               default:
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "getUserAppsOrderBySortPref failed: no match for " + usrSortPref);
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppsOrderBySortPref failed", e);
+               }
+               return ecompApps;
+       }
+
+       /**
+        * Sets the user apps manual sort preference
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @param epAppsManualPref
+        *            sort pref
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = {
+                       "/portalApi/saveUserAppsSortingManual" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putUserAppsSortingManual(HttpServletRequest request,
+                       @RequestBody List<EPAppsManualPreference> epAppsManualPref, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       fieldsValidator = appService.saveAppsSortManual(epAppsManualPref, user);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserAppsSortingManual failed", e);
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/saveUserAppsSortingManual", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/saveUserWidgetsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putUserWidgetsSortManual(HttpServletRequest request,
+                       @RequestBody List<EPWidgetsSortPreference> saveManualWidgetSData, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       fieldsValidator = appService.saveWidgetsSortManual(saveManualWidgetSData, user);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortManual failed", e);
+               }
+               // return fieldsValidator;
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/putUserWidgetsSortManual", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/updateWidgetsSortPref" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putUserWidgetsSortPref(HttpServletRequest request,
+                       @RequestBody List<EPWidgetsSortPreference> delManualWidgetData, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       fieldsValidator = appService.deleteUserWidgetSortPref(delManualWidgetData, user);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortPref failed", e);
+
+               }
+               // return fieldsValidator;
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/putUserWidgetsSortPref", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       /**
+        * Deletes the user app manual sort preference record
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @param delManualAppData
+        *            data to delete
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = {
+                       "/portalApi/UpdateUserAppsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator deleteUserAppSortManual(HttpServletRequest request,
+                       @RequestBody EPDeleteAppsManualSortPref delManualAppData, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       fieldsValidator = appService.deleteUserAppSortManual(delManualAppData, user);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserAppSortManual failed", e);
+
+               }
+               // return fieldsValidator;
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/deleteUserAppSortManual", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/saveUserAppsSortingPreference" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putUserAppsSortingPreference(HttpServletRequest request,
+                       @RequestBody EPAppsSortPreference userAppsValue, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       fieldsValidator = appService.saveAppsSortPreference(userAppsValue, user);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserAppsSortingPreference failed", e);
+
+               }
+
+               // return fieldsValidator;
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/putUserAppsSortingPreference", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/userAppsSortTypePreference" }, method = RequestMethod.GET, produces = "application/String")
+       public String getUserAppsSortTypePreference(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               String userSortPreference = null;
+
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "userAppsSortTypePreference");
+                       } else {
+                               userSortPreference = appService.getUserAppsSortTypePreference(user);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsSortTypePreference", "GET result =",
+                                               userSortPreference);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppsSortTypePreference failed", e);
+               }
+
+               return userSortPreference;
+       }
+
+       /**
+        * RESTful service method to fetch Application Administrators to Super
+        * Administrator user. Attention: Users which have Super Administrator roles
+        * only are not included!
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @return List<AdminUserApplications>
+        */
+       @RequestMapping(value = { "/portalApi/accountAdmins" }, method = RequestMethod.GET, produces = "application/json")
+       public List<AdminUserApplications> getAppsAdministrators(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<AdminUserApplications> admins = null;
+               try {
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getAppsAdministrators");
+                       } else {
+                               admins = appService.getAppsAdmins();
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/accountAdmins", "GET result =", admins);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsAdministrators failed", e);
+               }
+
+               return admins;
+       }
+
+       @RequestMapping(value = { "/portalApi/availableApps" }, method = RequestMethod.GET, produces = "application/json")
+       public List<AppsResponse> getApps(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<AppsResponse> apps = null;
+               try {
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getApps");
+                       } else {
+                               apps = appService.getAllApps(false);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/availableApps", "GET result =", apps);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getApps failed", e);
+               }
+
+               return apps;
+       }
+
+       /**
+        * Gets all apps, both active and inactive; i.e., all on-boarded apps,
+        * regardless of enabled status.
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @return List of applications
+        */
+       @RequestMapping(value = {
+                       "/portalApi/allAvailableApps" }, method = RequestMethod.GET, produces = "application/json")
+       public List<AppsResponse> getAllApps(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<AppsResponse> apps = null;
+               try {
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getApps");
+                       } else {
+                               apps = appService.getAllApps(true);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/availableApps", "GET result =", apps);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAllApps failed", e);
+               }
+
+               return apps;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @return List of applications
+        */
+       @RequestMapping(value = { "/portalApi/appsFullList" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EcompApp> getAppsFullList(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EcompApp> ecompApps = null;
+               if (user == null) {
+                       EcompPortalUtils.setBadPermissions(user, response, "getAppsFullList");
+               } else {
+                       ecompApps = appService.getEcompAppAppsFullList();
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/appsFullList", "GET result =", ecompApps);
+               }
+               return ecompApps;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @return UserRoles
+        */
+       @RequestMapping(value = { "/portalApi/userProfile" }, method = RequestMethod.GET, produces = "application/json")
+       public UserRoles getUserProfile(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               UserRoles userAndRoles = null;
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getUserProfile");
+                       } else {
+                               userAndRoles = appService.getUserProfileNormalized(user);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserProfile failed", e);
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userProfile", "getUserProfile result =",
+                               userAndRoles);
+               return userAndRoles;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param appId
+        *            application ID
+        * @return List<LocalRole>
+        */
+       @RequestMapping(value = { "/portalApi/appRoles/{appId}" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<LocalRole> getAppRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
+                       HttpServletResponse response) {
+               List<LocalRole> roleList = null;
+               EPUser user = EPUserUtils.getUserSession(request);
+               EPApp requestedApp = appService.getApp(appId);
+               if (user != null && (adminRolesService.isAccountAdminOfApplication(user, requestedApp)
+                               || (adminRolesService.isSuperAdmin(user) && requestedApp.getId() == PortalConstants.PORTAL_APP_ID))) {
+                       try {
+                               roleList = appService.getAppRoles(appId);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/appRoles/" + appId, "GET result =",
+                                               roleList);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getAppRoles failed", e);
+                       }
+               } else {
+                       EcompPortalUtils.setBadPermissions(user, response, "getAppRoles");
+               }
+               return roleList;
+       }
+       
+       /**
+        * 
+        * Return single app information with appName as parameter
+        * 
+        * @param request
+        * @param response
+        * @return EPApp object
+        */
+       @RequestMapping(value = { "/portalApi/singleAppInfo" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public EPApp getSingleAppInfo(HttpServletRequest request, HttpServletResponse response) {
+               EPApp app = null;
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       String appName = request.getParameter("appParam");
+                       app = appService.getAppDetailByAppName(appName);
+                       if (user != null && (adminRolesService.isAccountAdminOfApplication(user, app)
+                                       || (adminRolesService.isSuperAdmin(user) && app.getId() == PortalConstants.PORTAL_APP_ID)))
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/singleAppInfo" + appName, "GET result =", app);
+                       else{
+                               app= null;
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getSingleAppInfo failed", e);
+               }
+               return app;
+       }
+
+       /**
+        * 
+        * Return single app information with appId as parameter
+        * 
+        * @param request
+        * @param response
+        * @return EPApp object
+        */
+       @RequestMapping(value = { "/portalApi/singleAppInfoById" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public EPApp getSingleAppInfoById(HttpServletRequest request, HttpServletResponse response) {
+               EPApp app = null;
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       String appId = request.getParameter("appParam");
+                       app = appService.getApp(Long.valueOf(appId));
+                       if(!EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                               app.setCentralAuth(false);
+                       }
+                       if (user != null && (adminRolesService.isAccountAdminOfApplication(user, app)
+                                       || (adminRolesService.isSuperAdmin(user) && app.getId() == PortalConstants.PORTAL_APP_ID)))
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/singleAppInfoById" + appId, "GET result =", app);
+                       else{
+                               app= null;
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getSingleAppInfo failed", e);
+               }
+               return app;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @return List<OnboardingApp>
+        */
+       @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.GET, produces = "application/json")
+       public List<OnboardingApp> getOnboardingApps(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<OnboardingApp> onboardingApps = null;
+               try {
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getOnboardingApps");
+                       } else {
+                               onboardingApps = appService.getOnboardingApps();
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps", "GET result =",
+                                               "onboardingApps of size " + onboardingApps.size());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getOnboardingApps failed", e);
+               }
+
+               return onboardingApps;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @param modifiedOnboardingApp
+        *            app to update
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putOnboardingApp(HttpServletRequest request,
+                       @RequestBody OnboardingApp modifiedOnboardingApp, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "putOnboardingApp");
+                       } else {
+                               modifiedOnboardingApp.normalize();
+                               fieldsValidator = appService.modifyOnboardingApp(modifiedOnboardingApp, user);
+                               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putOnboardingApps failed", e);
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @param newOnboardingApp
+        *            app to add
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.POST, produces = "application/json")
+       public FieldsValidator postOnboardingApp(HttpServletRequest request, @RequestBody OnboardingApp newOnboardingApp,
+                       HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "postOnboardingApps");
+                       } else {
+                               newOnboardingApp.normalize();
+                               fieldsValidator = appService.addOnboardingApp(newOnboardingApp, user);
+                               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "postOnboardingApp failed", e);
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps", "POST result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       /**
+        * REST endpoint to process a request to delete an on-boarded application.
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @param appId
+        *            ID of app to delete
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/onboardingApps/{appId}" }, method = {
+                       RequestMethod.DELETE }, produces = "application/json")
+       public FieldsValidator deleteOnboardingApp(HttpServletRequest request, @PathVariable("appId") Long appId,
+                       HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "deleteOnboardingApps");
+                       } else {
+                               fieldsValidator = appService.deleteOnboardingApp(user, appId);
+                               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteOnboardingApp failed", e);
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps" + appId, "DELETE result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       /**
+        * Gets the application thumbnail image; sets status 404 if none exists.
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param response
+        *            HTTP servlet response
+        * @param appId
+        *            Application ID
+        * @return Bytes with the app thumbnail image; null if not available.
+        */
+       @RequestMapping(value = { "/portalApi/appThumbnail/{appId}" }, method = { RequestMethod.GET })
+       public HttpEntity<byte[]> getAppThumbnail(HttpServletRequest request, @PathVariable("appId") Long appId,
+                       HttpServletResponse response) {
+               EPApp app = appService.getApp(appId);
+               if (app == null || app.getImageUrl() == null || app.getThumbnail() == null || app.getThumbnail().length == 0) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "getAppThumbnail: no app and/or no thumbnail for app " + appId);
+                       response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+                       return null;
+               }
+               String url = app.getImageUrl();
+               int indexOfDot = url.lastIndexOf('.');
+               String urlSuffix = indexOfDot > 0 ? url.substring(indexOfDot + 1).toLowerCase() : "UNK";
+               // Default to JPG if no usable suffix.
+               MediaType mediaType = MediaType.IMAGE_JPEG;
+               if ("png".equals(urlSuffix))
+                       mediaType = MediaType.IMAGE_PNG;
+               else if ("gif".equals(urlSuffix))
+                       mediaType = MediaType.IMAGE_GIF;
+               HttpHeaders header = new HttpHeaders();
+               header.setContentType(mediaType);
+               header.setContentLength(app.getThumbnail().length);
+               return new HttpEntity<byte[]>(app.getThumbnail(), header);
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..34aa481
--- /dev/null
@@ -0,0 +1,392 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.PortalAdminService;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.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.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * Processes requests from external systems (i.e., not the front-end web UI).
+ * First use case is ECOMP Controller, which has to create an admin and onboard
+ * itself upon launch of a fresh Portal.
+ * 
+ * Listens on the "auxapi" path prefix. Provides alternate implementations of
+ * methods in several existing controllers because an EPUser object is not
+ * available in the session for these requests.
+ * 
+ * Checks credentials sent via HTTP Basic Authentication. The Portal's basic
+ * HTTP authentication system requires that the user names and endpoints are
+ * registered together.
+ */
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class AppsControllerExternalRequest implements BasicAuthenticationController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsControllerExternalRequest.class);
+
+       private static final String ONBOARD_APP = "/onboardApp";
+
+       // Where is this used?
+       public boolean isAuxRESTfulCall() {
+               return true;
+       }
+
+       /**
+        * For testing whether a user is a superadmin.
+        */
+       @Autowired
+       private AdminRolesService adminRolesService;
+
+       /**
+        * For onboarding or updating an app
+        */
+       @Autowired
+       private EPAppService appService;
+
+       /**
+        * For promoting a user to Portal admin
+        */
+       @Autowired
+       private PortalAdminService portalAdminService;
+
+       /**
+        * For creating a new user
+        */
+       @Autowired
+       private UserService userService;
+
+       /**
+        * Creates a new user as a Portal administrator.
+        * 
+        * <PRE>
+        { 
+               "loginId" : "abc123",
+               "loginPwd": "",
+               "email":"ecomp@controller" 
+        }
+        * </PRE>
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param epUser
+        *            User details; the email and orgUserId fields are mandatory
+        * @param response
+        *            HttpServletResponse
+        * @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")
+       @ResponseBody
+       public PortalRestResponse<String> postPortalAdmin(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody EPUser epUser) {
+               EcompPortalUtils.logAndSerializeObject(logger, "postPortalAdmin", "request", epUser);
+               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
+
+               // Check mandatory fields.
+               if (epUser.getEmail() == null || epUser.getEmail().trim().length() == 0 //
+                               || epUser.getLoginId() == null || epUser.getLoginId().trim().length() == 0 //
+                               || epUser.getLoginPwd() == null) {
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage("Missing required field: email, loginId, or loginPwd");
+                       return portalResponse;
+               }
+
+               try {
+                       // Check for existing user; create if not found.
+                       List<EPUser> userList = userService.getUserByUserId(epUser.getOrgUserId());
+                       if (userList == null || userList.size() == 0) {
+                               // Create user with first, last names etc.; do check for
+                               // duplicates.
+                               String userCreateResult = userService.saveNewUser(epUser, "Yes");
+                               if (!"success".equals(userCreateResult)) {
+                                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                                       portalResponse.setMessage(userCreateResult);
+                                       return portalResponse;
+                               }
+                       }
+
+                       // Check for Portal admin status; promote if not.
+                       if (adminRolesService.isSuperAdmin(epUser)) {
+                               portalResponse.setStatus(PortalRestStatusEnum.OK);
+                       } else {
+                               FieldsValidator fv = portalAdminService.createPortalAdmin(epUser.getOrgUserId());
+                               if (fv.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                                       portalResponse.setStatus(PortalRestStatusEnum.OK);
+                               } else {
+                                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                                       portalResponse.setMessage(fv.toString());
+                               }
+                       }
+               } catch (Exception ex) {
+                       // Uncaught exceptions yield 404 and an empty error page
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage(ex.toString());
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "postPortalAdmin", "response", portalResponse);
+               return portalResponse;
+       }
+
+       /**
+        * Gets the specified application that is on-boarded in Portal.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param appId
+        *            Application ID to get
+        * @param response
+        *            httpServletResponse
+        * @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")
+       @ResponseBody
+       public OnboardingApp getOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("appId") Long appId) {
+               EPApp epApp = appService.getApp(appId);
+               OnboardingApp obApp = new OnboardingApp();
+               appService.createOnboardingFromApp(epApp, obApp);
+               EcompPortalUtils.logAndSerializeObject(logger, "getOnboardAppExternal", "response", obApp);
+               return obApp;
+       }
+
+       /**
+        * Adds a new application to Portal. The My Logins App Owner in the request
+        * must be the organization user ID of a person who is a Portal
+        * administrator.
+        * 
+        * <pre>
+        * { 
+               "myLoginsAppOwner" : "abc123",
+               "name": "dashboard",
+               "url": "http://k8s/something",
+               "restUrl" : "http://targeturl.com",
+               "restrictedApp" : true,
+               "isOpen" : true,
+               "isEnabled": false
+               }
+        * </pre>
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            httpServletResponse
+        * @param newOnboardApp
+        *            Message with details about the app to add
+        * @return PortalRestResponse
+        */
+       @ApiOperation(value = "Adds a new application to Portal.", response = PortalRestResponse.class)
+       @RequestMapping(value = { ONBOARD_APP }, method = RequestMethod.POST, produces = "application/json")
+       @ResponseBody
+       public PortalRestResponse<String> postOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody OnboardingApp newOnboardApp) {
+               EcompPortalUtils.logAndSerializeObject(logger, "postOnboardAppExternal", "request", newOnboardApp);
+               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
+
+               // Validate fields
+               if (newOnboardApp.id != null) {
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage("Unexpected field: id");
+                       return portalResponse;
+               }
+               if (newOnboardApp.name == null || newOnboardApp.name.trim().length() == 0 //
+                               || newOnboardApp.url == null || newOnboardApp.url.trim().length() == 0 //
+                               || newOnboardApp.restUrl == null || newOnboardApp.restUrl.trim().length() == 0
+                               || newOnboardApp.myLoginsAppOwner == null || newOnboardApp.myLoginsAppOwner.trim().length() == 0
+                               || newOnboardApp.restrictedApp == null //
+                               || newOnboardApp.isOpen == null //
+                               || newOnboardApp.isEnabled == null) {
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage(
+                                       "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
+                       return portalResponse;
+               }
+
+               try {
+                       List<EPUser> userList = userService.getUserByUserId(newOnboardApp.myLoginsAppOwner);
+                       if (userList == null || userList.size() != 1) {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage("Failed to find user: " + newOnboardApp.myLoginsAppOwner);
+                               return portalResponse;
+                       }
+
+                       EPUser epUser = userList.get(0);
+                       // Check for Portal admin status
+                       if (! adminRolesService.isSuperAdmin(epUser)) {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage("User lacks Portal admin role: " + epUser.getLoginId());
+                               return portalResponse;                          
+                       }
+                               
+                       newOnboardApp.normalize();
+                       FieldsValidator fv = appService.addOnboardingApp(newOnboardApp, epUser);
+                       if (fv.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                               portalResponse.setStatus(PortalRestStatusEnum.OK);
+                       } else {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage(fv.toString());
+                       }
+               } catch (Exception ex) {
+                       // Uncaught exceptions yield 404 and an empty error page
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage(ex.toString());
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "postOnboardAppExternal", "response", portalResponse);
+               return portalResponse;
+       }
+
+       /**
+        * Updates information about an on-boarded application in Portal. The My
+        * Logins App Owner in the request must be the organization user ID of a
+        * person who is a Portal administrator.
+        * <pre>
+          { 
+               "id" : 123,
+               "myLoginsAppOwner" : "abc123",
+               "name": "dashboard",
+               "url": "http://k8s/something",
+               "restUrl" : "http://targeturl.com",
+               "restrictedApp" : true,
+               "isOpen" : true,
+               "isEnabled": false
+               }
+               </pre>
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            httpServletResponse
+        * @param appId
+        *            application id
+        * @param oldOnboardApp
+        *            Message with details about the app to add
+        * @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")
+       @ResponseBody
+       public PortalRestResponse<String> putOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("appId") Long appId, @RequestBody OnboardingApp oldOnboardApp) {
+               EcompPortalUtils.logAndSerializeObject(logger, "putOnboardAppExternal", "request", oldOnboardApp);
+               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
+               // Validate fields.
+               if (oldOnboardApp.id == null || !appId.equals(oldOnboardApp.id)) {
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage("Unexpected value for field: id");
+                       return portalResponse;
+               }
+               if (oldOnboardApp.name == null || oldOnboardApp.name.trim().length() == 0 //
+                               || oldOnboardApp.url == null || oldOnboardApp.url.trim().length() == 0 //
+                               || oldOnboardApp.restUrl == null || oldOnboardApp.restUrl.trim().length() == 0
+                               || oldOnboardApp.myLoginsAppOwner == null || oldOnboardApp.myLoginsAppOwner.trim().length() == 0
+                               || oldOnboardApp.restrictedApp == null //
+                               || oldOnboardApp.isOpen == null //
+                               || oldOnboardApp.isEnabled == null) {
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage(
+                                       "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
+                       return portalResponse;
+               }
+
+               try {
+                       List<EPUser> userList = userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner);
+                       if (userList == null || userList.size() != 1) {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage("Failed to find user: " + oldOnboardApp.myLoginsAppOwner);
+                               return portalResponse;
+                       }
+
+                       EPUser epUser = userList.get(0);
+                       // Check for Portal admin status
+                       if (! adminRolesService.isSuperAdmin(epUser)) {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage("User lacks Portal admin role: " + epUser.getLoginId());
+                               return portalResponse;                          
+                       }
+
+                       oldOnboardApp.normalize();
+                       FieldsValidator fv = appService.modifyOnboardingApp(oldOnboardApp, epUser);
+                       if (fv.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                               portalResponse.setStatus(PortalRestStatusEnum.OK);
+                       } else {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage(fv.toString());
+                       }
+               } catch (Exception ex) {
+                       // Uncaught exceptions yield 404 and an empty error page
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       portalResponse.setMessage(ex.toString());
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "putOnboardAppExternal", "response", portalResponse);
+               return portalResponse;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..e023285
--- /dev/null
@@ -0,0 +1,129 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import javax.servlet.http.HttpServletRequest;
+
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.AuditService;
+
+@RestController
+@RequestMapping("/portalApi/auditLog")
+public class AuditLogController extends EPRestrictedBaseController {
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardController.class);
+
+       @Autowired
+       private AuditService auditService;
+
+       /**
+        * Store audit log of the specified access type.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param affectedAppId
+        *            App ID
+        * @param type
+        *            Access type
+        * @param comment
+        *            Comment
+        */
+       @RequestMapping(value = "/store", method = RequestMethod.GET, 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,
+                               comment);
+               String cd_type = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       /* Check type of Activity CD */
+                       if (type.equals("app")) {
+                               cd_type = AuditLog.CD_ACTIVITY_APP_ACCESS;
+                       } else if (type.equals("tab")) {
+                               cd_type = AuditLog.CD_ACTIVITY_TAB_ACCESS;
+                       } else if (type.equals("functional")) {
+                               cd_type = AuditLog.CD_ACTIVITY_FUNCTIONAL_ACCESS;
+                       } else if (type.equals("leftMenu")) {
+                               cd_type = AuditLog.CD_ACTIVITY_LEFT_MENU_ACCESS;
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Storing auditLog failed! Activity CD type is not correct.");
+                       }
+                       /* Store the audit log only if it contains valid Activity CD */
+                       if (cd_type != null) {
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setActivityCode(cd_type);
+                               /*
+                                * Check affectedAppId and comment and see if these two values are valid
+                                */
+                               if (comment != null && !comment.equals("") && !comment.equals("undefined"))
+                                       auditLog.setComments(EcompPortalUtils.truncateString(comment, PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               if (affectedAppId != null && !affectedAppId.equals("") && !affectedAppId.equals("undefined"))
+                                       auditLog.setAffectedRecordId(affectedAppId);
+                               long userId = EPUserUtils.getUserId(request);
+                               auditLog.setUserId(userId);
+                               auditService.logActivity(auditLog, null);
+
+                               // Log file
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage(
+                                               "AuditLogController.auditLog", cd_type, user.getOrgUserId(), affectedAppId, comment));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "auditLog failed", e);
+               }
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..6b5d31d
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.onap.portalapp.portal.domain.BEProperty;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalsdk.core.controller.FusionBaseController;
+import org.onap.portalsdk.core.util.SystemProperties;
+
+@RestController
+@RequestMapping("/portalApi/properties")
+public class BEPropertyReaderController extends FusionBaseController{
+       @RequestMapping(value = "/readProperty", method = RequestMethod.GET, 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)));
+               } catch (Exception e) {
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
+               }               
+       }
+}
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
new file mode 100644 (file)
index 0000000..f02d8fc
--- /dev/null
@@ -0,0 +1,215 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.BasicAuthCredentials;
+import org.onap.portalapp.portal.domain.EPEndpoint;
+import org.onap.portalapp.portal.domain.EPUser;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.BasicAuthAccountService;
+import org.onap.portalapp.util.EPUserUtils;
+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.RestController;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class BasicAuthAccountController extends EPRestrictedBaseController {
+
+       @Autowired
+       private BasicAuthAccountService basicAuthAccountService;
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+
+       /**
+        * Saves Basic Authentication account for external systems
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param newBasicAuthAccount
+        *            BasicAuthCredentials
+        * @return Id of the newly created account
+        * @throws Exception
+        *             on failure
+        */
+       @RequestMapping(value = { "/portalApi/basicAuthAccount" }, method = RequestMethod.POST)
+       public PortalRestResponse<String> createBasicAuthAccount(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody BasicAuthCredentials newBasicAuthAccount) throws Exception {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Authorization Required",
+                                       "Admin Only Operation! ");
+               }
+
+               if (newBasicAuthAccount == null) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "newBasicAuthAccount cannot be null or empty");
+               }
+               long accountId = basicAuthAccountService.saveBasicAuthAccount(newBasicAuthAccount);
+
+               List<Long> endpointIdList = new ArrayList<>();
+               try {
+                       for (EPEndpoint ep : newBasicAuthAccount.getEndpoints()) {
+                               endpointIdList.add(basicAuthAccountService.saveEndpoints(ep));
+                       }
+                       for (Long endpointId : endpointIdList) {
+                               basicAuthAccountService.saveEndpointAccount(accountId, endpointId);
+                       }
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+
+       /**
+        * Returns list of all BasicAuthCredentials in the system
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List<BasicAuthCredentials>
+        * @throws Exception
+        *             on failure
+        */
+
+       @RequestMapping(value = { "/portalApi/basicAuthAccount" }, method = RequestMethod.GET)
+       public PortalRestResponse<List<BasicAuthCredentials>> getBasicAuthAccount(HttpServletRequest request,
+                       HttpServletResponse response) throws Exception {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       return new PortalRestResponse<List<BasicAuthCredentials>>(PortalRestStatusEnum.ERROR,
+                                       "UnAuthorized! Admin Only Operation", new ArrayList<>());
+               }
+
+               return new PortalRestResponse<List<BasicAuthCredentials>>(PortalRestStatusEnum.OK, "Success",
+                               basicAuthAccountService.getAccountData());
+       }
+
+       /**
+        * Updates an existing BasicAuthCredentials account
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param accountId
+        *            account ID
+        * @param newBasicAuthAccount
+        *            BasicAuthCredentials
+        * @return PortalRestResponse<String>
+        * @throws Exception
+        *             on failure
+        */
+       @RequestMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }, method = RequestMethod.PUT)
+       public PortalRestResponse<String> updateAccount(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("accountId") long accountId, @RequestBody BasicAuthCredentials newBasicAuthAccount)
+                       throws Exception {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Authorization Required",
+                                       "Admin Only Operation! ");
+               }
+
+               if (newBasicAuthAccount == null) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "BasicAuthCredentials cannot be null or empty");
+               }
+               try {
+                       basicAuthAccountService.updateBasicAuthAccount(accountId, newBasicAuthAccount);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+
+       /**
+        * deletes an existing BasicAuthCredentials account
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param accountId
+        *            account ID
+        * @return PortalRestResponse<String>
+        * @throws Exception
+        *             on failure
+        */
+       @RequestMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }, method = RequestMethod.DELETE)
+       public PortalRestResponse<String> deleteAccount(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("accountId") long accountId) throws Exception {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Authorization Required",
+                                       "Admin Only Operation! ");
+               }
+
+               try {
+                       basicAuthAccountService.deleteEndpointAccout(accountId);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthenticationController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/BasicAuthenticationController.java
new file mode 100644 (file)
index 0000000..94e3828
--- /dev/null
@@ -0,0 +1,46 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+/**
+ * Marker interface to indicate that requests to this controller present HTTP
+ * Basic Authentication credentials.
+ */
+public interface BasicAuthenticationController {
+
+}
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
new file mode 100644 (file)
index 0000000..0ede833
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.controller.DashboardController.WidgetCategory;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class CommonWidgetController extends EPRestrictedBaseController implements BasicAuthenticationController{
+       
+       
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CommonWidgetController.class);
+       @Autowired
+       private DashboardSearchService searchService;
+       
+       /**
+        * Validates the resource type parameter.
+        * 
+        * @param resourceType
+        * @return True if known in the enum WidgetCategory, else false.
+        */
+       private boolean isValidResourceType(String resourceType) {
+               if (resourceType == null)
+                       return false;
+               for (WidgetCategory wc : WidgetCategory.values())
+                       if (wc.name().equals(resourceType))
+                               return true;
+               return false;
+       }
+       
+       /**
+        * Gets all widgets of the specified resource type.
+        * 
+        * @param request
+        * @param resourceType
+        *            Request parameter.
+        * @return Rest response wrapped around a CommonWidgetMeta object.
+        */
+       @RequestMapping(value = "/commonWidgets", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
+                       @RequestParam String resourceType) {
+               if (!isValidResourceType(resourceType)){
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Unexpected resource type {}", resourceType);
+                       return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.ERROR,
+                                       "Unexpected resource type " + resourceType, null);
+               }
+               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
+                               searchService.getWidgetData(resourceType));
+       }
+               
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ConsulClientController.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/controller/ConsulClientController.java
new file mode 100644 (file)
index 0000000..3a8f6c8
--- /dev/null
@@ -0,0 +1,113 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.service.ConsulHealthService;
+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.RestController;
+
+import com.orbitz.consul.ConsulException;
+import com.orbitz.consul.model.health.ServiceHealth;
+
+import io.searchbox.client.config.exception.NoServerConfiguredException;
+
+@RestController
+@RequestMapping("/portalApi/consul")
+public class ConsulClientController extends EPRestrictedBaseController {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ConsulClientController.class);
+
+       @Autowired
+       private ConsulHealthService consulHealthService;
+
+       // Get location of a healthy node running our service
+       @RequestMapping(value = { "/service/{service}" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<String> getServiceLocation(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("service") String service) {
+
+               try {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Success!",
+                                       consulHealthService.getServiceLocation(service, null));
+               } catch (NoServerConfiguredException e) {
+                       logger.error(logger.errorLogger, "No healthy service exception!");
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.WARN, "Warning!",
+                                       "No healthy service exception!");
+               } catch (ConsulException e) {
+                       logger.error(logger.errorLogger, "Couldn't connect ot consul - Is consul running?");
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Error!",
+                                       "Couldn't connect ot consul - Is consul running?");
+               }
+       }
+
+       @RequestMapping(value = { "/service/healthy/{service}" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<ServiceHealth>> getAllHealthyNodes(HttpServletRequest request,
+                       HttpServletResponse response, @PathVariable("service") String service) {
+               try {
+                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.OK, "Success!",
+                                       consulHealthService.getAllHealthyNodes(service));
+               } catch (ConsulException e) {
+                       logger.error(logger.errorLogger, "Couldn't connect to consul - shouldn't break anything.");
+                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.ERROR, "Error!", new ArrayList<>());
+               }
+       }
+
+       @RequestMapping(value = { "/service/all/{service}" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<ServiceHealth>> getAllNodes(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("service") String service) {
+               try {
+                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.OK, "Success!",
+                                       consulHealthService.getAllNodes(service));
+               } catch (ConsulException e) {
+                       logger.error(logger.errorLogger, "Couldn't connect to consul - shouldn't break anything.");
+                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.ERROR, "Error!", new ArrayList<>());
+               }
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..d8e8aeb
--- /dev/null
@@ -0,0 +1,414 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EcompAuditLog;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+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.DashboardSearchService;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Controller supplies data to Angular services on the dashboard page.
+ */
+@Configuration
+@RestController
+@RequestMapping("/portalApi/dashboard")
+public class DashboardController extends EPRestrictedBaseController {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardController.class);
+
+       @Autowired
+       private DashboardSearchService searchService;
+       @Autowired
+       private AuditService auditService;
+       
+       @Autowired
+       private AdminRolesService adminRolesService;
+       
+       public enum WidgetCategory {
+               EVENTS, NEWS, IMPORTANTRESOURCES;
+       }
+
+       /**
+        * Validates the resource type parameter.
+        * 
+        * @param resourceType
+        * @return True if known in the enum WidgetCategory, else false.
+        */
+       private boolean isValidResourceType(String resourceType) {
+               if (resourceType == null)
+                       return false;
+               for (WidgetCategory wc : WidgetCategory.values())
+                       if (wc.name().equals(resourceType))
+                               return true;
+               return false;
+       }
+
+       /**
+        * Gets all widgets of the specified resource type. 
+        * In iteration 41 (when widget will utilized service onboarding), this method can be removed, instead we will use CommonWidgetController.java (basic auth based)
+        * 
+        * @param request
+        * @param resourceType
+        *            Request parameter.
+        * @return Rest response wrapped around a CommonWidgetMeta object.
+        */
+       @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
+                       @RequestParam String resourceType) {
+               if (!isValidResourceType(resourceType))
+                       return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.ERROR,
+                                       "Unexpected resource type " + resourceType, null);
+               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
+                               searchService.getWidgetData(resourceType));
+       }
+       
+       
+       /**
+        * Saves a batch of events, news or resources.
+        * 
+        * @param commonWidgetMeta
+        *            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")
+       public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta);
+               if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals(""))
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
+                                       "Category cannot be null or empty");
+               if (!isValidResourceType(commonWidgetMeta.getCategory()))
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                       "Unexpected resource type " + commonWidgetMeta.getCategory(), null);
+               // validate dates
+               for (CommonWidget cw : commonWidgetMeta.getItems()) {
+                       String err = validateCommonWidget(cw);
+                       if (err != null)
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.saveWidgetDataBulk(commonWidgetMeta));
+       }
+
+       /**
+        * Saves one: event, news or resource
+        * 
+        * @param commonWidget
+        *            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")
+       public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget, HttpServletRequest request,
+                       HttpServletResponse response) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget);
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (adminRolesService.isSuperAdmin(user)) {
+                       if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().isEmpty())
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
+                                               "Category cannot be null or empty");
+                       String err = validateCommonWidget(commonWidget);
+                       if (err != null)
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                                       searchService.saveWidgetData(commonWidget));
+               } else {
+                       EcompPortalUtils.setBadPermissions(user, response, "saveWidgetData");
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed", null);
+               }
+       }
+
+       /**
+        * Used by the validate function
+        */
+       private final SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+       /**
+        * Validates the content of a common widget.
+        * 
+        * @param cw
+        * @return null on success; an error message if validation fails.
+        * @throws Exception
+        */
+       private String validateCommonWidget(CommonWidget cw) {
+               if (!isValidResourceType(cw.getCategory()))
+                       return "Invalid category: " + cw.getCategory();
+               if (cw.getTitle() == null || cw.getTitle().trim().length() == 0)
+                       return "Title is missing";
+               if (cw.getHref() == null || cw.getHref().trim().length() == 0)
+                       return "HREF is missing";
+               if (!cw.getHref().toLowerCase().startsWith("http"))
+                       return "HREF does not start with http";
+               if (cw.getSortOrder() == null)
+                       return "Sort order is null";
+               if (cw.getEventDate() == null || cw.getEventDate().trim().length() == 0)
+                       return "Date is missing";
+               try {
+                       yearMonthDayFormat.setLenient(false);
+                       Date date = yearMonthDayFormat.parse(cw.getEventDate());
+                       if (date == null)
+                               return "Failed to parse date " + cw.getEventDate();
+               } catch (ParseException ex) {
+                       return "Invalid date format " +ex.toString();
+               }
+               return null;
+       }
+
+       /**
+        * Deletes one: event, news or resource
+        * 
+        * @param commonWidget
+        *            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")
+       public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget);
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.deleteWidgetData(commonWidget));
+       }
+
+       /**
+        * Searches all portal for the input string.
+        * 
+        * @param request
+        * @param searchString
+        * @return Rest response wrapped around a Map of String to List of Search
+        *         Result Item.
+        */
+       @EPAuditLog
+       @RequestMapping(value = "/search", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request,
+                       @RequestParam String searchString) {
+
+               if (searchString != null)
+                       searchString = searchString.trim();
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (user == null) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+                                               "searchPortal: User object is null? - check logs",
+                                               new HashMap<String, List<SearchResultItem>>());
+                       } else if (searchString == null || searchString.length() == 0) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null",
+                                               new HashMap<String, List<SearchResultItem>>());
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'",
+                                               user.getLoginId(), searchString);
+                               Map<String, List<SearchResultItem>> results = searchService.searchResults(user.getLoginId(),
+                                               searchString);
+                               /*Audit log the search*/
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_SEARCH);
+                               auditLog.setComments(EcompPortalUtils.truncateString(searchString, PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,EPEELFLoggerAdvice.getCurrentDateTimeUTC());          
+                               auditService.logActivity(auditLog, null);
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage("DashboardController.PortalRestResponse", 
+                                               EcompAuditLog.CD_ACTIVITY_SEARCH, user.getOrgUserId(), null, searchString));    
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchPortal failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
+                                       new HashMap<String, List<SearchResultItem>>());
+               }
+       }
+
+       /**
+        * Gets all active users.
+        * 
+        * TODO: should only the superuser be allowed to use this API?
+        * 
+        * @param request
+        * @return Rest response wrapped around a list of String
+        */
+       @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json")
+       public List<String> getActiveUsers(HttpServletRequest request) {
+               List<String> activeUsers = null;
+               List<String> onlineUsers = new ArrayList<>();
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       String userId = user.getOrgUserId();
+
+                       activeUsers = searchService.getRelatedUsers(userId);
+                       HashSet<String> usersSet = (HashSet<String>) CollaborateList.getInstance().getAllUserName();
+                       for (String users : activeUsers) {
+                               if (usersSet.contains(users)) {
+                                       onlineUsers.add(users);
+                               }
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e);
+               }
+               return onlineUsers;
+       }
+       
+       /**
+        * Gets the refresh interval and duration of a cycle of continuous refreshing for the online users side panel, both in milliseconds.
+        * 
+        * @param request
+        * @return Rest response wrapped around a number that is the number of milliseconds.
+        */
+       @RequestMapping(value = "/onlineUserUpdateRate", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, String>> getOnlineUserUpdateRate(HttpServletRequest request) {
+               try {
+                       String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE);     
+                       String updateDuration = SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION);                             
+                       Integer rateInMiliSec = Integer.valueOf(updateRate)*1000;
+                       Integer durationInMiliSec = Integer.valueOf(updateDuration)*1000;
+                       Map<String, String> results = new HashMap<String,String>();
+                       results.put("onlineUserUpdateRate", String.valueOf(rateInMiliSec));
+                       results.put("onlineUserUpdateDuration", String.valueOf(durationInMiliSec));                     
+                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getOnlineUserUpdateRate failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
+               }               
+       }
+
+       /**
+        * Gets the window width threshold for collapsing right menu from system.properties.
+        * 
+        * @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")
+       public PortalRestResponse<Map<String, String>> getWindowWidthThresholdForRightMenu(HttpServletRequest request) {
+               try {
+                       String windowWidthString = SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU);    
+                       Integer windowWidth = Integer.valueOf(windowWidthString);
+                       Map<String, String> results = new HashMap<String,String>();
+                       results.put("windowWidth", String.valueOf(windowWidth));
+                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getWindowWidthThresholdForRightMenu failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
+               }               
+       }
+
+
+       /**
+        * Gets the window width threshold for collapsing left menu from system.properties.
+        * 
+        * @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")
+       public PortalRestResponse<Map<String, String>> getWindowWidthThresholdForLeftMenu(HttpServletRequest request) {
+               try {
+                       String windowWidthString = SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU);     
+                       Integer windowWidth = Integer.valueOf(windowWidthString);
+                       Map<String, String> results = new HashMap<String,String>();
+                       results.put("windowWidth", String.valueOf(windowWidth));
+                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getWindowWidthThresholdForLeftMenu failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
+               }               
+       }
+       
+       /**
+        * Gets only those users that are 'related' to the currently logged-in user.
+        * 
+        * @param request
+        * @return Rest response wrapped around a List of String
+        */
+       @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (user == null) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "User object is null? - check logs",
+                                               new ArrayList<>());
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "activeUsers: searching for user {}", user.getLoginId());
+                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",
+                                               searchService.getRelatedUsers(user.getLoginId()));
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "activeUsers failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
+                                       new ArrayList<>());
+               }
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..b26bd1b
--- /dev/null
@@ -0,0 +1,261 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/portalApi/search")
+public class DashboardSearchResultController extends EPRestrictedBaseController {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardSearchResultController.class);
+
+       @Autowired
+       private DashboardSearchService searchService;
+
+       /**
+        * Gets all widgets by type: NEW or RESOURCE
+        * 
+        * @param request
+        * @param resourceType
+        *            Request parameter.
+        * @return Rest response wrapped around a CommonWidgetMeta object.
+        */
+       @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
+                       @RequestParam String resourceType) {
+               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
+                               searchService.getWidgetData(resourceType));
+       }
+
+       /**
+        * Saves all: news and resources
+        * 
+        * @param commonWidgetMeta
+        *            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")
+       public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta);
+               if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals(""))
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
+                                       "Category cannot be null or empty");
+               // validate dates
+               for (CommonWidget cw : commonWidgetMeta.getItems()) {
+                       String err = validateCommonWidget(cw);
+                       if (err != null)
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.saveWidgetDataBulk(commonWidgetMeta));
+       }
+
+       /**
+        * Saves one: news or resource
+        * 
+        * @param commonWidget
+        *            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")
+       public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget);
+               if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals(""))
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
+                                       "Cateogry cannot be null or empty");
+               String err = validateCommonWidget(commonWidget);
+               if (err != null)
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.saveWidgetData(commonWidget));
+       }
+
+       /**
+        * Used by the validate function
+        */
+       private final SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+       /**
+        * Validates the content of a common widget.
+        * 
+        * @param cw
+        * @return null on success; an error message if validation fails.
+        * @throws Exception
+        */
+       private String validateCommonWidget(CommonWidget cw) {
+               try {
+                       if (cw.getEventDate() != null && cw.getEventDate().trim().length() > 0)
+                               yearMonthDayFormat.parse(cw.getEventDate());
+               } catch (ParseException ex) {
+                       return ex.toString();
+               }
+               return null;
+       }
+
+       /**
+        * Deletes one: news or resource
+        * 
+        * @param commonWidget
+        *            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")
+       public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget);
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.deleteWidgetData(commonWidget));
+       }
+
+       /**
+        * Searches all portal for the input string.
+        * 
+        * @param request
+        * @param searchString
+        * @return Rest response wrapped around a Map of String to List of Search
+        *         Result Item.
+        */
+       @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request,
+                       @RequestParam String searchString) {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (user == null) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+                                               "searchPortal: User object is null? - check logs",
+                                               new HashMap<String, List<SearchResultItem>>());
+                       } else if (searchString == null || searchString.trim().length() == 0) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null",
+                                               new HashMap<String, List<SearchResultItem>>());
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'",
+                                               user.getLoginId(), searchString);
+                               Map<String, List<SearchResultItem>> results = searchService.searchResults(user.getLoginId(),
+                                               searchString);
+                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchPortal failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
+                                       new HashMap<String, List<SearchResultItem>>());
+               }
+       }
+
+       /**
+        * Gets all active users.
+        * 
+        * TODO: should only the superuser be allowed to use this API?
+        * 
+        * @param request
+        * @return Rest response wrapped around a list of String
+        */
+       @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json")
+       public List<String> getActiveUsers(HttpServletRequest request) {
+               List<String> activeUsers = null;
+               List<String> onlineUsers = new ArrayList<>();
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       String userId = user.getOrgUserId();
+
+                       activeUsers = searchService.getRelatedUsers(userId);
+                       HashSet<String> usersSet = (HashSet<String>) CollaborateList.getInstance().getAllUserName();
+                       for (String users : activeUsers) {
+                               if (usersSet.contains(users)) {
+                                       onlineUsers.add(users);
+                               }
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e);
+               }
+               return onlineUsers;
+       }
+
+       /**
+        * Gets only those users that are 'related' to the currently logged-in user.
+        * 
+        * @param request
+        * @return Rest response wrapped around a List of String
+        */
+       @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (user == null) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "User object is null? - check logs",
+                                               new ArrayList<>());
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "activeUsers: searching for user {}", user.getLoginId());
+                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",
+                                               searchService.getRelatedUsers(user.getLoginId()));
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "activeUsers failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
+                                       new ArrayList<>());
+               }
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..65b2470
--- /dev/null
@@ -0,0 +1,220 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+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.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.RestController;
+
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class EncryptAdminController implements BasicAuthenticationController {
+       @Autowired
+       DataAccessService dataAccessService;
+       @Autowired
+       protected SessionFactory sessionFactory;
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EncryptAdminController.class);
+
+       @RequestMapping(value = { "/executeEncryptQuery" }, method = RequestMethod.POST)
+       public Map<Long, String> executeEncrypt(HttpServletRequest request, HttpServletResponse response)
+                       throws CipherUtilException {
+
+               return fetchRecords();
+       }
+
+       public Map<Long, String> fetchRecords() throws CipherUtilException {
+               List appPassword = null;
+               Session localSession = null;
+               Map<Long, String> responsemap;
+               try {
+                       localSession = sessionFactory.openSession();
+                       responsemap = new LinkedHashMap<Long, String>();
+                       appPassword = dataAccessService.executeNamedQuery("getAppPassword", null, null);
+                       if (appPassword != null) {
+                               Iterator i = appPassword.iterator();
+                               while (i.hasNext()) {
+                                       Object[] user = (Object[]) i.next();
+                                       Long app_id = (Long) user[0];
+                                       String app_password = (String) user[1];
+                                       if (app_id != null && StringUtils.isNotEmpty(app_password)) {
+                                               try {
+                                                       final String pass = CipherUtil.encryptPKC(CipherUtil.decrypt(app_password));
+                                                       Query query = null;
+                                                       try {
+                                                               localSession.getTransaction().begin();
+                                                               query = localSession.createSQLQuery(
+                                                                               "UPDATE fn_app m SET m.app_password= :pass " + " where m.app_id = :app_id");
+                                                               query.setParameter("pass", pass);
+                                                               query.setParameter("app_id", app_id);
+                                                               int result = query.executeUpdate();
+                                                               localSession.getTransaction().commit();
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "--------------getAppPassword-------query successfull------------------"
+                                                                                               + query);
+
+                                                       } catch (Exception e) {
+                                                               localSession.getTransaction().rollback();
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "--------------getAppPassword--------query failed-----------------" + query);
+                                                               responsemap.put(app_id, "-------query failed-----------------" + query);
+                                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                                               "getAppPassword error while executing  the query", e);
+
+                                                       }
+                                               } catch (Exception e) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "getAppPassword error while executing  the query", e);
+                                               }
+                                       }
+                               }
+                       }
+                       appPassword = dataAccessService.executeNamedQuery("getBasicauthAccount", null, null);
+                       if (appPassword != null) {
+                               Iterator i = appPassword.iterator();
+                               while (i.hasNext()) {
+                                       Object[] user = (Object[]) i.next();
+                                       Long app_id = (Long) user[0];
+                                       String password = (String) user[1];
+                                       if (app_id != null && StringUtils.isNotEmpty(password)) {
+                                               try {
+                                                       final String pass = CipherUtil.encryptPKC(CipherUtil.decrypt(password));
+                                                       Query query = null;
+                                                       try {
+                                                               localSession.getTransaction().begin();
+                                                               query = localSession
+                                                                               .createSQLQuery("UPDATE ep_basic_auth_account m SET m.password = :pass"
+                                                                                               + " where m.id  = :app_id");
+                                                               query.setParameter("pass", pass);
+                                                               query.setParameter("app_id", app_id);
+                                                               int result = query.executeUpdate();
+                                                               localSession.getTransaction().commit();
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "--------------getAppPassword-------query successfull------------------"
+                                                                                               + query);
+
+                                                       } catch (Exception e) {
+                                                               localSession.getTransaction().rollback();
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "--------------getAppPassword--------query failed-----------------" + query);
+                                                               responsemap.put(app_id, "-------query failed-----------------" + query);
+                                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                                               "getAppPassword error while executing  the query", e);
+
+                                                       }
+                                               } catch (Exception e) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "getAppPassword error while executing  the query", e);
+                                               }
+
+                                       }
+
+                               }
+                       }
+                       appPassword = dataAccessService.executeNamedQuery("getMicroserviceInfo", null, null);
+                       if (appPassword != null) {
+                               Iterator i = appPassword.iterator();
+                               while (i.hasNext()) {
+                                       Object[] user = (Object[]) i.next();
+                                       Long app_id = (Long) user[0];
+                                       String password = (String) user[1];
+                                       if (app_id != null && StringUtils.isNotEmpty(password)) {
+                                               try {
+                                                       final String pass = CipherUtil.encryptPKC(CipherUtil.decrypt(password));
+                                                       Query query = null;
+                                                       try {
+                                                               localSession.getTransaction().begin();
+                                                               query = localSession.createSQLQuery(
+                                                                               "UPDATE ep_microservice m SET m.password = :pass" + " WHERE m.id = :app_id");
+                                                               query.setParameter("pass", pass);
+                                                               query.setParameter("app_id", app_id);
+                                                               int result = query.executeUpdate();
+                                                               localSession.getTransaction().commit();
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "--------------getAppPassword-------query successfull------------------"
+                                                                                               + query);
+
+                                                       } catch (Exception e) {
+                                                               localSession.getTransaction().rollback();
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "--------------getAppPassword--------query failed-----------------" + query);
+                                                               responsemap.put(app_id, "-------query failed-----------------" + query);
+                                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                                               "getAppPassword error while executing  the query", e);
+
+                                                       }
+                                               } catch (Exception e) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "getAppPassword error while executing  the query", e);
+                                               }
+
+                                       }
+
+                               }
+                       }
+                       
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "updateRecords");
+               }
+               return responsemap;
+       }
+}
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
new file mode 100644 (file)
index 0000000..0be015e
--- /dev/null
@@ -0,0 +1,807 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+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.EcompAuditLog;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.exceptions.InvalidRoleException;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.ExternalAccessRolesService;
+import org.onap.portalapp.portal.transport.CentralRole;
+import org.onap.portalapp.portal.transport.CentralRoleFunction;
+import org.onap.portalapp.portal.transport.CentralUser;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("/auxapi")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class ExternalAccessRolesController implements BasicAuthenticationController {
+
+       private static final String ROLE_INVALID_CHARS = "%=():,\"\"";
+
+       private static final String SUCCESSFULLY_DELETED = "Successfully Deleted";
+
+       private static final String INVALID_UEB_KEY = "Invalid uebkey!";
+
+       private static final String LOGIN_ID = "LoginId";
+       
+       RestTemplate template = new RestTemplate();
+
+       @Autowired
+       private AuditService auditService;
+
+       private static final String UEBKEY = "uebkey";
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAccessRolesController.class);
+
+       @Autowired
+       private ExternalAccessRolesService externalAccessRolesService;
+
+       @ApiOperation(value = "Gets user role for an application.", response = CentralUser.class, responseContainer="List")
+       @RequestMapping(value = {
+                       "/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
+       public CentralUser getUser(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("loginId") String loginId) throws Exception {
+
+               CentralUser answer = null;
+               try {
+                       fieldsValidation(request);
+                       answer = externalAccessRolesService.getUserRoles(loginId, request.getHeader(UEBKEY));           
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUser failed", e);
+               }
+               return answer;
+       }
+       
+       @ApiOperation(value = "Gets user roles for an application which is upgraded to newer version.", response = String.class, responseContainer="List")
+       @RequestMapping(value = {
+                       "/v2/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
+       public String getV2UserList(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("loginId") String loginId) throws Exception {
+               String answer = null;
+               try {
+                       fieldsValidation(request);
+                       answer = externalAccessRolesService.getV2UserWithRoles(loginId, request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getV2UserList failed", e);
+               }
+               return answer;
+       }
+       
+       @ApiOperation(value = "Gets roles for an application.", response = CentralRole.class, responseContainer="Json")
+       @RequestMapping(value = {
+                       "/roles" }, method = RequestMethod.GET, 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;
+               List<CentralRole> cenRole = null;
+               try {
+                       fieldsValidation(request);      
+                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                       // Sync all roles from external system into Ecomp portal DB
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getRolesForApp: Entering into syncApplicationRolesWithEcompDB");
+                       externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getRolesForApp: Finished syncApplicationRolesWithEcompDB");
+                       v2CenRole = externalAccessRolesService.getRolesForApp(request.getHeader(UEBKEY));
+                       cenRole = externalAccessRolesService.convertV2CentralRoleListToOldVerisonCentralRoleList(v2CenRole);
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRolesForApp failed", e);
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRolesForApp");
+               return cenRole;
+       }
+       
+       @ApiOperation(value = "Gets roles for an application which is upgraded to newer version.", response = CentralV2Role.class, responseContainer="Json")
+       @RequestMapping(value = {
+                       "/v2/roles" }, method = RequestMethod.GET, 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;
+               try {
+                       fieldsValidation(request);
+                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                       // Sync all roles from external system into Ecomp portal DB
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getV2RolesForApp: Entering into syncApplicationRolesWithEcompDB");
+                       externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getV2RolesForApp: Finished syncApplicationRolesWithEcompDB");
+                       answer = externalAccessRolesService.getRolesForApp(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getV2RolesForApp failed", e);
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getV2RolesForApp");
+               return answer;
+       }
+
+       @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")
+       public List<RoleFunction> getRoleFunctionsList(HttpServletRequest request, HttpServletResponse response)
+                       throws Exception {
+               List<CentralV2RoleFunction> answer = null;
+               List<RoleFunction> roleFuncList = null;
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRoleFunctionsList");
+               try {
+                       fieldsValidation(request);
+                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                       // Sync all functions from external system into Ecomp portal DB
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getRoleFunctionsList: Entering into syncRoleFunctionFromExternalAccessSystem");
+                       externalAccessRolesService.syncRoleFunctionFromExternalAccessSystem(app);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getRoleFunctionsList: Finished syncRoleFunctionFromExternalAccessSystem");
+                       answer = externalAccessRolesService.getRoleFuncList(request.getHeader(UEBKEY));
+                       roleFuncList = externalAccessRolesService.convertCentralRoleFunctionToRoleFunctionObject(answer);               
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunctionsList failed", e);
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRoleFunctionsList");
+               return roleFuncList;
+       }       
+       
+       @ApiOperation(value = "Gets all role functions for an application which is upgraded to newer version.", response = CentralV2RoleFunction.class, responseContainer="Json")
+       @RequestMapping(value = {
+                       "/v2/functions" }, method = RequestMethod.GET, produces = "application/json")
+       public List<CentralV2RoleFunction> getV2RoleFunctionsList(HttpServletRequest request, HttpServletResponse response)
+                       throws Exception {
+               List<CentralV2RoleFunction> cenRoleFuncList = null;
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getV2RoleFunctionsList");
+               try {
+                       fieldsValidation(request);
+                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                       // Sync all functions from external system into Ecomp portal DB
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getV2RoleFunctionsList: Entering into syncRoleFunctionFromExternalAccessSystem");
+                       externalAccessRolesService.syncRoleFunctionFromExternalAccessSystem(app);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getV2RoleFunctionsList: Finished syncRoleFunctionFromExternalAccessSystem");
+                       cenRoleFuncList = externalAccessRolesService.getRoleFuncList(request.getHeader(UEBKEY));        
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getV2RoleFunctionsList failed", e);
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getV2RoleFunctionsList");
+               return cenRoleFuncList;
+       }       
+
+       @ApiOperation(value = "Gets role information for an application.", response = CentralRole.class, responseContainer="Json")
+       @RequestMapping(value = {
+                       "/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json")
+       public CentralRole getRoleInfo(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("role_id") Long roleId) throws Exception {
+               CentralV2Role answer = null;
+               CentralRole cenRole = null;
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRoleInfo");
+               try {
+                       fieldsValidation(request);
+                       answer = externalAccessRolesService.getRoleInfo(roleId, request.getHeader(UEBKEY));
+                       cenRole = externalAccessRolesService.convertV2CentralRoleToOldVerisonCentralRole(answer);
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleInfo failed", e);
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRoleInfo");
+               return cenRole;
+       }
+       
+       @ApiOperation(value = "Gets v2 role information for an application which is upgraded to newer version.", response = CentralV2Role.class, responseContainer="Json")
+       @RequestMapping(value = {
+                       "/v2/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json")
+       public CentralV2Role getV2RoleInfo(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("role_id") Long roleId) throws Exception {
+               CentralV2Role answer = null;
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getV2RoleInfo");
+               try {
+                       fieldsValidation(request);
+                       answer = externalAccessRolesService.getRoleInfo(roleId, request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getV2RoleInfo failed", e);
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getV2RoleInfo");
+               return answer;
+       }
+       
+       @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")
+       public CentralRoleFunction getRoleFunction(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("code") String code) throws Exception {
+               CentralV2RoleFunction centralV2RoleFunction = null;
+               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
+               try {
+                       fieldsValidation(request);
+                       centralV2RoleFunction = externalAccessRolesService.getRoleFunction(code, request.getHeader(UEBKEY));
+                       if(centralV2RoleFunction != null && EcompPortalUtils.getFunctionCode(centralV2RoleFunction.getCode()).equals(code)) {
+                               BeanUtils.copyProperties(centralV2RoleFunction, centralRoleFunction, "type","action");
+                       }
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunction failed", e);
+               }
+               return centralRoleFunction;
+       }
+       
+       @ApiOperation(value = "Gets role information for an application provided by function code.", response = CentralV2RoleFunction.class, responseContainer = "Json")
+       @RequestMapping(value = { "/v2/function/{code}" }, method = RequestMethod.GET, produces = "application/json")
+       public CentralV2RoleFunction getV2RoleFunction(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("code") String code) throws Exception {
+               CentralV2RoleFunction centralV2RoleFunction = null;
+               try {
+                       fieldsValidation(request);
+                       centralV2RoleFunction = externalAccessRolesService.getRoleFunction(code, request.getHeader(UEBKEY));
+                       if(centralV2RoleFunction == null || !EcompPortalUtils.getFunctionCode(centralV2RoleFunction.getCode()).equals(code)) {
+                               centralV2RoleFunction = new CentralV2RoleFunction();
+                       }
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getV2RoleFunction failed", e);
+               }
+               return centralV2RoleFunction;
+       }
+
+       @ApiOperation(value = "Saves role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/roleFunction" }, method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody String roleFunc) throws Exception {
+               try {
+                       fieldsValidation(request);
+                       String data = roleFunc;
+                       ObjectMapper mapper = new ObjectMapper();
+                       List<EPApp> applicationList = externalAccessRolesService.getApp(request.getHeader(UEBKEY));
+                       EPApp requestedApp = applicationList.get(0);
+                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                       CentralV2RoleFunction availableRoleFunction = mapper.readValue(data, CentralV2RoleFunction.class);
+                       CentralV2RoleFunction domainRoleFunction = externalAccessRolesService.getRoleFunction(availableRoleFunction.getCode(),
+                                       requestedApp.getUebKey());
+                       boolean saveOrUpdateResponse = false;
+                       if (domainRoleFunction != null) {
+                               domainRoleFunction.setName(availableRoleFunction.getName());
+                               saveOrUpdateResponse = externalAccessRolesService.saveCentralRoleFunction(domainRoleFunction,
+                                               requestedApp);
+                       } else {
+                               availableRoleFunction.setAppId(requestedApp.getId());
+                               saveOrUpdateResponse = externalAccessRolesService.saveCentralRoleFunction(availableRoleFunction,
+                                               requestedApp);
+                       }                       
+                       if (saveOrUpdateResponse) {
+                               EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
+                               EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                               CentralV2RoleFunction function = externalAccessRolesService
+                                               .getRoleFunction(availableRoleFunction.getCode(), request.getHeader(UEBKEY));
+                               String activityCode = (function.getCode() == null)
+                                               ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION
+                                               : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION;
+                               logger.info(EELFLoggerDelegate.applicationLogger, "saveRoleFunction: succeeded for app {}, function {}",
+                                               app.getId(), availableRoleFunction.getCode());
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(activityCode);
+                               auditLog.setComments(
+                                               EcompPortalUtils.truncateString(
+                                                               "saveRoleFunction role for app:" + app.getId() + " and function:'"
+                                                                               + availableRoleFunction.getCode() + "'",
+                                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               auditLog.setAffectedRecordId(user.getOrgUserId());
+                               auditService.logActivity(auditLog, null);
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.saveRoleFunction", activityCode,
+                                                               String.valueOf(user.getId()), user.getOrgUserId(), availableRoleFunction.getCode()));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed");
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               "Failed to saveRoleFunction for '" + availableRoleFunction.getCode() + "'", "Failed");
+                       }
+               } catch (Exception e) {
+                       if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       }else {
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Saved", "Success");
+       }
+       
+       @ApiOperation(value = "Deletes role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/roleFunction/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
+       public PortalRestResponse<String> deleteRoleFunction(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("code") String code) throws Exception {
+               try {
+                       fieldsValidation(request);
+                       EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
+                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                       boolean getDelFuncResponse = externalAccessRolesService.deleteCentralRoleFunction(code, app);
+                       if (getDelFuncResponse) {
+                               logger.info(EELFLoggerDelegate.applicationLogger, "deleteRoleFunction: succeeded for app {}, role {}",
+                                               app.getId(), code);
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION);
+                               auditLog.setComments(EcompPortalUtils.truncateString(
+                                               "Deleted function for app:" + app.getId() + " and function code:'" + code + "'",
+                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               auditLog.setAffectedRecordId(user.getOrgUserId());
+                               auditService.logActivity(auditLog, null);
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.deleteRoleFunction",
+                                                               EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION, String.valueOf(user.getId()),
+                                                               user.getOrgUserId(), code));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction failed");
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               "Failed to deleteRoleFunction for '" + code + "'", "Failed");
+                       }
+               } catch (Exception e) {
+                       if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       } else {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, SUCCESSFULLY_DELETED, "Success");
+
+       }       
+       
+       @ApiOperation(value = "Saves role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/role" }, method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> saveRole(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody Role role) throws Exception {
+               try {
+                       fieldsValidation(request);
+                       ExternalRequestFieldsValidator saveRoleResult = null;
+                       EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
+                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                       if(role.getId()!=null && StringUtils.containsAny(role.getName(), ROLE_INVALID_CHARS)) {
+                               throw new InvalidRoleException("Invalid role name found for '" + role.getName() + "'. Any one of the following characters '%,(),=,:,comma, and double quotes' are not allowed");
+                       }
+                       saveRoleResult = externalAccessRolesService.saveRoleForApplication(role, request.getHeader(UEBKEY));
+                       if (saveRoleResult.isResult()) {
+                               String activityCode = (role.getId() == null) ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_ROLE
+                                               : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_ROLE_AND_FUNCTION;
+                               logger.info(EELFLoggerDelegate.applicationLogger, "saveRole: succeeded for app {}, role {}",
+                                               app.getId(), role.getName());
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(activityCode);
+                               auditLog.setComments(EcompPortalUtils.truncateString(
+                                               "saveRole role for app:" + app.getId() + " and role:'" + role.getName() + "'",
+                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               auditLog.setAffectedRecordId(user.getOrgUserId());
+                               auditService.logActivity(auditLog, null);
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.saveRole", activityCode,
+                                                               String.valueOf(user.getId()), user.getOrgUserId(), role.getName()));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       } else {
+                               if(saveRoleResult.getDetailMessage().contains("406")){
+                                       response.setStatus(HttpServletResponse.SC_NOT_ACCEPTABLE);
+                                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,                                             
+                                       "Failed to create a role for '" + role.getName() + "'. Any one of the following characters '%,(),=,:,comma, and double quotes' are not allowed"
+                                               , "Failed");
+                               } else{
+                                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+                                                       "Failed to saveRole for '" + role.getName() + "'", "Failed");
+                               }
+                       }
+               } catch (Exception e) {
+                       if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       }else {
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveRole failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Saved", "Success");
+       }
+       
+       @ApiOperation(value = "Deletes role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/deleteRole/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
+       public  PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable String code) throws Exception {
+               try {
+                       fieldsValidation(request);
+                       boolean deleteResponse = externalAccessRolesService.deleteRoleForApplication(code,
+                                       request.getHeader(UEBKEY));
+                       if (deleteResponse) {
+                               EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
+                               EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
+                               logger.info(EELFLoggerDelegate.applicationLogger, "deleteRole: succeeded for app {}, role {}",
+                                               app.getId(), code);
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE);
+                               auditLog.setComments(EcompPortalUtils.truncateString(
+                                               "Deleted role for app:" + app.getId() + " and role:'" + code + "'",
+                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               auditLog.setAffectedRecordId(user.getOrgUserId());
+                               auditService.logActivity(auditLog, null);
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.deleteRole",
+                                                               EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE, String.valueOf(user.getId()),
+                                                               user.getOrgUserId(), code));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "deleteRole failed");
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               "Failed to deleteRole for '" + code + "'", "Failed");
+                       }
+               } catch (Exception e) {
+                       if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       } else {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRole failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, SUCCESSFULLY_DELETED, "Success");
+       }
+       
+       @ApiOperation(value = "Gets active roles for an application.", response = CentralV2Role.class, responseContainer = "Json")
+       @RequestMapping(value = { "/activeRoles" }, method = RequestMethod.GET, produces = "application/json")
+       public  List<CentralV2Role> getActiveRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               List<CentralV2Role> cenRole = null;
+               try {
+                       fieldsValidation(request);
+                       cenRole = externalAccessRolesService.getActiveRoles(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);         
+                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveRoles failed", e);
+               }
+               return cenRole;
+               
+       }
+       
+       @ApiOperation(value = "deletes user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/deleteDependcyRoleRecord/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json")
+       public PortalRestResponse<String> deleteDependencyRoleRecord(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("roleId") Long roleId) throws Exception {
+               ExternalRequestFieldsValidator removeResult = null;
+               try {
+                       fieldsValidation(request);
+                       removeResult = externalAccessRolesService.deleteDependencyRoleRecord(roleId,
+                                       request.getHeader(UEBKEY), request.getHeader(LOGIN_ID));
+                       if (!removeResult.isResult()) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Failed to deleteDependencyRoleRecord",
+                                               "Failed");
+                       }
+               } catch (Exception e) {
+                       if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       } else {
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, SUCCESSFULLY_DELETED, "Success");
+       }
+       
+       
+       @ApiOperation(value = "deletes  roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/v2/deleteRole/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json")
+       public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("roleId") Long roleId) throws Exception {
+               ExternalRequestFieldsValidator removeResult = null;
+               try {
+                       fieldsValidation(request);
+                       removeResult = externalAccessRolesService.deleteDependencyRoleRecord(roleId,
+                                       request.getHeader(UEBKEY), request.getHeader(LOGIN_ID));
+                       if (!removeResult.isResult()) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Failed to deleteRole",
+                                               "Failed");
+                       }
+               } catch (Exception e) {
+                       if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       } else {
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRole failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, SUCCESSFULLY_DELETED, "Success");
+       }
+       
+       
+       @ApiOperation(value = "Bulk upload functions for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/upload/portal/functions" }, method = RequestMethod.POST, produces = "application/json")
+       public  PortalRestResponse<String> bulkUploadFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               Integer result = 0;
+               try {
+                       result = externalAccessRolesService.bulkUploadFunctions(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+       }
+       
+       @ApiOperation(value = "Bulk upload roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
+       @RequestMapping(value = { "/upload/portal/roles" }, method = RequestMethod.POST, produces = "application/json")
+       public  PortalRestResponse<String> bulkUploadRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               Integer result = 0;
+               try {
+                       result = externalAccessRolesService.bulkUploadRoles(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoles", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+       }
+       
+       @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")
+       public  PortalRestResponse<String> bulkUploadRoleFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               Integer result = 0;
+               try {
+                       result = externalAccessRolesService.bulkUploadRolesFunctions(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoleFunctions failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoleFunctions", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+       }
+       
+       @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")
+       public  PortalRestResponse<String> bulkUploadUserRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               Integer result = 0;
+               try {
+                       result = externalAccessRolesService.bulkUploadUserRoles(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadUserRoles failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadUserRoles", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+       }
+       
+       @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")
+       public  PortalRestResponse<String> bulkUploadUsersSingleRole(HttpServletRequest request, HttpServletResponse response, @PathVariable Long roleId) throws Exception {
+               Integer result = 0;
+               try {
+                       String roleName = request.getHeader("RoleName");
+                       result = externalAccessRolesService.bulkUploadUsersSingleRole(request.getHeader(UEBKEY), roleId, roleName);
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadUsersSingleRole failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadUsersSingleRole", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: "+result, "Success");
+       }
+       
+       @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")
+       public  PortalRestResponse<String> bulkUploadPartnerFunctions(HttpServletRequest request, HttpServletResponse response, @RequestBody List<RoleFunction> upload) throws Exception {
+               try {
+                       externalAccessRolesService.bulkUploadPartnerFunctions(request.getHeader(UEBKEY), upload);
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
+       }
+       
+       @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")
+       public  PortalRestResponse<String> bulkUploadPartnerRoles(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Role> upload) throws Exception {
+               try {
+                       externalAccessRolesService.bulkUploadPartnerRoles(request.getHeader(UEBKEY), upload);
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoles", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
+       }
+       
+       @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")
+       public  PortalRestResponse<String> bulkUploadPartnerRoleFunctions(HttpServletRequest request, HttpServletResponse response, @RequestBody List<Role> upload) throws Exception {
+               try {
+                       externalAccessRolesService.bulkUploadPartnerRoleFunctions(request.getHeader(UEBKEY), upload);
+               } catch (Exception e) {
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadPartnerRoleFunctions", "Failed");
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
+       }
+       
+       @ApiOperation(value = "Gets all functions along with global functions", response = List.class, responseContainer = "Json")
+       @RequestMapping(value = { "/menuFunctions" }, method = RequestMethod.GET, produces = "application/json")
+       public  List<String> getMenuFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               List<String> functionsList = null;
+               try {
+                       fieldsValidation(request);
+                       functionsList = externalAccessRolesService.getMenuFunctionsList(request.getHeader(UEBKEY));
+               } catch (Exception e) {
+                       sendErrorResponse(response, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuFunctions failed", e);
+               }
+               return functionsList;
+       }
+       
+       @ApiOperation(value = "Gets all active Users of application", response = String.class, responseContainer = "Json")
+       @RequestMapping(value = { "/users" }, method = RequestMethod.GET, produces = "application/json")
+       public  List<EcompUser> getUsersOfApplication(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               List<EcompUser> users = null;
+               try {
+                       users = externalAccessRolesService.getAllAppUsers(request.getHeader(UEBKEY));
+               } catch (Exception e) {         
+                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUsersOfApplication failed", e);
+                       throw new Exception(e.getMessage());
+               }
+               return users;
+       }
+       
+       /**
+        * 
+        * It checks the input uebkey of the application and throws exception if it is invalid key
+        * 
+        * @param request
+        * @throws Exception
+        */
+       private void  fieldsValidation(HttpServletRequest request) throws Exception{
+               List<EPApp> app = externalAccessRolesService.getApp(request.getHeader(UEBKEY));
+               if(app.isEmpty()){
+                       throw new Exception(INVALID_UEB_KEY);
+               }
+               if(!app.isEmpty() && app.get(0).getCentralAuth()){
+                       ResponseEntity<String> response = externalAccessRolesService.getNameSpaceIfExists(app.get(0));
+                       if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND)
+                               throw new Exception("Invalid NameSpace");
+               }
+       }
+       
+       /**
+        * 
+        * It returns http response with appropriate message
+        * 
+        * @param response
+        * @param e
+        * @throws IOException
+        */
+       private void sendErrorResponse(HttpServletResponse response, Exception e) throws IOException {
+               response.setContentType("application/json");
+               response.setCharacterEncoding("UTF-8");
+               final Map<String,String> uebkeyResponse = new HashMap<>();
+               ObjectMapper mapper = new ObjectMapper();
+               String reason = "";
+               if (e.getMessage().contains(INVALID_UEB_KEY)) {
+                       uebkeyResponse.put("error",INVALID_UEB_KEY);
+                       reason = mapper.writeValueAsString(uebkeyResponse);
+                       response.getWriter().write(reason);
+                       response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+               } else {
+                       uebkeyResponse.put("error",e.getMessage());
+                       reason = mapper.writeValueAsString(uebkeyResponse);
+                       response.getWriter().write(reason);
+                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+               }
+       }
+}
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
new file mode 100644 (file)
index 0000000..bd2b0a1
--- /dev/null
@@ -0,0 +1,231 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedRESTfulBaseController;
+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.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPRoleService;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+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.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppsRestfulController.class);
+
+       @Autowired
+       private FunctionalMenuService functionalMenuService;
+
+       @Autowired
+       private EPLoginService epLoginService;
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+
+       @Autowired
+       private UserNotificationService userNotificationService;
+
+       @Autowired
+       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")
+       @ResponseBody
+       public PortalAPIResponse publishNotification(HttpServletRequest request,
+                       @RequestBody EpNotificationItem notificationItem) throws Exception {
+               String appKey = request.getHeader("uebkey");
+               EPApp app = findEpApp(appKey);
+               List<Long> postRoleIds = new ArrayList<Long>();
+               for (Long roleId : notificationItem.getRoleIds()) {
+                       EPRole role = epRoleService.getRole(app.getId(), roleId);
+                       if (role != null)
+                               postRoleIds.add(role.getId());
+               }
+
+               // --- recreate the user notification object with the POrtal Role Ids
+               EpNotificationItem postItem = new EpNotificationItem();
+               postItem.setRoleIds(postRoleIds);
+               postItem.setIsForAllRoles("N");
+               postItem.setIsForOnlineUsers("N");
+               postItem.setActiveYn("Y");
+               postItem.setPriority(notificationItem.getPriority());
+               postItem.setMsgHeader(notificationItem.getMsgHeader());
+               postItem.setMsgDescription(notificationItem.getMsgDescription());
+               postItem.setStartTime(notificationItem.getStartTime());
+               postItem.setEndTime(notificationItem.getEndTime());
+               postItem.setCreatedDate(Calendar.getInstance().getTime());
+               // default creator to 1 for now
+               postItem.setCreatorId(PortalConstants.DEFAULT_NOTIFICATION_CREATOR);
+               // ----
+
+               try {
+                       userNotificationService.saveNotification(postItem);
+               } catch (Exception e) {
+                       return new PortalAPIResponse(false, e.getMessage());
+               }
+
+               PortalAPIResponse response = new PortalAPIResponse(true, "success");
+               return response;
+       }
+
+       private EPApp findEpApp(String uebKey) {
+               List<?> list = null;
+               Map<String, String> params = new HashMap<>();
+               params.put("appKey", uebKey);
+               try {
+                       list = this.getDataAccessService().executeNamedQuery("getMyAppDetailsByUebKey", params, null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMyAppDetailsByUebKey failed", e);                      
+               }
+                       
+               return (list == null || list.size() == 0) ? null : (EPApp) list.get(0);
+       }
+
+       @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")
+       public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request,
+                       HttpServletResponse response) throws Exception {
+               String loginId = "";
+               String userAgent = "";
+               List<FavoritesFunctionalMenuItemJson> favorites = null;
+
+               loginId = request.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID);
+               userAgent = MDC.get(EPCommonSystemProperties.PARTNER_NAME);
+
+               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
+               logger.info(EELFLoggerDelegate.errorLogger,
+                               "getFavorites request was received from " + userAgent + " for the user " + loginId + ".");
+               if (epUser == null || epUser.getId() == null) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "No User record found for the LoginId '" + loginId + "' in the database.");
+                       throw new Exception("Received null for Login-Id.");
+               } else {
+                       favorites = functionalMenuService.getFavoriteItems(epUser.getId());
+                       FieldsValidator fieldsValidator = new FieldsValidator();
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+
+                       EcompPortalUtils.logAndSerializeObject(logger, "/getFavorites", "result = ", favorites);
+               }
+
+               return favorites;
+       }
+
+       @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")
+       public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request,
+                       HttpServletResponse response) throws Exception {
+               String loginId = "";
+               String userAgent = "";
+               List<FunctionalMenuItem> fnMenuItems = null;
+
+               loginId = request.getHeader("LoginId");
+               userAgent = MDC.get(EPCommonSystemProperties.PARTNER_NAME);
+
+               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
+               logger.info(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemsForUser request was received from "
+                               + userAgent + " for the user " + loginId + ".");
+               if (epUser == null || epUser.getId() == null) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "No User record found for the LoginId '" + loginId + "' in the database.");
+                       throw new Exception("Received null for Login-Id.");
+               } else if (adminRolesService.isSuperAdmin(epUser)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
+                       fnMenuItems = functionalMenuService.getFunctionalMenuItems();
+               } else {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
+                       fnMenuItems = functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId());
+               }
+
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/functionalMenuItemsForUser", "result = ", fnMenuItems);
+
+               return fnMenuItems;
+       }
+
+       @ExceptionHandler(Exception.class)
+       protected void handleBadRequests(Exception e, HttpServletResponse response) throws IOException {
+               logger.warn(EELFLoggerDelegate.errorLogger, "Handling bad request", e);
+               response.sendError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
+       }
+}
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
new file mode 100644 (file)
index 0000000..1b54ebb
--- /dev/null
@@ -0,0 +1,666 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.JSONObject;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.SharedContext;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.portal.service.SharedContextService;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRole;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRolesList;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuItemWithRoles;
+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.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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Supports menus at the top of the Portal app landing page.
+ */
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class FunctionalMenuController extends EPRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuController.class);
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+       @Autowired
+       private FunctionalMenuService functionalMenuService;
+       @Autowired
+       private SharedContextService sharedContextService;
+       @Autowired
+       private SearchService searchService;
+
+       /**
+        * RESTful service method to fetch all the FunctionalMenuItems.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List of FunctionalMenuItem objects
+        */
+       @RequestMapping(value = { "/portalApi/functionalMenu" }, method = RequestMethod.GET, 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;
+               try {
+                       menuItems = functionalMenuService.getFunctionalMenuItems();
+                       functionalMenuService.assignHelpURLs(menuItems);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenu", "result =", menuItems);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItems failed", e);
+               }
+               return menuItems;
+       }
+
+       /**
+        * RESTful service method to get ECOMP Portal Title.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return PortalRestResponse of ECOMP portal title
+        */
+       @RequestMapping(value = { "/portalApi/ecompTitle" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<String> getECOMPTitle(HttpServletRequest request, HttpServletResponse response) {
+               PortalRestResponse<String> portalRestResponse = null;
+               try {
+                       String ecompTitle = SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME);
+                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success", ecompTitle);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/ecompTitle", "result =", ecompTitle);
+               } catch (Exception e) {
+                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), null);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getEcompTitle failed", e);
+               }
+               return portalRestResponse;
+       }
+
+       /**
+        * RESTful service method to fetch all the FunctionalMenuItems, both active and
+        * inactive, for the EditFunctionalMenu feature. Can only be accessed by the
+        * portal admin.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List of FunctionalMenuItem objects
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuForEditing" }, method = RequestMethod.GET, 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);
+               List<FunctionalMenuItem> menuItems = null;
+               try {
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getFunctionalMenuItemDetails");
+                       } else {
+                               menuItems = functionalMenuService.getFunctionalMenuItems(true);
+                       }
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForEditing", "result =",
+                                       menuItems);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForEditing failed", e);
+               }
+               return menuItems;
+       }
+
+       /**
+        * RESTful service method to fetch all the FunctionalMenuItems, active , for the
+        * Functional menu in notification Tree feature.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List of FunctionalMenuItem objects
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuForNotificationTree" }, method = RequestMethod.GET, produces = "application/json")
+       public List<FunctionalMenuItem> getMenuItemsForNotifications(HttpServletRequest request,
+                       HttpServletResponse response) {
+               // TODO: should only the superuser be allowed to use this API?
+               // EPUser user = EPUserUtils.getUserSession(request);
+               List<FunctionalMenuItem> menuItems = null;
+               try {
+                       menuItems = functionalMenuService.getFunctionalMenuItemsForNotificationTree(true);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForNotificationTree", "result =",
+                                       menuItems);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForNotifications failed", e);
+               }
+               return menuItems;
+       }
+
+       /**
+        * RESTful service method to fetch all FunctionalMenuItems associated with an
+        * application.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param appId
+        *            application ID
+        * @return List of FunctionalMenuItem objects
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuForApp/{appId}" }, method = RequestMethod.GET, produces = "application/json")
+       public List<FunctionalMenuItem> getMenuItemsForApp(HttpServletRequest request,
+                       @PathVariable("appId") Integer appId) {
+               // TODO: should only the superuser be allowed to use this API?
+               List<FunctionalMenuItem> menuItems = null;
+               try {
+                       menuItems = functionalMenuService.getFunctionalMenuItemsForApp(appId);
+                       functionalMenuService.assignHelpURLs(menuItems);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForApp/" + appId, "result =",
+                                       menuItems);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForApp failed", e);
+               }
+               return menuItems;
+       }
+
+       /**
+        * RESTful service method to fetch all FunctionalMenuItems associated with the
+        * applications and roles that a user has access to.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param orgUserId
+        *            user ID
+        * @return List of FunctionalMenuItem objects
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuForUser/{orgUserId}" }, method = RequestMethod.GET, produces = "application/json")
+       public List<FunctionalMenuItem> getMenuItemsForUser(HttpServletRequest request,
+                       @PathVariable("orgUserId") String orgUserId) {
+               // TODO: should only the superuser be allowed to use this API?
+               List<FunctionalMenuItem> menuItems = null;
+               try {
+                       menuItems = functionalMenuService.getFunctionalMenuItemsForUser(orgUserId);
+                       functionalMenuService.assignHelpURLs(menuItems);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForUser/" + orgUserId, "result =",
+                                       menuItems);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForUser failed", e);
+               }
+
+               return menuItems;
+       }
+
+       /**
+        * RESTful service method to fetch all FunctionalMenuItems associated with the
+        * applications and roles that the authenticated user has access to.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List of FunctionalMenuItem objects
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuForAuthUser" }, method = RequestMethod.GET, produces = "application/json")
+       public List<FunctionalMenuItem> getMenuItemsForAuthUser(HttpServletRequest request, HttpServletResponse response) {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<FunctionalMenuItem> menuItems = null;
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getMenuItemsForAuthUser");
+                       } else if (adminRolesService.isSuperAdmin(user)) {
+                               menuItems = functionalMenuService.getFunctionalMenuItems();
+                       } else {
+                               // calculate the menu items
+                               String orgUserId = user.getOrgUserId();
+                               menuItems = functionalMenuService.getFunctionalMenuItemsForUser(orgUserId);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForUser/" + orgUserId,
+                                               "result =", menuItems);
+                       }
+                       functionalMenuService.assignHelpURLs(menuItems);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForAuthUser failed", e);
+               }
+               return menuItems;
+       }
+
+       /**
+        * RESTful service method to fetch the details for a functional menu item.
+        * Requirement: you must be the Ecomp portal super admin user.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param menuId
+        *            menu ID
+        * @return FunctionalMenuItem object
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuItemDetails/{menuId}" }, method = RequestMethod.GET, produces = "application/json")
+       public FunctionalMenuItem getFunctionalMenuItemDetails(HttpServletRequest request,
+                       @PathVariable("menuId") Long menuId, HttpServletResponse response) {
+               // TODO: return FunctionalMenuItemJson
+               // TODO: modify FunctionalMenuItem to not include the transient fields
+               FunctionalMenuItem menuItem = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       if (!adminRolesService.isSuperAdmin(user)) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getFunctionalMenuItemDetails");
+                       } else {
+                               menuItem = functionalMenuService.getFunctionalMenuItemDetails(menuId);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItemDetails/" + menuId,
+                                               "result =", menuItem);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemDetails failed", e);
+               }
+
+               return menuItem;
+       }
+
+       /**
+        * RESTful service method to create a new menu item.
+        * 
+        * Requirement: you must be the Ecomp portal super admin user.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param menuItemJson
+        *            FunctionalMenuItemWithRoles
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/functionalMenuItem" }, method = RequestMethod.POST)
+       public FieldsValidator createFunctionalMenuItem(HttpServletRequest request,
+                       @RequestBody FunctionalMenuItemWithRoles menuItemJson, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "FunctionalMenuController.createFunctionalMenuItem bad permissions");
+                       EcompPortalUtils.setBadPermissions(user, response, "createFunctionalMenuItem");
+               } else {
+                       fieldsValidator = functionalMenuService.createFunctionalMenuItem(menuItemJson);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItem", "POST result =",
+                                       response.getStatus());
+               }
+
+               return fieldsValidator;
+       }
+
+       /**
+        * RESTful service method to update an existing menu item
+        * 
+        * Requirement: you must be the Ecomp portal super admin user.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param menuItemJson
+        *            FunctionalMenuItemWithRoles
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/functionalMenuItem" }, method = RequestMethod.PUT)
+       public FieldsValidator editFunctionalMenuItem(HttpServletRequest request,
+                       @RequestBody FunctionalMenuItemWithRoles menuItemJson, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "editFunctionalMenuItem");
+               } else {
+                       fieldsValidator = functionalMenuService.editFunctionalMenuItem(menuItemJson);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItem", "PUT result =",
+                                       response.getStatus());
+               }
+
+               return fieldsValidator;
+       }
+
+       /**
+        * RESTful service method to delete a menu item
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param menuId
+        *            menu identifier
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/functionalMenuItem/{menuId}" }, method = RequestMethod.DELETE)
+       public FieldsValidator deleteFunctionalMenuItem(HttpServletRequest request, @PathVariable("menuId") Long menuId,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "deleteFunctionalMenuItem");
+               } else {
+                       fieldsValidator = functionalMenuService.deleteFunctionalMenuItem(menuId);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItem", "DELETE result =",
+                                       response.getStatus());
+               }
+
+               return fieldsValidator;
+       }
+
+       /**
+        * RESTful service to regenerate table
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/regenerateFunctionalMenuAncestors" }, method = RequestMethod.GET)
+       public FieldsValidator regenerateAncestorTable(HttpServletRequest request, HttpServletResponse response) {
+               // TODO: should only the superuser be allowed to use this API?
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "deleteFunctionalMenuItem");
+               } else {
+                       fieldsValidator = functionalMenuService.regenerateAncestorTable();
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/regenerateAncestorTable", "GET result =",
+                                       response.getStatus());
+               }
+
+               return fieldsValidator;
+       }
+
+       /**
+        * RESful service to set a favorite item.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param menuItemJson
+        *            FunctionalMenuItemWithRoles
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/setFavoriteItem" }, method = RequestMethod.POST)
+       public FieldsValidator addFavoriteItem(HttpServletRequest request,
+                       @RequestBody FavoritesFunctionalMenuItem menuItemJson, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               menuItemJson.userId = user.getId();
+               fieldsValidator = functionalMenuService.setFavoriteItem(menuItemJson);
+               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/setFavoriteItem", "Post result =",
+                               response.getStatus());
+
+               return fieldsValidator;
+       }
+
+       /**
+        * RESTful service to get favorites for the current user as identified in the
+        * session
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return List of FavoritesFunctionalMenuItemJson
+        */
+       @RequestMapping(value = {
+                       "/portalApi/getFavoriteItems" }, method = RequestMethod.GET, produces = "application/json")
+       public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<FavoritesFunctionalMenuItemJson> favorites = functionalMenuService.getFavoriteItems(user.getId());
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getFavoriteItems", "GET result =",
+                               response.getStatus());
+               return favorites;
+       }
+
+       /**
+        * RESTful service to delete a favorite menu item for the current user as
+        * identified in the session.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param menuId
+        *            menu identifier
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/removeFavoriteItem/{menuId}" }, method = RequestMethod.DELETE)
+       public FieldsValidator deleteFavoriteItem(HttpServletRequest request, @PathVariable("menuId") Long menuId,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               Long userId = user.getId();
+               fieldsValidator = functionalMenuService.removeFavoriteItem(userId, menuId);
+               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               EcompPortalUtils.logAndSerializeObject(logger, "/deleteFavoriteItem", "DELETE result =", response.getStatus());
+
+               return fieldsValidator;
+       }
+
+       /**
+        * RESTful service to get user information: user's first and last names, org
+        * user ID, email and last-login. (Actually has nothing to do with the real
+        * functional menu.) First attempts to get the information from the Tomcat
+        * session (i.e., the CSP cookie); if that fails, calls the shared context
+        * service to read the information from the database. Gives back what it found,
+        * any of which may be null, as a JSON collection.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return JSON collection of key-value pairs shown below.
+        */
+       @RequestMapping(value = {
+                       "/portalApi/functionalMenuStaticInfo" }, method = RequestMethod.GET, produces = "application/json")
+       public String getFunctionalMenuStaticInfo(HttpServletRequest request, HttpServletResponse response) {
+
+               // Get user details from session
+               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuStaticInfo: getting user info");
+               String fnMenuStaticResponse = null;
+               try {
+                       String orgUserIdStr = null, firstNameStr = null, lastNameStr = null, emailStr = null, lastLogin = null;
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       firstNameStr = user.getFirstName();
+                       lastNameStr = user.getLastName();
+                       orgUserIdStr = user.getOrgUserId();
+                       emailStr = user.getEmail();
+                       if (emailStr == null || emailStr.equals("")) {
+                               EPUser userResult = searchService.searchUserByUserId(orgUserIdStr);
+                               emailStr = userResult.getEmail();
+                       }
+                       SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ssZ");
+                       Date lastLoginDate = user.getLastLoginDate();
+                       if (lastLoginDate == null) {
+                               // should never happen
+                               logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuStaticInfo: no last login in session");
+                               lastLogin = "no last login available";
+                       } else {
+                               lastLogin = sdf.format(lastLoginDate);
+                       }
+
+                       // If any item is missing from session, try the Shared Context
+                       // service.
+                       SharedContext orgUserIdSC = null, firstNameSC = null, lastNameSC = null, emailSC = null;
+                       String sessionId = request.getSession().getId();
+                       if (firstNameStr == null)
+                               firstNameSC = sharedContextService.getSharedContext(sessionId,
+                                               EPCommonSystemProperties.USER_FIRST_NAME);
+                       if (lastNameStr == null)
+                               lastNameSC = sharedContextService.getSharedContext(sessionId, EPCommonSystemProperties.USER_LAST_NAME);
+                       if (emailStr == null)
+                               emailSC = sharedContextService.getSharedContext(sessionId, EPCommonSystemProperties.USER_EMAIL);
+                       if (orgUserIdStr == null)
+                               orgUserIdSC = sharedContextService.getSharedContext(sessionId,
+                                               EPCommonSystemProperties.USER_ORG_USERID);
+
+                       // Build the response
+                       Map<String, String> map = new HashMap<String, String>();
+                       map.put("firstName",
+                                       firstNameStr != null ? firstNameStr : (firstNameSC != null ? firstNameSC.getCvalue() : null));
+                       map.put("lastName",
+                                       lastNameStr != null ? lastNameStr : (lastNameSC != null ? lastNameSC.getCvalue() : null));
+                       map.put("email", emailStr != null ? emailStr : (emailSC != null ? emailSC.getCvalue() : null));
+                       map.put("userId",
+                                       orgUserIdStr != null ? orgUserIdStr : (orgUserIdSC != null ? orgUserIdSC.getCvalue() : null));
+                       map.put("last_login", lastLogin);
+                       JSONObject j = new JSONObject(map);
+                       fnMenuStaticResponse = j.toString();
+                       // Be chatty in the log
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuStaticInfo", "GET result =",
+                                       fnMenuStaticResponse);
+               } catch (Exception e) {
+                       // Should never happen.
+                       logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuStaticInfo failed", e);
+                       // Return a real error?
+                       // fnMenuStaticResponse = "{ \"status\": \"error\", \"message\": \""
+                       // + e.toString() + "\" }";
+                       // But the angular controller expects null on error.
+               }
+               return fnMenuStaticResponse;
+       }
+
+       private Comparator<BusinessCardApplicationRole> getUserAppRolesComparator = new Comparator<BusinessCardApplicationRole>() {
+               public int compare(BusinessCardApplicationRole o1, BusinessCardApplicationRole o2) {
+                       return o1.getAppName().compareTo(o2.getAppName());
+               }
+       };
+
+       /**
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param userId
+        *            user ID
+        * @return List<BusinessCardApplicationRolesList>
+        * @throws IOException
+        *             on error
+        */
+       @RequestMapping(value = {
+                       "/portalApi/userApplicationRoles" }, method = RequestMethod.GET, produces = "application/json")
+       public List<BusinessCardApplicationRolesList> getAppList(HttpServletRequest request,
+                       @RequestParam("userId") String userId) throws IOException {
+
+               List<BusinessCardApplicationRolesList> AppRoles = null;
+               try {
+                       List<BusinessCardApplicationRole> userAppRoleList = functionalMenuService.getUserAppRolesList(userId);
+
+                       Collections.sort(userAppRoleList, getUserAppRolesComparator);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApplicationRoles", "result =",
+                                       userAppRoleList);
+
+                       AppRoles = new ArrayList<BusinessCardApplicationRolesList>();
+                       for (BusinessCardApplicationRole userAppRole : userAppRoleList) {
+                               boolean found = false;
+                               List<String> roles = null;
+
+                               for (BusinessCardApplicationRolesList app : AppRoles) {
+                                       if (app.getAppName().equals(userAppRole.getAppName())) {
+                                               roles = app.getRoleNames();
+                                               roles.add(userAppRole.getRoleName());
+                                               app.setRoleNames(roles);
+                                               found = true;
+                                               break;
+                                       }
+                               }
+
+                               if (!found) {
+                                       roles = new ArrayList<String>();
+                                       roles.add(userAppRole.getRoleName());
+                                       AppRoles.add(new BusinessCardApplicationRolesList(userAppRole.getAppName(), roles));
+                               }
+
+                               Collections.sort(roles);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppList failed", e);
+               }
+
+               return AppRoles;
+
+       }
+}
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
new file mode 100644 (file)
index 0000000..b590c5e
--- /dev/null
@@ -0,0 +1,90 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+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.RestController;
+import org.onap.portalapp.controller.EPUnRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.GetAccessResult;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.GetAccessService;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class GetAccessController extends EPUnRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(GetAccessController.class);
+
+       @Autowired
+       private GetAccessService getAccessService;
+
+       /**
+        * Sorts the list by ECOMP function name.
+        */
+       private Comparator<GetAccessResult> getAccessComparator = new Comparator<GetAccessResult>() {
+               public int compare(GetAccessResult o1, GetAccessResult o2) {
+                       return o1.getAppName().compareTo(o2.getAppName());
+               }
+       };
+       
+       @RequestMapping(value = { "/portalApi/getAppList" }, method = RequestMethod.GET, produces = "application/json")
+       public List<GetAccessResult> getAppList(HttpServletRequest request) throws IOException {
+               List<GetAccessResult> appsList = null;
+               EPUser user = EPUserUtils.getUserSession(request);
+               appsList = getAccessService.getAppAccessList(user);
+               Collections.sort(appsList, getAccessComparator);
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getAppList", "result =", appsList);
+               return appsList;
+       }
+}
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
new file mode 100644 (file)
index 0000000..80e16b5
--- /dev/null
@@ -0,0 +1,249 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+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.RestController;
+import org.onap.portalapp.controller.EPUnRestrictedBaseController;
+import org.onap.portalapp.portal.listener.HealthMonitor;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import com.google.gson.Gson;
+
+/**
+ * This controller processes requests for the health-check feature implemented
+ * in the HealthMonitor, which runs in its own thread. These requests do not
+ * require any authentication nor an active user session.
+ */
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class HealthCheckController extends EPUnRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class);
+
+       private class HealthStatus {
+               public int statusCode;
+               @SuppressWarnings("unused")
+               public String body;
+
+               public HealthStatus(int code, String body) {
+                       this.statusCode = code;
+                       this.body = body;
+               }
+       }
+
+       private class HealthStatusInfo {
+               HealthStatusInfo(String healthCheckComponent) {
+                       this.healthCheckComponent = healthCheckComponent;
+                       this.healthCheckStatus = statusUp; // Default value
+                       this.version = "";
+                       this.description = statusOk; // Default value
+                       this.hostName = "";
+                       this.ipAddress = "";
+                       this.dbClusterStatus = "";
+                       this.dbPermissions = "";
+               }
+
+               @SuppressWarnings("unused")
+               public String healthCheckComponent;
+               @SuppressWarnings("unused")
+               public String healthCheckStatus;
+               @SuppressWarnings("unused")
+               public String version;
+               @SuppressWarnings("unused")
+               public String description;
+               @SuppressWarnings("unused")
+               public String hostName;
+               @SuppressWarnings("unused")
+               public String ipAddress;
+               @SuppressWarnings("unused")
+               public String dbClusterStatus;
+               @SuppressWarnings("unused")
+               public String dbPermissions;
+       }
+
+       private final String statusUp = "UP";
+       private final String statusDown = "DOWN";
+       private final String statusOk = "OK";
+
+       @RequestMapping(value = { "/portalApi/healthCheck" }, method = RequestMethod.GET, produces = "application/json")
+       public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
+               HealthStatus healthStatus = new HealthStatus(500, "");
+
+               // Return the status as 500 if it suspended due to manual fail over
+               if (HealthMonitor.isSuspended) {
+                       healthStatus.body = "Suspended";
+                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE,
+                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+                       return healthStatus;
+               }
+
+               try {
+                       boolean overallStatus = true;
+
+                       List<HealthStatusInfo> statusCollection = new ArrayList<HealthStatusInfo>();
+
+                       HealthStatusInfo beInfo = new HealthStatusInfo("BE");
+                       beInfo.hostName = EcompPortalUtils.getMyHostName();
+                       beInfo.ipAddress = EcompPortalUtils.getMyIpAdddress();
+                       if (!HealthMonitor.isBackEndUp()) {
+                               overallStatus = false;
+                               beInfo.healthCheckStatus = statusDown;
+                               beInfo.description = "Check the logs for more details";
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckError);
+                       }
+                       statusCollection.add(beInfo);
+
+                       HealthStatusInfo feInfo = new HealthStatusInfo("FE");
+                       if (!HealthMonitor.isFrontEndUp()) {
+                               overallStatus = false;
+                               feInfo.healthCheckStatus = statusDown;
+                               feInfo.description = "Check the logs for more details";
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.FeHealthCheckError);
+                       }
+                       statusCollection.add(feInfo);
+
+                       HealthStatusInfo dbInfo = new HealthStatusInfo("DB");
+                       if (!HealthMonitor.isDatabaseUp()) {
+                               overallStatus = false;
+                               dbInfo.healthCheckStatus = statusDown;
+                               dbInfo.description = "Check the logs for more details";
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
+                       }
+
+                       if (!HealthMonitor.isClusterStatusOk()) {
+                               dbInfo.dbClusterStatus = "Problem, check the logs for more details";
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
+                       } else {
+                               dbInfo.dbClusterStatus = statusOk;
+                       }
+
+                       if (!HealthMonitor.isDatabasePermissionsOk()) {
+                               dbInfo.dbPermissions = "Problem, check the logs for more details";
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
+                       } else {
+                               dbInfo.dbPermissions = statusOk;
+                       }
+                       statusCollection.add(dbInfo);
+
+                       HealthStatusInfo uebInfo = new HealthStatusInfo("UEB");
+                       if (!HealthMonitor.isUebUp()) {
+                               // As per test case review meeting, UEB is considered as
+                               // critical as DB. Hence commenting
+                               // overallStatus = false;
+                               uebInfo.healthCheckStatus = statusDown;
+                               uebInfo.description = "Check the logs for more details";
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError);
+                       }
+                       statusCollection.add(uebInfo);
+
+                       String json = "";
+                       try {
+                               json = new Gson().toJson(statusCollection);
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput);
+                       }
+                       logger.info(EELFLoggerDelegate.debugLogger, json);
+
+                       if (overallStatus) {
+                               healthStatus = new HealthStatus(200, json);
+                       } else {
+                               healthStatus = new HealthStatus(500, json);
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(healthStatus.statusCode));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,    "healthCheck failed", e);
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheck", "GET result =", response.getStatus());
+
+               return healthStatus;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/healthCheckSuspend" }, method = RequestMethod.GET, produces = "application/json")
+       public HealthStatus healthCheckSuspend(HttpServletRequest request, HttpServletResponse response) {
+               HealthStatus healthStatus = new HealthStatus(500, "Suspended for manual failover mechanism");
+
+               HealthMonitor.isSuspended = true;
+               healthStatus.statusCode = 200;
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheckSuspend", "GET result =",
+                               response.getStatus());
+
+               return healthStatus;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/healthCheckResume" }, method = RequestMethod.GET, produces = "application/json")
+       public HealthStatus healthCheckResume(HttpServletRequest request, HttpServletResponse response) {
+               HealthStatus healthStatus = new HealthStatus(500, "Resumed from manual failover mechanism");
+
+               HealthMonitor.isSuspended = false;
+               healthStatus.statusCode = 200;
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheckResume", "GET result =",
+                               response.getStatus());
+               return healthStatus;
+       }
+
+       @RequestMapping(value = { "/portalApi/ping" }, method = RequestMethod.GET, 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());
+
+               return healthStatus;
+       }
+}
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
new file mode 100644 (file)
index 0000000..7f68ab2
--- /dev/null
@@ -0,0 +1,108 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.Attributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+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.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.ManifestService;
+import org.onap.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+/**
+ * This controller responds to a request for the web application manifest,
+ * returning a JSON with the information that was created at build time.
+ * 
+ * Manifest entries have names with hyphens, which means Javascript code can't
+ * simply use the shorthand object.key; instead use object['key'].
+ */
+@RestController
+@Configuration("manifestPortalController")
+@EnableAspectJAutoProxy
+@RequestMapping("/")
+@EPAuditLog
+public class ManifestController extends RestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManifestController.class);
+
+       @Autowired
+       private ManifestService manifestService;
+
+       /**
+        * Gets the webapp manifest contents as a JSON object.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return A map of key-value pairs. On success:
+        * 
+        *         <pre>
+        * { "manifest" : { "key1": "value1", "key2": "value2" } }
+        *         </pre>
+        * 
+        *         On failure:
+        * 
+        *         <pre>
+        * { "error": "message" }
+        *         </pre>
+        */
+       @RequestMapping(value = { "/portalApi/manifest" }, method = RequestMethod.GET, produces = "application/json")
+       @ResponseBody
+       public Map<String, Object> getManifest(HttpServletRequest request) {
+               Map<String, Object> response = new HashMap<String, Object>();
+               try {
+                       Attributes attributes = manifestService.getWebappManifest();
+                       response.put("manifest", attributes);
+               } catch (Exception ex) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getManifest: failed to read manifest", ex);
+                       response.put("error", "failed to get manifest: " + ex.toString());
+               }
+               return response;
+       }
+
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..4530266
--- /dev/null
@@ -0,0 +1,156 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.MicroserviceData;
+import org.onap.portalapp.portal.domain.WidgetCatalog;
+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.ConsulHealthService;
+import org.onap.portalapp.portal.service.MicroserviceService;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+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.RestController;
+import org.springframework.web.client.RestTemplate;
+
+@SuppressWarnings("unchecked")
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class MicroserviceController extends EPRestrictedBaseController {
+       
+       String whatService = "widgets-service";
+       RestTemplate template = new RestTemplate();
+
+       @Autowired
+       private ConsulHealthService consulHealthService;
+
+       @Autowired
+       private MicroserviceService microserviceService;
+
+       @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
+       public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody MicroserviceData newServiceData) throws Exception {
+               if (newServiceData == null) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "MicroserviceData cannot be null or empty");
+               }
+               long serviceId = microserviceService.saveMicroservice(newServiceData);
+
+               try {
+                       microserviceService.saveServiceParameters(serviceId, newServiceData.getParameterList());
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.GET)
+       public List<MicroserviceData> getMicroservice(HttpServletRequest request, HttpServletResponse response)
+                       throws Exception {
+               List<MicroserviceData> list = microserviceService.getMicroserviceData();
+               return list;
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.PUT)
+       public PortalRestResponse<String> updateMicroservice(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("serviceId") long serviceId, @RequestBody MicroserviceData newServiceData) throws Exception {
+
+               if (newServiceData == null) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "MicroserviceData cannot be null or empty");
+               }
+               try {
+                       microserviceService.updateMicroservice(serviceId, newServiceData);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+       
+       @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.DELETE)
+       public PortalRestResponse<String> deleteMicroservice(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("serviceId") long serviceId) throws Exception {
+               try {
+                       ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
+                       };
+                       // If this service is assoicated with widgets, cannnot be deleted
+                       ResponseEntity<List<WidgetCatalog>> ans = (ResponseEntity<List<WidgetCatalog>>) template.exchange(
+                                       EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+                                                       + "/widget/microservices/widgetCatalog/service/" + serviceId,
+                                       HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef);
+                       List<WidgetCatalog> widgets = ans.getBody();
+                       if(widgets.size() == 0)
+                               microserviceService.deleteMicroservice(serviceId);
+                       else{
+                               StringBuilder sb = new StringBuilder();
+                               for(int i = 0; i < widgets.size(); i++){
+                                       sb.append("'" + widgets.get(i).getName() + "' ");
+                                       if(i < (widgets.size()-1)){
+                                               sb.append(",");
+                                       }
+                               }
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.WARN, "SOME WIDGETS ASSOICATE WITH THIS SERVICE", sb.toString());
+                       }
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..934d8f5
--- /dev/null
@@ -0,0 +1,115 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPUnRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.MicroserviceProxyService;
+import org.onap.portalapp.util.EPUserUtils;
+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.RestController;
+import org.springframework.web.client.HttpClientErrorException;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class MicroserviceProxyController extends EPUnRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyController.class);
+
+       @Autowired
+       private MicroserviceProxyService microserviceProxyService;
+
+       @RequestMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public String getMicroserviceProxy(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("serviceId") long serviceId) throws Exception {
+               EPUser user = EPUserUtils.getUserSession(request);
+               String answer = "";
+               try {
+                       answer = microserviceProxyService.proxyToDestination(serviceId, user, request);
+               } catch (HttpClientErrorException e) {
+                       answer = e.getResponseBodyAsString();
+               }
+               return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
+       }
+
+       @RequestMapping(value = { "/portalApi/microservice/proxy/parameter/{widgetId}" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public String getMicroserviceProxyByWidgetId(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("widgetId") long widgetId) throws Exception {
+               EPUser user = EPUserUtils.getUserSession(request);
+               String answer = "";
+               try {
+                       answer = microserviceProxyService.proxyToDestinationByWidgetId(widgetId, user, request);
+               } catch (HttpClientErrorException e) {
+                       answer = e.getResponseBodyAsString();
+               }
+               return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
+       }
+
+       /**
+        * Check whether the response is a valid JSON
+        * @param response
+        * @return true if the response is valid JSON, otherwise, false
+        */
+       private boolean isValidJSON(String response) {
+               try {
+                       final ObjectMapper mapper = new ObjectMapper();
+                       mapper.readTree(response);
+                       return true;
+               } 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
new file mode 100644 (file)
index 0000000..e77f8f9
--- /dev/null
@@ -0,0 +1,230 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EcompAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+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.PortalAdminService;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.PortalAdmin;
+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.domain.AuditLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+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.RestController;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class PortalAdminController extends EPRestrictedBaseController {
+       @Autowired
+       PortalAdminService portalAdminService;
+       @Autowired
+       AdminRolesService adminRolesService;
+       @Autowired
+       AuditService auditService;
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalAdminController.class);
+
+       @RequestMapping(value = { "/portalApi/portalAdmins" }, method = RequestMethod.GET, produces = "application/json")
+       public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<PortalAdmin> portalAdmins = null;
+               if (user == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, null user");
+                       EcompPortalUtils.setBadPermissions(user, response, "getPortalAdmins");
+               } else if (!adminRolesService.isSuperAdmin(user)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, bad permissions");
+                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
+               } else {
+                       // return the list of portal admins
+                       portalAdmins = portalAdminService.getPortalAdmins();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "portalAdmins: called getPortalAdmins()");
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getPortalAdmins", "result =", portalAdmins);
+               }
+
+               return portalAdmins;
+       }
+
+       /**
+        * RESTful service method to create a new portal admin. Requirement: you
+        * must be the Ecomp portal super admin user.
+        * @param request 
+        * @param userId 
+        * @param response 
+        * @return FieldsValidator 
+        */
+       @RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
+       public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userId,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (user == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin, null user");
+                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
+               } else if (!adminRolesService.isSuperAdmin(user)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin bad permissions");
+                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
+               } else {
+                       fieldsValidator = portalAdminService.createPortalAdmin(userId);
+                       int statusCode = fieldsValidator.httpStatusCode.intValue();
+                       response.setStatus(statusCode);
+                       if (statusCode == 200) {
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_ADD_PORTAL_ADMIN);
+                               auditLog.setAffectedRecordId(userId);
+                               try {
+                                       auditService.logActivity(auditLog, null);
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "createPortalAdmin: failed for save audit log", e);
+                               }
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("PortalAdminController.createPortalAdmin",
+                                                               EcompAuditLog.CD_ACTIVITY_ADD_PORTAL_ADMIN, user.getOrgUserId(), userId,
+                                                               "A new Portal Admin has been added"));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       }
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalAdmin", "POST result =", response.getStatus());
+
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = { "/portalApi/portalAdmin/{userInfo}" }, method = RequestMethod.DELETE)
+       public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("userInfo") String userInfo,
+                       HttpServletResponse response) {
+               int userIdIdx = userInfo.indexOf("-");
+               Long userId = null;
+               String sbcid = null;
+               FieldsValidator fieldsValidator = null;
+               try {
+                       if (userIdIdx == -1) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin missing userId");
+                               return fieldsValidator;
+                       } else {
+                               String userIdStr = userInfo.substring(0, userIdIdx);
+                               userId = Long.valueOf(userIdStr);
+                               sbcid = userInfo.substring(userIdIdx + 1, userInfo.length());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin error while parsing the userInfo", e);
+               }
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "deletePortalAdmin");
+               } else {
+                       fieldsValidator = portalAdminService.deletePortalAdmin(userId);
+                       int statusCode = fieldsValidator.httpStatusCode.intValue();
+                       response.setStatus(statusCode);
+                       if (statusCode == 200) {
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_DELETE_PORTAL_ADMIN);
+                               auditLog.setAffectedRecordId(sbcid);
+                               auditService.logActivity(auditLog, null);
+                               
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("PortalAdminController.deletePortalAdmin",
+                                                               EcompAuditLog.CD_ACTIVITY_DELETE_PORTAL_ADMIN, user.getOrgUserId(), sbcid,
+                                                               "A Portal Admin has been deleted"));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       }
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalAdmin", "DELETE result =", response.getStatus());
+
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/adminAppsRoles/{appId}" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EPRole> rolesByApp = null;
+
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getUserApps");
+                       } else {
+                               rolesByApp = adminRolesService.getRolesByApp(user, appId);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,    "getRolesByApp failed", e);
+               }
+
+               return rolesByApp;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..1433fb2
--- /dev/null
@@ -0,0 +1,747 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.json.JSONObject;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.controller.core.RoleController;
+import org.onap.portalapp.controller.core.RoleListController;
+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.EcompAuditLog;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.exceptions.DuplicateRecordException;
+import org.onap.portalapp.portal.exceptions.InvalidApplicationException;
+import org.onap.portalapp.portal.exceptions.InvalidRoleException;
+import org.onap.portalapp.portal.exceptions.NonCentralizedAppException;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+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.EPAppService;
+import org.onap.portalapp.portal.service.ExternalAccessRolesService;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.JsonMessage;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+
+/**
+ * Proxies REST calls to role-management functions that arrive on paths
+ * /portalApi/* over to controller methods provided by the SDK-Core library.
+ * Those controller methods are mounted on paths not exposed by the Portal FE.
+ */
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class RoleManageController extends EPRestrictedBaseController {
+       private static final String ROLE_INVALID_CHARS = "%=():,\"\"";
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RoleManageController.class);
+
+       @Autowired
+       private RoleController roleController;
+
+       @Autowired
+       private RoleListController roleListController;
+       
+       @Autowired
+       private EPAppService appService;
+
+       @Autowired
+       private AuditService auditService;
+       
+       @Autowired
+       private ExternalAccessRolesService externalAccessRolesService;
+       
+       
+       @Autowired
+       private AdminRolesService adminRolesService;
+
+       /**
+        * Calls an SDK-Core library method that gets the available roles and writes
+        * them to the request object. Portal specifies a Hibernate mappings from
+        * the Role class to the fn_role_v view, which ensures that only Portal
+        * (app_id is null) roles are fetched.
+        * 
+        * Any method declared void (no return value) or returning null causes the
+        * audit log aspect method to declare failure. TODO: should return a JSON
+        * string.
+        * 
+        * @param request
+        * @param response
+        * @throws Exception 
+        */
+       
+       @RequestMapping(value = { "/portalApi/get_roles/{appId}" }, method = RequestMethod.GET)
+       public void getRoles(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId) throws Exception {
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       EPApp requestedApp = appService.getApp(appId);
+                       if (isAuthorizedUser(user, requestedApp)) {
+                               fieldsValidation(requestedApp);
+                               if (requestedApp.getCentralAuth()) {
+                                       List<CentralV2Role> answer = null;
+                                       Map<String, Object> model = new HashMap<>();
+                                       ObjectMapper mapper = new ObjectMapper();
+                                       answer = externalAccessRolesService.getRolesForApp(requestedApp.getUebKey());
+                                       model.put("availableRoles", answer);
+                                       JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
+                                       JSONObject j = new JSONObject(msg);
+                                       response.getWriter().write(j.toString());
+                               } else
+                                       throw new NonCentralizedAppException(requestedApp.getName());
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger, "RoleManageController.getRoles, Unauthorized user");
+                               SendErrorForUnauthorizedUser(response, user);
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoles failed", e);
+               }
+       }
+       
+       
+
+       @RequestMapping(value = { "/portalApi/role_list/toggleRole/{appId}/{roleId}" }, method = RequestMethod.POST)
+       public Map<String, Object> toggleRole(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId,
+                       @PathVariable("roleId") Long roleId) throws Exception {
+               EPApp requestedApp = null;
+               String restcallStatus = null;
+               HashMap<String, Object> responseMap = new HashMap<>();
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       requestedApp = appService.getApp(appId);
+                       if (isAuthorizedUser(user, requestedApp)) {
+                               fieldsValidation(requestedApp);
+                               ObjectMapper mapper = new ObjectMapper();
+                               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                               CentralV2Role domainRole = externalAccessRolesService.getRoleInfo(roleId, requestedApp.getUebKey());
+                               // role. toggle active ind
+                               boolean active = domainRole.isActive();
+                               domainRole.setActive(!active);
+
+                               String result = mapper.writeValueAsString(domainRole);
+                               Role newRole = externalAccessRolesService.ConvertCentralRoleToRole(result);
+                               ExternalRequestFieldsValidator externalRequestFieldsValidator = externalAccessRolesService
+                                               .saveRoleForApplication(newRole, requestedApp.getUebKey());
+                               boolean getAddResponse = externalRequestFieldsValidator.isResult();
+                               if (getAddResponse) {
+                                       restcallStatus = "Success";
+                                       logger.info(EELFLoggerDelegate.auditLogger, "Toggle active status for role " + domainRole.getId());
+                               } else {
+                                       restcallStatus = "Toggle Role Failed";
+                                       logger.info(EELFLoggerDelegate.auditLogger, "Toggle Role Failed " + domainRole.getId());
+                               }
+                               responseMap.put("restcallStatus", restcallStatus);
+                               responseMap.put("availableRoles", externalAccessRolesService.getRolesForApp(requestedApp.getUebKey()));
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger, "RoleManageController.toggleRole, Unauthorized user");
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               responseMap.put("restcallStatus", " Unauthorized user");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "toggleRole failed", e);
+                       throw e;
+               }
+               return responseMap;
+       }
+       
+       @RequestMapping(value = { "/portalApi/role_list/removeRole/{appId}/{roleId}" }, method = RequestMethod.POST)
+       public Map<String, Object> removeRole(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId,
+                       @PathVariable("roleId") Long roleId) throws Exception {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               EPApp requestedApp = null;
+               String restCallStatus = null;
+               HashMap<String, Object> responseMap = new HashMap<>();
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = null;
+               try {
+                       requestedApp = appService.getApp(appId);
+                       if (isAuthorizedUser(user, requestedApp)) {
+                               fieldsValidation(requestedApp);
+                               if (requestedApp.getCentralAuth()) {
+                                       externalRequestFieldsValidator = externalAccessRolesService.deleteDependencyRoleRecord(roleId,
+                                                       requestedApp.getUebKey(), user.getOrgUserId());
+                                       boolean deleteResponse = externalRequestFieldsValidator.isResult();
+                                       if (deleteResponse) {
+                                               restCallStatus = "Success";
+                                               EPUser requestedUser = (EPUser) externalAccessRolesService.getUser(user.getOrgUserId()).get(0);
+                                               EPApp app = (EPApp) externalAccessRolesService.getApp(requestedApp.getUebKey()).get(0);
+                                               logger.info(EELFLoggerDelegate.applicationLogger, "deleteRole: succeeded for app {}, role {}",
+                                                               app.getId(), roleId);
+                                               String activityCode = EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE;
+                                               AuditLog auditLog = getAuditInfo(requestedUser, activityCode);
+                                               auditLog.setComments(EcompPortalUtils.truncateString(
+                                                               "Deleted role for app:" + app.getId() + " and role:'" + roleId + "'",
+                                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                                               auditService.logActivity(auditLog, null);
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                                               logger.info(EELFLoggerDelegate.auditLogger,
+                                                               EPLogUtil.formatAuditLogMessage("RoleManageController.removeRole",
+                                                                               EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE,
+                                                                               String.valueOf(requestedUser.getId()), requestedUser.getOrgUserId(),
+                                                                               roleId.toString()));
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                                               MDC.remove(SystemProperties.MDC_TIMER);
+                                       } else {
+                                               restCallStatus = "Remove Role failed";
+                                               responseMap.put("error", externalRequestFieldsValidator.getDetailMessage());
+                                               logger.error(EELFLoggerDelegate.errorLogger, "removeRole failed");
+                                       }
+                                       responseMap.put("restCallStatus", restCallStatus);
+                                       responseMap.put("availableRoles",
+                                                       externalAccessRolesService.getRolesForApp(requestedApp.getUebKey()));
+                               } else
+                                       throw new NonCentralizedAppException(requestedApp.getName());
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger, "RoleManageController.removeRole, Unauthorized user");
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               responseMap.put("restCallStatus", " Unauthorized user");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "removeRole failed", e);
+                       throw e;
+               }
+               return responseMap;
+       }
+       
+       @RequestMapping(value = { "/portalApi/role/saveRole/{appId}" }, method = RequestMethod.POST)
+       public Map<String, Object> saveRole(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("appId") Long appId) throws Exception {
+               EPUser user = EPUserUtils.getUserSession(request);
+               String responseString = null;
+               HashMap<String, Object> responseMap = new HashMap<>();
+               try {
+                       EPApp requestedApp = appService.getApp(appId);
+                       if (isAuthorizedUser(user, requestedApp)) {
+                               fieldsValidation(requestedApp);
+                               if (requestedApp != null && requestedApp.getCentralAuth().equals(true)) {
+                                       ObjectMapper mapper = new ObjectMapper();
+                                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                                       JsonNode root = mapper.readTree(request.getReader());
+                                       CentralV2Role role = mapper.readValue(root.get("role").toString(), CentralV2Role.class);
+
+                                       List<CentralV2Role> childRoles = mapper.readValue(root.get("childRoles").toString(),
+                                                       TypeFactory.defaultInstance().constructCollectionType(List.class, CentralV2Role.class));
+                                       List<CentralV2RoleFunction> roleFunctions = mapper.readValue(root.get("roleFunctions").toString(),
+                                                       TypeFactory.defaultInstance().constructCollectionType(List.class,
+                                                                       CentralV2RoleFunction.class));
+                                       if (role.getId() != null && StringUtils.containsAny(role.getName(), ROLE_INVALID_CHARS)) {
+                                               throw new InvalidRoleException("Invalid role name found for '" + role.getName()
+                                                               + "'. Any one of the following characters '%,(),=,:,comma, and double quotes' are not allowed");
+                                       }
+                                       CentralV2Role domainRole;
+                                       if (role.getId() != null) {
+                                               domainRole = externalAccessRolesService.getRoleInfo(role.getId(), requestedApp.getUebKey());
+                                               domainRole.setName(role.getName());
+                                               domainRole.setPriority(role.getPriority());
+                                       } else {
+                                               // check for existing role of same name
+                                               List<CentralV2Role> roles = externalAccessRolesService.getRolesForApp(requestedApp.getUebKey());
+                                               for (CentralV2Role existRole : roles)
+                                                       if (existRole.getName().equalsIgnoreCase(role.getName()))
+                                                               throw new DuplicateRecordException("role already exists: " + existRole.getName());
+
+                                               domainRole = new CentralV2Role();
+                                               domainRole.setName(role.getName());
+                                               domainRole.setPriority(role.getPriority());
+                                               if (role.getChildRoles() != null && role.getChildRoles().size() > 0) {
+                                                       for (Object childRole : childRoles) {
+                                                               domainRole.addChildRole((CentralV2Role) childRole);
+                                                       }
+                                               }
+                                       }
+                                       if (role.getRoleFunctions() != null && role.getRoleFunctions().size() > 0) {
+                                               domainRole.setRoleFunctions(new TreeSet<CentralV2RoleFunction>());
+                                               for (CentralV2RoleFunction roleFunction : roleFunctions) {
+                                                       if (roleFunction.getType() == null && roleFunction.getAction() == null) {
+                                                               throw new InvalidRoleException("Invalid role function type:" + roleFunction.getType()
+                                                                               + " and action: " + roleFunction.getAction() + " found while saving!");
+                                                       }
+                                                       roleFunction.setCode(externalAccessRolesService.encodeFunctionCode(roleFunction.getCode()));
+                                                       roleFunction.setCode(roleFunction.getType() + "|" + roleFunction.getCode() + "|"
+                                                                       + roleFunction.getAction());
+                                                       domainRole.addRoleFunction((CentralV2RoleFunction) roleFunction);
+                                               }
+                                       } else {
+                                               domainRole.setRoleFunctions(new TreeSet<>());
+                                       }
+                                       String result = mapper.writeValueAsString(domainRole);
+                                       Role newRole = externalAccessRolesService.ConvertCentralRoleToRole(result);
+                                       ExternalRequestFieldsValidator externalRequestFieldsValidator = externalAccessRolesService
+                                                       .saveRoleForApplication(newRole, requestedApp.getUebKey());
+                                       boolean getAddResponse = externalRequestFieldsValidator.isResult();
+                                       if (getAddResponse) {
+                                               String activityCode = (role.getId() == null) ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_ROLE
+                                                               : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_ROLE_AND_FUNCTION;
+                                               logger.info(EELFLoggerDelegate.applicationLogger, "saveRole: succeeded for app {}, role {}",
+                                                               requestedApp.getId(), role.getName());
+                                               AuditLog auditLog = new AuditLog();
+                                               auditLog.setUserId(user.getId());
+                                               auditLog.setActivityCode(activityCode);
+                                               auditLog.setComments(EcompPortalUtils.truncateString(
+                                                               "saveRole role for app:" + requestedApp.getId() + " and role:'" + role.getName() + "'",
+                                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                                               auditLog.setAffectedRecordId(user.getOrgUserId());
+                                               auditService.logActivity(auditLog, null);
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                                               logger.info(EELFLoggerDelegate.auditLogger,
+                                                               EPLogUtil.formatAuditLogMessage("RoleManageController.saveRole", activityCode,
+                                                                               String.valueOf(user.getId()), user.getOrgUserId(), role.getName()));
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                                               MDC.remove(SystemProperties.MDC_TIMER);
+                                               responseMap.put("status", "Success");
+                                               responseMap.put("role", domainRole);
+                                       } else {
+                                               if (externalRequestFieldsValidator.getDetailMessage().contains("406")) {
+                                                       externalRequestFieldsValidator.setDetailMessage("Failed to save role for '" + role.getName()
+                                                                       + "'. Any one of the following characters '%,(),=,:,comma, and double quotes' are not allowed");
+                                               }
+                                               responseMap.put("status", "SaveRole Failed");
+                                               responseMap.put("role", responseString);
+                                               responseMap.put("error", externalRequestFieldsValidator.getDetailMessage());
+                                               logger.error(EELFLoggerDelegate.errorLogger, "saveRole failed");
+                                       }
+                               }
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger, "RoleManageController.saveRole, Unauthorized user");
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               responseMap.put("error", " Unauthorized user");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveRole failed", e);
+                       responseMap.put("error", e.getMessage());
+               }
+               return responseMap;
+       }
+
+       @RequestMapping(value = { "/portalApi/role/removeRoleFunction" }, method = RequestMethod.POST)
+       public ModelAndView removeRoleRoleFunction(HttpServletRequest request, HttpServletResponse response)
+                       throws Exception {
+               return getRoleController().removeRoleFunction(request, response);
+       }
+
+       @RequestMapping(value = { "/portalApi/role/addRoleFunction" }, method = RequestMethod.POST)
+       public ModelAndView addRoleRoRoleFunction(HttpServletRequest request, HttpServletResponse response)
+                       throws Exception {
+               return getRoleController().addRoleFunction(request, response);
+       }
+
+       @RequestMapping(value = { "/portalApi/role/removeChildRole" }, method = RequestMethod.POST)
+       public ModelAndView removeChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               return getRoleController().removeChildRole(request, response);
+       }
+
+       @RequestMapping(value = { "/portalApi/role/addChildRole" }, method = RequestMethod.POST)
+       public ModelAndView addChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               return getRoleController().addChildRole(request, response);
+       }
+
+       @RequestMapping(value = { "/portalApi/get_role/{appId}/{roleId}" }, method = RequestMethod.GET)
+       public void getRole(HttpServletRequest request, HttpServletResponse response, @PathVariable("appId") Long appId,
+                       @PathVariable("roleId") Long roleId) throws Exception {
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                               ObjectMapper mapper = new ObjectMapper();
+                               EPApp requestedApp = appService.getApp(appId);
+                               if (isAuthorizedUser(user, requestedApp)) {
+                                       fieldsValidation(requestedApp);
+                                       if (requestedApp.getCentralAuth()) {
+                                               CentralV2Role answer = externalAccessRolesService.getRoleInfo(roleId, requestedApp.getUebKey());
+                                               logger.info(EELFLoggerDelegate.applicationLogger, "role_id" + roleId);
+                                               Map<String, Object> model = new HashMap<>();
+                                               model.put("availableRoleFunctions", mapper.writeValueAsString(
+                                                               externalAccessRolesService.getRoleFuncList(requestedApp.getUebKey())));
+                                               model.put("availableRoles",
+                                                               mapper.writeValueAsString(getAvailableChildRoles(requestedApp.getUebKey(), roleId)));
+                                               model.put("role", mapper.writeValueAsString(answer));
+                                               JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
+                                               JSONObject j = new JSONObject(msg);
+                                               response.getWriter().write(j.toString());
+                                       } else
+                                               throw new NonCentralizedAppException(requestedApp.getName());
+                               } else {
+                                       logger.info(EELFLoggerDelegate.auditLogger,
+                                                       "RoleManageController.getRoleFunctionList, Unauthorized user");
+                                       SendErrorForUnauthorizedUser(response, user);
+                               }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRole failed", e);
+                       throw e;
+               }
+       }
+
+       @RequestMapping(value = { "/portalApi/get_role_functions/{appId}" }, method = RequestMethod.GET)
+       public void getRoleFunctionList(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("appId") Long appId) throws Exception {
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                               EPApp requestedApp = appService.getApp(appId);
+                               if (isAuthorizedUser(user, requestedApp)) {
+                                       fieldsValidation(requestedApp);
+                                       if (requestedApp.getCentralAuth()) {
+                                               List<CentralV2RoleFunction> answer = null;
+                                               Map<String, Object> model = new HashMap<>();
+                                               ObjectMapper mapper = new ObjectMapper();
+                                               answer = externalAccessRolesService.getRoleFuncList(requestedApp.getUebKey());
+                                               model.put("availableRoleFunctions", answer);
+                                               JsonMessage msg = new JsonMessage(mapper.writeValueAsString(model));
+                                               JSONObject j = new JSONObject(msg);
+                                               response.getWriter().write(j.toString());
+                                       } else
+                                               throw new NonCentralizedAppException(requestedApp.getName());
+                               } else {
+                                       logger.info(EELFLoggerDelegate.auditLogger,
+                                                       "RoleManageController.getRoleFunctionList, Unauthorized user");
+                                       EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                                       response.getWriter().write("Unauthorized User");
+                               }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunctionList failed", e);
+                       throw e;
+               }
+       }
+
+       @RequestMapping(value = { "/portalApi/role_function_list/saveRoleFunction/{appId}" }, method = RequestMethod.POST)
+       public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response, @RequestBody CentralV2RoleFunction roleFunc,
+                       @PathVariable("appId") Long appId) throws Exception {
+               EPUser user = EPUserUtils.getUserSession(request);
+               boolean saveOrUpdateResponse = false;
+               try {
+                       EPApp requestedApp = appService.getApp(appId);
+                       if (isAuthorizedUser(user, requestedApp)) {
+                               fieldsValidation(requestedApp);
+                               if (requestedApp.getCentralAuth()) {
+                                       saveOrUpdateResponse = externalAccessRolesService.saveCentralRoleFunction(roleFunc, requestedApp);
+                                       if (saveOrUpdateResponse) {
+                                               EPUser requestedUser = externalAccessRolesService.getUser(user.getOrgUserId()).get(0);
+                                               EPApp app = externalAccessRolesService.getApp(requestedApp.getUebKey()).get(0);
+                                               CentralV2RoleFunction function = externalAccessRolesService.getRoleFunction(roleFunc.getCode(),
+                                                               requestedApp.getUebKey());
+                                               String activityCode = (function.getCode() == null)
+                                                               ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION
+                                                               : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION;
+                                               logger.info(EELFLoggerDelegate.applicationLogger,
+                                                               "saveRoleFunction: succeeded for app {}, function {}", app.getId(), roleFunc.getCode());
+                                               AuditLog auditLog = getAuditInfo(requestedUser, activityCode);
+                                               auditLog.setComments(EcompPortalUtils.truncateString("saveRoleFunction role for app:"
+                                                               + app.getId() + " and function:'" + roleFunc.getCode() + "'",
+                                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                                               auditService.logActivity(auditLog, null);
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                                               logger.info(EELFLoggerDelegate.auditLogger,
+                                                               EPLogUtil.formatAuditLogMessage("RoleManageController.saveRoleFunction", activityCode,
+                                                                               String.valueOf(requestedUser.getId()), requestedUser.getOrgUserId(),
+                                                                               roleFunc.getCode()));
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                                               MDC.remove(SystemProperties.MDC_TIMER);
+                                       }
+                               } else
+                                       throw new NonCentralizedAppException(requestedApp.getName() + " is not Centralized Application");
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               "RoleManageController.saveRoleFunction, Unauthorized user");
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Unauthorized User", "Failure");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction: Failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failure");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Saved Successfully!", "Success");
+       }
+
+       @RequestMapping(value = { "/portalApi/role_function_list/removeRoleFunction/{appId}" }, method = RequestMethod.POST)
+       public PortalRestResponse<String> removeRoleFunction(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody String roleFunc, @PathVariable("appId") Long appId) throws Exception {
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       EPApp requestedApp = appService.getApp(appId);
+                       if (isAuthorizedUser(user, requestedApp)) {
+                               fieldsValidation(requestedApp);
+                               if (requestedApp.getCentralAuth()) {
+                                       ObjectMapper mapper = new ObjectMapper();
+                                       String data = roleFunc;
+                                       CentralV2RoleFunction availableRoleFunction = mapper.readValue(data, CentralV2RoleFunction.class);
+                                       CentralV2RoleFunction domainRoleFunction = externalAccessRolesService
+                                                       .getRoleFunction(availableRoleFunction.getCode(), requestedApp.getUebKey());
+                                       boolean getDelFuncResponse = externalAccessRolesService
+                                                       .deleteCentralRoleFunction(domainRoleFunction.getCode(), requestedApp);
+                                       if (getDelFuncResponse) {
+                                               logger.info(EELFLoggerDelegate.applicationLogger,
+                                                               "deleteRoleFunction: succeeded for app {}, role {}", requestedApp.getId(),
+                                                               domainRoleFunction.getCode());
+                                               String activityCode = EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION;
+                                               AuditLog auditLog = getAuditInfo(user, activityCode);
+                                               auditLog.setComments(
+                                                               EcompPortalUtils.truncateString(
+                                                                               "Deleted function for app:" + requestedApp.getId() + " and function code:'"
+                                                                                               + domainRoleFunction.getCode() + "'",
+                                                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                                               auditService.logActivity(auditLog, null);
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,
+                                                               EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                                               logger.info(EELFLoggerDelegate.auditLogger,
+                                                               EPLogUtil.formatAuditLogMessage("RoleManageController.removeRoleFunction",
+                                                                               EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION,
+                                                                               String.valueOf(user.getId()), user.getOrgUserId(),
+                                                                               domainRoleFunction.getCode()));
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                                               MDC.remove(SystemProperties.MDC_TIMER);
+                                               logger.info(EELFLoggerDelegate.auditLogger,
+                                                               "Remove role function " + domainRoleFunction.getName());
+                                       }
+                               } else
+                                       throw new NonCentralizedAppException(requestedApp.getName() + " is not Centralized Application");
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               "RoleManageController.removeRoleFunction, Unauthorized user");
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Unauthorized User", "Failure");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "removeRoleFunction failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failure");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Deleted Successfully!", "Success");
+       }
+
+       @RequestMapping(value = { "/portalApi/centralizedApps" }, method = RequestMethod.GET)
+       public List<CentralizedApp> getCentralizedAppRoles(HttpServletRequest request, HttpServletResponse response, String userId) throws IOException {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<CentralizedApp> applicationsList = null;
+                       if (adminRolesService.isAccountAdmin(user) || adminRolesService.isSuperAdmin(user)) {
+                               applicationsList = externalAccessRolesService.getCentralizedAppsOfUser(userId);
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               "RoleManageController.getCentralizedAppRoles, Unauthorized user");
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                       }
+               return applicationsList;
+       }
+       
+       public RoleListController getRoleListController() {
+               return roleListController;
+       }
+
+       public void setRoleListController(RoleListController roleListController) {
+               this.roleListController = roleListController;
+       }
+
+       public RoleController getRoleController() {
+               return roleController;
+       }
+
+       public void setRoleController(RoleController roleController) {
+               this.roleController = roleController;
+       }
+
+
+       @RequestMapping(value = { "/portalApi/syncRoles" }, method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> syncRoles(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody Long appId) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       EPApp app = appService.getApp(appId);
+                       if (isAuthorizedUser(user, app)) {
+                               fieldsValidation(app);
+                               externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               "RoleManageController.syncRoles, Unauthorized user:" + user.getOrgUserId());
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Unauthorized User", "Failure");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "failed syncRoles", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Sync roles completed successfully!", "Success");
+       }
+       
+       @RequestMapping(value = { "/portalApi/syncFunctions" }, method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> syncFunctions(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody Long appId) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       EPApp app = appService.getApp(appId);
+                       if (isAuthorizedUser(user, app)) {
+                               fieldsValidation(app);
+                               externalAccessRolesService.syncRoleFunctionFromExternalAccessSystem(app);;
+                       } else {
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               "RoleManageController.syncFunctions, Unauthorized user:" + user.getOrgUserId());
+                               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Unauthorized User", "Failure");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "failed syncFunctions", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
+               }
+               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Sync Functions completed successfully!", "Success");
+       }
+
+       public List<CentralV2Role> getAvailableChildRoles(String uebKey, Long roleId) throws Exception {
+               List<CentralV2Role> availableChildRoles = externalAccessRolesService.getRolesForApp(uebKey);
+               if (roleId == null || roleId == 0) {
+                       return availableChildRoles;
+               }
+               CentralV2Role currentRole = externalAccessRolesService.getRoleInfo(roleId, uebKey);
+               Set<CentralV2Role> allParentRoles = new TreeSet<>();
+               allParentRoles = getAllParentRolesAsList(currentRole, allParentRoles);
+               Iterator<CentralV2Role> availableChildRolesIterator = availableChildRoles.iterator();
+               while (availableChildRolesIterator.hasNext()) {
+                       CentralV2Role role = availableChildRolesIterator.next();
+                       if (!role.isActive() || allParentRoles.contains(role) || role.getId().equals(roleId)) {
+                               availableChildRolesIterator.remove();
+                       }
+               }
+               return availableChildRoles;
+       }
+
+       private Set<CentralV2Role> getAllParentRolesAsList(CentralV2Role role, Set<CentralV2Role> allParentRoles) {
+               Set<CentralV2Role> parentRoles = role.getParentRoles();
+               allParentRoles.addAll(parentRoles);
+               Iterator<CentralV2Role> parentRolesIterator = parentRoles.iterator();
+               while (parentRolesIterator.hasNext()) {
+                       getAllParentRolesAsList(parentRolesIterator.next(), allParentRoles);
+               }
+               return allParentRoles;
+       }
+       
+       public AuditLog getAuditInfo(EPUser user, String activityCode)
+       {
+               AuditLog auditLog = new AuditLog();
+               auditLog.setUserId(user.getId());
+               auditLog.setActivityCode(activityCode);
+               auditLog.setAffectedRecordId(user.getOrgUserId());
+               
+               return auditLog;
+       }
+       
+       private void  fieldsValidation(EPApp app) throws Exception{
+               app.getUebKey();
+               List<EPApp> appInfo = externalAccessRolesService.getApp(app.getUebKey());
+               if(appInfo.isEmpty()){
+                       throw new InvalidApplicationException("Invalid uebkey");
+               }
+               if(!appInfo.isEmpty() && EcompPortalUtils.checkIfRemoteCentralAccessAllowed() && appInfo.get(0).getCentralAuth()){
+                       ResponseEntity<String> response = externalAccessRolesService.getNameSpaceIfExists(appInfo.get(0));
+                       if (response.getStatusCode().value() == HttpServletResponse.SC_NOT_FOUND)
+                               throw new InvalidApplicationException("Invalid NameSpace");
+               }
+       }
+       
+       private boolean isAuthorizedUser(EPUser user, EPApp requestedApp) {
+               if (user != null && (adminRolesService.isAccountAdminOfApplication(user, requestedApp)
+                               || (adminRolesService.isSuperAdmin(user) && requestedApp.getId() == PortalConstants.PORTAL_APP_ID)))
+                       return true;
+               return false;
+       }
+
+       private void SendErrorForUnauthorizedUser(HttpServletResponse response, EPUser user) throws IOException {
+               EcompPortalUtils.setBadPermissions(user, response, "createAdmin");
+               response.getWriter().write("Unauthorized User");
+       }
+}
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
new file mode 100644 (file)
index 0000000..b4babfd
--- /dev/null
@@ -0,0 +1,232 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.controller;
+
+import java.util.ArrayList;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemUser;
+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.UserRolesService;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping("/auxapi")
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class RolesApprovalSystemController implements BasicAuthenticationController {
+       
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RolesApprovalSystemController.class);
+
+       @Autowired
+       private UserRolesService userRolesService;
+
+       /**
+        * Creates an application user with the specified roles.
+        * 
+        * @param request
+        * @param extSysUser
+        * @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")
+       public PortalRestResponse<String> postUserProfile(HttpServletRequest request,
+                       @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
+               ExternalRequestFieldsValidator reqResult = null;
+               try {
+                       logger.info(EELFLoggerDelegate.debugLogger, "postUserProfile: request received for app {}, user {}",
+                                       extSysUser.getApplicationName(), extSysUser.getLoginId());
+                       
+                       validateExtSystemUser(extSysUser, true);
+                reqResult = userRolesService.setExternalRequestUserAppRole(extSysUser, "POST");
+                if (!reqResult.isResult())
+                               throw new Exception(reqResult.getDetailMessage());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "postUserProfile: failed for app {}, user {}",
+                                       extSysUser.getApplicationName(), extSysUser.getLoginId(), e);
+                       if(reqResult == null || (!reqResult.isResult()  && !e.getMessage().contains("404") && !e.getMessage().contains("405"))){
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed"); 
+                   } else if(e.getMessage().contains("404")){
+                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed");
+                   } else if(e.getMessage().contains("500")){
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed");
+                       } else if (e.getMessage().contains("405")) {
+                               response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(),
+                                               "save user profile failed");
+                       } else {
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(),
+                                               "save user profile failed");
+                       }
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, reqResult.getDetailMessage(), "Success");
+       }
+
+       /**
+        * Updates an application user to have only the specified roles.
+        * 
+        * @param request
+        * @param extSysUser
+        * @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")
+       public PortalRestResponse<String> putUserProfile(HttpServletRequest request,
+                       @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
+               ExternalRequestFieldsValidator reqResult = null;
+               try {
+                       logger.info(EELFLoggerDelegate.debugLogger, "putUserProfile: request received for app {}, user {}", 
+                                       extSysUser.getApplicationName(), extSysUser.getLoginId());
+                       validateExtSystemUser(extSysUser, true);
+                       reqResult = userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT");
+                        if (!reqResult.isResult())
+                                       throw new Exception(reqResult.getDetailMessage());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserProfile: failed for app {}, user {}",
+                                       extSysUser.getApplicationName(), extSysUser.getLoginId(), e);
+                       if(reqResult == null || (!reqResult.isResult()  && !e.getMessage().contains("404") && !e.getMessage().contains("405"))){
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed"); 
+                   } else if(e.getMessage().contains("404")){
+                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed");
+                       } else if(e.getMessage().contains("500")){
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed");
+                       } else if (e.getMessage().contains("405")) {
+                               response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), "save user profile failed");
+                       } else{
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "save user profile failed");
+                       }
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, reqResult.getDetailMessage() , "Success");
+       }
+
+       /**
+        * Deletes an application user by removing all assigned roles.
+        * 
+        * @param request
+        * @param extSysUser
+        *            This object must have zero roles.
+        * @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")
+       public PortalRestResponse<String> deleteUserProfile(HttpServletRequest request,
+                       @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
+               ExternalRequestFieldsValidator reqResult  = null;
+               try {
+                       logger.info(EELFLoggerDelegate.debugLogger, "deleteUserProfile: request received for app {}, user {}", 
+                                       extSysUser.getApplicationName(), extSysUser.getLoginId());
+                       validateExtSystemUser(extSysUser, false);
+                       // Ignore any roles that might be mistakenly present in the request
+                       extSysUser.setRoles(new ArrayList<ExternalSystemRoleApproval>());
+                       reqResult = userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE");
+                        if (!reqResult.isResult())
+                                       throw new Exception(reqResult.getDetailMessage());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserProfile: failed for app {}, user {}",
+                                       extSysUser.getApplicationName(), extSysUser.getLoginId(), e);
+                       if(reqResult == null || (!reqResult.isResult()  && !e.getMessage().contains("404"))){
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "delete user profile failed"); 
+                   }else if(e.getMessage().contains("404")){
+                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "delete user profile failed");
+                       } else{
+                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
+                                               e.getMessage(), "delete user profile failed");
+                       }
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Deleted Successfully", "Success");
+       }
+
+       /**
+        * Checks for presence of required fields.
+        * 
+        * @param extSysUser
+        * @param rolesRequired
+        *            If true, checks whether roles are present
+        * @throws Exception
+        *             If any field is missing.
+        */
+       private void validateExtSystemUser(ExternalSystemUser extSysUser, boolean rolesRequired) throws Exception {
+               if (extSysUser.getLoginId() == null || extSysUser.getLoginId() == "")
+                       throw new Exception("Request has no login ID");
+               if (extSysUser.getApplicationName() == null || extSysUser.getApplicationName() == "")
+                       throw new Exception("Request has no application name");
+               if (extSysUser.getMyloginrequestId() == null)
+                       throw new Exception("Request has no request ID");
+               if (rolesRequired && (extSysUser.getRoles() == null || extSysUser.getRoles().size() == 0))
+                       throw new Exception("Request has no roles");
+       }
+
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..c676fa9
--- /dev/null
@@ -0,0 +1,141 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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;
+
+import org.json.simple.JSONObject;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.scheduler.SchedulerProperties;
+import org.onap.portalapp.portal.scheduleraux.RestObject;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxResponseWrapper;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxRestInterfaceFactory;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxRestInterfaceIfc;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxUtil;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+/*import org.openecomp.vid.policy.PolicyProperties;
+import org.openecomp.vid.policy.PolicyResponseWrapper;
+import org.openecomp.vid.policy.PolicyRestInterfaceFactory;
+import org.openecomp.vid.policy.PolicyRestInterfaceIfc;
+import org.openecomp.vid.policy.PolicyUtil;*/
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * Controller to handle Policy requests.
+ */
+
+@RestController
+@RequestMapping(PortalConstants.PORTAL_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+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")
+       public ResponseEntity<String> getPolicyInfo(HttpServletRequest request) throws Exception {
+               try {
+
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "SchedulerAux Controller Call Started: " + SchedulerProperties.SCHEDULERAUX_GET_CONFIG_VAL);
+                       String path = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_GET_CONFIG_VAL);
+                       SchedulerAuxResponseWrapper policyResWrapper = getPolicyConfig(path);
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "SchedulerAux Request END : Response: ",
+                                       new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
+
+                       return (new ResponseEntity<String>(policyResWrapper.getResponse(),
+                                       HttpStatus.valueOf(policyResWrapper.getStatus())));
+               } catch (Exception e) {
+                       SchedulerAuxResponseWrapper policyResWrapper = new SchedulerAuxResponseWrapper();
+                       policyResWrapper.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+                       policyResWrapper.setEntity(e.getMessage());
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception with getpolicy ", e);
+                       return (new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.INTERNAL_SERVER_ERROR));
+               }
+       }
+
+       protected static SchedulerAuxResponseWrapper getPolicyConfig(String path) throws Exception {
+               String methodName = "getPolicyConfig";
+               String uuid = UUID.randomUUID().toString();
+               logger.debug(EELFLoggerDelegate.debugLogger, "starting getPolicyConfig ");
+
+               try {
+                       // STARTING REST API CALL AS AN FACTORY INSTACE
+                       SchedulerAuxRestInterfaceIfc policyRestController = SchedulerAuxRestInterfaceFactory.getInstance();
+                       JSONObject request = new JSONObject();
+                       String policyName = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_POLICY_NAME);
+                       request.put("policyName", policyName);
+                       RestObject<String> restObjStr = new RestObject<String>();
+                       String str = new String();
+                       restObjStr.set(str);
+                       policyRestController.<String>Post(str, request, uuid, path, restObjStr);
+                       SchedulerAuxResponseWrapper policyRespWrapper = SchedulerAuxUtil.wrapResponse(restObjStr);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Getpolicy Request END : Response: ", methodName,
+                                       policyRespWrapper.getResponse());
+                       if (policyRespWrapper.getStatus() != 200) {
+                               String message = String.format(
+                                               " get policy Information failed  . MethodName: %s, PolicyRespWrapperResponse: %s", methodName,
+                                               policyRespWrapper.getResponse());
+                               logger.error(EELFLoggerDelegate.errorLogger, message);
+                               EPLogUtil.schedulerAccessAlarm(logger, policyRespWrapper.getStatus());
+                       }
+                       return policyRespWrapper;
+               } catch (Exception e) {
+                       String message = String.format(" EXCEPTION in getPolicyConfig  . MethodName: %s and Exception:  %s", methodName, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "EXCEPTION in getPolicyConfig", message);
+                       throw e;
+               }
+       }
+}
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
new file mode 100644 (file)
index 0000000..f7d90db
--- /dev/null
@@ -0,0 +1,348 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.simple.JSONObject;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+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.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.scheduler.SchedulerProperties;
+import org.onap.portalapp.portal.scheduler.SchedulerRestInterface;
+import org.onap.portalapp.portal.scheduler.SchedulerUtil;
+import org.onap.portalapp.portal.scheduler.restobjects.GetTimeSlotsRestObject;
+import org.onap.portalapp.portal.scheduler.restobjects.PostCreateNewVnfRestObject;
+import org.onap.portalapp.portal.scheduler.restobjects.PostSubmitVnfChangeRestObject;
+import org.onap.portalapp.portal.scheduler.wrapper.GetTimeSlotsWrapper;
+import org.onap.portalapp.portal.scheduler.wrapper.PostCreateNewVnfWrapper;
+import org.onap.portalapp.portal.scheduler.wrapper.PostSubmitVnfChangeTimeSlotsWrapper;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.http.HttpStatus;
+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.RestController;
+
+@RestController
+@RequestMapping(PortalConstants.PORTAL_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class SchedulerController extends EPRestrictedBaseController {
+
+       @Autowired
+       private SchedulerRestInterface schedulerRestController;
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerController.class);
+
+       /** The request date format. */
+       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
+
+       @RequestMapping(value = "/get_time_slots/{scheduler_request}", method = RequestMethod.GET, produces = "application/json")
+       public ResponseEntity<String> getTimeSlots(HttpServletRequest request,
+                       @PathVariable("scheduler_request") String scheduler_request) throws Exception {
+               try {
+
+                       Date startingTime = new Date();
+                       String startTimeRequest = requestDateFormat.format(startingTime);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Controller Scheduler GET Timeslots for startTimeRequest: ",
+                                       startTimeRequest);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Original Request : \n ", scheduler_request);
+                       String path = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_GET_TIME_SLOTS)
+                                       + scheduler_request;
+
+                       GetTimeSlotsWrapper schedulerResWrapper = getTimeSlots(scheduler_request, path, scheduler_request);
+
+                       Date endTime = new Date();
+                       String endTimeRequest = requestDateFormat.format(endTime);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Controller Scheduler - GET for EndTimeRequest",
+                                       endTimeRequest);
+                       return (new ResponseEntity<String>(schedulerResWrapper.getResponse(),
+                                       HttpStatus.valueOf(schedulerResWrapper.getStatus())));
+               } catch (Exception e) {
+                       GetTimeSlotsWrapper schedulerResWrapper=new GetTimeSlotsWrapper();
+                       schedulerResWrapper.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+                       schedulerResWrapper.setEntity(e.getMessage());
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception with getTimeslots", e);
+                       return (new ResponseEntity<String>(schedulerResWrapper.getResponse(), HttpStatus.INTERNAL_SERVER_ERROR));
+               }
+
+       }
+
+       protected GetTimeSlotsWrapper getTimeSlots(String request, String path, String uuid) throws Exception {
+
+               try {
+                       // STARTING REST API CALL AS AN FACTORY INSTACE
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Get Time Slots Request START");
+
+                       GetTimeSlotsRestObject<String> restObjStr = new GetTimeSlotsRestObject<String>();
+                       String str = new String();
+
+                       restObjStr.set(str);
+
+                       schedulerRestController.Get(str, uuid, path, restObjStr);
+                       GetTimeSlotsWrapper schedulerRespWrapper = SchedulerUtil.getTimeSlotsWrapResponse(restObjStr);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Get Time Slots Request END : Response: ",
+                                       schedulerRespWrapper.getResponse());
+                       if (schedulerRespWrapper.getStatus() != 200 && schedulerRespWrapper.getStatus() != 204
+                                       && schedulerRespWrapper.getStatus() != 202) {
+                               String message = String.format(
+                                               " getTimeslots Information failed . SchedulerResponseWrapper for gettimeslots: %s", schedulerRespWrapper.getResponse());
+                               logger.error(EELFLoggerDelegate.errorLogger, message);
+                               EPLogUtil.schedulerAccessAlarm(logger, schedulerRespWrapper.getStatus());
+
+                       }
+                       return schedulerRespWrapper;
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,  "Get Time Slots Request ERROR : Exception:",e);
+                       throw e;
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       @RequestMapping(value = "/post_create_new_vnf_change", method = RequestMethod.POST, produces = "application/json")
+       public ResponseEntity<String> postCreateNewVNFChange(HttpServletRequest request,
+                       @RequestBody JSONObject scheduler_request) throws Exception {
+               try {
+                       Date startingTime = new Date();
+                       String startTimeRequest = requestDateFormat.format(startingTime);
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Controller Scheduler POST : post_create_new_vnf_change",
+                                       startTimeRequest);
+
+                       // Generating uuid
+                       String uuid = UUID.randomUUID().toString();
+
+                       scheduler_request.put("scheduleId", uuid);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "UUID : ", uuid);
+
+                       // adding uuid to the request payload
+                       scheduler_request.put("scheduleId", uuid);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Original Request ", scheduler_request.toString());
+
+                       String path = SchedulerProperties
+                                       .getProperty(SchedulerProperties.SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL) + uuid;
+
+                       PostCreateNewVnfWrapper responseWrapper = postSchedulingRequest(scheduler_request, path, uuid);
+
+                       Date endTime = new Date();
+                       String endTimeRequest = requestDateFormat.format(endTime);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Controller Scheduler - POST", endTimeRequest);
+
+                       return new ResponseEntity<String>(responseWrapper.getResponse(),
+                                       HttpStatus.valueOf(responseWrapper.getStatus()));
+               } catch (Exception e) {
+                       PostCreateNewVnfWrapper responseWrapper=new PostCreateNewVnfWrapper();
+                       responseWrapper.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+                       responseWrapper.setEntity(e.getMessage());
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception with postCreateNewVNFChange ", e);
+                       return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.INTERNAL_SERVER_ERROR));
+
+               }
+
+       }
+
+       protected PostCreateNewVnfWrapper postSchedulingRequest(JSONObject request, String path, String uuid)
+                       throws Exception {
+
+               try {
+                       // STARTING REST API CALL AS AN FACTORY INSTACE
+
+                       PostCreateNewVnfRestObject<String> restObjStr = new PostCreateNewVnfRestObject<String>();
+                       String str = new String();
+
+                       restObjStr.set(str);
+                       schedulerRestController.<String>Post(str, request, path, restObjStr);
+
+                       int status = restObjStr.getStatusCode();
+                       if (status >= 200 && status <= 299) {
+                               restObjStr.setUUID(uuid);
+                       }
+
+                       PostCreateNewVnfWrapper responseWrapper = SchedulerUtil.postCreateNewVnfWrapResponse(restObjStr);
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, " Post Create New Vnf Scheduling Request END : Response: ",
+                                       responseWrapper.getResponse());
+                       if (responseWrapper.getStatus() != 200 && responseWrapper.getStatus() != 202 && responseWrapper.getStatus() != 204) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "PostCreateNewVnfWrapper Information failed", responseWrapper.getResponse());
+                               EPLogUtil.schedulerAccessAlarm(logger, responseWrapper.getStatus());
+
+                       }
+                       return responseWrapper;
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "PostCreateNewVnfWrapper failed . Post Create New Vnf Scheduling Request ERROR :",e);
+                       throw e;
+               }
+       }
+
+       @RequestMapping(value = "/submit_vnf_change_timeslots", method = RequestMethod.POST, produces = "application/json")
+       public ResponseEntity<String> postSubmitVnfChangeTimeslots(HttpServletRequest request,
+                       @RequestBody JSONObject scheduler_request) throws Exception {
+               try {
+                       Date startingTime = new Date();
+                       String startTimeRequest = requestDateFormat.format(startingTime);
+                       logger.debug(EELFLoggerDelegate.debugLogger, " Controller Scheduler POST : submit_vnf_change_timeslots",
+                                       startTimeRequest);
+
+                       // Generating uuid
+                       String uuid = (String) scheduler_request.get("scheduleId");
+                       logger.debug(EELFLoggerDelegate.debugLogger, "UUID : ", uuid);
+
+                       scheduler_request.remove("scheduleId");
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Original Request for the schedulerId: ",
+                                       scheduler_request.toString());
+
+                       String path = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_SUBMIT_NEW_VNF_CHANGE)
+                                       .replace("{scheduleId}", uuid);
+
+                       PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = postSubmitSchedulingRequest(scheduler_request, path,
+                                       uuid);
+
+                       Date endTime = new Date();
+                       String endTimeRequest = requestDateFormat.format(endTime);
+                       logger.debug(EELFLoggerDelegate.debugLogger, " Controller Scheduler - POST Submit for end time request",
+                                       endTimeRequest);
+
+                       return (new ResponseEntity<String>(responseWrapper.getResponse(),HttpStatus.valueOf(responseWrapper.getStatus())));
+               } catch (Exception e) {
+                       PostSubmitVnfChangeTimeSlotsWrapper responseWrapper=new PostSubmitVnfChangeTimeSlotsWrapper();
+                       responseWrapper.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+                       responseWrapper.setEntity(e.getMessage());
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception with Post submit Vnf change Timeslots", e);
+                       return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.INTERNAL_SERVER_ERROR));
+
+               }
+       }
+
+       protected PostSubmitVnfChangeTimeSlotsWrapper postSubmitSchedulingRequest(JSONObject request, String path,
+                       String uuid) throws Exception {
+
+               try {
+                       // STARTING REST API CALL AS AN FACTORY INSTACE
+
+                       PostSubmitVnfChangeRestObject<String> restObjStr = new PostSubmitVnfChangeRestObject<String>();
+                       String str = new String();
+
+                       restObjStr.set(str);
+                       schedulerRestController.<String>Post(str, request, path, restObjStr);
+
+                       int status = restObjStr.getStatusCode();
+                       if (status >= 200 && status <= 299) {
+                               status=(status==204)?200:status;
+                               restObjStr.setStatusCode(status);
+                               restObjStr.setUUID(uuid);
+                       }
+
+                       PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = SchedulerUtil
+                                       .postSubmitNewVnfWrapResponse(restObjStr);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Post Submit Scheduling Request END : Response = ",
+                                       responseWrapper.getResponse());
+                       if (responseWrapper.getStatus() != 200 && responseWrapper.getStatus() != 202
+                                       && responseWrapper.getStatus() != 204) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "PostCreateNewVnfWrapper Information failed", responseWrapper.getResponse());
+                               EPLogUtil.schedulerAccessAlarm(logger, responseWrapper.getStatus());
+
+                       }
+                       return responseWrapper;
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, " PostCreateNewVnfWrapper failed . Post Submit Scheduling Request ERROR :",e);
+                       throw e;
+               }
+       }
+
+       /**
+        * Get Scheduler UI constant values from properties file
+        * 
+        * @return Rest response wrapped around a String; e.g., "success" or "ERROR"
+        */
+       @RequestMapping(value = "/get_scheduler_constant", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, String>> getSchedulerConstant(HttpServletRequest request,
+                       HttpServletResponse response) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "get scheduler constant");
+
+               PortalRestResponse<Map<String, String>> portalRestResponse = null;
+               String errorMsg = " is not defined in property file. Please check the property file and make sure all the schedule constant values are defined";
+               HashMap<String, String> constantMap = new HashMap<>();
+               constantMap.put(SchedulerProperties.SCHEDULER_DOMAIN_NAME, "domainName");
+               constantMap.put(SchedulerProperties.SCHEDULER_SCHEDULE_NAME, "scheduleName");
+               constantMap.put(SchedulerProperties.SCHEDULER_WORKFLOW_NAME, "workflowName");
+               constantMap.put(SchedulerProperties.SCHEDULER_CALLBACK_URL, "callbackUrl");
+               constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_TYPE, "approvalType");
+               constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_SUBMIT_STATUS, "approvalSubmitStatus");
+               constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_REJECT_STATUS, "approvalRejectStatus");
+               constantMap.put(SchedulerProperties.SCHEDULER_POLICY_NAME, "policyName");
+               constantMap.put(SchedulerProperties.SCHEDULER_INTERVAL_GET_TIMESLOT_RATE, "intervalRate");
+               constantMap.put(SchedulerProperties.SCHEDULER_GROUP_ID, "groupId");
+               try {
+                       Map<String, String> map = new HashMap<>();
+                       for (Map.Entry<String, String> entry : constantMap.entrySet()) {
+                               if (SchedulerProperties.containsProperty(entry.getKey()))
+                                       map.put(entry.getValue(), SchedulerProperties.getProperty(entry.getKey()));
+                               else
+                                       throw new Exception(entry.getKey() + errorMsg);
+                       }
+                       portalRestResponse = new PortalRestResponse<Map<String, String>>(PortalRestStatusEnum.OK, "success", map);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getSchedulerConstant failed", e);
+                       portalRestResponse = new PortalRestResponse<Map<String, String>>(PortalRestStatusEnum.ERROR, e.getMessage(),
+                                       null);
+               }
+               return portalRestResponse;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..9a68496
--- /dev/null
@@ -0,0 +1,384 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedRESTfulBaseController;
+import org.onap.portalapp.portal.domain.SharedContext;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.SharedContextService;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * The shared-context feature allows onboarded applications to share data among
+ * themselves easily for a given session. It basically implements a Java map:
+ * put or get a key-value pair within a map identified by a session ID.
+ * 
+ * This REST endpoint listens on the Portal app server and answers requests made
+ * by back-end application servers. Reads and writes values to the database
+ * using a Hibernate service to ensure all servers in a high-availability
+ * cluster see the same data.
+ */
+@Configuration
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API + "/context")
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class SharedContextRestController extends EPRestrictedRESTfulBaseController {
+
+       /**
+        * Model for a one-element JSON object returned by many methods.
+        */
+       class SharedContextJsonResponse {
+               String response;
+       }
+
+       /**
+        * Access to the database
+        */
+       @Autowired
+       private SharedContextService contextService;
+
+       /**
+        * Logger for debug etc.
+        */
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SharedContextRestController.class);
+
+       /**
+        * Reusable JSON (de)serializer
+        */
+       private final ObjectMapper mapper = new ObjectMapper();
+
+       /**
+        * Gets a value for the specified context and key (RESTful service method).
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param context_id
+        *            ID that identifies the context, usually the ECOMP Portal
+        *            session key.
+        * @param ckey
+        *            Key for the key-value pair to fetch
+        * @return JSON with shared context object; response=null if not found.
+        * @throws Exception
+        *             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")
+       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);
+               if (context_id == null || ckey == null)
+                       throw new Exception("Received null for context_id and/or ckey");
+
+               SharedContext context = contextService.getSharedContext(context_id, ckey);
+               String jsonResponse = "";
+               if (context == null)
+                       jsonResponse = convertResponseToJSON(context);
+               else
+                       jsonResponse = mapper.writeValueAsString(context);
+
+               return jsonResponse;
+       }
+
+       /**
+        * Gets user information for the specified context (RESTful service method).
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param context_id
+        *            ID that identifies the context, usually the ECOMP Portal
+        *            session key.
+        * @return List of shared-context objects as JSON; should have user's first
+        *         name, last name and email address; null if none found
+        * @throws Exception
+        *             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")
+       public String getUserContext(HttpServletRequest request, @RequestParam String context_id) throws Exception {
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "getUserContext for ID " + context_id);
+               if (context_id == null)
+                       throw new Exception("Received null for context_id");
+
+               List<SharedContext> listSharedContext = new ArrayList<SharedContext>();
+               SharedContext firstNameContext = contextService.getSharedContext(context_id,
+                               EPCommonSystemProperties.USER_FIRST_NAME);
+               SharedContext lastNameContext = contextService.getSharedContext(context_id,
+                               EPCommonSystemProperties.USER_LAST_NAME);
+               SharedContext emailContext = contextService.getSharedContext(context_id, EPCommonSystemProperties.USER_EMAIL);
+               SharedContext orgUserIdContext = contextService.getSharedContext(context_id,
+                               EPCommonSystemProperties.USER_ORG_USERID);
+               if (firstNameContext != null)
+                       listSharedContext.add(firstNameContext);
+               if (lastNameContext != null)
+                       listSharedContext.add(lastNameContext);
+               if (emailContext != null)
+                       listSharedContext.add(emailContext);
+               if (orgUserIdContext != null)
+                       listSharedContext.add(orgUserIdContext);
+               String jsonResponse = convertResponseToJSON(listSharedContext);
+               return jsonResponse;
+       }
+
+       /**
+        * Tests for presence of the specified key in the specified context (RESTful
+        * service method).
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param context_id
+        *            ID that identifies the context, usually the ECOMP Portal
+        *            session key.
+        * @param ckey
+        *            Key for the key-value pair to test
+        * @return JSON with result indicating whether the context and key were
+        *         found.
+        * @throws Exception
+        *             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")
+       public String checkContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
+                       throws Exception {
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "checkContext for " + context_id + ", key " + ckey);
+               if (context_id == null || ckey == null)
+                       throw new Exception("Received null for contextId and/or key");
+
+               String response = null;
+               SharedContext context = contextService.getSharedContext(context_id, ckey);
+               if (context != null)
+                       response = "exists";
+
+               String jsonResponse = convertResponseToJSON(response);
+               return jsonResponse;
+       }
+
+       /**
+        * Removes the specified key in the specified context (RESTful service
+        * method).
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param context_id
+        *            ID that identifies the context, usually the ECOMP Portal
+        *            session key.
+        * @param ckey
+        *            Key for the key-value pair to remove
+        * @return JSON with result indicating whether the context and key were
+        *         found.
+        * @throws Exception
+        *             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")
+       public String removeContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
+                       throws Exception {
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "removeContext for " + context_id + ", key " + ckey);
+               if (context_id == null || ckey == null)
+                       throw new Exception("Received null for contextId and/or key");
+
+               SharedContext context = contextService.getSharedContext(context_id, ckey);
+               String response = null;
+               if (context != null) {
+                       contextService.deleteSharedContext(context);
+                       response = "removed";
+               }
+
+               String jsonResponse = convertResponseToJSON(response);
+               return jsonResponse;
+       }
+
+       /**
+        * Clears all key-value pairs in the specified context (RESTful service
+        * method).
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param context_id
+        *            ID that identifies the context, usually the ECOMP Portal
+        *            session key.
+        * @return JSON with result indicating the number of key-value pairs
+        *         removed.
+        * @throws Exception
+        *             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")
+       public String clearContext(HttpServletRequest request, @RequestParam String context_id) throws Exception {
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "clearContext for " + context_id);
+               if (context_id == null)
+                       throw new Exception("clearContext: Received null for contextId");
+
+               int count = contextService.deleteSharedContexts(context_id);
+               String jsonResponse = convertResponseToJSON(Integer.toString(count));
+               return jsonResponse;
+       }
+
+       /**
+        * Sets a context value for the specified context and key (RESTful service
+        * method). Creates the context if no context with the specified ID-key pair
+        * exists, overwrites the value if it exists already.
+        * 
+        * @param request
+        *            HTTP servlet request
+        * @param userJson
+        *            JSON block with these tag-value pairs:
+        *            <UL>
+        *            <LI>context_id: ID that identifies the context
+        *            <LI>ckey: Key for the key-value pair to store
+        *            <LI>cvalue: Value to store
+        *            </UL>
+        * @return JSON with result indicating whether the value was added (key not
+        *         previously known) or replaced (key previously known).
+        * @throws Exception
+        *             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")
+       public String setContext(HttpServletRequest request, @RequestBody String userJson) throws Exception {
+
+               @SuppressWarnings("unchecked")
+               Map<String, Object> userData = mapper.readValue(userJson, Map.class);
+               // Use column names as JSON tags
+               final String contextId = (String) userData.get("context_id");
+               final String key = (String) userData.get("ckey");
+               final String value = (String) userData.get("cvalue");
+               if (contextId == null || key == null)
+                       throw new Exception("setContext: received null for contextId and/or key");
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "setContext: ID " + contextId + ", key " + key + "->" + value);
+               String response = null;
+               SharedContext existing = contextService.getSharedContext(contextId, key);
+               if (existing == null) {
+                       contextService.addSharedContext(contextId, key, value);
+               } else {
+                       existing.setCvalue(value);
+                       contextService.saveSharedContext(existing);
+               }
+               response = existing == null ? "added" : "replaced";
+               String jsonResponse = convertResponseToJSON(response);
+               return jsonResponse;
+       }
+
+       /**
+        * Creates a two-element JSON object tagged "response".
+        * 
+        * @param responseBody
+        * @return JSON object as String
+        * @throws JsonProcessingException
+        */
+       private String convertResponseToJSON(String responseBody) throws JsonProcessingException {
+               Map<String, String> responseMap = new HashMap<String, String>();
+               responseMap.put("response", responseBody);
+               String response = mapper.writeValueAsString(responseMap);
+               return response;
+       }
+
+       /**
+        * Converts a list of SharedContext objects to a JSON array.
+        * 
+        * @param contextList
+        * @return JSON array as String
+        * @throws JsonProcessingException
+        */
+       private String convertResponseToJSON(List<SharedContext> contextList) throws JsonProcessingException {
+               String jsonArray = mapper.writeValueAsString(contextList);
+               return jsonArray;
+       }
+
+       /**
+        * Creates a JSON object with the content of the shared context; null is ok.
+        * 
+        * @param context
+        * @return tag "response" with collection of context object's fields
+        * @throws JsonProcessingException
+        */
+       private String convertResponseToJSON(SharedContext context) throws JsonProcessingException {
+               Map<String, Object> responseMap = new HashMap<String, Object>();
+               responseMap.put("response", context);
+               String responseBody = mapper.writeValueAsString(responseMap);
+               return responseBody;
+       }
+
+       /**
+        * Handles any exception thrown by a method in this controller.
+        * 
+        * @param e
+        *            Exception
+        * @param response
+        *            HttpServletResponse
+        * @throws IOException
+        */
+       @ExceptionHandler(Exception.class)
+       protected void handleBadRequests(Exception e, HttpServletResponse response) throws IOException {
+               logger.error(EELFLoggerDelegate.errorLogger, "handleBadRequest caught exception", e);
+               response.sendError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..522c7ae
--- /dev/null
@@ -0,0 +1,229 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.portal.domain.EPUser;
+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.TicketEventService;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+import org.onap.portalapp.portal.transport.EpRoleNotificationItem;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * Receives messages from the Collaboration Bus (C-BUS) notification and event
+ * brokering tool. Creates notifications for ECOMP Portal users.
+ */
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class TicketEventController implements BasicAuthenticationController {
+
+
+       @Autowired
+       private UserNotificationService userNotificationService;
+       
+       @Autowired
+       private TicketEventService ticketEventService;
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TicketEventController.class);
+
+       public boolean isAuxRESTfulCall() {
+               return true;
+       }
+
+       private final ObjectMapper mapper = new ObjectMapper();
+
+
+
+       @ApiOperation(value = "Accepts messages from external ticketing systems and creates notifications for Portal users.", response = PortalRestResponse.class)
+       @RequestMapping(value = { "/ticketevent" }, method = RequestMethod.POST)
+       public PortalRestResponse<String> handleRequest(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody String ticketEventJson) throws Exception {
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "Ticket Event notification" + ticketEventJson);
+               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
+               try {
+                       JsonNode ticketEventNotif = mapper.readTree(ticketEventJson);
+
+                       // Reject request if required fields are missing.
+                       String error = validateTicketEventMessage(ticketEventNotif);
+                       if (error != null) {
+                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                               portalResponse.setMessage(error);
+                               response.setStatus(400);
+                               return portalResponse;
+                       }
+
+                       EpNotificationItem epItem = new EpNotificationItem();
+                       epItem.setCreatedDate(new Date());
+                       epItem.setIsForOnlineUsers("Y");
+                       epItem.setIsForAllRoles("N");
+                       epItem.setActiveYn("Y");
+
+                       JsonNode event = ticketEventNotif.get("event");
+                       JsonNode header = event.get("header");
+                       JsonNode body = event.get("body");
+                       JsonNode application = ticketEventNotif.get("application");
+                       epItem.setMsgDescription(body.toString());
+                       Long eventDate = System.currentTimeMillis();
+                       if (body.get("eventDate") != null) {
+                               eventDate = body.get("eventDate").asLong();
+                       }
+                       String eventSource = header.get("eventSource").asText();
+                       epItem.setMsgSource(eventSource);
+                       String ticket = body.get("ticketNum").asText();
+                       String hyperlink = ticketEventService.getNotificationHyperLink(application, ticket, eventSource);                       
+                       if(body.get("notificationHyperlink")!=null){
+                               hyperlink=body.get("notificationHyperlink").asText();
+                       }
+                       epItem.setNotificationHyperlink(hyperlink);
+                       epItem.setStartTime(new Date(eventDate));
+                       Calendar calendar = Calendar.getInstance();
+                       calendar.setTime(epItem.getStartTime());
+                       int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
+                       calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth + 30);
+                       epItem.setEndTime(calendar.getTime());
+                       String severityString = "1";
+                       if (body.get("severity") != null) {
+                               severityString = (body.get("severity").toString()).substring(1, 2);
+                       }
+                       Long severity = Long.parseLong(severityString);
+                       epItem.setPriority(severity);
+                       epItem.setCreatorId(null);
+                       Set<EpRoleNotificationItem> roles = new HashSet<>();
+                       JsonNode SubscriberInfo = ticketEventNotif.get("SubscriberInfo");
+                       JsonNode userList = SubscriberInfo.get("UserList");
+                       String UserIds[] = userList.toString().replace("[", "").replace("]", "").trim().replace("\"", "")
+                                       .split(",");
+                       String assetID = eventSource + ' '
+                                       + userList.toString().replace("[", "").replace("]", "").trim().replace("\"", "") + ' '
+                                       + new Date(eventDate);
+                       if (body.get("assetID") != null) {
+                               assetID = body.get("assetID").asText();
+                       }
+                       epItem.setMsgHeader(assetID);
+                       List<EPUser> users = userNotificationService.getUsersByOrgIds(Arrays.asList(UserIds));
+                       for (String userId : UserIds) {
+                               EpRoleNotificationItem roleNotifItem = new EpRoleNotificationItem();
+                               for (EPUser user : users) {
+                                       if (user.getOrgUserId().equals(userId)) {
+                                               roleNotifItem.setRecvUserId(user.getId().intValue());
+                                               roles.add(roleNotifItem);
+                                               break;
+                                       }
+                               }
+
+                       }
+                       epItem.setRoles(roles);
+                       userNotificationService.saveNotification(epItem);
+
+                       portalResponse.setStatus(PortalRestStatusEnum.OK);
+                       portalResponse.setMessage("processEventNotification: notification created");
+                       portalResponse.setResponse("NotificationId is :" + epItem.notificationId);
+               } catch (Exception ex) {
+                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
+                       response.setStatus(400);
+                       portalResponse.setMessage(ex.toString());
+               }
+               return portalResponse;
+       }
+
+       /**
+        * Validates that mandatory fields are present.
+        * 
+        * @param ticketEventNotif
+        * @return Error message if a problem is found; null if all is well.
+        */
+       private String validateTicketEventMessage(JsonNode ticketEventNotif) {
+               JsonNode application = ticketEventNotif.get("application");
+               JsonNode event = ticketEventNotif.get("event");
+               JsonNode header = event.get("header");
+               JsonNode eventSource=header.get("eventSource");
+               JsonNode body = event.get("body");
+               JsonNode SubscriberInfo = ticketEventNotif.get("SubscriberInfo");
+               JsonNode userList = SubscriberInfo.get("UserList");
+
+               if (application == null||application.asText().length()==0||application.asText().equalsIgnoreCase("null"))
+                       return "Application is mandatory";
+               if (body == null)
+                       return "body is mandatory";
+               if (eventSource == null||eventSource.asText().trim().length()==0||eventSource.asText().equalsIgnoreCase("null"))
+                       return "Message Source is mandatory";
+               if (userList == null)
+                       return "At least one user Id is mandatory";
+               JsonNode eventDate=body.get("eventDate");
+               
+               if(eventDate!=null&&eventDate.asText().length()==8)
+                       return "EventDate is invalid";
+               String UserIds[] = userList.toString().replace("[", "").replace("]", "").trim().replace("\"", "")
+                               .split(",");            
+               List<EPUser> users = userNotificationService.getUsersByOrgIds(Arrays.asList(UserIds));
+               if(users==null||users.size()==0)
+                       return "Invalid Org User ID";
+               return null;
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..cbcd263
--- /dev/null
@@ -0,0 +1,141 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+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.UserService;
+import org.onap.portalapp.portal.transport.ProfileDetail;
+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.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.util.SystemProperties;
+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;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class UserController extends EPRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserController.class);
+
+       @Autowired
+       private UserService userService;
+
+       /**
+        * RESTful service method to get ECOMP Logged in User details.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * 
+        * @return PortalRestResponse of EPUser
+        */
+       @RequestMapping(value = { "/portalApi/loggedinUser" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<ProfileDetail> getLoggedinUser(HttpServletRequest request) {
+               PortalRestResponse<ProfileDetail> portalRestResponse = null;
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       ProfileDetail profileDetail = new ProfileDetail(user.getFirstName(), user.getLastName(),
+                                       user.getMiddleInitial(), user.getEmail(), user.getLoginId(),  CipherUtil.decryptPKC(user.getLoginPwd()));
+                       portalRestResponse = new PortalRestResponse<ProfileDetail>(PortalRestStatusEnum.OK, "success",
+                                       profileDetail);
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/loggedinUser", "result =", profileDetail);
+               } catch (Exception e) {
+                       portalRestResponse = new PortalRestResponse<ProfileDetail>(PortalRestStatusEnum.ERROR, e.getMessage(),
+                                       null);
+                       logger.error(EELFLoggerDelegate.errorLogger, "getLoggedinUser failed", e);
+               }
+               return portalRestResponse;
+       }
+
+       /**
+        * RESTful service method to update ECOMP Logged in User in DB.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param profileDetail
+        *            Body with user information
+        * @return PortalRestResponse of String
+        */
+       @RequestMapping(value = {
+                       "/portalApi/modifyLoggedinUser" }, method = RequestMethod.PUT, produces = "application/json")
+       public PortalRestResponse<String> modifyLoggedinUser(HttpServletRequest request,
+                       @RequestBody ProfileDetail profileDetail) {
+               PortalRestResponse<String> portalRestResponse = null;
+               try {
+                       String errorMsg = "";
+                       if (profileDetail.getFirstName().equals("") || profileDetail.getLastName().equals("")
+                                       || profileDetail.getEmail().equals("") || profileDetail.getLoginId().equals("")
+                                       || profileDetail.getLoginPassword().equals("")) {
+                               errorMsg = "Required field(s) is missing";
+                               portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, errorMsg, null);
+                               logger.error(EELFLoggerDelegate.errorLogger, "modifyLoggedinUser failed", errorMsg);
+                       } else {
+                               EPUser user = EPUserUtils.getUserSession(request);
+                               user.setFirstName(profileDetail.getFirstName());
+                               user.setLastName(profileDetail.getLastName());
+                               user.setEmail(profileDetail.getEmail());
+                               user.setMiddleInitial(profileDetail.getMiddleName());
+                               user.setLoginId(profileDetail.getLoginId());
+                               user.setLoginPwd(CipherUtil.encryptPKC(profileDetail.getLoginPassword()));
+                               userService.saveUser(user);
+                               // Update user info in the session
+                               request.getSession().setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME),
+                                               user);
+                               portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success", null);
+                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/modifyLoggedinUser", "result =", user);
+                       }
+               } catch (Exception e) {
+                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.toString(), null);
+                       logger.error(EELFLoggerDelegate.errorLogger, "modifyLoggedinUser failed", e);
+               }
+               return portalRestResponse;
+       }
+}
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
new file mode 100644 (file)
index 0000000..d25ad2c
--- /dev/null
@@ -0,0 +1,234 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EcompAppRole;
+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.FunctionalMenuService;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+import org.onap.portalapp.portal.transport.EpNotificationItemVO;
+import org.onap.portalapp.portal.transport.EpRoleNotificationItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.UserUtils;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class UserNotificationController extends EPRestrictedBaseController {
+
+       @Autowired
+       FunctionalMenuService functionalMenuService;
+
+       @Autowired
+       UserNotificationService userNotificationService;
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserNotificationController.class);
+
+       @RequestMapping(value = {
+                       "/portalApi/getFunctionalMenuRole" }, method = RequestMethod.GET, produces = "application/json")
+       public List<FunctionalMenuRole> getMenuIdRoleId(HttpServletRequest request, HttpServletResponse response) {
+               // EPUser user = EPUserUtils.getUserSession(request);
+               List<FunctionalMenuRole> menuRoleList = null;
+               menuRoleList = functionalMenuService.getFunctionalMenuRole();
+               return menuRoleList;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/getNotifications" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<EpNotificationItem>> getNotifications(HttpServletRequest request,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               PortalRestResponse<List<EpNotificationItem>> portalRestResponse = null;
+               try {
+                       List<EpNotificationItem> notificationList = userNotificationService.getNotifications(user.getId());
+                       portalRestResponse = new PortalRestResponse<List<EpNotificationItem>>(PortalRestStatusEnum.OK, "success",
+                                       notificationList);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAllAppsAndContacts failed", e);
+                       portalRestResponse = new PortalRestResponse<List<EpNotificationItem>>(PortalRestStatusEnum.ERROR,
+                                       e.getMessage(), null);
+               }
+               return portalRestResponse;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/getAdminNotifications" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EpNotificationItemVO> getAdminNotifications(HttpServletRequest request, HttpServletResponse response) {
+               List<EpNotificationItemVO> adminNotificationList = null;
+               EPUser user = EPUserUtils.getUserSession(request);
+               adminNotificationList = userNotificationService.getAdminNotificationVOS(user.getId());
+               return adminNotificationList;
+       }
+
+       @RequestMapping(value = "/portalApi/saveNotification", method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> save(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody EpNotificationItem notificationItem) {
+
+               if (notificationItem == null || notificationItem.getMsgHeader() == null)
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "Notification Header cannot be null or empty");
+               if (notificationItem.getEndTime().compareTo(notificationItem.getStartTime()) < 0) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "End Time should be greater than  start time");
+               }
+
+               if ((notificationItem.getIsForAllRoles() == "N") && notificationItem.getRoleIds().isEmpty()) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
+                                       "No Roles Ids Exist for the selected Roles");
+               }
+
+               Long creatorId = UserUtils.getUserIdAsLong(request);
+               notificationItem.setCreatorId(creatorId);
+
+               // Front-end date picker does not accept a time value, so all
+               // values are the start of the chosen day in the local time zone.
+               // Move the end time value to the very end of the chosen day.
+               // Avoid Calendar.getDefault() which uses the server's locale.
+               Long endTime = notificationItem.getEndTime().getTime();
+               endTime += (23 * 3600 + 59 * 60 + 59) * 1000;
+               notificationItem.getEndTime().setTime(endTime);
+
+               try {
+                       userNotificationService.saveNotification(notificationItem);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/notificationUpdateRate" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, String>> getNotificationUpdateRate(HttpServletRequest request) {
+               try {
+                       String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_RATE);
+                       String updateDuration = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_DURATION);
+                       Integer rateInMiliSec = Integer.valueOf(updateRate) * 1000;
+                       Integer durationInMiliSec = Integer.valueOf(updateDuration) * 1000;
+                       Map<String, String> results = new HashMap<String, String>();
+                       results.put("updateRate", String.valueOf(rateInMiliSec));
+                       results.put("updateDuration", String.valueOf(durationInMiliSec));
+                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getNotificationUpdateRate failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
+               }
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/notificationRead" }, method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, String>> notificationRead(
+                       @RequestParam("notificationId") String notificationID, HttpServletRequest request) {
+               try {
+                       userNotificationService.setNotificationRead(Long.parseLong(notificationID), UserUtils.getUserId(request));
+                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "notificationRead failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
+               }
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/getNotificationHistory" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EpNotificationItemVO> getNotificationHistory(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EpNotificationItemVO> notificationList = null;
+               notificationList = userNotificationService.getNotificationHistoryVO(user.getId());
+               return notificationList;
+       }
+
+       @RequestMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<Integer> testGetRoles(HttpServletRequest request, @PathVariable("notificationId") Long notificationId) {
+               List<EpRoleNotificationItem> NotifRoles = userNotificationService.getNotificationRoles(notificationId);
+               ArrayList<Integer> rolesList = new ArrayList<Integer>();
+               for (EpRoleNotificationItem notifRole : NotifRoles) {
+                       rolesList.add(notifRole.roleId);
+               }
+               return rolesList;
+       }
+
+       @RequestMapping(value = { "/portalApi/getNotificationAppRoles" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<EcompAppRole> getNotificationAppRoles(HttpServletRequest request, HttpServletResponse response) {
+               List<EcompAppRole> epAppRoleList = null;
+               try {
+                       epAppRoleList = userNotificationService.getAppRoleList();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "Exception occurred while performing UserNofiticationController.getNotificationAppRoles. Details: ",
+                                       e);
+               }
+               return epAppRoleList;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/getMessageRecipients" }, method = RequestMethod.GET, produces = "application/json")
+       public List<String> getMessageRecipients(@RequestParam("notificationId") Long notificationID) {
+               // EPUser user = EPUserUtils.getUserSession(request);
+               List<String> messageUserRecipients = null;
+               messageUserRecipients = userNotificationService.getMessageRecipients(notificationID);
+               return messageUserRecipients;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..167fa2e
--- /dev/null
@@ -0,0 +1,546 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+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.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EPUserAppCatalogRoles;
+import org.onap.portalapp.portal.domain.EcompAuditLog;
+import org.onap.portalapp.portal.domain.ExternalSystemAccess;
+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.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.SearchService;
+import org.onap.portalapp.portal.service.UserRolesService;
+import org.onap.portalapp.portal.transport.AppNameIdIsAdmin;
+import org.onap.portalapp.portal.transport.AppWithRolesForUser;
+import org.onap.portalapp.portal.transport.AppsListWithAdminRole;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.RoleInAppForUser;
+import org.onap.portalapp.portal.transport.UserApplicationRoles;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class UserRolesController extends EPRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesController.class);
+
+       @Autowired
+       private SearchService searchService;
+       @Autowired
+       private AdminRolesService adminRolesService;
+       private @Autowired UserRolesService userRolesService;
+       @Autowired
+       private ApplicationsRestClientService applicationsRestClientService;
+       @Autowired
+       private AuditService auditService;
+
+       private static final String FAILURE = "failure";
+
+       /**
+        * RESTful service method to fetch users in the WebPhone external service
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param searchString
+        *            search string
+        * @param response
+        *            HttpServletResponse
+        * @return array of found users as json
+        */
+       @RequestMapping(value = { "/portalApi/queryUsers" }, method = RequestMethod.GET, produces = "application/json")
+       public String getPhoneBookSearchResult(HttpServletRequest request, @RequestParam("search") String searchString,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               String searchResult = null;
+               if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "getPhoneBookSearchResult");
+               } else {
+                       searchString = searchString.trim();
+                       if (searchString.length() > 2) {
+                               searchResult = searchService.searchUsersInPhoneBook(searchString);
+                       } else {
+                               logger.info(EELFLoggerDelegate.errorLogger,
+                                               "getPhoneBookSearchResult - too short search string: " + searchString);
+                       }
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/queryUsers", "result =", searchResult);
+
+               return searchResult;
+       }
+
+       /**
+        * RESTful service method to fetch applications where user is admin
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param orgUserId
+        *            search string
+        * @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")
+       public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(HttpServletRequest request,
+                       @RequestParam("user") String orgUserId, HttpServletResponse response) {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               AppsListWithAdminRole result = null;
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "getAppsWithAdminRoleStateForUser");
+               } else {
+                       if (EcompPortalUtils.legitimateUserId(orgUserId)) {
+                               result = adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId);
+                       } else {
+                               logger.info(EELFLoggerDelegate.errorLogger,
+                                               "getAppsWithAdminRoleStateForUser - parms error, no Organization User ID");
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       }
+               }
+
+               StringBuilder adminAppRoles = new StringBuilder();
+               if(result != null){
+                       if ( result.appsRoles.size() >= 1) {
+                               adminAppRoles.append("User '" + result.orgUserId + "' has admin role to the apps = {");
+                               for (AppNameIdIsAdmin adminAppRole : result.appsRoles) {
+                                       if (adminAppRole.isAdmin) {
+                                               adminAppRoles.append(adminAppRole.appName + ", ");
+                                       }
+                               }
+                               adminAppRoles.append("}.");
+                       } else {
+                               adminAppRoles.append("User '" + result.orgUserId + "' has no Apps with Admin Role.");
+                       }
+               }else{
+                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: getAppsWithAdminRoleStateForUser result is null");
+               }
+               
+               logger.info(EELFLoggerDelegate.errorLogger, adminAppRoles.toString());
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "get result =", result);
+
+               return result;
+       }
+
+       /**
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param newAppsListWithAdminRoles
+        *            new apps
+        * @param response
+        *            HttpServletResponse
+        * @return FieldsValidator
+        */
+       @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
+                       RequestMethod.PUT }, produces = "application/json")
+       public FieldsValidator putAppsWithAdminRoleStateForUser(HttpServletRequest request,
+                       @RequestBody AppsListWithAdminRole newAppsListWithAdminRoles, HttpServletResponse response) {
+
+               // newAppsListWithAdminRoles.appsRoles
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               StringBuilder newAppRoles = new StringBuilder();
+               if(newAppsListWithAdminRoles != null ){
+                       if (newAppsListWithAdminRoles.appsRoles.size() >= 1) {
+                               newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has admin role to the apps = { ");
+                               for (AppNameIdIsAdmin adminAppRole : newAppsListWithAdminRoles.appsRoles) {
+                                       if (adminAppRole.isAdmin) {
+                                               newAppRoles.append(adminAppRole.appName + " ,");
+                                       }
+                               }
+                               newAppRoles.deleteCharAt(newAppRoles.length() - 1);
+                               newAppRoles.append("}.");
+                       } else {
+                               newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has no Apps with Admin Role.");
+                       }
+               }else{
+                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: putAppsWithAdminRoleStateForUser result is null");
+               }
+               
+               logger.info(EELFLoggerDelegate.errorLogger, newAppRoles.toString());
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               boolean changesApplied = false;
+
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "putAppsWithAdminRoleStateForUser");
+               } else {
+                       changesApplied = adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles);
+                       AuditLog auditLog = new AuditLog();
+                       auditLog.setUserId(user.getId());
+                       auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN);
+                       auditLog.setAffectedRecordId(newAppsListWithAdminRoles.orgUserId);
+                       auditLog.setComments(EcompPortalUtils.truncateString(newAppRoles.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                       auditService.logActivity(auditLog, null);
+
+                       MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                       MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                       EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                       MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                       MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                       logger.info(EELFLoggerDelegate.auditLogger,
+                                       EPLogUtil.formatAuditLogMessage("UserRolesController.putAppsWithAdminRoleStateForUser",
+                                                       EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN, user.getOrgUserId(),
+                                                       newAppsListWithAdminRoles.orgUserId, newAppRoles.toString()));
+                       MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                       MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                       MDC.remove(SystemProperties.MDC_TIMER);
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "put result =", changesApplied);
+
+               return fieldsValidator;
+       }
+
+       /**
+        * It returns a list of user app roles for single app
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @param orgUserId
+        *            user ID
+        * @param appid
+        *            application ID
+        * @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")
+       public List<RoleInAppForUser> getAppRolesForUser(HttpServletRequest request, @RequestParam("user") String orgUserId,
+                       @RequestParam("app") Long appid, @RequestParam("externalRequest") Boolean extRequestValue,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<RoleInAppForUser> result = null;
+               String feErrorString = "";
+               if (!adminRolesService.isAccountAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "getAppRolesForUser");
+                       feErrorString = EcompPortalUtils.getFEErrorString(true, response.getStatus());
+               } else {
+                       if (EcompPortalUtils.legitimateUserId(orgUserId)) {
+                               result = userRolesService.getAppRolesForUser(appid, orgUserId, extRequestValue);
+                               int responseCode = EcompPortalUtils.getExternalAppResponseCode();
+                               if (responseCode != 0 && responseCode != 200) {
+                                       // external error
+                                       response.setStatus(responseCode);
+                                       feErrorString = EcompPortalUtils.getFEErrorString(false, responseCode);
+                               } else if (result == null) {
+                                       // If the result is null, there was an internal ecomp error
+                                       // in the service call.
+                                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                                       feErrorString = EcompPortalUtils.getFEErrorString(true,
+                                                       HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               }
+                       } else {
+                               logger.info(EELFLoggerDelegate.errorLogger, "getAppRolesForUser - no Organization User ID");
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                               feErrorString = EcompPortalUtils.getFEErrorString(true, HttpServletResponse.SC_BAD_REQUEST);
+                       }
+               }
+
+               StringBuilder sbUserApps = new StringBuilder();
+               if (result != null && result.size() >= 1) {
+                       sbUserApps.append("User '" + orgUserId + "' has Roles={");
+                       for (RoleInAppForUser appRole : result) {
+                               if (appRole.isApplied) {
+                                       sbUserApps.append(appRole.roleName + ", ");
+                               }
+                       }
+                       sbUserApps.append("} assigned to the appId '" + appid + "'.");
+               } else {
+                       // Not sure creating an empty object will make any difference
+                       // but would like to give it a shot for defect #DE221057
+                       if (result == null) {
+                               result = new ArrayList<RoleInAppForUser>();
+                       }
+                       sbUserApps.append("User '" + orgUserId + "' and appid " + appid + " has no roles");
+               }
+               logger.info(EELFLoggerDelegate.errorLogger, sbUserApps.toString());
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "get result =", result);
+               if (feErrorString != "") {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "LR: FEErrorString to header: " + feErrorString);
+
+                       response.addHeader("FEErrorString", feErrorString);
+                       response.addHeader("Access-Control-Expose-Headers", "FEErrorString");
+               }
+               return result;
+       }
+
+       @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
+                       RequestMethod.PUT }, produces = "application/json")
+       public FieldsValidator putAppWithUserRoleStateForUser(HttpServletRequest request,
+                       @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               StringBuilder sbUserApps = new StringBuilder();
+               if (newAppRolesForUser != null) {
+                       sbUserApps.append("User '" + newAppRolesForUser.orgUserId);
+                       if (newAppRolesForUser.appRoles != null && newAppRolesForUser.appRoles.size() >= 1) {
+                               sbUserApps.append("' has roles = { ");
+                               for (RoleInAppForUser appRole : newAppRolesForUser.appRoles) {
+                                       if (appRole.isApplied) {
+                                               sbUserApps.append(appRole.roleName + " ,");
+                                       }
+                               }
+                               sbUserApps.deleteCharAt(sbUserApps.length() - 1);
+                               sbUserApps.append("} assigned for the app " + newAppRolesForUser.appId);
+                       } else {
+                               sbUserApps.append("' has no roles assigned for app " + newAppRolesForUser.appId);
+                       }
+               }
+               logger.info(EELFLoggerDelegate.applicationLogger, "putAppWithUserRoleStateForUser: {}", sbUserApps.toString());
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               boolean changesApplied = false;
+               if (!adminRolesService.isAccountAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "putAppWithUserRoleStateForUser");
+               } else if(newAppRolesForUser==null){
+                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: newAppRolesForUser is null");
+               } else{
+                       changesApplied = userRolesService.setAppWithUserRoleStateForUser(user, newAppRolesForUser);
+                       if (changesApplied) {
+                               logger.info(EELFLoggerDelegate.applicationLogger,
+                                               "putAppWithUserRoleStateForUser: succeeded for app {}, user {}", newAppRolesForUser.appId,
+                                               newAppRolesForUser.orgUserId);
+
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               AuditLog auditLog = new AuditLog();
+                               auditLog.setUserId(user.getId());
+                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_USER);
+                               auditLog.setAffectedRecordId(newAppRolesForUser.orgUserId);
+                               auditLog.setComments(EcompPortalUtils.truncateString(sbUserApps.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
+                               auditService.logActivity(auditLog, null);
+                               
+                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                               logger.info(EELFLoggerDelegate.auditLogger,
+                                               EPLogUtil.formatAuditLogMessage("UserRolesController.putAppWithUserRoleStateForUser",
+                                                               EcompAuditLog.CD_ACTIVITY_UPDATE_USER, user.getOrgUserId(),
+                                                               newAppRolesForUser.orgUserId, sbUserApps.toString()));
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                               MDC.remove(SystemProperties.MDC_TIMER);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "putAppWithUserRoleStateForUser: failed for app {}, user {}", newAppRolesForUser.appId,
+                                               newAppRolesForUser.orgUserId);
+                       }
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "put result =", changesApplied);
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public PortalRestResponse<String> updateRemoteUserProfile(HttpServletRequest request,
+                       HttpServletResponse response) {
+
+               String updateRemoteUserFlag = FAILURE;
+               try {
+                       // saveNewUser = userService.saveNewUser(newUser);
+                       String orgUserId = request.getParameter("loginId");
+                       Long appId = Long.parseLong(request.getParameter("appId"));
+                       userRolesService.updateRemoteUserProfile(orgUserId, appId);
+
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, updateRemoteUserFlag, e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, updateRemoteUserFlag, "");
+
+       }
+
+       @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<UserApplicationRoles> getUsersFromAppEndpoint(HttpServletRequest request,
+                       @PathVariable("appId") Long appId) throws HTTPException {
+               try {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "/portalApi/app/{}/users was invoked", appId);
+                       List<UserApplicationRoles> appUsers = userRolesService.getUsersFromAppEndpoint(appId);
+                       return appUsers;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,    "getUsersFromAppEndpoint failed", e);
+                       return new ArrayList<UserApplicationRoles>();
+               }
+       }
+
+       @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<EcompRole> testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId)
+                       throws HTTPException {
+               EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
+               List<EcompRole> rolesList = Arrays.asList(appRoles);
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/roles", "response for appId=" + appId,
+                               rolesList);
+
+               return rolesList;
+       }
+
+       @RequestMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<EPRole> importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId)
+                       throws HTTPException {
+               List<EPRole> rolesList = userRolesService.importRolesFromRemoteApplication(appId);
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/admin/import/app/{appId}/roles",
+                               "response for appId=" + appId, rolesList);
+
+               return rolesList;
+       }
+
+       @RequestMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public EcompRole testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
+                       @PathVariable("orgUserId") String orgUserId) throws Exception {
+               if (!EcompPortalUtils.legitimateUserId(orgUserId)) {
+                       String msg = "Error /user/<user>/roles not legitimate orgUserId = " + orgUserId;
+                       logger.error(EELFLoggerDelegate.errorLogger, msg);
+                       throw new Exception(msg);
+               }
+               EcompRole[] roles = applicationsRestClientService.get(EcompRole[].class, appId,
+                               String.format("/user/%s/roles", orgUserId));
+               if (roles.length != 1) {
+                       String msg = "Error /user/<user>/roles returned array. expected size 1 recieved size = " + roles.length;
+                       logger.error(EELFLoggerDelegate.errorLogger, msg);
+                       throw new Exception(msg);
+               }
+
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/user/{orgUserId}/roles",
+                               "response for appId='" + appId + "' and orgUserId='" + orgUserId + "'", roles[0]);
+               return roles[0];
+       }
+
+       @RequestMapping(value = { "/portalApi/saveUserAppRoles" }, method = {
+                       RequestMethod.PUT }, produces = "application/json")
+       public FieldsValidator putAppWithUserRoleRequest(HttpServletRequest request,
+                       @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
+               FieldsValidator fieldsValidator = null;
+               try {
+
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       fieldsValidator = userRolesService.putUserAppRolesRequest(newAppRolesForUser, user);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleRequest failed", e);
+
+               }
+               // return fieldsValidator;
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/saveUserAppRoles", "PUT result =",
+                               response.getStatus());
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = { "/portalApi/appCatalogRoles" }, method = {
+                       RequestMethod.GET }, produces = "application/json")
+       public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(HttpServletRequest request,
+                       @RequestParam("appName") String appName) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EPUserAppCatalogRoles> userAppRoleList = null;
+               try {
+                       userAppRoleList = userRolesService.getUserAppCatalogRoles(user, appName);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortPref failed", e);
+
+               }
+               Collections.sort(userAppRoleList, getUserAppCatalogRolesComparator);
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApplicationRoles", "result =", userAppRoleList);
+
+               return userAppRoleList;
+
+       }
+
+       private Comparator<EPUserAppCatalogRoles> getUserAppCatalogRolesComparator = new Comparator<EPUserAppCatalogRoles>() {
+               public int compare(EPUserAppCatalogRoles o1, EPUserAppCatalogRoles o2) {
+                       return o1.getRolename().compareTo(o2.getRolename());
+               }
+       };
+
+       @RequestMapping(value = "/portalApi/externalRequestAccessSystem", method = RequestMethod.GET, produces = "application/json")
+       public ExternalSystemAccess readExternalRequestAccess(HttpServletRequest request) {
+               ExternalSystemAccess result = null;
+               try {
+                       result = userRolesService.getExternalRequestAccess();
+                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/externalRequestAccessSystem", "GET result =",
+                                       result);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "readExternalRequestAccess failed: " + e.getMessage());
+               }
+               return result;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..35e26c0
--- /dev/null
@@ -0,0 +1,257 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.io.IOUtils;
+import org.onap.portalapp.controller.EPRestrictedRESTfulBaseController;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EcompAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.AppsCacheService;
+import org.onap.portalapp.portal.service.ConsulHealthService;
+import org.onap.portalapp.portal.transport.Analytics;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+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.concurrent.FailureCallback;
+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.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.client.AsyncRestTemplate;
+
+import io.swagger.annotations.ApiOperation;
+
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseController {
+
+       @Autowired
+       private ConsulHealthService consulHealthService;
+
+       private static final String MACHINE_LEARNING_SERVICE_CTX = "/ml_api";
+       private static final String REGISTER_ACTION = MACHINE_LEARNING_SERVICE_CTX + "/" + "registerAction";
+       private static final String CONSUL_ML_SERVICE_ID = "machine-learning";
+       private static final String APP_KEY = "uebkey";
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebAnalyticsExtAppController.class);
+       private AsyncRestTemplate restTemplate = new AsyncRestTemplate();
+
+
+       @Autowired
+       AuditService auditService;
+
+       @Autowired
+       AppsCacheService appCacheService;
+
+       SuccessCallback<ResponseEntity<String>> successCallback = new SuccessCallback<ResponseEntity<String>>() {
+               @Override
+               public void onSuccess(ResponseEntity<String> arg) {
+                       logger.info(EELFLoggerDelegate.debugLogger, arg.getBody());
+               }
+       };
+
+       FailureCallback failureCallback = new FailureCallback() {
+               @Override
+               public void onFailure(Throwable arg) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "storeAuxAnalytics failed", arg);
+               }
+       };
+
+       protected boolean isAuxRESTfulCall() {
+               return true;
+       }
+
+       /**
+        * Answers requests from partner applications for a file that is expected to
+        * contain javascript to support web analytics.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return String
+        * @throws Exception
+        *             on failure
+        */
+       @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")
+       public String getAnalyticsScript(HttpServletRequest request) throws Exception {
+               String responseText = "";
+               final String fileName = "analytics.txt";
+               InputStream analyticsFileStream = null;
+               try {
+                       analyticsFileStream = this.getClass().getClassLoader().getResourceAsStream(fileName);
+                       responseText = IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Error reading contents of the file " + fileName, e);
+               } finally {
+                       if (analyticsFileStream != null)
+                               analyticsFileStream.close();
+               }
+
+               String feURLContext = SystemProperties.getProperty("frontend_url");
+               String feURL = feURLContext.substring(0, feURLContext.lastIndexOf('/'));
+
+               responseText = responseText.replace("PORTAL_ENV_URL", feURL);
+               return responseText;
+       }
+
+       /**
+        * Accepts data from partner applications with web analytics data.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param analyticsMap
+        *            Analytics
+        * @return PortalAPIResponse
+        * @throws Exception
+        *             on failure
+        */
+       @RequestMapping(value = { "/storeAnalytics" }, method = RequestMethod.POST, 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)
+                       throws Exception {
+               try {
+                       MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+                       String appName = "";
+                       try {
+                               appName = getAppName(request, appName);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               " Error retrieving Application to capture app name for analytics; Proceeding with empty app name");
+                       }
+
+                       try {
+                               storeAuxAnalytics(analyticsMap, appName);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               " Error retrieving Application to capture app name for analytics; Proceeding with empty app name");
+                       }
+
+                       MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
+
+                       EcompPortalUtils.calculateDateTimeDifferenceForLog(
+                                       MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                       MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+                       logger.info(EELFLoggerDelegate.auditLogger,
+                                       EPLogUtil.formatStoreAnalyticsAuditLogMessage(analyticsMap.getUserid(), appName,
+                                                       "WebAnalyticsExtAppController.postWebAnalyticsData",
+                                                       EcompAuditLog.CD_ACTIVITY_STORE_ANALYTICS, analyticsMap.getAction(), analyticsMap.getPage(),
+                                                       analyticsMap.getFunction(), analyticsMap.getType()));
+
+                       MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                       MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                       MDC.remove(SystemProperties.MDC_TIMER);
+
+                       PortalAPIResponse response = new PortalAPIResponse(true, "success");
+                       return response;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "storeAnalytics failed", e);
+                       PortalAPIResponse response = new PortalAPIResponse(true, "error");
+                       return response;
+               }
+       }
+
+       protected String getAppName(HttpServletRequest request, String appName) {
+               String appKeyValue = request.getHeader(APP_KEY);
+               if (appKeyValue == null || appKeyValue.equals("")) {
+                       logger.error(EELFLoggerDelegate.errorLogger, " App Key unavailable; Proceeding with null app name");
+               } else {
+                       EPApp appRecord = appCacheService.getAppForAnalytics(appKeyValue);
+                       if (appRecord == null) {
+                               logger.error(EELFLoggerDelegate.errorLogger, " App could not be found for the key " + appKeyValue);
+                       } else
+                               appName = appRecord.getName();
+
+               }
+               return appName;
+       }
+
+       protected void storeAuxAnalytics(Analytics analyticsMap, String appName) {
+               logger.info(EELFLoggerDelegate.debugLogger,
+                               " Registering an action for recommendation: AppName/Function/UserId " + appName + "/"
+                                               + analyticsMap.getFunction() + "/" + analyticsMap.getUserid());
+
+               Map<String, String> requestMapping = new HashMap<String, String>();
+               requestMapping.put("id", analyticsMap.getUserid());
+               requestMapping.put("action", appName + "|" + analyticsMap.getFunction());
+
+               HttpHeaders headers = new HttpHeaders();
+               headers.setContentType(MediaType.APPLICATION_JSON);
+
+               // set your entity to send
+               HttpEntity<Map<String, String>> entity = new HttpEntity<Map<String, String>>(requestMapping, headers);
+
+               // send it!
+               ListenableFuture<ResponseEntity<String>> out = restTemplate.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                               + consulHealthService.getServiceLocation(CONSUL_ML_SERVICE_ID,
+                                                               SystemProperties.getProperty("microservices.m-learn.local.port"))
+                                               + REGISTER_ACTION,
+                               HttpMethod.POST, entity, String.class);
+               out.addCallback(successCallback, failureCallback);
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..15e1982
--- /dev/null
@@ -0,0 +1,417 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+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.ConsulHealthService;
+import org.onap.portalapp.portal.service.MicroserviceService;
+import org.onap.portalapp.portal.service.WidgetParameterService;
+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.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+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 WidgetsCatalogController extends EPRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogController.class);
+
+       private static final String MS_WIDGET_LOCAL_PORT = "microservices.widget.local.port";
+
+       private RestTemplate template = new RestTemplate();
+
+       private String whatService = "widgets-service";
+
+       @Autowired
+       private ConsulHealthService consulHealthService;
+
+       @Autowired
+       private MicroserviceService microserviceService;
+
+       @Autowired
+       private WidgetParameterService widgetParameterService;
+
+       @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;
+                       }
+               });
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET)
+       public List<WidgetCatalog> getUserWidgetCatalog(@PathVariable("loginName") String loginName) {
+               List<WidgetCatalog> widgets = new ArrayList<>();
+               try {
+                       ResponseEntity<List> ans = template.exchange(
+                                       EcompPortalUtils.widgetMsProtocol() + "://"
+                                                       + consulHealthService.getServiceLocation(whatService,
+                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                                       + "/widget/microservices/widgetCatalog/" + loginName,
+                                       HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), List.class);
+                       widgets = ans.getBody();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserWidgetCatalog failed", e);
+                       // returning null because null help check on the UI if there was a
+                       // communication problem with Microservice.
+                       return null;
+               }
+               return widgets;
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.GET)
+       public List<WidgetCatalog> getWidgetCatalog() {
+               List<WidgetCatalog> widgets = new ArrayList<>();
+               try {
+                       ResponseEntity<List> ans = template.exchange(
+                                       EcompPortalUtils.widgetMsProtocol() + "://"
+                                                       + consulHealthService.getServiceLocation(whatService,
+                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                                       + "/widget/microservices/widgetCatalog",
+                                       HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), List.class);
+                       widgets = ans.getBody();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getWidgetCatalog failed", e);
+                       // returning null because null help check on the UI if there was a
+                       // communication problem with Microservice.
+                       return null;
+               }
+               return widgets;
+       }
+
+       @RequestMapping(value = {
+                       "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
+       public void updateWidgetCatalog(@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId) throws Exception {
+               template.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                               + consulHealthService.getServiceLocation(whatService,
+                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                               + "/widget/microservices/widgetCatalog/" + widgetId,
+                               HttpMethod.PUT, new HttpEntity<>(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.DELETE)
+       public void deleteOnboardingWidget(@PathVariable("widgetId") long widgetId) throws Exception {
+               template.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                               + consulHealthService.getServiceLocation(whatService,
+                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                               + "/widget/microservices/widgetCatalog/" + widgetId,
+                               HttpMethod.DELETE, new HttpEntity<>(WidgetServiceHeaders.getInstance()), String.class);
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST)
+       public String updateWidgetCatalogWithFiles(HttpServletRequest request,
+                       @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+               MultipartHttpServletRequest mRequest;
+               MultiValueMap<String, Object> multipartRequest = new LinkedMultiValueMap<>();
+               String fileName;
+               String tmpFolderName = "/tmp/";
+               String respond = null;
+               FileOutputStream fo = null;
+               try {
+                       mRequest = (MultipartHttpServletRequest) request;
+                       MultipartFile mFile = mRequest.getFile("file");
+                       fileName = mFile.getOriginalFilename();
+                       fo = new FileOutputStream(tmpFolderName + fileName);
+                       fo.write(mFile.getBytes());
+                       // silence sonar scan by calling close here
+                       fo.close();
+                       fo = null;
+
+                       HttpHeaders header = new HttpHeaders();
+                       header.setContentType(MediaType.MULTIPART_FORM_DATA);
+                       multipartRequest.add("file", new FileSystemResource(tmpFolderName + fileName));
+                       multipartRequest.add("widget", request.getParameter("newWidget"));
+                       respond = template.postForObject(
+                                       EcompPortalUtils.widgetMsProtocol() + "://"
+                                                       + consulHealthService.getServiceLocation(whatService,
+                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                                       + "/widget/microservices/widgetCatalog/" + widgetId,
+                                       new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
+                       File f = new File(tmpFolderName + fileName);
+                       f.delete();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "updateWidgetCatalogWithFiles failed", e);
+               } finally {
+                       try {
+                               if (fo != null)
+                                       fo.close();
+                       } catch (IOException e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "updateWidgetCatalogWithFiles failed 2", e);
+                       }
+               }
+               return respond;
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.POST)
+       public String createWidgetCatalog(HttpServletRequest request)
+                       throws Exception {
+               MultipartHttpServletRequest mRequest;
+               MultiValueMap<String, Object> multipartRequest = new LinkedMultiValueMap<>();
+               String fileName;
+               String tmpFolderName = "/tmp/";
+               String respond = null;
+               FileOutputStream fo = null;
+               try {
+                       mRequest = (MultipartHttpServletRequest) request;
+                       MultipartFile mFile = mRequest.getFile("file");
+                       fileName = mFile.getOriginalFilename();
+                       fo = new FileOutputStream(tmpFolderName + fileName);
+                       fo.write(mFile.getBytes());
+                       // silence sonar scan by calling close here
+                       fo.close();
+                       fo = null;
+
+                       HttpHeaders header = new HttpHeaders();
+                       header.setContentType(MediaType.MULTIPART_FORM_DATA);
+                       multipartRequest.add("file", new FileSystemResource(tmpFolderName + fileName));
+                       multipartRequest.add("widget", request.getParameter("newWidget"));
+
+                       respond = template.postForObject(
+                                       EcompPortalUtils.widgetMsProtocol() + "://"
+                                                       + consulHealthService.getServiceLocation(whatService,
+                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                                       + "/widget/microservices/widgetCatalog",
+                                       new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
+                       File f = new File(tmpFolderName + fileName);
+                       f.delete();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "createWidgetCatalog failed", e);
+               } finally {
+                       try {
+                               if (fo != null)
+                                       fo.close();
+                       } catch (IOException e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "createWidgetCatalog failed 2", e);
+                       }
+               }
+               return respond;
+       }
+
+       @RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
+       public String getWidgetFramework(@PathVariable("widgetId") long widgetId) throws Exception {
+               return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+                               + consulHealthService.getServiceLocation(whatService,
+                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                               + "/widget/microservices/" + 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() + "://"
+                               + consulHealthService.getServiceLocation(whatService,
+                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                               + "/widget/microservices/" + widgetId + "/controller.js", String.class,
+                               WidgetServiceHeaders.getInstance());
+       }
+
+       @RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET)
+       public String getWidgetCSS(@PathVariable("widgetId") long widgetId) throws Exception {
+               return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
+                               + consulHealthService.getServiceLocation(whatService,
+                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                               + "/widget/microservices/" + widgetId + "/styles.css", String.class,
+                               WidgetServiceHeaders.getInstance());
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/parameters/{widgetId}" }, method = RequestMethod.GET)
+       public PortalRestResponse<List<WidgetParameterResult>> getWidgetParameterResult(HttpServletRequest request,
+                       @PathVariable("widgetId") long widgetId) throws Exception {
+               EPUser user = EPUserUtils.getUserSession(request);
+
+               List<WidgetParameterResult> list = new ArrayList<>();
+               Long serviceId = template.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                               + consulHealthService.getServiceLocation(whatService,
+                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                               + "/widget/microservices/widgetCatalog/parameters/" + widgetId,
+                               HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), Long.class).getBody();
+               if (serviceId == null) {
+                       // return ok/sucess and no service parameter for this widget
+                       return new PortalRestResponse<List<WidgetParameterResult>>(PortalRestStatusEnum.WARN,
+                                       "No service parameters for this widget", list);
+               } else {
+                       List<MicroserviceParameter> defaultParam = microserviceService.getParametersById(serviceId);
+                       for (MicroserviceParameter param : defaultParam) {
+                               WidgetParameterResult userResult = new WidgetParameterResult();
+                               userResult.setParam_id(param.getId());
+                               userResult.setDefault_value(param.getPara_value());
+                               userResult.setParam_key(param.getPara_key());
+                               WidgetCatalogParameter userValue = widgetParameterService.getUserParamById(widgetId, user.getId(),
+                                               param.getId());
+                               if (userValue == null)
+                                       userResult.setUser_value(param.getPara_value());
+                               else {
+                                       userResult.setUser_value(userValue.getUser_value());
+                               }
+                               list.add(userResult);
+                       }
+               }
+               return new PortalRestResponse<List<WidgetParameterResult>>(PortalRestStatusEnum.OK, "SUCCESS", list);
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.GET)
+       public List<WidgetCatalogParameter> getUserParameterById(       @PathVariable("paramId") long paramId) {
+               List<WidgetCatalogParameter> list = widgetParameterService.getUserParameterById(paramId);
+               return list;
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.DELETE)
+       public void deleteUserParameterById(@PathVariable("paramId") long paramId) {
+               widgetParameterService.deleteUserParameterById(paramId);
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/download/{widgetId}" }, method = RequestMethod.GET)
+       public void doDownload(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("widgetId") long widgetId) throws Exception {
+
+               ServletContext context = request.getServletContext();
+               byte[] byteFile = template
+                               .exchange(
+                                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                                               + consulHealthService.getServiceLocation(whatService,
+                                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
+                                                               + "/widget/microservices/download/" + widgetId,
+                                               HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), byte[].class)
+                               .getBody();
+
+               File downloadFile = File.createTempFile("temp", ".zip");
+               FileOutputStream stream = new FileOutputStream(downloadFile.getPath());
+               stream.write(byteFile);
+               stream.close();
+
+               FileInputStream inputStream = new FileInputStream(downloadFile);
+               String mimeType = context.getMimeType(downloadFile.getPath());
+               if (mimeType == null) {
+                       mimeType = "application/octet-stream";
+               }
+
+               response.setContentType(mimeType);
+               response.setContentLength((int) downloadFile.length());
+               String headerKey = "Content-Disposition";
+               String headerValue = String.format("attachment; filename=\"%s\"", downloadFile.getName());
+               downloadFile.delete();
+               response.setHeader(headerKey, headerValue);
+
+               OutputStream outStream = response.getOutputStream();
+               byte[] buffer = new byte[32 * 1024];
+               int bytesRead;
+               while ((bytesRead = inputStream.read(buffer)) != -1) {
+                       outStream.write(buffer, 0, bytesRead);
+               }
+
+               inputStream.close();
+               outStream.close();
+       }
+
+       @RequestMapping(value = { "/portalApi/microservices/parameters" }, method = RequestMethod.POST)
+       public PortalRestResponse<String> saveWidgetParameter(HttpServletRequest request,
+                       @RequestBody WidgetCatalogParameter widgetParameters) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               widgetParameters.setUserId(user.getId());
+               try {
+                       WidgetCatalogParameter oldParam = widgetParameterService.getUserParamById(widgetParameters.getWidgetId(),
+                                       widgetParameters.getUserId(), widgetParameters.getParamId());
+                       if (oldParam != null) {
+                               widgetParameters.setId(oldParam.getId());
+                       }
+                       widgetParameterService.saveUserParameter(widgetParameters);
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveWidgetParameter failed", e);
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
+       }
+}
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
new file mode 100644 (file)
index 0000000..f721088
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPUnRestrictedBaseController;
+import org.onap.portalapp.portal.domain.WidgetServiceHeaders;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.ConsulHealthService;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+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.web.bind.annotation.PathVariable;
+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.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogMarkupController.class);
+       private RestTemplate template = new RestTemplate();
+       private final String whatService = "widgets-service";
+
+       @Autowired
+       private ConsulHealthService consulHealthService;
+
+       @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 (hostname.equals("localhost")) {
+                                       return true;
+                               }
+                               return false;
+                       }
+               });
+       }
+
+       @RequestMapping(value = "/portalApi/microservices/markup/{widgetId}", method = RequestMethod.GET)
+       public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
+               return template
+                               .getForObject(
+                                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                                               + consulHealthService.getServiceLocation(whatService,
+                                                                               SystemProperties.getProperty("microservices.widget.local.port"))
+                                                               + "/widget/microservices/markup/" + widgetId,
+                                               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
new file mode 100644 (file)
index 0000000..fec16b0
--- /dev/null
@@ -0,0 +1,186 @@
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.PersUserWidgetService;
+import org.onap.portalapp.portal.service.WidgetService;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.OnboardingWidget;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class WidgetsController extends EPRestrictedBaseController {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsController.class);
+       
+       @Autowired
+       private AdminRolesService adminRolesService;
+       @Autowired
+       private WidgetService widgetService;
+       @Autowired
+       private PersUserWidgetService persUserWidgetService;
+
+       @RequestMapping(value = { "/portalApi/widgets" }, method = RequestMethod.GET, produces = "application/json")
+       public List<OnboardingWidget> getOnboardingWidgets(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<OnboardingWidget> onboardingWidgets = null;
+               
+               if (user == null || user.isGuest()) {
+                       EcompPortalUtils.setBadPermissions(user, response, "getOnboardingWidgets");
+               } else {
+                       String getType = request.getHeader("X-Widgets-Type");
+                       if (!StringUtils.isEmpty(getType) && (getType.equals("managed") || getType.equals("all"))) {
+                               onboardingWidgets = widgetService.getOnboardingWidgets(user, getType.equals("managed"));
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "WidgetsController.getOnboardingApps - request must contain header 'X-Widgets-Type' with 'all' or 'managed'");
+                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+                       }
+               }
+               
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/widgets", "GET result =", response.getStatus());
+               return onboardingWidgets;
+       }
+
+       private boolean userHasPermissions(EPUser user, HttpServletResponse response, String invocator) {
+               if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, invocator);
+                       return false;
+               }
+               return true;
+       }
+
+       // 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 }, produces = "application/json")
+       public FieldsValidator putOnboardingWidget(HttpServletRequest request, @PathVariable("widgetId") Long widgetId,
+                       @RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (userHasPermissions(user, response, "putOnboardingWidget")) {
+                       onboardingWidget.id = widgetId; // !
+                       onboardingWidget.normalize();
+                       fieldsValidator = widgetService.setOnboardingWidget(user, onboardingWidget);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               }
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/widgets/" + widgetId, "GET result =", response.getStatus());
+               
+               return fieldsValidator;
+       }
+
+       // 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")
+       public FieldsValidator postOnboardingWidget(HttpServletRequest request, @RequestBody OnboardingWidget onboardingWidget, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null; ;
+               
+               if (userHasPermissions(user, response, "postOnboardingWidget")) {
+                       onboardingWidget.id = null; // !
+                       onboardingWidget.normalize();
+                       fieldsValidator = widgetService.setOnboardingWidget(user, onboardingWidget);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               }
+               
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/widgets", "POST result =", response.getStatus());
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = { "/portalApi/widgets/{widgetId}" }, method = { RequestMethod.DELETE }, produces = "application/json")
+       public FieldsValidator deleteOnboardingWidget(HttpServletRequest request, @PathVariable("widgetId") Long widgetId, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null; ;
+               
+               if (userHasPermissions(user, response, "deleteOnboardingWidget")) {
+                       fieldsValidator = widgetService.deleteOnboardingWidget(user, widgetId);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               }
+               
+               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/widgets/" + widgetId, "DELETE result =", response.getStatus());
+               return fieldsValidator;
+       }
+       
+       /**
+        * service to accept a user's action made on the application
+        * catalog.
+        * 
+        * @param request
+        * @param selectRequest
+        *            JSON with data including application ID
+        * @param response
+        * @return FieldsValidator
+        * @throws IOException
+        */
+       @RequestMapping(value = { "portalApi/widgetCatalogSelection" }, method = RequestMethod.PUT, produces = "application/json")
+       public FieldsValidator putWidgetCatalogSelection(HttpServletRequest request,
+                       @RequestBody org.onap.portalapp.portal.transport.WidgetCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
+               FieldsValidator result = new FieldsValidator();
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (persRequest.getWidgetId() == null || user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "putWidgetCatalogSelection");
+                       } else {
+                               persUserWidgetService.setPersUserAppValue(user, persRequest.getWidgetId(), persRequest.getSelect());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Failed in putAppCatalogSelection", e);
+                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
+               }
+               result.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+               return result;
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AdminUserApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AdminUserApp.java
new file mode 100644 (file)
index 0000000..72bd798
--- /dev/null
@@ -0,0 +1,106 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class AdminUserApp implements Serializable{
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name="USER_ID")
+       private Long user_Id;
+       
+       @Column(name="FIRST_NAME")
+       private String firstName;
+       
+       @Column(name="LAST_NAME")
+       private String lastName;
+       
+       @Column(name="ORG_USER_ID")
+       private String orgUserId;
+
+       @Id
+       @Column(name="APP_ID")
+       private Long appId; 
+       
+       @Column(name="APP_NAME")
+       private String appName; 
+       
+       public Long getAppId() {
+               return appId;
+       }
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+       public Long getUser_Id() {
+               return user_Id;
+       }
+       public void setUserId(Long user_Id) {
+               this.user_Id = user_Id;
+       }
+       public String getFirstName() {
+               return firstName;
+       }
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+       public String getLastName() {
+               return lastName;
+       }
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+       public String getAppName() {
+               return appName;
+       }
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AdminUserApplications.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AdminUserApplications.java
new file mode 100644 (file)
index 0000000..ca54d23
--- /dev/null
@@ -0,0 +1,114 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AdminUserApplications {
+       private List<Application> apps = new ArrayList<Application>();
+       
+       private Long user_Id;
+       private String firstName;
+       private String lastName;
+       private String orgUserId;
+       
+       public AdminUserApplications(AdminUserApp app) {
+               setUser_Id(app.getUser_Id());
+               setOrgUserId(app.getOrgUserId());
+               setFirstName(app.getFirstName());
+               setLastName(app.getLastName());
+               
+               addApp(app.getAppId(), app.getAppName());
+       }
+       public Long getUser_Id() {
+               return user_Id;
+       }
+       public void setUser_Id(Long user_Id) {
+               this.user_Id = user_Id;
+       }
+       public String getFirstName() {
+               return firstName;
+       }
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+       public String getLastName() {
+               return lastName;
+       }
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+       public List<Application> getApps() {
+               return apps;
+       }
+       public void setApps(List<Application> apps) {
+               this.apps = apps;
+       }
+       public void addApp(Long otherAppId, String otherAppName) {
+               apps.add(new Application(otherAppId, otherAppName));
+       }
+
+       public class Application {
+               private Long appId; 
+               private String appName; 
+               
+               public Application(Long otherAppId, String otherAppName) {
+                       setAppId(otherAppId);
+                       setAppName(otherAppName);
+               }
+               public Long getAppId() {
+                       return appId;
+               }
+               public void setAppId(Long appId) {
+                       this.appId = appId;
+               }
+               public String getAppName() {
+                       return appName;
+               }
+               public void setAppName(String appName) {
+                       this.appName = appName;
+               }
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/App.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/App.java
new file mode 100644 (file)
index 0000000..aa5a4b8
--- /dev/null
@@ -0,0 +1,80 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+//@Entity
+//@Table(name = "FN_APP")
+public class App implements Serializable{
+       
+       private static final long serialVersionUID = 1L;
+
+       //@Id
+       //@Column(name = "APP_ID")
+       //@GeneratedValue(strategy=GenerationType.AUTO)
+       private Long appId;
+       
+       //@Column(name = "APP_Name")
+       private String appName;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+       
+
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppContactUs.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppContactUs.java
new file mode 100644 (file)
index 0000000..f311762
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+
+public class AppContactUs extends DomainVo {
+
+       private static final long serialVersionUID = -2742197830465055134L;
+
+       @JsonBackReference private EPApp app;
+       private String description;
+       private String contactEmail;
+       private String contactName;
+       private String url;
+       private String activeYN;
+
+       public EPApp getApp() {
+               return app;
+       }
+
+       public void setApp(EPApp app) {
+               this.app = app;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+
+       public void setDescription(String description) {
+               this.description = description;
+       }
+
+       public String getContactEmail() {
+               return contactEmail;
+       }
+
+       public void setContactEmail(String contactEmail) {
+               this.contactEmail = contactEmail;
+       }
+
+       public String getContactName() {
+               return contactName;
+       }
+
+       public void setContactName(String contactName) {
+               this.contactName = contactName;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public String getActiveYN() {
+               return activeYN;
+       }
+
+       public void setActiveYN(String activeYN) {
+               this.activeYN = activeYN;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppIdAndNameTransportModel.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppIdAndNameTransportModel.java
new file mode 100644 (file)
index 0000000..d57e282
--- /dev/null
@@ -0,0 +1,81 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class AppIdAndNameTransportModel implements Serializable{
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name="APP_ID")
+       private Long id;
+       
+       @Column(name="APP_NAME")
+       private String name;
+
+       @Column(name="APP_TYPE")
+       private Integer appType;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+       
+       public Boolean isRestrictedApp() {
+               return (this.appType == 2 ? true : false);
+       }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppsResponse.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/AppsResponse.java
new file mode 100644 (file)
index 0000000..a7835fd
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+public class AppsResponse {
+       
+       public AppsResponse(Long id, String name, Boolean restrictedApp, Boolean enabled) {
+               this.index = id;
+               this.title = this.value = name;
+               this.restrictedApp = restrictedApp;
+               this.enabled = enabled;
+       }
+
+       public Long getIndex() {
+               return index;
+       }
+
+       public void setIndex(Long index) {
+               this.index = index;
+       }
+
+       public String getTitle() {
+               return title;
+       }
+
+       public void setTitle(String title) {
+               this.title = title;
+       }
+
+       public String getValue() {
+               return value;
+       }
+
+       public void setValue(String value) {
+               this.value = value;
+       }
+
+       // 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 setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+       
+       public Boolean getEnabled() {
+               return enabled;
+       }
+       
+       public void setEnabled(Boolean enabled) {
+               this.enabled = enabled;
+       }
+
+       private Long index;
+       private String title;
+       private String value;
+       public Boolean restrictedApp;
+       public Boolean enabled;
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/BEProperty.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/BEProperty.java
new file mode 100644 (file)
index 0000000..737f4ab
--- /dev/null
@@ -0,0 +1,96 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+public class BEProperty {
+       private String key;
+       private String value;
+
+       public BEProperty(String key, String value) {
+               this.key = key;
+               this.value = value;
+       }
+
+       public String getKey() {
+               return key;
+       }
+
+       public void setKey(String key) {
+               this.key = key;
+       }
+
+       public String getValue() {
+               return value;
+       }
+
+       public void setValue(String value) {
+               this.value = value;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((key == null) ? 0 : key.hashCode());
+               result = prime * result + ((value == null) ? 0 : value.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               BEProperty other = (BEProperty) obj;
+               if (key == null) {
+                       if (other.key != null)
+                               return false;
+               } else if (!key.equals(other.key))
+                       return false;
+               if (value == null) {
+                       if (other.value != null)
+                               return false;
+               } else if (!value.equals(other.value))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/BasicAuthCredentials.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/BasicAuthCredentials.java
new file mode 100644 (file)
index 0000000..30dad84
--- /dev/null
@@ -0,0 +1,113 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.List;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class BasicAuthCredentials extends DomainVo {
+       
+       private static final long serialVersionUID = 1L;
+
+       public BasicAuthCredentials() {
+
+       }
+       
+       private Long id;
+       private String applicationName;
+       private String username;
+       private String password;
+       private String isActive;
+       private List<EPEndpoint> endpoints;
+       
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getApplicationName() {
+               return applicationName;
+       }
+
+       public void setApplicationName(String applicationName) {
+               this.applicationName = applicationName;
+       }
+
+       public String getUsername() {
+               return username;
+       }
+
+       public void setUsername(String username) {
+               this.username = username;
+       }
+
+       public String getPassword() {
+               return password;
+       }
+
+       public void setPassword(String password) {
+               this.password = password;
+       }
+
+       public String getIsActive() {
+               return isActive;
+       }
+
+       public void setIsActive(String isActive) {
+               this.isActive = isActive;
+       }
+       
+       public List<EPEndpoint> getEndpoints() {
+               return endpoints;
+       }
+
+       public void setEndpoints(List<EPEndpoint> endpoints) {
+               this.endpoints = endpoints;
+       }
+
+       @Override
+       public String toString() {
+               return "BasicAuthCredentials [id=" + id + ", applicationName=" + applicationName + ", username=" + username
+                               + ", password=" + password + ", isActive=" + isActive + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralV2RoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralV2RoleFunction.java
new file mode 100644 (file)
index 0000000..05c87ba
--- /dev/null
@@ -0,0 +1,188 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+@SuppressWarnings("rawtypes")
+public class CentralV2RoleFunction extends DomainVo implements Serializable, Comparable{
+       
+          /**
+        * 
+        */
+       private static final long serialVersionUID = -4018975640065252688L;
+          private String code;
+          private String name;
+          @JsonIgnore
+          private Long appId;
+          @JsonIgnore
+          private Long roleId;
+          private String type;
+          private String action;
+          private String editUrl;
+          
+          
+       public CentralV2RoleFunction() {
+       
+       }
+       
+       
+       public CentralV2RoleFunction(Long id, String code, String name, Long appId, String type, String action,String editUrl) {
+               super();
+               this.id = id;
+               this.code = code;
+               this.name = name;
+               this.appId = appId;
+               this.type = type;
+               this.action = action;
+               this.editUrl = editUrl;
+       }
+       
+       public CentralV2RoleFunction(Long id, String code, String name, Long appId,String editUrl) {
+               super();
+               this.id = id;
+               this.code = code;
+               this.name = name;
+               this.appId = appId;
+               this.editUrl = editUrl;
+       }
+       
+       
+
+       public CentralV2RoleFunction(String code, String name) {
+               super();
+               this.code = code;
+               this.name = name;
+       }
+
+       /**
+        * @return the code
+        */
+       public String getCode() {
+               return code;
+       }
+       /**
+        * @param code the code to set
+        */
+       public void setCode(String code) {
+               this.code = code;
+       }
+       /**
+        * @return the name
+        */
+       public String getName() {
+               return name;
+       }
+       /**
+        * @param name the name to set
+        */
+       public void setName(String name) {
+               this.name = name;
+       }
+       /**
+        * @return the appId
+        */
+       public Long getAppId() {
+               return appId;
+       }
+       /**
+        * @param appId the appId to set
+        */
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+       /**
+        * @return the editUrl
+        */
+       public String getEditUrl() {
+               return editUrl;
+       }
+       /**
+        * @param editUrl the editUrl to set
+        */
+       public void setEditUrl(String editUrl) {
+               this.editUrl = editUrl;
+       }
+       
+       
+    /**
+        * @return the type
+        */
+       public String getType() {
+               return type;
+       }
+
+
+       /**
+        * @param type the type to set
+        */
+       public void setType(String type) {
+               this.type = type;
+       }
+
+
+       /**
+        * @return the action
+        */
+       public String getAction() {
+               return action;
+       }
+
+
+       /**
+        * @param action the action to set
+        */
+       public void setAction(String action) {
+               this.action = action;
+       }
+
+
+       public int compareTo(Object obj){
+        String c1 = getName();
+        String c2 = ((CentralV2RoleFunction)obj).getName();
+
+        return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+      }
+       
+       
+   
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralizedApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralizedApp.java
new file mode 100644 (file)
index 0000000..2e902b8
--- /dev/null
@@ -0,0 +1,81 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CentralizedApp implements Serializable{
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -3773410386555027935L;
+
+       @Id
+       @Column(name="app_id")
+       private int appId;
+        
+       @Id
+       @Column(name="app_name") 
+       private String appName;
+
+       public int getAppId() {
+               return appId;
+       }
+
+       public void setAppId(int appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+               
+}
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
new file mode 100644 (file)
index 0000000..6f593df
--- /dev/null
@@ -0,0 +1,484 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Arrays;
+
+import javax.persistence.Lob;
+
+import org.apache.commons.lang.StringUtils;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Model for all columns in the fn_app table.
+ */
+public class EPApp extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+
+       private String name;
+       private String imageUrl;
+       private String description;
+       private String notes;
+       private String url;
+       private String alternateUrl;
+       private String appRestEndpoint;
+       private String mlAppName;
+       private String mlAppAdminId;
+       private Long motsId;
+       private String username;
+       private String appPassword;
+       @Lob
+       private byte[] thumbnail;
+       private Boolean open;
+       private Boolean enabled;
+       private String uebTopicName;
+       private String uebKey;
+       private String uebSecret;
+       private Integer appType;
+       private AppContactUs contactUs;
+       private Boolean centralAuth;
+       private String  nameSpace;
+
+       public EPApp() {
+               // Attention!!!
+               // We set here all default values. We also place protection
+               // into setters for fields with default values.
+               // If we don't use such protection we are able to place null
+               // to these fields and save such fields into DB even if DB has
+               // default values for these fields.
+               this.name = "";
+               this.mlAppName = "";
+               this.mlAppAdminId = "";
+               this.username = "";
+               this.appPassword = "";
+               this.open = new Boolean(false);
+               this.enabled = new Boolean(true);
+               this.uebTopicName = "";
+               this.uebKey = "";
+               this.uebSecret = "";
+               this.appType = 1;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               if (StringUtils.isEmpty(name)) {
+                       name = "";
+               }
+               this.name = name;
+       }
+
+       public String getImageUrl() {
+               return imageUrl;
+       }
+
+       public void setImageUrl(String imageUrl) {
+               this.imageUrl = imageUrl;
+       }
+
+
+
+       public byte[] getThumbnail() {
+               return this.thumbnail;
+       }
+
+       public void setThumbnail(byte[] thumbnail) {
+               this.thumbnail = thumbnail;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+
+       public void setDescription(String description) {
+               this.description = description;
+       }
+
+       public String getNotes() {
+               return notes;
+       }
+
+       public void setNotes(String notes) {
+               this.notes = notes;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public String getAlternateUrl() {
+               return alternateUrl;
+       }
+
+       public void setAlternateUrl(String alternateUrl) {
+               this.alternateUrl = alternateUrl;
+       }
+
+       public String getAppRestEndpoint() {
+               return appRestEndpoint;
+       }
+
+       public void setAppRestEndpoint(String appRestEndpoint) {
+               this.appRestEndpoint = appRestEndpoint;
+       }
+
+       public String getMlAppName() {
+               return mlAppName;
+       }
+
+       public void setMlAppName(String mlAppName) {
+               if (StringUtils.isEmpty(mlAppName)) {
+                       mlAppName = "";
+               }
+               this.mlAppName = mlAppName;
+       }
+
+       public String getMlAppAdminId() {
+               return mlAppAdminId;
+       }
+
+       public void setMlAppAdminId(String mlAppAdminId) {
+               if (StringUtils.isEmpty(mlAppAdminId)) {
+                       mlAppAdminId = "";
+               }
+               this.mlAppAdminId = mlAppAdminId;
+       }
+
+       public Long getMotsId() {
+               return motsId;
+       }
+
+       public void setMotsId(Long motsId) {
+               this.motsId = motsId;
+       }
+
+       public String getUsername() {
+               return username;
+       }
+
+       public void setUsername(String username) {
+               this.username = username;
+       }
+
+       public String getAppPassword() {
+               return appPassword;
+       }
+
+       public void setAppPassword(String appPassword) {
+               if (StringUtils.isEmpty(appPassword)) {
+                       appPassword = "";
+               }
+               this.appPassword = appPassword;
+       }
+
+       public Boolean getOpen() {
+               return open;
+       }
+
+       public void setOpen(Boolean open) {
+               if (open == null) {
+                       open = new Boolean(false);
+               }
+               this.open = open;
+       }
+
+       public Boolean getEnabled() {
+               return enabled;
+       }
+
+       public void setEnabled(Boolean enabled) {
+               if (enabled == null) {
+                       enabled = new Boolean(true);
+               }
+               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);
+       }
+
+       public int compareTo(Object obj) {
+               Long c1 = getId();
+               Long c2 = ((EPApp) obj).getId();
+
+               return c1.compareTo(c2);
+       }
+
+       public String getUebTopicName() {
+               return this.uebTopicName;
+       }
+
+       public void setUebTopicName(String topicName) {
+               if (StringUtils.isEmpty(topicName)) {
+                       this.uebTopicName = "";
+               }
+               this.uebTopicName = topicName;
+       }
+
+       public String getUebKey() {
+               return this.uebKey;
+       }
+
+       public void setUebKey(String uebKey) {
+               if (StringUtils.isEmpty(uebKey)) {
+                       this.uebKey = "";
+               }
+               this.uebKey = uebKey;
+       }
+
+       public String getUebSecret() {
+               return this.uebSecret;
+       }
+
+       public void setUebSecret(String uebSecret) {
+               if (StringUtils.isEmpty(uebSecret)) {
+                       this.uebSecret = "";
+               }
+               this.uebSecret = uebSecret;
+       }
+
+       public AppContactUs getContactUs() {
+               return contactUs;
+       }
+
+       public void setContactUs(AppContactUs contactUs) {
+               this.contactUs = contactUs;
+       }
+       
+       public Boolean getCentralAuth() {
+               return centralAuth;
+       }
+
+       public void setCentralAuth(Boolean centralAuth) {
+               if (centralAuth == null) {
+                       centralAuth = new Boolean(false);
+               }
+               this.centralAuth = centralAuth;
+       }
+       
+       public String getNameSpace() {
+               return nameSpace;
+       }
+
+       public void setNameSpace(String nameSpace) {
+               if (StringUtils.isEmpty(nameSpace)) {
+                       nameSpace = null;
+               }
+               this.nameSpace = nameSpace;
+       }
+
+       @Override
+       public String toString() {
+               String str = "[" + getId() + ":" + getName() + "]";
+               return str;
+       }
+
+       @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 + ((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 + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode());
+               result = prime * result + ((mlAppName == null) ? 0 : mlAppName.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 + 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());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               EPApp other = (EPApp) obj;
+               if (alternateUrl == null) {
+                       if (other.alternateUrl != null)
+                               return false;
+               } else if (!alternateUrl.equals(other.alternateUrl))
+                       return false;
+               if (appPassword == null) {
+                       if (other.appPassword != null)
+                               return false;
+               } else if (!appPassword.equals(other.appPassword))
+                       return false;
+               if (appRestEndpoint == null) {
+                       if (other.appRestEndpoint != null)
+                               return false;
+               } 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 (centralAuth == null) {
+                       if (other.centralAuth != null)
+                               return false;
+               } else if (!centralAuth.equals(other.centralAuth))
+                       return false;
+               if (contactUs == null) {
+                       if (other.contactUs != null)
+                               return false;
+               } else if (!contactUs.equals(other.contactUs))
+                       return false;
+               if (description == null) {
+                       if (other.description != null)
+                               return false;
+               } else if (!description.equals(other.description))
+                       return false;
+               if (enabled == null) {
+                       if (other.enabled != null)
+                               return false;
+               } else if (!enabled.equals(other.enabled))
+                       return false;
+               if (imageUrl == null) {
+                       if (other.imageUrl != null)
+                               return false;
+               } else if (!imageUrl.equals(other.imageUrl))
+                       return false;
+               if (mlAppAdminId == null) {
+                       if (other.mlAppAdminId != null)
+                               return false;
+               } else if (!mlAppAdminId.equals(other.mlAppAdminId))
+                       return false;
+               if (mlAppName == null) {
+                       if (other.mlAppName != null)
+                               return false;
+               } else if (!mlAppName.equals(other.mlAppName))
+                       return false;
+               if (motsId == null) {
+                       if (other.motsId != null)
+                               return false;
+               } else if (!motsId.equals(other.motsId))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       return false;
+               if (nameSpace == null) {
+                       if (other.nameSpace != null)
+                               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 (!Arrays.equals(thumbnail, other.thumbnail))
+                       return false;
+               if (uebKey == null) {
+                       if (other.uebKey != null)
+                               return false;
+               } else if (!uebKey.equals(other.uebKey))
+                       return false;
+               if (uebSecret == null) {
+                       if (other.uebSecret != null)
+                               return false;
+               } else if (!uebSecret.equals(other.uebSecret))
+                       return false;
+               if (uebTopicName == null) {
+                       if (other.uebTopicName != null)
+                               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)
+                               return false;
+               } else if (!username.equals(other.username))
+                       return false;
+               return true;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPAppRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPAppRoleFunction.java
new file mode 100644 (file)
index 0000000..559050b
--- /dev/null
@@ -0,0 +1,101 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPAppRoleFunction extends DomainVo  implements java.io.Serializable{
+
+       private static final long serialVersionUID = 7752385247460299630L;
+       
+       private Long roleId;
+       private Long appId;
+       private String code;
+       private String roleAppId;
+       
+       /**
+        * @return the roleId
+        */
+       public Long getRoleId() {
+               return roleId;
+       }
+       /**
+        * @param roleId the roleId to set
+        */
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+       /**
+        * @return the appId
+        */
+       public Long getAppId() {
+               return appId;
+       }
+       /**
+        * @param appId the appId to set
+        */
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+       /**
+        * @return the code
+        */
+       public String getCode() {
+               return code;
+       }
+       /**
+        * @param code the code to set
+        */
+       public void setCode(String code) {
+               this.code = code;
+       }
+       /**
+        * 
+        * @return the roles app Id
+        */
+       public String getRoleAppId() {
+               return roleAppId;
+       }
+       /**
+        * 
+        * @param roleAppId
+        */
+       public void setRoleAppId(String roleAppId) {
+               this.roleAppId = roleAppId;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPEndpoint.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPEndpoint.java
new file mode 100644 (file)
index 0000000..c967919
--- /dev/null
@@ -0,0 +1,74 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPEndpoint extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+
+       public EPEndpoint() {
+
+       }
+
+       private Long id;
+       private String name;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       @Override
+       public String toString() {
+               return "EPEndpoint [id=" + id + ", name=" + name + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPEndpointAccount.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPEndpointAccount.java
new file mode 100644 (file)
index 0000000..3184be4
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPEndpointAccount extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+
+       public EPEndpointAccount() {
+
+       }
+
+       private Long id;
+       private Long ep_id;
+       private Long account_id;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public Long getEp_id() {
+               return ep_id;
+       }
+
+       public void setEp_id(Long ep_id) {
+               this.ep_id = ep_id;
+       }
+
+       public Long getAccount_id() {
+               return account_id;
+       }
+
+       public void setAccount_id(Long account_id) {
+               this.account_id = account_id;
+       }
+
+       @Override
+       public String toString() {
+               return "EPEndpointAccount [id=" + id + ", ep_id=" + ep_id + ", account_id=" + account_id + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPRole.java
new file mode 100644 (file)
index 0000000..601c763
--- /dev/null
@@ -0,0 +1,221 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Iterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class EPRole extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+       private String  name;
+    private boolean active;
+    private Integer priority;
+    
+    // ECOMP will identify the specific remote application role id by appID;appRoleId among all the application roles it persists.
+    private Long appId;     // used by ECOMP only 
+    private Long appRoleId; // used by ECOMP only
+
+    private SortedSet<RoleFunction>     roleFunctions = new TreeSet<RoleFunction>();
+    
+    private SortedSet<EPRole> childRoles = new TreeSet<EPRole>();
+    
+    @JsonIgnore
+    private SortedSet<EPRole> parentRoles = new TreeSet<EPRole>();
+
+    public EPRole() {}
+
+    public String getName() {
+        return name;
+    }
+
+    public boolean getActive() {
+        return active;
+    }
+
+    public SortedSet<RoleFunction> getRoleFunctions() {
+        return roleFunctions;
+    }
+
+    public Integer getPriority() {
+        return priority;
+    }
+
+    public SortedSet<EPRole> getChildRoles() {
+        return childRoles;
+    }
+
+    public SortedSet<EPRole> getParentRoles() {
+        return parentRoles;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setActive(boolean active) {
+        this.active = active;
+    }
+
+    public void setRoleFunctions(SortedSet<RoleFunction> roleFunctions) {
+        this.roleFunctions = roleFunctions;
+    }
+
+    public void setPriority(Integer priority) {
+        this.priority = priority;
+    }
+
+    public void setChildRoles(SortedSet<EPRole> childRoles) {
+        this.childRoles = childRoles;
+    }
+
+    public void setParentRoles(SortedSet<EPRole> parentRoles) {
+        this.parentRoles = parentRoles;
+    }
+
+    public void addRoleFunction(RoleFunction roleFunction) {
+        this.roleFunctions.add(roleFunction);
+    }
+
+    public void addChildRole(EPRole role) {
+        this.childRoles.add(role);
+    }
+
+    public void addParentRole(EPRole role) {
+        this.parentRoles.add(role);
+    }
+
+    public String getEditUrl() {
+        return "/role.htm?role_id=" + getId();         
+    }
+    
+       public String getToggleActiveImage() {
+               return "/static/fusion/images/" + (getActive() ? "active.png" : "inactive.png" );
+       }
+
+       public String getToggleActiveAltText() {
+               return getActive() ? "Click to Deactivate Role" : "Click to Activate Role";
+       }
+    
+    public void removeChildRole(Long roleId) {
+      Iterator<EPRole> i = this.childRoles.iterator();
+
+      while (i.hasNext()) {
+        EPRole childRole = (EPRole)i.next();
+        if (childRole.getId().equals(roleId)) {
+          this.childRoles.remove(childRole);
+          break;
+        }
+      }
+    }
+
+    public void removeParentRole(Long roleId) {
+        Iterator<EPRole> i = this.parentRoles.iterator();
+
+        while (i.hasNext()) {
+          EPRole parentRole = (EPRole)i.next();
+          if (parentRole.getId().equals(roleId)) {
+            this.parentRoles.remove(parentRole);
+            break;
+          }
+        }
+      }
+
+    public void removeRoleFunction(String roleFunctionCd) {
+      Iterator<RoleFunction> i = this.roleFunctions.iterator();
+
+      while (i.hasNext()) {
+        RoleFunction roleFunction = (RoleFunction)i.next();
+        if (roleFunction.getCode().equals(roleFunctionCd)) {
+          this.roleFunctions.remove(roleFunction);
+          break;
+        }
+      }
+    }
+
+    public int compareTo(Object obj){
+       EPRole other = (EPRole)obj;
+
+       if(this.appId == null)
+               if(other.getAppId() == null)
+                       return compareByName(other); //equal
+               else
+                       return -1; 
+       else // this.appId != null
+               if(other.getAppId() == null)
+                       return 1;  // appId != null, but others is null
+               else{
+                       int appIdCompareResult = appId.compareTo(other.getAppId());
+                       return appIdCompareResult == 0? compareByName(other) : appIdCompareResult;
+               }
+    }
+
+       private int compareByName(EPRole other) {
+               String c1 = getName();
+       String c2 = other.getName();
+
+       return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+       }
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public Long getAppRoleId() {
+               return appRoleId;
+       }
+
+       public void setAppRoleId(Long appRoleId) {
+               this.appRoleId = appRoleId;
+       }
+       
+       @Override
+       public String toString() {
+               return "[Id = " + id + ", name = " + name + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUser.java
new file mode 100644 (file)
index 0000000..e743520
--- /dev/null
@@ -0,0 +1,668 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Date;
+import java.util.Iterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.domain.User;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class EPUser extends User {
+           
+           private Long   orgId;
+           private Long   managerId;
+           private String firstName;
+           private String middleInitial;
+           private String lastName;
+           private String phone;
+           private String fax;
+           private String cellular;
+           private String email;
+           private Long   addressId;
+           private String alertMethodCd;
+           private String hrid;
+           private String orgUserId;
+           private String orgCode;
+           private String address1;
+           private String address2;
+           private String city;
+           private String state;
+           private String zipCode;
+           private String country;
+           private String orgManagerUserId;
+           private String locationClli;
+           private String businessCountryCode;
+           private String businessCountryName;
+           private String businessUnit;
+           private String businessUnitName;
+           private String department;
+           private String departmentName;
+           private String companyCode;
+           private String company;
+           private String zipCodeSuffix;
+           private String jobTitle;
+           private String commandChain;
+           private String siloStatus;
+           private String costCenter;
+           private String financialLocCode;
+           
+           
+         
+           private String loginId;
+           private String loginPwd;
+           private Date   lastLoginDate;
+           private boolean active;
+           private boolean internal;
+           private Long    selectedProfileId;
+           private Long timeZoneId;
+           private boolean online;
+           private String chatId;
+       
+           private static final long serialVersionUID = 1L;
+
+           private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUser.class);
+               private static final String ECOMP_PORTAL_NAME = "ECOMP";
+               private boolean isGuest = false;
+               
+               private SortedSet<EPUserApp> userApps = new TreeSet<EPUserApp>();
+               private SortedSet<EPRole> pseudoRoles = new TreeSet<EPRole>();
+
+           public EPUser() {}
+
+           public Long getAddressId() {
+               return addressId;
+           }
+
+           public String getAlertMethodCd() {
+               return alertMethodCd;
+           }
+
+           public String getCellular() {
+               return cellular;
+           }
+
+           public String getEmail() {
+               return email;
+           }
+
+           public String getFax() {
+               return fax;
+           }
+
+           public String getFirstName() {
+               return firstName;
+           }
+
+           public String getHrid() {
+               return hrid;
+           }
+
+           public Date getLastLoginDate() {
+               return lastLoginDate;
+           }
+
+           public String getLastName() {
+               return lastName;
+           }
+
+           @JsonIgnore
+           public String getFullName() {
+               return getFirstName() + " " + getLastName();    
+           }
+           
+           public String getLoginId() {
+               return loginId;
+           }
+
+           public String getLoginPwd() {
+               return loginPwd;
+           }
+
+           public Long getManagerId() {
+               return managerId;
+           }
+
+           public String getMiddleInitial() {
+               return middleInitial;
+           }
+
+           public String getOrgCode() {
+               return orgCode;
+           }
+
+           public Long getOrgId() {
+               return orgId;
+           }
+
+           public String getPhone() {
+               return phone;
+           }
+
+           public String getOrgUserId() {
+               return orgUserId;
+           }
+
+           public boolean getActive() {
+               return active;
+           }
+
+           public boolean getInternal() {
+               return internal;
+           }
+
+           public String getAddress1() {
+               return address1;
+           }
+
+           public String getAddress2() {
+               return address2;
+           }
+
+           public String getCity() {
+               return city;
+           }
+
+           public String getCountry() {
+               return country;
+           }
+
+           public String getState() {
+               return state;
+           }
+
+           public String getZipCode() {
+               return zipCode;
+           }
+
+           public String getBusinessCountryCode() {
+               return businessCountryCode;
+           }
+
+           public String getCommandChain() {
+               return commandChain;
+           }
+
+           public String getCompany() {
+               return company;
+           }
+
+           public String getCompanyCode() {
+               return companyCode;
+           }
+
+           public String getDepartment() {
+               return department;
+           }
+
+           public String getJobTitle() {
+               return jobTitle;
+           }
+
+           public String getLocationClli() {
+               return locationClli;
+           }
+
+           public String getOrgManagerUserId() {
+               return orgManagerUserId;
+           }
+
+           public String getZipCodeSuffix() {
+               return zipCodeSuffix;
+           }
+
+           public String getBusinessCountryName() {
+               return businessCountryName;
+           }
+
+           public Long getSelectedProfileId() {
+               return selectedProfileId;
+           }
+
+           public void setAddressId(Long addressId) {
+               this.addressId = addressId;
+           }
+
+           public void setAlertMethodCd(String alertMethodCd) {
+               this.alertMethodCd = alertMethodCd;
+           }
+
+           public void setCellular(String cellular) {
+               this.cellular = cellular;
+           }
+
+           public void setEmail(String email) {
+               this.email = email;
+           }
+
+           public void setFax(String fax) {
+               this.fax = fax;
+           }
+
+           public void setFirstName(String firstName) {
+               this.firstName = firstName;
+           }
+
+           public void setHrid(String hrid) {
+               this.hrid = hrid;
+           }
+
+           public void setLastLoginDate(Date lastLoginDate) {
+               this.lastLoginDate = lastLoginDate;
+           }
+
+           public void setLastName(String lastName) {
+               this.lastName = lastName;
+           }
+
+           public void setLoginId(String loginId) {
+               this.loginId = loginId;
+           }
+
+           public void setLoginPwd(String loginPwd) {
+               this.loginPwd = loginPwd;
+           }
+
+           public void setManagerId(Long managerId) {
+               this.managerId = managerId;
+           }
+
+           public void setMiddleInitial(String middleInitial) {
+               this.middleInitial = middleInitial;
+           }
+
+           public void setOrgCode(String orgCode) {
+               this.orgCode = orgCode;
+           }
+
+           public void setOrgId(Long orgId) {
+               this.orgId = orgId;
+           }
+
+           public void setPhone(String phone) {
+               this.phone = phone;
+           }
+
+           public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+           }
+
+           public void setActive(boolean active) {
+               this.active = active;
+           }
+
+           public void setInternal(boolean internal) {
+               this.internal = internal;
+           }
+
+           public void setAddress1(String address1) {
+               this.address1 = address1;
+           }
+
+           public void setAddress2(String address2) {
+               this.address2 = address2;
+           }
+
+           public void setCity(String city) {
+               this.city = city;
+           }
+
+           public void setCountry(String country) {
+               this.country = country;
+           }
+
+           public void setState(String state) {
+               this.state = state;
+           }
+
+           public void setZipCode(String zipCode) {
+               this.zipCode = zipCode;
+           }
+
+           public void setBusinessCountryCode(String businessCountryCode) {
+               this.businessCountryCode = businessCountryCode;
+           }
+
+           public void setCommandChain(String commandChain) {
+               this.commandChain = commandChain;
+           }
+
+           public void setCompany(String company) {
+               this.company = company;
+           }
+
+           public void setCompanyCode(String companyCode) {
+               this.companyCode = companyCode;
+           }
+
+           public void setDepartment(String department) {
+               this.department = department;
+           }
+
+           public void setJobTitle(String jobTitle) {
+               this.jobTitle = jobTitle;
+           }
+
+           public void setLocationClli(String locationClli) {
+               this.locationClli = locationClli;
+           }
+
+           public void setOrgManagerUserId(String orgManagerUserId) {
+               this.orgManagerUserId = orgManagerUserId;
+           }
+
+           public void setZipCodeSuffix(String zipCodeSuffix) {
+               this.zipCodeSuffix = zipCodeSuffix;
+           }
+
+           public void setBusinessCountryName(String businessCountryName) {
+               this.businessCountryName = businessCountryName;
+           }
+
+           public SortedSet<EPRole> getPseudoRoles() {
+                       return pseudoRoles;
+               }
+           
+           public void setPseudoRoles(SortedSet<EPRole> pseudoRoles) {
+               this.pseudoRoles = pseudoRoles;
+           }
+
+           public void setSelectedProfileId(Long selectedProfileId) {
+               this.selectedProfileId = selectedProfileId;
+           }
+           
+               public Long getTimeZoneId() {
+                       return timeZoneId;
+               }
+
+               public void setTimeZoneId(Long timeZoneId) {
+                       this.timeZoneId = timeZoneId;
+               }
+
+               public String getBusinessUnit() {
+                       return businessUnit;
+               }
+
+               public void setBusinessUnit(String businessUnit) {
+                       this.businessUnit = businessUnit;
+               }
+
+               public String getSiloStatus() {
+                       return siloStatus;
+               }
+
+               public void setSiloStatus(String siloStatus) {
+                       this.siloStatus = siloStatus;
+               }
+
+               public String getCostCenter() {
+                       return costCenter;
+               }
+
+               public void setCostCenter(String costCenter) {
+                       this.costCenter = costCenter;
+               }
+
+               public String getFinancialLocCode() {
+                       return financialLocCode;
+               }
+
+               public void setFinancialLocCode(String financialLocCode) {
+                       this.financialLocCode = financialLocCode;
+               }
+               
+               public String getBusinessUnitName() {
+                       return businessUnitName;
+               }
+
+               public void setBusinessUnitName(String businessUnitName) {
+                       this.businessUnitName = businessUnitName;
+               }
+
+               public String getDepartmentName() {
+                       return departmentName;
+               }
+
+               public void setDepartmentName(String departmentName) {
+                       this.departmentName = departmentName;
+               }
+
+               public int compareTo(Object obj){
+             EPUser user = (EPUser)obj;
+
+             String c1 = getLastName() + getFirstName() + getMiddleInitial();
+             String c2 = user.getLastName() + user.getFirstName() + user.getMiddleInitial();
+
+             return c1.compareTo(c2);
+           }
+
+               public boolean isOnline() {
+                       return online;
+               }
+
+               public void setOnline(boolean online) {
+                       this.online = online;
+               }
+
+               public String getChatId() {
+                       return chatId;
+               }
+
+               public void setChatId(String chatId) {
+                       this.chatId = chatId;
+               }
+
+               
+       public void setPseudoEPRoles(SortedSet<EPRole> pseudoRoles) {
+               this.pseudoRoles = pseudoRoles;
+       }
+       
+       public SortedSet<EPUserApp> getEPUserApps() {
+               return userApps;
+       }
+
+       public void setEPUserApps(SortedSet<EPUserApp> userApps) {
+               this.userApps = userApps;
+       }
+
+       public void addUserApp(EPUserApp userApp) {
+               userApps.add(userApp);
+       }
+       
+       public void addAppRoles(EPApp app, SortedSet<EPRole> roles) {
+               if (roles != null) {
+                       // add all
+                       SortedSet<EPUserApp> userApps = new TreeSet<EPUserApp>();
+                       // this.userApps.removeAll(this.userApps);
+                       Iterator<EPRole> itr = roles.iterator();
+                       while (itr.hasNext()) {
+                               EPRole role = (EPRole) itr.next();
+                               EPUserApp userApp = new EPUserApp();
+                               userApp.setUserId(this.id);
+                               userApp.setApp(app);
+                               userApp.setRole(role);
+                               userApps.add(userApp);
+                       }
+                       setEPUserApps(userApps);
+               } else {
+                       // remove all
+                       setEPUserApps(null);
+               }
+
+       }
+
+       public SortedSet<EPRole> getAppEPRoles(EPApp app) {
+               
+               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - app = {}", app.getName());
+               
+               SortedSet<EPRole> roles = new TreeSet<EPRole>();
+               SortedSet<EPUserApp> userAppRoles = getEPUserApps();
+               
+               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - userApps = ", userAppRoles.size());
+
+               Iterator<EPUserApp> userAppRolesIterator = userAppRoles.iterator();
+               EPUserApp userAppRole = null;
+               // getting default app
+               while (userAppRolesIterator.hasNext()) {
+                       EPUserApp tempUserApp = (EPUserApp) userAppRolesIterator.next();
+                       if (tempUserApp.getApp().getId().equals(app.getId())) {
+
+                               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - for user {}, found application {}", this.getFullName(), app.getName());
+                               
+                               userAppRole = tempUserApp;
+                               
+                               EPRole role = userAppRole.getRole();
+                               if(role.getActive()){
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - Role {} is active - adding for user {} and app {}", role.getName(), this.getFullName(), app.getName());
+                                       roles.add((EPRole) role);
+                               }
+                               else{
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - Role {} is NOT active - NOT adding for user {} and app {}", role.getName(), this.getFullName(), app.getName());
+                               }                               
+                       }
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - roles = ", roles.size());
+
+               return roles;
+       }
+
+       
+       /**
+        * Attention! Not for use in ECOMP
+        */
+       public SortedSet<EPRole> getAppRoles(EPApp app) {
+               SortedSet<EPRole> roles = new TreeSet<EPRole>();
+               SortedSet<EPUserApp> apps = getEPUserApps();
+               Iterator<EPUserApp> appsItr = apps.iterator();
+               EPUserApp userApp = null;
+               // getting default app
+               while (appsItr.hasNext()) {
+                       EPUserApp tempUserApp = (EPUserApp) appsItr.next();
+                       if (tempUserApp.getApp().getId().equals(app.getId())) {
+                               userApp = tempUserApp;
+                               roles.add((EPRole) userApp.getRole());
+                       }
+               }
+               return roles;
+       }
+
+       
+
+       /**
+        * Attention! Not for use in ECOMP
+        */
+       public SortedSet<EPRole> getEPRoles() {
+               EPApp app = new EPApp();
+               app.setId(new Long(PortalConstants.PORTAL_APP_ID));
+               app.setName(ECOMP_PORTAL_NAME);
+               return getAppEPRoles(app);
+       }
+
+       /**
+        * Attention! Not for use in ECOMP
+        */
+       public void setEPRoles(SortedSet<EPRole> roles) {
+               EPApp app = new EPApp();
+               app.setId(new Long(PortalConstants.PORTAL_APP_ID));
+               app.setName(ECOMP_PORTAL_NAME);
+               addAppRoles(app, roles);
+       }
+
+       /**
+        * Attention! Not for use in ECOMP
+        */
+       public void removeEPRole(Long roleId) {
+               SortedSet<EPUserApp> apps = getEPUserApps();
+               Iterator<EPUserApp> appsItr = apps.iterator();
+               // getting default app
+               while (appsItr.hasNext()) {
+                       EPUserApp tempUserApp = (EPUserApp) appsItr.next();
+                       if (tempUserApp.equals(new Long(PortalConstants.PORTAL_APP_ID)) && tempUserApp.getRole().getId().equals(roleId)) {
+                               appsItr.remove();
+                       }
+               }
+       }
+
+       /**
+        * Attention! Not for use in ECOMP
+        */
+       public void addEPRole(EPRole role) {
+               if (role != null) {
+                       SortedSet<EPRole> roles = getEPRoles();
+                       if (roles == null) {
+                               roles = new TreeSet<EPRole>();
+                       }
+                       roles.add(role);
+                       setEPRoles(roles);
+               }
+       }
+       
+       public boolean isGuest() {
+               return isGuest;
+       }
+
+       public void setGuest(boolean isGuest) {
+               this.isGuest = isGuest;
+       }
+
+       @Override
+       public String toString() {
+               return "EPUser [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName + ", middleInitial="
+                               + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", fax=" + fax + ", cellular="
+                               + cellular + ", email=" + email + ", addressId=" + addressId + ", alertMethodCd=" + alertMethodCd
+                               + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", address1=" + address1
+                               + ", address2=" + address2 + ", city=" + city + ", state=" + state + ", zipCode=" + zipCode
+                               + ", country=" + country + ", orgManagerUserId=" + orgManagerUserId + ", locationClli=" + locationClli
+                               + ", businessCountryCode=" + businessCountryCode + ", businessCountryName=" + businessCountryName
+                               + ", businessUnit=" + businessUnit + ", businessUnitName=" + businessUnitName + ", department="
+                               + department + ", departmentName=" + departmentName + ", companyCode=" + companyCode + ", company="
+                               + company + ", zipCodeSuffix=" + zipCodeSuffix + ", jobTitle=" + jobTitle + ", commandChain="
+                               + commandChain + ", siloStatus=" + siloStatus + ", costCenter=" + costCenter + ", financialLocCode="
+                               + financialLocCode + ", loginId=" + loginId + ", loginPwd=" + loginPwd + ", lastLoginDate="
+                               + lastLoginDate + ", active=" + active + ", internal=" + internal + ", selectedProfileId="
+                               + selectedProfileId + ", timeZoneId=" + timeZoneId + ", online=" + online + ", chatId=" + chatId
+                               + ", isGuest=" + isGuest + ", userApps=" + userApps + ", pseudoRoles=" + pseudoRoles + "]";
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserApp.java
new file mode 100644 (file)
index 0000000..1449af7
--- /dev/null
@@ -0,0 +1,137 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+
+@SuppressWarnings("rawtypes")
+public class EPUserApp implements java.io.Serializable, Comparable {
+
+       private static final long serialVersionUID = 1L;
+       
+       private Long userId;
+       private EPApp app;
+       private EPRole role;
+       private Short priority;
+       
+       public EPUserApp() {
+       }
+       
+       public Long getAppId() {
+               return this.getApp().getId();
+       }
+       
+       public Long getRoleId() {
+               return (role == null) ? null : role.getId();
+       }
+       
+       public Long getAppRoleId() {
+               return (role.getAppRoleId() == null) ? null : role.getAppRoleId();
+       }
+               
+       @Override 
+       public String toString() {
+               String str = "[u: "+getUserId()+"; a: "+getAppId()+", r: "+getRoleId()+"; appRoleId: "+getAppRoleId()+"]";
+               return str;
+       }
+       
+       public Long getUserId() {
+               return userId;
+       }
+
+       public void setUserId(Long id) {
+               this.userId = id;
+       }
+
+       public EPApp getApp() {
+               return app;
+       }
+
+       public void setApp(EPApp app) {
+               this.app = app;
+       }
+
+       public EPRole getRole() {
+               return role;
+       }
+
+       public void setRole(EPRole role) {
+               this.role = role;
+       }
+               
+       public Short getPriority() {
+               return this.priority;
+       }
+
+       public void setPriority(Short priority) {
+               this.priority = priority;
+       }
+
+       public boolean equals(Object other) {
+               if ((this == other))
+                       return true;
+               if ((other == null))
+                       return false;
+               if (!(other instanceof EPUserApp))
+                       return false;
+               EPUserApp castOther = (EPUserApp) other;
+
+               return (this.getUserId().equals(castOther.getUserId()))
+                               && (this.getApp().getId().equals(castOther.getApp().getId()))
+                               && (this.getRole().getId().equals(castOther.getRole().getId()))
+                               && ((this.priority==null && castOther.getPriority()==null) || this.getPriority().equals(castOther.getPriority()));
+       }
+
+       public int hashCode() {
+               int result = 17;
+
+               result = 37 * result + (int) (this.getUserId()==null ? 0 : this.getUserId().intValue());
+               result = 37 * result + (int) (this.getApp().getId()==null ? 0 : this.getApp().getId().intValue());
+               result = 37 * result + (int) (this.getRole().getId()==null ? 0 : this.getRole().getId().intValue());
+               result = 37 * result + (int) (this.priority==null ? 0 : this.priority);
+               return result;
+       }
+
+       public int compareTo(Object other){
+           EPUserApp castOther = (EPUserApp) other;
+
+           Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.getApp()==null||this.getApp().getId()==null ? 0 : this.getApp().getId()) + (this.getRole()==null||this.getRole().getId()==null ? 0 : this.getRole().getId()) + (this.priority==null ? 0 : this.priority);
+           Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.getRole()==null||castOther.getRole().getId()==null ? 0 : castOther.getRole().getId()) + (castOther.priority==null ? 0 : castOther.priority);
+
+           return c1.compareTo(c2);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppCatalogRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppCatalogRoles.java
new file mode 100644 (file)
index 0000000..f6d42b7
--- /dev/null
@@ -0,0 +1,110 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude
+public class EPUserAppCatalogRoles extends DomainVo {
+
+       private static final long serialVersionUID = -5259869298825093816L;
+
+
+       @Id
+       @Column(name="requested_role_id")
+       public Long requestedRoleId;
+       
+       
+       @Id
+       @Column(name="role_name")
+       public String rolename;
+       
+       @Id
+       @Column(name="request_status")
+       public String requestStatus;
+       
+       @Id
+       @Column(name="app_id")
+       public Long appId;
+
+       public Long getRequestedRoleId() {
+               return requestedRoleId;
+       }
+
+       public void setRequestedRoleId(Long requestedRoleId) {
+               this.requestedRoleId = requestedRoleId;
+       }
+
+       public String getRolename() {
+               return rolename;
+       }
+
+       public void setRolename(String rolename) {
+               this.rolename = rolename;
+       }
+
+       public String getRequestStatus() {
+               return requestStatus;
+       }
+
+       public void setRequestStatus(String requestStatus) {
+               this.requestStatus = requestStatus;
+       }
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String toString() {
+               return "EPUserAppCatalogRoles [requestedRoleId=" + requestedRoleId + ", rolename=" + rolename
+                               + ", requestStatus=" + requestStatus + ", appId=" + appId + "]";
+       }
+
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRoles.java
new file mode 100644 (file)
index 0000000..3e68108
--- /dev/null
@@ -0,0 +1,81 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class EPUserAppRoles extends DomainVo {
+
+       private static final long serialVersionUID = -1484592641766545668L;
+
+       @Id
+       @Column(name ="role_id")
+       public Long roleId;
+       
+       @Id
+       @Column(name ="app_id")
+       public Long appId;
+       
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+       public Long getAppId() {
+               return appId;
+       }
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+       
+       @Override
+       public String toString() {
+               return "EpUserAppRoles [roleId=" + roleId + ", appId=" + appId + "]";
+       }
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequest.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequest.java
new file mode 100644 (file)
index 0000000..923d244
--- /dev/null
@@ -0,0 +1,158 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Date;
+import java.util.Set;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppRolesRequest extends DomainVo {
+
+       private static final long serialVersionUID = -7225288307806389019L;
+       private Long userId;
+       private Long appId;
+       private Date createdDate;
+       private Date updatedDate;
+       private String requestStatus;
+
+       private Set<EPUserAppRolesRequestDetail> epRequestIdDetail;
+
+       public Long getUserId() {
+               return userId;
+       }
+
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public Date getCreatedDate() {
+               return createdDate;
+       }
+
+       public void setCreatedDate(Date createdDate) {
+               this.createdDate = createdDate;
+       }
+
+       public Date getUpdatedDate() {
+               return updatedDate;
+       }
+
+       public void setUpdatedDate(Date updatedDate) {
+               this.updatedDate = updatedDate;
+       }
+
+       public String getRequestStatus() {
+               return requestStatus;
+       }
+
+       public void setRequestStatus(String requestStatus) {
+               this.requestStatus = requestStatus;
+       }
+
+       public Set<EPUserAppRolesRequestDetail> getEpRequestIdDetail() {
+               return epRequestIdDetail;
+       }
+
+       public void setEpRequestIdDetail(Set<EPUserAppRolesRequestDetail> epMyLoginsDetail) {
+               this.epRequestIdDetail = epMyLoginsDetail;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
+               result = prime * result + ((epRequestIdDetail == null) ? 0 : epRequestIdDetail.hashCode());
+               result = prime * result + ((requestStatus == null) ? 0 : requestStatus.hashCode());
+               result = prime * result + ((updatedDate == null) ? 0 : updatedDate.hashCode());
+               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               EPUserAppRolesRequest other = (EPUserAppRolesRequest) obj;
+               if (appId == null) {
+                       if (other.appId != null)
+                               return false;
+               } else if (!appId.equals(other.appId))
+                       return false;
+               if (createdDate == null) {
+                       if (other.createdDate != null)
+                               return false;
+               } else if (!createdDate.equals(other.createdDate))
+                       return false;
+               if (epRequestIdDetail == null) {
+                       if (other.epRequestIdDetail != null)
+                               return false;
+               } else if (!epRequestIdDetail.equals(other.epRequestIdDetail))
+                       return false;
+               if (requestStatus == null) {
+                       if (other.requestStatus != null)
+                               return false;
+               } else if (!requestStatus.equals(other.requestStatus))
+                       return false;
+               if (updatedDate == null) {
+                       if (other.updatedDate != null)
+                               return false;
+               } else if (!updatedDate.equals(other.updatedDate))
+                       return false;
+               if (userId == null) {
+                       if (other.userId != null)
+                               return false;
+               } else if (!userId.equals(other.userId))
+                       return false;
+               return true;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequestDetail.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequestDetail.java
new file mode 100644 (file)
index 0000000..4237385
--- /dev/null
@@ -0,0 +1,111 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppRolesRequestDetail extends DomainVo {
+
+       private static final long serialVersionUID = -4908856671135348157L;
+
+       private Long reqRoleId;
+       private String reqType;
+       private EPUserAppRolesRequest epRequestIdData;
+
+       public EPUserAppRolesRequest getEpRequestIdData() {
+               return epRequestIdData;
+       }
+
+       public void setEpRequestIdData(EPUserAppRolesRequest epRequestIdData) {
+               this.epRequestIdData = epRequestIdData;
+       }
+
+       public Long getReqRoleId() {
+               return reqRoleId;
+       }
+
+       public void setReqRoleId(Long reqRoleId) {
+               this.reqRoleId = reqRoleId;
+       }
+
+       public String getReqType() {
+               return reqType;
+       }
+
+       public void setReqType(String reqType) {
+               this.reqType = reqType;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((epRequestIdData == null) ? 0 : epRequestIdData.hashCode());
+               result = prime * result + ((reqRoleId == null) ? 0 : reqRoleId.hashCode());
+               result = prime * result + ((reqType == null) ? 0 : reqType.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               EPUserAppRolesRequestDetail other = (EPUserAppRolesRequestDetail) obj;
+               if (epRequestIdData == null) {
+                       if (other.epRequestIdData != null)
+                               return false;
+               } else if (!epRequestIdData.equals(other.epRequestIdData))
+                       return false;
+               if (reqRoleId == null) {
+                       if (other.reqRoleId != null)
+                               return false;
+               } else if (!reqRoleId.equals(other.reqRoleId))
+                       return false;
+               if (reqType == null) {
+                       if (other.reqType != null)
+                               return false;
+               } else if (!reqType.equals(other.reqType))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppsManualSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppsManualSortPreference.java
new file mode 100644 (file)
index 0000000..4d943f6
--- /dev/null
@@ -0,0 +1,68 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppsManualSortPreference extends DomainVo {
+
+       private static final long serialVersionUID = -6270136291139278216L;
+       private int userId;
+       private Long appId;
+       private int appManualSortOrder;
+       
+       public int getUserId() {
+               return userId;
+       }
+       public void setUserId(int userId) {
+               this.userId = userId;
+       }
+       public Long getAppId() {
+               return appId;
+       }
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+       public int getAppManualSortOrder() {
+               return appManualSortOrder;
+       }
+       public void setAppManualSortOrder(int appManualSortOrder) {
+               this.appManualSortOrder = appManualSortOrder;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserAppsSortPreference.java
new file mode 100644 (file)
index 0000000..1fc7b8e
--- /dev/null
@@ -0,0 +1,62 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPUserAppsSortPreference extends DomainVo{
+
+       private static final long serialVersionUID = -5267000174894006433L;
+
+       private int userId;
+       private String sortPref;
+       
+       public int getUserId() {
+               return userId;
+       }
+       public void setUserId(final int userId) {
+               this.userId = userId;
+       }
+       public String getSortPref() {
+               return sortPref;
+       }
+       public void setSortPref(final String sortPref) {
+               this.sortPref = sortPref;
+       }
+               
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserNotification.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPUserNotification.java
new file mode 100644 (file)
index 0000000..1cb85a5
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Date;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+
+public class EPUserNotification extends DomainVo {     
+       private Long userId;
+       private Long notificationId;
+       private String viewed;
+       private Date updateTime;
+       
+       public Long getUserId() {
+               return userId;
+       }
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+       public Long getNotificationId() {
+               return notificationId;
+       }
+       public void setNotificationId(Long notificationId) {
+               this.notificationId = notificationId;
+       }
+       public String getViewed() {
+               return viewed;
+       }
+       public void setViewed(String viewed) {
+               this.viewed = viewed;
+       }
+       public Date getUpdateTime() {
+               return updateTime;
+       }
+       public void setUpdateTime(Date updateTime) {
+               this.updateTime = updateTime;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPWidgetsManualSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EPWidgetsManualSortPreference.java
new file mode 100644 (file)
index 0000000..552e2e0
--- /dev/null
@@ -0,0 +1,88 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class EPWidgetsManualSortPreference extends DomainVo{
+
+       private static final long serialVersionUID = 4607102334801223570L;
+       private int userId;
+       private Long widgetId;
+       private int widgetRow;
+       private int widgetCol;
+       private int widgetWidth;
+       private int widgetHeight;
+
+       public int getUserId() {
+               return userId;
+       }
+       public void setUserId(int userId) {
+               this.userId = userId;
+       }
+       public Long getWidgetId() {
+               return widgetId;
+       }
+       public void setWidgetId(Long widgetId) {
+               this.widgetId = widgetId;
+       }
+       public int getWidgetRow() {
+               return widgetRow;
+       }
+       public void setWidgetRow(int widgetRow) {
+               this.widgetRow = widgetRow;
+       }
+       public int getWidgetCol() {
+               return widgetCol;
+       }
+       public void setWidgetCol(int widgetCol) {
+               this.widgetCol = widgetCol;
+       }
+       public int getWidgetWidth() {
+               return widgetWidth;
+       }
+       public void setWidgetWidth(int widgetWidth) {
+               this.widgetWidth = widgetWidth;
+       }
+       public int getWidgetHeight() {
+               return widgetHeight;
+       }
+       public void setWidgetHeight(int widgetHeight) {
+               this.widgetHeight = widgetHeight;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompApp.java
new file mode 100644 (file)
index 0000000..6fafbba
--- /dev/null
@@ -0,0 +1,186 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+/**
+ * Model for a subset of the columns in the fn_app table.
+ */
+public class EcompApp {
+       
+       protected Long id;
+
+       public Long getId() {
+               return id;
+       }
+       
+       public void setId(Long id) {
+               this.id = id;
+       }
+       
+    private String name;
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+       
+       private String imageUrl;
+
+       public String getImageUrl() {
+               return imageUrl;
+       }
+
+       public void setImageUrl(String imageUrl) {
+               this.imageUrl = imageUrl;
+       }
+       
+       private String description;
+
+       public String getDescription() {
+               return description;
+       }
+
+       public void setDescription(String description) {
+               this.description = description;
+       }
+       
+       private String notes;
+
+       public String getNotes() {
+               return notes;
+       }
+
+       public void setNotes(String notes) {
+               this.notes = notes;
+       }       
+
+       private String url;
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       private String alternateUrl;
+
+       public String getAlternateUrl() {
+               return alternateUrl;
+       }
+
+       public void setAlternateUrl(String alternateUrl) {
+               this.alternateUrl = alternateUrl;
+       }
+       
+       private String uebTopicName;
+       
+       public String getUebTopicName() {
+               return uebTopicName;
+       }
+       
+       public void setUebTopicName(String topicName) {
+               this.uebTopicName = topicName;
+       }
+       
+       private String uebKey;
+       
+       public String getUebKey() {
+               return uebKey;
+       }
+       
+       public void setUebKey(String uebKey) {
+               this.uebKey = uebKey;
+       }
+       
+       private String uebSecret;
+       
+       public String getUebSecret() {
+               return uebSecret;
+       }
+       
+       public void setUebSecret(String secret) {
+               this.uebSecret = secret;
+       }
+       
+       private Boolean enabled;
+       
+       public Boolean isEnabled() {
+               return enabled;
+       }
+       
+       public void setEnabled(Boolean enable) {
+               this.enabled = enable;
+       }
+
+       private Boolean restrictedApp;
+       
+       public Boolean isRestrictedApp() {
+               return restrictedApp;
+       }
+       
+       public void setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+
+       private Boolean centralAuth;
+
+       public Boolean getCentralAuth() {
+               return centralAuth;
+       }
+
+       public void setCentralAuth(Boolean centralAuth) {
+               this.centralAuth = centralAuth;
+       }
+
+       private String nameSpace;
+       
+       public String getNameSpace() {
+               return nameSpace;
+       }
+
+       public void setNameSpace(String nameSpace) {
+               this.nameSpace = nameSpace;
+       }
+
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAppRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAppRole.java
new file mode 100644 (file)
index 0000000..e6176eb
--- /dev/null
@@ -0,0 +1,98 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+
+@Entity
+@IdClass(EcompAppRoleId.class)
+public class EcompAppRole {
+
+       @Id
+       @Column(name="app_id")
+       private Long appId;
+       @Id
+       @Column(name="app_name")
+       private String appName; 
+       
+       @Id
+       @Column(name="role_id")
+       private Integer roleId;
+       
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+
+       public Integer getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Integer roleId) {
+               this.roleId = roleId;
+       }
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAppRoleId.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAppRoleId.java
new file mode 100644 (file)
index 0000000..063714e
--- /dev/null
@@ -0,0 +1,101 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+public class EcompAppRoleId implements Serializable{
+       
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name="app_id")
+       private Long appId;
+       @Id
+       @Column(name="app_name")
+       private String appName; 
+       
+       @Id
+       @Column(name="role_id")
+       private Integer roleId;
+       
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+
+       public Integer getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Integer roleId) {
+               this.roleId = roleId;
+       }
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAuditLog.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/EcompAuditLog.java
new file mode 100644 (file)
index 0000000..72307eb
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Date;
+
+import org.onap.portalsdk.core.domain.AuditLog;
+
+public class EcompAuditLog extends AuditLog {
+
+       private static final long serialVersionUID = 7970458389782626231L;
+       
+       // values of activity_cd column in table fu_lu_activity
+       // as loaded by DML sql script
+       public static final String CD_ACTIVITY_ADD_CHILD_ROLE = "add_child_role";
+       public static final String CD_ACTIVITY_ADD_ROLE = "add_role";
+       public static final String CD_ACTIVITY_ADD_ROLE_FUNCTION = "add_role_function";
+       public static final String CD_ACTIVITY_ADD_USER_ROLE = "add_user_role";
+       public static final String CD_ACTIVITY_APP_ACCESS = "app_access";
+       public static final String CD_ACTIVITY_FUNCTIONAL_ACCESS = "functional_access";
+       public static final String CD_ACTIVITY_GUEST_LOGIN = "guest_login";
+       public static final String CD_ACTIVITY_LOGIN = "login";
+       public static final String CD_ACTIVITY_LOGOUT = "logout";
+       public static final String CD_ACTIVITY_MOBILE_LOGIN = "mobile_login";
+       public static final String CD_ACTIVITY_MOBILE_LOGOUT = "mobile_logout";
+       public static final String CD_ACTIVITY_REMOVE_CHILD_ROLE = "remove_child_role";
+       public static final String CD_ACTIVITY_REMOVE_ROLE = "remove_role";
+       public static final String CD_ACTIVITY_REMOVE_ROLE_FUNCTION = "remove_role_function";
+       public static final String CD_ACTIVITY_REMOVE_USER_ROLE = "remove_user_role";
+       public static final String CD_ACTIVITY_TAB_ACCESS = "tab_access";
+       public static final String CD_ACTIVITY_SEARCH = "search";
+       public static final String CD_ACTIVITY_ADD_PORTAL_ADMIN = "apa ";
+       public static final String CD_ACTIVITY_DELETE_PORTAL_ADMIN = "dpa";
+       public static final String CD_ACTIVITY_UPDATE_USER = "uu ";
+       public static final String CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN = "uaa ";
+       public static final String CD_ACTIVITY_STORE_ANALYTICS = "store_analytics";
+       public static final String CD_ACTIVITY_EXTERNAL_AUTH_ADD_ROLE = "eaar";
+       public static final String CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION = "eaaf";
+       public static final String CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION = "eauf";
+       public static final String CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_ROLE_AND_FUNCTION = "eaurf";
+       public static final String CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE = "eadr";
+       public static final String CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION = "eadf";
+       /**
+        * Creates a new object with the created field set to the current date-time.
+        */
+       public EcompAuditLog() {
+               setCreated(new Date());
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalRoleDetails.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalRoleDetails.java
new file mode 100644 (file)
index 0000000..6c8a548
--- /dev/null
@@ -0,0 +1,115 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.List;
+
+public class ExternalRoleDetails implements Comparable {
+
+       
+       private String  name;
+    private boolean active;
+    private Integer priority;
+    
+    private Long appId;     // used by ECOMP only 
+    private Long appRoleId; // used by ECOMP only
+
+       private List<EPAppRoleFunction> perms;
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public boolean isActive() {
+               return active;
+       }
+
+       public void setActive(boolean active) {
+               this.active = active;
+       }
+
+       public Integer getPriority() {
+               return priority;
+       }
+
+       public void setPriority(Integer priority) {
+               this.priority = priority;
+       }
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public Long getAppRoleId() {
+               return appRoleId;
+       }
+
+       public void setAppRoleId(Long appRoleId) {
+               this.appRoleId = appRoleId;
+       }
+
+
+
+       public List<EPAppRoleFunction> getPerms() {
+               return perms;
+       }
+
+       public void setPerms(List<EPAppRoleFunction> perms) {
+               this.perms = perms;
+       }
+
+       @Override
+       public int compareTo(Object obj) {
+               EPRole other = (EPRole)obj;
+
+       String c1 = getName();
+       String c2 = other.getName();
+
+       return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+       }
+
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalSystemAccess.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalSystemAccess.java
new file mode 100644 (file)
index 0000000..29b4fe3
--- /dev/null
@@ -0,0 +1,67 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+public class ExternalSystemAccess {
+       
+       private String key;
+       private Boolean accessValue;
+               
+       public ExternalSystemAccess(String key, Boolean accessValue){
+               this.key = key;
+               this.accessValue = accessValue;
+       }
+       
+       public String getKey() {
+               return key;
+       }
+       public void setKey(String key) {
+               this.key = key;
+       }
+
+       public Boolean getAccessValue() {
+               return accessValue;
+       }
+
+       public void setAccessValue(Boolean accessValue) {
+               this.accessValue = accessValue;
+       }
+       
+       
+       
+}
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
new file mode 100644 (file)
index 0000000..a9455d6
--- /dev/null
@@ -0,0 +1,114 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Transient;
+/***
+ * 
+ * This class is almost identical to org.openecomp.portalapp.portal.transport.FunctionalMenuItem
+ * The only difference is the appId field. In FunctionMenuItem, we used @Transient as an attribute, and we are using @Column in this class.
+ * In some sql queries, we need to have appId, but it's not a field in fn_menu_functional table.
+ * 
+ * @author robertlo
+ *
+ */
+@Entity
+public class FunctionalMenuItemWithAppID{
+       private static final long serialVersionUID = 1L;
+
+       @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+       @Column(name = "MENU_ID")
+       public Long menuId;
+       
+       @Column(name = "COLUMN_NUM")
+       public Integer column;
+       
+       @Column(name = "TEXT")
+       public String text;
+       
+       @Column(name = "PARENT_MENU_ID")
+       public Integer parentMenuId;
+       
+       @Column(name = "URL")
+       public String url;
+       
+       @Column(name="ACTIVE_YN")
+       public String active_yn;
+
+       @Column(name="APP_ID")
+       public Integer appid;
+       
+       @Transient
+       public List<Integer> roles;
+       
+       @Transient
+       public Boolean restrictedApp;
+       
+       public void normalize() {
+               if (this.column == null)
+                       this.column = new Integer(1);
+               this.text = (this.text == null) ? "" : this.text.trim();
+               if (this.parentMenuId == null)
+                       this.parentMenuId = new Integer(-1);
+               this.url = (this.url == null) ? "" : this.url.trim();
+       }
+
+       @Override
+       public String toString() {
+               return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
+                               + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
+                               + ", restrictedApp=" + restrictedApp + "]";
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public void setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/GetAccessResult.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/GetAccessResult.java
new file mode 100644 (file)
index 0000000..f64810d
--- /dev/null
@@ -0,0 +1,132 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude
+public class GetAccessResult implements Serializable{
+
+
+       private static final long serialVersionUID = 5239527705869613411L;
+
+       @Id
+       @Column(name="row_id")
+       private String rowId;
+       
+       @Column(name="role_id")
+       private Long roleId;
+       
+       @Column(name="ecomp_function",nullable=true)
+       private String ecompFunction;
+       
+       @Column(name="app_name")
+       private String appName; 
+       
+       @Column(name="app_mots_id",nullable=true)
+       private Integer appMotsId;
+       
+       @Column(name="role_name")
+       private String roleName;
+       
+       @Column(name="role_actv",nullable=true)
+       private String roleActive;
+       
+       
+       @Column(name="request_type",nullable=true)
+       private String reqType;
+       
+       
+       
+       public String getRowId() {
+               return rowId;
+       }
+       public void setRowId(String rowId) {
+               this.rowId = rowId;
+       }
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       } 
+       public String getEcompFunction() {
+               return ecompFunction;
+       }
+       public void setEcompFunction(String ecompFunction) {
+               this.ecompFunction = ecompFunction;
+       }
+       public String getAppName() {
+               return appName;
+       }
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+       public Integer getAppMotsId() {
+               return appMotsId;
+       }
+       public void setAppMotsId(Integer appMotsId) {
+               this.appMotsId = appMotsId;
+       }
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       public String getRoleActive() {
+               return roleActive;
+       }
+       public void setRoleActive(String roleActive) {
+               this.roleActive = roleActive;
+       }
+       public String getReqType() {
+               return reqType;
+       }
+       public void setReqType(String reqType) {
+               this.reqType = reqType;
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/GetAccessResultId.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/GetAccessResultId.java
new file mode 100644 (file)
index 0000000..a9cd69a
--- /dev/null
@@ -0,0 +1,82 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+public class GetAccessResultId implements Serializable{
+       
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name="ecomp_function")
+       private String ecompFunction;
+
+       @Id
+       @Column(name="app_name")
+       private String appName; 
+       
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+       
+       public String getEcompFunction() {
+               return ecompFunction;
+       }
+       public void setEcompFunction(String ecompFunction) {
+               this.ecompFunction = ecompFunction;
+       }
+       public String getAppName() {
+               return appName;
+       }
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+}
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
new file mode 100644 (file)
index 0000000..a7129d5
--- /dev/null
@@ -0,0 +1,164 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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 org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class MicroserviceData extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+
+       public MicroserviceData() {
+
+       }
+
+       private Long id;
+
+       private String name;
+
+       private String active;
+
+       private String desc;
+
+       private long appId;
+
+       private String url;
+
+       private String securityType;
+
+       private String username;
+
+       private String password;
+
+       private List<MicroserviceParameter> parameterList;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public String getActive() {
+               return active;
+       }
+
+       public void setActive(String active) {
+               this.active = active;
+       }
+
+       public String getDesc() {
+               return desc;
+       }
+
+       public void setDesc(String desc) {
+               this.desc = desc;
+       }
+
+       public long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(long appId) {
+               this.appId = appId;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public String getSecurityType() {
+               return securityType;
+       }
+
+       public void setSecurityType(String securityType) {
+               this.securityType = securityType;
+       }
+
+       public String getUsername() {
+               return username;
+       }
+
+       public void setUsername(String username) {
+               this.username = username;
+       }
+
+       public String getPassword() {
+               return password;
+       }
+
+       public void setPassword(String password) {
+               this.password = password;
+       }
+
+       public List<MicroserviceParameter> getParameterList() {
+               return parameterList;
+       }
+
+       public void setParameterList(List<MicroserviceParameter> parameterList) {
+               this.parameterList = parameterList;
+       }
+
+       @Override
+       public String toString() {
+               return "MicroserviceData [id=" + id + ", name=" + name + ", desc=" + desc + ", appId=" + appId + ", url=" + url
+                               + ", securityType=" + securityType + ", username=" + username + ", password=" + password
+                               + ", parameterList=" + parameterList + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceParameter.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/MicroserviceParameter.java
new file mode 100644 (file)
index 0000000..a761f75
--- /dev/null
@@ -0,0 +1,96 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class MicroserviceParameter extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+
+       public MicroserviceParameter() {
+
+       }
+
+       private Long id;
+
+       private long serviceId;
+
+       private String para_key;
+
+       private String para_value;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public long getServiceId() {
+               return serviceId;
+       }
+
+       public void setServiceId(long serviceId) {
+               this.serviceId = serviceId;
+       }
+
+       public String getPara_key() {
+               return para_key;
+       }
+
+       public void setPara_key(String para_key) {
+               this.para_key = para_key;
+       }
+
+       public String getPara_value() {
+               return para_value;
+       }
+
+       public void setPara_value(String para_value) {
+               this.para_value = para_value;
+       }
+
+       @Override
+       public String toString() {
+               return "MicroserviceParameter [id=" + id + ", serviceId=" + serviceId + ", para_key=" + para_key
+                               + ", para_value=" + para_value + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/PersUserAppSelection.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/PersUserAppSelection.java
new file mode 100644 (file)
index 0000000..13e58dc
--- /dev/null
@@ -0,0 +1,133 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Models a row in the table with personalization of user app selections.
+ */
+public class PersUserAppSelection extends DomainVo {
+
+       private static final long serialVersionUID = 1545308654500121206L;
+
+       private Long userId;
+
+       private Long appId;
+
+       private String statusCode;
+
+       public PersUserAppSelection() {}
+       
+       /**
+        * Convenience constructor
+        * 
+        * @param id
+        * @param userId
+        * @param appId
+        * @param statusCode
+        */
+       public PersUserAppSelection(final Long id, final Long userId, final Long appId, final String statusCode) {
+               super.id = id;
+               this.userId = userId;
+               this.appId = appId;
+               this.statusCode = statusCode;
+       }
+       
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public Long getUserId() {
+               return userId;
+       }
+
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+       public String getStatusCode() {
+               return statusCode;
+       }
+
+       public void setStatusCode(String statusCode) {
+               this.statusCode = statusCode;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
+               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               PersUserAppSelection other = (PersUserAppSelection) obj;
+               if (appId == null) {
+                       if (other.appId != null)
+                               return false;
+               } else if (!appId.equals(other.appId))
+                       return false;
+               if (statusCode == null) {
+                       if (other.statusCode != null)
+                               return false;
+               } else if (!statusCode.equals(other.statusCode))
+                       return false;
+               if (userId == null) {
+                       if (other.userId != null)
+                               return false;
+               } else if (!userId.equals(other.userId))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/PersUserWidgetSelection.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/PersUserWidgetSelection.java
new file mode 100644 (file)
index 0000000..833934d
--- /dev/null
@@ -0,0 +1,136 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * Models a row in the table with personalization of user widget selections.
+ */
+public class PersUserWidgetSelection extends DomainVo {
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -6547880514779039200L;
+
+       private Long userId;
+
+       private Long widgetId;
+
+       private String statusCode;
+
+       public PersUserWidgetSelection() {}
+       
+       /**
+        * Convenience constructor
+        * 
+        * @param id
+        * @param userId
+        * @param widgetId
+        * @param statusCode
+        */
+       public PersUserWidgetSelection(final Long id, final Long userId, final Long widgetId, final String statusCode) {
+               super.id = id;
+               this.userId = userId;
+               this.widgetId = widgetId;
+               this.statusCode = statusCode;
+       }
+       
+       public Long getWidgetId() {
+               return widgetId;
+       }
+
+       public void setWidgetId(Long widgetId) {
+               this.widgetId = widgetId;
+       }
+
+       public Long getUserId() {
+               return userId;
+       }
+
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+       public String getStatusCode() {
+               return statusCode;
+       }
+
+       public void setStatusCode(String statusCode) {
+               this.statusCode = statusCode;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
+               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
+               result = prime * result + ((widgetId == null) ? 0 : widgetId.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               PersUserWidgetSelection other = (PersUserWidgetSelection) obj;
+               if (statusCode == null) {
+                       if (other.statusCode != null)
+                               return false;
+               } else if (!statusCode.equals(other.statusCode))
+                       return false;
+               if (userId == null) {
+                       if (other.userId != null)
+                               return false;
+               } else if (!userId.equals(other.userId))
+                       return false;
+               if (widgetId == null) {
+                       if (other.widgetId != null)
+                               return false;
+               } else if (!widgetId.equals(other.widgetId))
+                       return false;
+               return true;
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/RoleApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/RoleApp.java
new file mode 100644 (file)
index 0000000..1b52b8b
--- /dev/null
@@ -0,0 +1,132 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+//@Entity
+//@Table(name = "FN_ROLE")
+public class RoleApp implements Serializable{
+       private static final long serialVersionUID = 1L;
+
+       //@Id
+       //@Column(name = "ROLE_ID")
+       //@GeneratedValue(strategy=GenerationType.AUTO)
+       private Long roleId;
+       
+       
+       //@Column(name = "ROLE_Name")
+       private String roleName;
+       
+       //@ManyToOne(fetch = FetchType.EAGER)
+       //@JoinColumn(name="APP_ID")
+       private App app;
+       
+       //@JsonIgnore
+       //@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
+       private Set<WidgetCatalog> widgets;
+
+       /*@PreRemove
+       private void removeGroupsFromUsers() {
+           for (WidgetCatalog w : widgets) {
+               w.getWidgetRoles().remove(this);
+           }
+       }*/
+       
+       /*@ManyToOne
+       @JoinColumn(name = "WIDGET_ID", nullable = false)
+       WidgetCatalog widgetCatalog;*/
+
+       //@JsonIgnore
+       //@ManyToMany(mappedBy = "widgetRoles")
+       //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
+       //private Set<WidgetCatalog> widgets  = new HashSet<WidgetCatalog>();
+       
+       public Long getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+
+       public App getApp() {
+               return app;
+       }
+
+       public void setApp(App app) {
+               this.app = app;
+       }
+       
+       
+
+       public Set<WidgetCatalog> getWidgets() {
+               return widgets;
+       }
+
+       public void setWidgets(Set<WidgetCatalog> widgets) {
+               this.widgets = widgets;
+       }
+
+       @Override
+       public String toString() {
+               return "Role [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..ebfb285
--- /dev/null
@@ -0,0 +1,191 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * A shared context is a key-value pair in a session. All shared-context objects
+ * should be dropped when a session is destroyed. Because there's always a
+ * chance of missing that event, this object notes its creation time so that it
+ * can be expired after a suitable time interval.
+ */
+@Entity
+@Table(name = "fn_shared_context")
+public class SharedContext extends DomainVo {
+
+       // generated
+       private static final long serialVersionUID = 7287469622586677888L;
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       private Long id;
+       private Date create_time;
+       private String context_id;
+       private String ckey;
+       private String cvalue;
+
+       /**
+        * Mandatory no-argument constructor
+        */
+       public SharedContext() {
+       }
+
+       /**
+        * Convenience constructor. The database ID and creation timestamp are
+        * populated when the object is added to the database.
+        * 
+        * @param contextId
+        *            context ID
+        * @param key
+        *            context key
+        * @param value
+        *            context value
+        */
+       public SharedContext(final String contextId, final String key, final String value) {
+               this.context_id = contextId;
+               this.ckey = key;
+               this.cvalue = value;
+       }
+
+       /**
+        * Gets the database row ID.
+        * 
+        * @return Database row ID
+        */
+       public Long getId() {
+               return id;
+       }
+
+       /**
+        * Sets the database row ID.
+        * 
+        * @param id
+        *            database row ID
+        */
+       public void setId(final Long id) {
+               this.id = id;
+       }
+
+       /**
+        * Gets the creation time
+        * 
+        * @return Creation time as a Date
+        */
+       public Date getCreate_time() {
+               return create_time;
+       }
+
+       /**
+        * Sets the creation time
+        * 
+        * @param create_time
+        *            Date
+        */
+       public void setCreate_time(final Date create_time) {
+               this.create_time = create_time;
+       }
+
+       /**
+        * Gets the context ID
+        * 
+        * @return Context ID
+        */
+       public String getContext_id() {
+               return context_id;
+       }
+
+       /**
+        * Sets the context ID
+        * 
+        * @param context_id
+        *            String
+        */
+       public void setContext_id(final String context_id) {
+               this.context_id = context_id;
+       }
+
+       /**
+        * Gets the key of the key-value pair. Called ckey because "key" is a
+        * reserved word in Mysql.
+        * 
+        * @return The key
+        */
+       public String getCkey() {
+               return ckey;
+       }
+
+       /**
+        * Sets the key of the key-value pair.
+        * 
+        * @param ckey
+        *            String
+        */
+       public void setCkey(final String ckey) {
+               this.ckey = ckey;
+       }
+
+       /**
+        * Gets the value of the key-value pair. Called cvalue because "value" is a
+        * reserved word in Mysql.
+        * 
+        * @return value
+        */
+       public String getCvalue() {
+               return cvalue;
+       }
+
+       /**
+        * Sets the value of the key-value pair.
+        * 
+        * @param cvalue
+        *            value
+        */
+       public void setCvalue(final String cvalue) {
+               this.cvalue = cvalue;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserIdRoleId.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserIdRoleId.java
new file mode 100644 (file)
index 0000000..e267e92
--- /dev/null
@@ -0,0 +1,95 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class UserIdRoleId implements Serializable{
+       
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name="USER_ID")
+       private String user_Id;
+       
+       @Column(name="ROLE_ID")
+       private String roleId;
+       
+       @Column(name="ORG_USER_ID")
+       private String orgUserId;
+       
+       @Column(name="APP_ID")
+       private String appId;
+
+       public String getUser_Id() {
+               return user_Id;
+       }
+
+       public void setUser_Id(String id) {
+               this.user_Id = id;
+       }
+
+       public String getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(String roleId) {
+               this.roleId = roleId;
+       }
+       
+       public String getAppId() {
+               return appId;
+       }
+
+       public void setAppId(String appId) {
+               this.appId = appId;
+       }
+       
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserRole.java
new file mode 100644 (file)
index 0000000..eda4eee
--- /dev/null
@@ -0,0 +1,109 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class UserRole implements Serializable{
+       private static final long serialVersionUID = 1L;
+       
+       
+       @Id
+       @Column(name="USER_ID")
+       private Long user_Id;
+       
+       @Id
+       @Column(name="ROLE_ID")
+       private Long roleId;
+       
+       @Column(name="ORG_USER_ID")
+       private String orgUserId;
+
+       
+       @Column(name="FIRST_NAME")
+       private String firstName;
+       
+       @Column(name="LAST_NAME")
+       private String lastName;
+
+       
+       @Column(name="ROLE_NAME")
+       private String roleName; 
+       
+       public String getFirstName() {
+               return firstName;
+       }
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+       public String getLastName() {
+               return lastName;
+       }
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       public Long getUser_Id() {
+               return user_Id;
+       }
+       public void setUser_Id(Long user_Id) {
+               this.user_Id = user_Id;
+       }
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/UserRoles.java
new file mode 100644 (file)
index 0000000..0efaaea
--- /dev/null
@@ -0,0 +1,131 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalsdk.core.util.SystemProperties;
+
+public class UserRoles implements Serializable {
+       private static final long serialVersionUID = 1L;
+
+       /* 
+       private static final HashMap<Long, String> rolesDictionary;
+       // remove hard coded roles
+       static {
+               rolesDictionary = new HashMap<Long, String>();
+               rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID)).longValue(), "superAdmin");
+               rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID)).longValue(), "admin");
+       }
+       */
+
+       public UserRoles(UserRole user) {
+               setOrgUserId(user.getOrgUserId());
+               setFirstName(user.getFirstName());
+               setLastName(user.getLastName());
+               setGuestSession(user.getUser_Id()==-1 ? true : false);
+
+               addRole(user.getRoleName());
+       }
+
+       public void addRole(String roleName) {
+               //String normalizedRole = normalizeRole(roleId);
+               if (!getRoles().contains(roleName)) {
+                       this.roles.add(roleName);
+               }
+       }
+
+       /*
+       public static String normalizeRole(Long role) {
+               String roleTranslated = rolesDictionary.get(role);
+               return roleTranslated == null ? "user" : roleTranslated;
+       }
+       */
+
+       private String orgUserId;
+       private String firstName;
+       private String lastName;
+       private boolean guestSession;
+
+       // TODO: Make into set
+       private List<String> roles = new ArrayList<String>();
+
+       public String getFirstName() {
+               return firstName;
+       }
+
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       public String getLastName() {
+               return lastName;
+       }
+
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+
+       public List<String> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<String> roles) {
+               this.roles = roles;
+       }
+
+       public void setGuestSession(boolean guestSession) {
+               this.guestSession = guestSession;
+       }
+
+       public boolean getGuestSession() {
+               return this.guestSession;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/Widget.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/Widget.java
new file mode 100644 (file)
index 0000000..98cfd15
--- /dev/null
@@ -0,0 +1,123 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.apache.commons.lang.StringUtils;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class Widget extends DomainVo {
+
+       private static final long serialVersionUID = 1L;
+
+       private String name;
+
+       private Integer width;
+
+       private Integer height;
+
+       private String url;
+
+       private Long appId;
+
+       public Widget() {
+               // Attention!!!
+               // We set here all default values. We also place protection
+               // into setters for fields with default values.
+               // If we don't use such protection we are able to place null
+               // to these fields and save such fields into DB even if DB has
+               // default values for these fields.
+               this.name = "";
+               this.width = new Integer(0);
+               this.height = new Integer(0);
+               this.url = "";
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               if (StringUtils.isEmpty(name)) {
+                       name = "";
+               }
+               this.name = name;
+       }
+
+       public Integer getWidth() {
+               return width;
+       }
+
+       public void setWidth(Integer width) {
+               if (width == null) {
+                       width = new Integer(0);
+               }
+               this.width = width;
+       }
+
+       public Integer getHeight() {
+               return height;
+       }
+
+       public void setHeight(Integer height) {
+               if (height == null) {
+                       height = new Integer(0);
+               }
+               this.height = height;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               if (StringUtils.isEmpty(url)) {
+                       url = "";
+               }
+               this.url = url;
+       }
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetCatalog.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetCatalog.java
new file mode 100644 (file)
index 0000000..7ddb5a4
--- /dev/null
@@ -0,0 +1,127 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.Set;
+
+public class WidgetCatalog implements Serializable{
+
+       private static final long serialVersionUID = 1L;
+
+       private long id;
+       
+       private String name;
+       
+       private String desc;
+       
+       private String fileLocation;
+       
+       private String allowAllUser;
+       
+       private Long serviceId;
+       
+       private String sortOrder;
+
+       private String statusCode;
+       
+       private Set<RoleApp> widgetRoles;
+       
+       public long getId() {
+               return id;
+       }
+       public void setId(long id) {
+               this.id = id;
+       }
+       public String getName() {
+               return name;
+       }
+       public void setName(String name) {
+               this.name = name;
+       }
+       
+       public Long getServiceId() {
+               return serviceId;
+       }
+       public void setServiceId(Long serviceId) {
+               this.serviceId = serviceId;
+       }
+       public String getDesc() {
+               return desc;
+       }
+       public void setDesc(String desc) {
+               this.desc = desc;
+       }
+       public String getFileLocation() {
+               return fileLocation;
+       }
+       public void setFileLocation(String fileLocation) {
+               this.fileLocation = fileLocation;
+       }
+       
+       public String getAllowAllUser() {
+               return allowAllUser;
+       }
+       public void setAllowAllUser(String allowAllUser) {
+               this.allowAllUser = allowAllUser;
+       }
+       public Set<RoleApp> getWidgetRoles() {
+               return widgetRoles;
+       }
+       public void setWidgetRoles(Set<RoleApp> widgetRoles) {
+               this.widgetRoles = widgetRoles;
+       }
+       
+       public String getSortOrder() {
+               return sortOrder;
+       }
+       public void setSortOrder(String sortOrder) {
+               this.sortOrder = sortOrder;
+       }
+       public String getStatusCode() {
+               return statusCode;
+       }
+       public void setStatusCode(String statusCode) {
+               this.statusCode = statusCode;
+       }
+       @Override
+       public String toString() {
+               return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation
+                               + ", allowAllUser=" + allowAllUser + "]";
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetCatalogParameter.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetCatalogParameter.java
new file mode 100644 (file)
index 0000000..2e5940f
--- /dev/null
@@ -0,0 +1,108 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+public class WidgetCatalogParameter extends DomainVo{
+       
+       private static final long serialVersionUID = 1L;
+
+       public WidgetCatalogParameter() {
+
+       }
+       private Long id;
+
+       private Long widgetId;
+
+       private Long userId;
+
+       private Long paramId;
+
+       private String user_value;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public Long getWidgetId() {
+               return widgetId;
+       }
+
+       public void setWidgetId(Long widgetId) {
+               this.widgetId = widgetId;
+       }
+
+       public String getUser_value() {
+               return user_value;
+       }
+
+       public void setUser_value(String user_value) {
+               this.user_value = user_value;
+       }
+
+       public Long getParamId() {
+               return paramId;
+       }
+
+       public void setParamId(Long paramId) {
+               this.paramId = paramId;
+       }
+
+       public Long getUserId() {
+               return userId;
+       }
+
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+       @Override
+       public String toString() {
+               return "WidgetCatalogParameter [id=" + id + ", widgetId=" + widgetId + ", userId=" + userId + ", paramId="
+                               + paramId + ", user_value=" + user_value + "]";
+       }
+
+       
+
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetParameterResult.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetParameterResult.java
new file mode 100644 (file)
index 0000000..0251c32
--- /dev/null
@@ -0,0 +1,88 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+public class WidgetParameterResult {
+       
+       private Long param_id;
+       
+       private String param_key;
+       
+       private String user_value;
+       
+       private String default_value;
+
+       public Long getParam_id() {
+               return param_id;
+       }
+
+       public void setParam_id(Long param_id) {
+               this.param_id = param_id;
+       }
+
+       public String getParam_key() {
+               return param_key;
+       }
+
+       public void setParam_key(String param_key) {
+               this.param_key = param_key;
+       }
+
+       public String getUser_value() {
+               return user_value;
+       }
+
+       public void setUser_value(String user_value) {
+               this.user_value = user_value;
+       }
+
+       public String getDefault_value() {
+               return default_value;
+       }
+
+       public void setDefault_value(String default_value) {
+               this.default_value = default_value;
+       }
+
+       @Override
+       public String toString() {
+               return "WidgetParameterResult [param_id=" + param_id + ", param_key=" + param_key + ", user_value=" + user_value
+                               + ", default_value=" + default_value + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetServiceHeaders.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/WidgetServiceHeaders.java
new file mode 100644 (file)
index 0000000..e6360e5
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.nio.charset.Charset;
+
+import org.apache.commons.codec.binary.Base64;
+import org.springframework.http.HttpHeaders;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+
+public class WidgetServiceHeaders {
+       
+       private static HttpHeaders widgetHeaders;
+       
+       private WidgetServiceHeaders(){}
+       
+       public static HttpHeaders getInstance() throws Exception{
+               if(null == widgetHeaders){
+                  return new HttpHeaders(){{
+                               
+                                   String username = EcompPortalUtils.getPropertyOrDefault("microservices.widget.username", "widget_user");
+                                   String password = CipherUtil.decryptPKC(EcompPortalUtils.getPropertyOrDefault("microservices.widget.password", "widget_password"));
+                               String auth = username + ":" + password;
+                               byte[] encodedAuth = Base64.encodeBase64( 
+                                  auth.getBytes(Charset.forName("US-ASCII")) );
+                               String authHeader = "Basic " + new String( encodedAuth );
+                               set( "Authorization", authHeader );
+                             }
+                          };
+               }
+               else 
+                       return widgetHeaders;
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppCatalogItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppCatalogItem.java
new file mode 100644 (file)
index 0000000..9701dd5
--- /dev/null
@@ -0,0 +1,276 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * This model of an application catalog entry has some EPApp fields plus
+ * additional fields to indicate access(ible) and select(ed) statuses.
+ */
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class AppCatalogItem extends DomainVo {
+
+       private static final long serialVersionUID = 6619663784935017846L;
+
+       @Id
+       private Long id;
+       private String name;
+       private String mlAppName;
+       private String imageUrl;
+       private String description;
+       private String notes;
+       private String url;
+       private String alternateUrl;
+       private Boolean restricted;
+       private Boolean open;
+       private Boolean access;
+       private Boolean select;
+       private Boolean pending;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public String getMlAppName() {
+               return mlAppName;
+       }
+
+       public void setMlAppName(String mlAppName) {
+               this.mlAppName = mlAppName;
+       }
+
+       public String getImageUrl() {
+               return imageUrl;
+       }
+
+       public void setImageUrl(String imageUrl) {
+               this.imageUrl = imageUrl;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+
+       public void setDescription(String description) {
+               this.description = description;
+       }
+
+       public String getNotes() {
+               return notes;
+       }
+
+       public void setNotes(String notes) {
+               this.notes = notes;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public String getAlternateUrl() {
+               return alternateUrl;
+       }
+
+       public void setAlternateUrl(String alternateUrl) {
+               this.alternateUrl = alternateUrl;
+       }
+
+       public Boolean getRestricted() {
+               return restricted;
+       }
+
+       public void setRestricted(Boolean restricted) {
+               this.restricted = restricted;
+       }
+
+       public Boolean getOpen() {
+               return open;
+       }
+
+       public void setOpen(Boolean open) {
+               this.open = open;
+       }
+
+       public Boolean getAccess() {
+               return access;
+       }
+
+       public void setAccess(Boolean access) {
+               this.access = access;
+       }
+
+       public Boolean getSelect() {
+               return select;
+       }
+
+       public void setSelect(Boolean select) {
+               this.select = select;
+       }
+
+       public Boolean getPending() {
+               return pending;
+       }
+
+       public void setPending(Boolean pending) {
+               this.pending = pending;
+       }
+
+       public static long getSerialversionuid() {
+               return serialVersionUID;
+       }
+
+       @Override
+       public String toString() {
+               return "AppCatalogItem [id=" + id + ", name=" + name + ", access=" + access + ", select=" + select
+                               + ", pending=" + pending + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((access == null) ? 0 : access.hashCode());
+               result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode());
+               result = prime * result + ((description == null) ? 0 : description.hashCode());
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
+               result = prime * result + ((name == null) ? 0 : name.hashCode());
+               result = prime * result + ((notes == null) ? 0 : notes.hashCode());
+               result = prime * result + ((open == null) ? 0 : open.hashCode());
+               result = prime * result + ((pending == null) ? 0 : pending.hashCode());
+               result = prime * result + ((restricted == null) ? 0 : restricted.hashCode());
+               result = prime * result + ((select == null) ? 0 : select.hashCode());
+               result = prime * result + ((url == null) ? 0 : url.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AppCatalogItem other = (AppCatalogItem) obj;
+               if (access == null) {
+                       if (other.access != null)
+                               return false;
+               } else if (!access.equals(other.access))
+                       return false;
+               if (alternateUrl == null) {
+                       if (other.alternateUrl != null)
+                               return false;
+               } else if (!alternateUrl.equals(other.alternateUrl))
+                       return false;
+               if (description == null) {
+                       if (other.description != null)
+                               return false;
+               } else if (!description.equals(other.description))
+                       return false;
+               if (id == null) {
+                       if (other.id != null)
+                               return false;
+               } else if (!id.equals(other.id))
+                       return false;
+               if (imageUrl == null) {
+                       if (other.imageUrl != null)
+                               return false;
+               } else if (!imageUrl.equals(other.imageUrl))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       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 (pending == null) {
+                       if (other.pending != null)
+                               return false;
+               } else if (!pending.equals(other.pending))
+                       return false;
+               if (restricted == null) {
+                       if (other.restricted != null)
+                               return false;
+               } else if (!restricted.equals(other.restricted))
+                       return false;
+               if (select == null) {
+                       if (other.select != null)
+                               return false;
+               } else if (!select.equals(other.select))
+                       return false;
+               if (url == null) {
+                       if (other.url != null)
+                               return false;
+               } else if (!url.equals(other.url))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java
new file mode 100644 (file)
index 0000000..d22c26d
--- /dev/null
@@ -0,0 +1,158 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * Carries row information for the functional table on the Contact Us page.
+ */
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class AppCategoryFunctionsItem extends DomainVo {
+
+       private static final long serialVersionUID = -1573834082471206458L;
+
+       @Id
+       private String rowId;
+       private String appId;
+       private String application;
+       private String category;
+       private String functions;
+
+       public String getRowId() {
+               return rowId;
+       }
+
+       public void setRowId(String rowId) {
+               this.rowId = rowId;
+       }
+
+       public String getAppId() {
+               return appId;
+       }
+       
+       public void setAppId(String appId) {
+               this.appId = appId;
+       }
+       
+       public String getApplication() {
+               return application;
+       }
+
+       public void setApplication(String appName) {
+               this.application = appName;
+       }
+
+       public String getCategory() {
+               return category;
+       }
+
+       public void setCategory(String category) {
+               this.category = category;
+       }
+
+       public String getFunctions() {
+               return functions;
+       }
+
+       public void setFunctions(String functions) {
+               this.functions = functions;
+       }
+
+       @Override
+       public String toString() {
+               return "AppCategoryFunctionsItem [rowId=" + rowId + ", appId=" + appId + ", application=" + application
+                               + ", category=" + category + ", functions=" + functions + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((application == null) ? 0 : application.hashCode());
+               result = prime * result + ((category == null) ? 0 : category.hashCode());
+               result = prime * result + ((functions == null) ? 0 : functions.hashCode());
+               result = prime * result + ((rowId == null) ? 0 : rowId.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AppCategoryFunctionsItem other = (AppCategoryFunctionsItem) obj;
+               if (appId == null) {
+                       if (other.appId != null)
+                               return false;
+               } else if (!appId.equals(other.appId))
+                       return false;
+               if (application == null) {
+                       if (other.application != null)
+                               return false;
+               } else if (!application.equals(other.application))
+                       return false;
+               if (category == null) {
+                       if (other.category != null)
+                               return false;
+               } else if (!category.equals(other.category))
+                       return false;
+               if (functions == null) {
+                       if (other.functions != null)
+                               return false;
+               } else if (!functions.equals(other.functions))
+                       return false;
+               if (rowId == null) {
+                       if (other.rowId != null)
+                               return false;
+               } else if (!rowId.equals(other.rowId))
+                       return false;
+               return true;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppContactUsItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/AppContactUsItem.java
new file mode 100644 (file)
index 0000000..9afde2b
--- /dev/null
@@ -0,0 +1,189 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * An easily serializable version of row information from the fn_app_contact_us
+ * table; specifically this has an app ID instead of an EPApp object.
+ */
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class AppContactUsItem extends DomainVo {
+
+       private static final long serialVersionUID = 6964210807573346262L;
+
+       @Id
+       private Long appId;
+       private String appName;
+       private String description;
+       private String contactName;
+       private String contactEmail;
+       private String url;
+       private String activeYN;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+
+       public void setDescription(String description) {
+               this.description = description;
+       }
+
+       public String getContactName() {
+               return contactName;
+       }
+
+       public void setContactName(String contactName) {
+               this.contactName = contactName;
+       }
+
+       public String getContactEmail() {
+               return contactEmail;
+       }
+
+       public void setContactEmail(String contactEmail) {
+               this.contactEmail = contactEmail;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public String getActiveYN() {
+               return activeYN;
+       }
+
+       public void setActiveYN(String activeYN) {
+               this.activeYN = activeYN;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((activeYN == null) ? 0 : activeYN.hashCode());
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
+               result = prime * result + ((contactEmail == null) ? 0 : contactEmail.hashCode());
+               result = prime * result + ((contactName == null) ? 0 : contactName.hashCode());
+               result = prime * result + ((description == null) ? 0 : description.hashCode());
+               result = prime * result + ((url == null) ? 0 : url.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AppContactUsItem other = (AppContactUsItem) obj;
+               if (activeYN == null) {
+                       if (other.activeYN != null)
+                               return false;
+               } else if (!activeYN.equals(other.activeYN))
+                       return false;
+               if (appId == null) {
+                       if (other.appId != null)
+                               return false;
+               } else if (!appId.equals(other.appId))
+                       return false;
+               if (appName == null) {
+                       if (other.appName != null)
+                               return false;
+               } else if (!appName.equals(other.appName))
+                       return false;
+               if (contactEmail == null) {
+                       if (other.contactEmail != null)
+                               return false;
+               } else if (!contactEmail.equals(other.contactEmail))
+                       return false;
+               if (contactName == null) {
+                       if (other.contactName != null)
+                               return false;
+               } else if (!contactName.equals(other.contactName))
+                       return false;
+               if (description == null) {
+                       if (other.description != null)
+                               return false;
+               } else if (!description.equals(other.description))
+                       return false;
+               if (url == null) {
+                       if (other.url != null)
+                               return false;
+               } else if (!url.equals(other.url))
+                       return false;
+               return true;
+       }
+
+       @Override
+       public String toString() {
+               return "AppContactUsItem [appId=" + appId + ", appName=" + appName + ", description=" + description
+                               + ", contactName=" + contactName + ", contactEmail=" + contactEmail + ", url=" + url + ", activeYN="
+                               + activeYN + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/CommonWidgetsEnum.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/CommonWidgetsEnum.java
new file mode 100644 (file)
index 0000000..43079a7
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+public enum CommonWidgetsEnum{
+       NEWS("news"),
+       EVENTS("events"),
+       RESOURCES("resources");
+       
+       private String value;
+       private CommonWidgetsEnum(String value){
+               this.value = value;
+       }
+       
+       @Override
+    public String toString() {
+        return value;
+    }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/PortalRestResponse.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/PortalRestResponse.java
new file mode 100644 (file)
index 0000000..7d1f432
--- /dev/null
@@ -0,0 +1,119 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+public class PortalRestResponse<T> {
+       
+       private PortalRestStatusEnum status;
+       private String message;
+       
+       private T response;
+       
+       public PortalRestResponse(){};
+       
+       public PortalRestResponse(PortalRestStatusEnum status, String message, T response){
+               this.status = status;
+               this.message = message;
+               this.response = response;
+       }
+
+       public PortalRestStatusEnum getStatus() {
+               return status;
+       }
+
+       public void setStatus(PortalRestStatusEnum status) {
+               this.status = status;
+       }
+
+       public String getMessage() {
+               return message;
+       }
+
+       public void setMessage(String message) {
+               this.message = message;
+       }
+
+       public T getResponse() {
+               return response;
+       }
+
+       public void setResponse(T response) {
+               this.response = response;
+       }
+
+       @Override
+       public String toString() {
+               return "PortalRestResponse [status=" + status + ", message=" + message + ", response=" + response + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((message == null) ? 0 : message.hashCode());
+               result = prime * result + ((response == null) ? 0 : response.hashCode());
+               result = prime * result + ((status == null) ? 0 : status.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               PortalRestResponse other = (PortalRestResponse) obj;
+               if (message == null) {
+                       if (other.message != null)
+                               return false;
+               } else if (!message.equals(other.message))
+                       return false;
+               if (response == null) {
+                       if (other.response != null)
+                               return false;
+               } else if (!response.equals(other.response))
+                       return false;
+               if (status != other.status)
+                       return false;
+               return true;
+       };      
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/PortalRestStatusEnum.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/PortalRestStatusEnum.java
new file mode 100644 (file)
index 0000000..5989ff8
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+public enum PortalRestStatusEnum{
+       OK("ok"),
+       WARN("WARNING"),
+       ERROR("error");
+       
+       private String value;
+       private PortalRestStatusEnum(String value){
+               this.value = value;
+       }
+       
+       @Override
+    public String toString() {
+        return value;
+    }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/SearchResultItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ecomp/model/SearchResultItem.java
new file mode 100644 (file)
index 0000000..6a62543
--- /dev/null
@@ -0,0 +1,104 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ecomp.model;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class SearchResultItem extends DomainVo{
+
+       @Id
+       private String rowId;   
+       
+       @JsonProperty("category")
+       private String category;
+       
+       @JsonProperty("name")
+       private String name;
+       
+       @JsonProperty("target")
+       private String target;
+
+       @JsonProperty("uuid")
+       private String uuid;
+       
+       public String getUuid() {
+               return uuid;
+       }
+       public void setUuid(String uuid) {
+               this.uuid = uuid;
+       }
+       public String getRowId() {
+               return rowId;
+       }
+       public void setRowId(String rowId) {
+               this.rowId = rowId;
+       }
+       public String getCategory() {
+               return category;
+       }
+       public void setCategory(String category) {
+               this.category = category;
+       }
+       public String getName() {
+               return name;
+       }
+       public void setName(String name) {
+               this.name = name;
+       }
+       
+       public String getTarget() {
+               return target;
+       }
+       public void setTarget(String target) {
+               this.target = target;
+       }
+       @Override
+       public String toString() {
+               return "SearchResultItem [rowId=" + rowId + ", category=" + category + ", name=" + name + ", target=" + target
+                               + ", uuid=" + uuid + "]";
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/DeleteDomainObjectFailedException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/DeleteDomainObjectFailedException.java
new file mode 100644 (file)
index 0000000..420184f
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class DeleteDomainObjectFailedException extends Exception{
+
+       private static final long serialVersionUID = -4591508985449251121L;
+
+       public DeleteDomainObjectFailedException(String msg) {
+                  super(msg);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/DuplicateRecordException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/DuplicateRecordException.java
new file mode 100644 (file)
index 0000000..1f279f4
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class DuplicateRecordException extends Exception{
+
+       private static final long serialVersionUID = 2759542750310357001L;
+
+       public DuplicateRecordException(String msg) {
+                  super(msg);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/ExternalAuthSystemException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/ExternalAuthSystemException.java
new file mode 100644 (file)
index 0000000..1c17c2c
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class ExternalAuthSystemException extends Exception {
+
+       private static final long serialVersionUID = -4576754924998287267L;
+
+       public ExternalAuthSystemException(String msg) {
+                  super(msg);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InactiveApplicationException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InactiveApplicationException.java
new file mode 100644 (file)
index 0000000..8a7d70c
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class InactiveApplicationException extends Exception{
+
+       private static final long serialVersionUID = -4641226040102977745L;
+
+       public InactiveApplicationException(String msg) {
+                  super(msg);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidApplicationException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidApplicationException.java
new file mode 100644 (file)
index 0000000..d48e60f
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class InvalidApplicationException extends Exception{
+
+       private static final long serialVersionUID = -5454293609563606255L;
+
+       public InvalidApplicationException(String msg) {
+                  super(msg);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidRoleException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidRoleException.java
new file mode 100644 (file)
index 0000000..bf19f4a
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class InvalidRoleException extends Exception{
+
+       private static final long serialVersionUID = -7453145846850741282L;
+
+       public InvalidRoleException(String message){
+               super(message);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidUserException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/InvalidUserException.java
new file mode 100644 (file)
index 0000000..0065010
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+public class InvalidUserException extends Exception{
+
+       private static final long serialVersionUID = 273572212076653743L;
+
+       public InvalidUserException(String msg) {
+                  super(msg);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/NoHealthyServiceException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/NoHealthyServiceException.java
new file mode 100644 (file)
index 0000000..d210b41
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+import com.ecwid.consul.ConsulException;
+
+public class NoHealthyServiceException extends ConsulException{
+
+       private static final long serialVersionUID = -7089437673127729813L;
+       
+       public NoHealthyServiceException(String message){
+               super(message);
+       }
+       
+       @Override
+       public String toString() {
+               return "NoHealthyServiceException [] " + this.getMessage();
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/NonCentralizedAppException.java
new file mode 100644 (file)
index 0000000..4bfde35
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.exceptions;
+
+public class NonCentralizedAppException extends Exception {
+
+       String appName;
+
+       private static final long serialVersionUID = 1L;
+       
+       public NonCentralizedAppException(String name) {
+       this.appName= name;
+       }
+
+       @Override
+       public String toString() {
+               return appName + " is not Centralized Application";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/RoleFunctionException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/RoleFunctionException.java
new file mode 100644 (file)
index 0000000..b189ca4
--- /dev/null
@@ -0,0 +1,53 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.exceptions;
+
+import org.apache.commons.codec.DecoderException;
+
+public class RoleFunctionException extends Exception{
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -3280548136475923423L;
+
+       public RoleFunctionException(String msg, DecoderException e) {
+                  super(msg,e);
+          } 
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/SecurityVulnerabilitiesException.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/exceptions/SecurityVulnerabilitiesException.java
new file mode 100644 (file)
index 0000000..8fffbc3
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+@SuppressWarnings("serial")
+public class SecurityVulnerabilitiesException extends Exception {
+          SecurityVulnerabilitiesException(String msg) {
+                  super(msg);
+          } 
+       }
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..5d2f399
--- /dev/null
@@ -0,0 +1,369 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.interceptor;
+
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.List;
+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.apache.commons.codec.binary.Hex;
+import org.onap.portalapp.controller.sessionmgt.SessionCommunicationController;
+import org.onap.portalapp.portal.controller.BasicAuthenticationController;
+import org.onap.portalapp.portal.controller.ExternalAppsRestfulController;
+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.EPEndpoint;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.BasicAuthenticationCredentialService;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.service.RemoteWebServiceCallService;
+import org.onap.portalapp.service.sessionmgt.ManageService;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.controller.FusionBaseController;
+import org.onap.portalsdk.core.exception.UrlAccessRestrictedException;
+import org.onap.portalsdk.core.interceptor.ResourceInterceptor;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.method.HandlerMethod;
+
+public class PortalResourceInterceptor extends ResourceInterceptor {
+       private static final String APP_KEY = "uebkey";
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalResourceInterceptor.class);
+
+       @Autowired
+       private RemoteWebServiceCallService remoteWebServiceCallService;
+
+       @Autowired
+       private ManageService manageService;
+
+       @Autowired
+       private EPEELFLoggerAdvice epAdvice;
+
+       @Autowired
+       private BasicAuthenticationCredentialService basicAuthService;
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
+                       throws Exception {
+
+               if (handler instanceof HandlerMethod) {
+                       HandlerMethod method = (HandlerMethod) handler;
+
+                       /**
+                        * These classes provide REST endpoints used by other application
+                        * servers, NOT by an end user's browser.
+                        */
+                       if (method.getBean() instanceof FusionBaseController) {
+                               FusionBaseController controller = (FusionBaseController) method.getBean();
+                               if (!controller.isAccessible()) {
+
+                                       // authorize portalApi requests by user role
+                                       String requestURI = request.getRequestURI();
+                                       if (requestURI != null) {
+                                               String[] uriArray = requestURI.split("/portalApi/");
+                                               if (uriArray.length > 1) {
+                                                       String portalApiPath = uriArray[1];
+
+                                                       Set<? extends String> roleFunctions = (Set<? extends String>) request.getSession()
+                                                                       .getAttribute(SystemProperties
+                                                                                       .getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
+                                                       Set<? extends String> allRoleFunctions = (Set<? extends String>) request.getSession()
+                                                                       .getAttribute(EPUserUtils.ALL_ROLE_FUNCTIONS);
+                                                       // Defend against code error to avoid throwing NPE
+                                                       if (roleFunctions == null || allRoleFunctions == null) {
+                                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                                               "preHandle: failed to get role functions attribute(s) from session!!");
+                                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInitializationError);
+                                                               return false;
+                                                       }
+                                                       // check to see if roleFunctions of the user is in
+                                                       // the
+                                                       // list of all role functions
+                                                       // if not, ignore to prevent restricting every
+                                                       // trivial
+                                                       // call; otherwise, if it is, then check for the
+                                                       // access
+                                                       if (matchRoleFunctions(portalApiPath, allRoleFunctions)
+                                                                       && !matchRoleFunctions(portalApiPath, roleFunctions)) {
+                                                               EPUser user = (EPUser) request.getSession().getAttribute(
+                                                                               SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
+                                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                                               "preHandle: User {} not authorized for path {} ", user.getOrgUserId(),
+                                                                               portalApiPath);
+                                                               EcompPortalUtils.setBadPermissions(user, response, portalApiPath);
+                                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError);
+                                                               return false;
+                                                       } // failed to match
+
+                                               } // is portalApi
+
+                                       } // requestURI
+                               } // instance check
+                       } // not accessible
+                       else if (method.getBean() instanceof BasicAuthenticationController) {
+                               return checkBasicAuth(request, response);
+                       }
+                       Object controllerObj = method.getBean();
+                       if (controllerObj instanceof SessionCommunicationController
+                                       || controllerObj instanceof SharedContextRestController
+                                       || controllerObj instanceof ExternalAppsRestfulController) {
+                               // check user authentication for RESTful calls
+                               String secretKey = null;
+                               try {
+                                       epAdvice.loadServletRequestBasedDefaults(request, SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
+                                       if (!remoteWebServiceCallService.verifyRESTCredential(secretKey, request.getHeader(APP_KEY),
+                                                       request.getHeader("username"), request.getHeader("password"))) {
+                                               throw new UrlAccessRestrictedException();
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "preHandle: failed to authenticate RESTful service",
+                                                       e);
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
+                                       throw new UrlAccessRestrictedException();
+                               }
+                       }
+
+                       if (controllerObj instanceof WebAnalyticsExtAppController) {
+                               if (!remoteWebServiceCallService.verifyAppKeyCredential(request.getHeader(APP_KEY))) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "preHandle: failed to verify app key for web analytics call");
+                                       throw new UrlAccessRestrictedException();
+                               }
+                       }
+               }
+
+               handleSessionUpdates(request);
+               return true;
+       }
+
+       /**
+        * Sets the status code and sends a response. Factors code out of many
+        * methods.
+        * 
+        * @param response
+        *            HttpServletResponse
+        * @param statusCode
+        *            HTTP status code like 404
+        * @param message
+        *            Message to send in a JSON error object
+        */
+       private void sendErrorResponse(HttpServletResponse response, final int statusCode, final String message)
+                       throws Exception {
+               response.setStatus(statusCode);
+               response.setContentType("application/json");
+               response.getWriter().write("{\"error\":\"" + message + "\"}");
+               response.getWriter().flush();
+       }
+
+       /**
+        * Gets HTTP basic authentication information from the request and checks
+        * whether those credentials are authorized for the request path.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param response
+        *            HttpServletResponse
+        * @return True if the request is authorized, else false
+        * @throws Exception
+        */
+       private boolean checkBasicAuth(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               String uri = request.getRequestURI().toString();
+               uri = uri.substring(uri.indexOf("/", 1));
+
+               final String authHeader = request.getHeader("Authorization");
+
+               // Unauthorized access due to missing HTTP Authorization request header
+               if (authHeader == null) {
+                       final String msg = "no authorization found";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
+                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
+                       return false;
+               }
+
+               String[] accountNamePassword = getUserNamePassword(authHeader);
+               if (accountNamePassword == null || accountNamePassword.length != 2) {
+                       final String msg = "failed to get username and password from Atuhorization header";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
+                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
+                       return false;
+               }
+
+               BasicAuthCredentials creds;
+               try {
+                       creds = basicAuthService.getBasicAuthCredentialByUsernameAndPassword(accountNamePassword[0],
+                                       encrypted(accountNamePassword[1]));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "checkBasicAuth failed to get credentials", e);
+                       final String msg = "Failed while getting basic authentication credential: ";
+                       sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
+                       throw e;
+               }
+
+               // Unauthorized access due to invalid credentials (username and
+               // password)
+               if (creds == null || !creds.getUsername().equals(accountNamePassword[0])) {
+                       final String msg = "Unauthorized: Access denied";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
+                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
+                       return false;
+               }
+
+               // Unauthorized access due to inactive account
+               if (creds.getIsActive().equals("N")) {
+                       final String msg = "Unauthorized: The account is inactive";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
+                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
+                       return false;
+               }
+               boolean isAllowedEp = false;
+               for (EPEndpoint ep : creds.getEndpoints()) {
+                       if (ep.getName().equals(uri)) {
+                               isAllowedEp = true;
+                               break;
+                       }
+               }
+
+               // If user doesn't specify any endpoint, allow all endpoints for that
+               // account
+               if (creds.getEndpoints().size() == 0)
+                       isAllowedEp = true;
+
+               // Unauthorized access due to the invalid endpoints
+               if (!isAllowedEp) {
+                       final String msg = "Unauthorized: Endpoint access denied";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
+                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
+                       return false;
+               }
+
+               // Made it to the end!
+               return true;
+       }
+
+       private String[] getUserNamePassword(String authValue) {
+               String base64Credentials = authValue.substring("Basic".length()).trim();
+               String credentials = new String(Base64.getDecoder().decode(base64Credentials), Charset.forName("UTF-8"));
+               final String[] values = credentials.split(":", 2);
+               return values;
+       }
+
+       @SuppressWarnings("unused")
+       private String decrypted(String encrypted) throws Exception {
+               String result = "";
+               if (encrypted != null & encrypted.length() > 0) {
+                       try {
+                               result = CipherUtil.decryptPKC(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+
+       private String encrypted(String decryptedPwd) throws Exception {
+               String result = "";
+               if (decryptedPwd != null & decryptedPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.encryptPKC(decryptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+
+       private Boolean matchRoleFunctions(String portalApiPath, Set<? extends String> roleFunctions) {
+               String[] path = portalApiPath.split("/");
+               List<String> roleFunList = new ArrayList<>();
+               if (path.length > 1) {
+                       roleFunList = roleFunctions.stream().filter(item -> item.startsWith(path[0])).collect(Collectors.toList());
+                       if (roleFunList.size() >= 1) {
+                               for (String roleFunction : roleFunList) {
+                                       String[] roleFunctionArray = roleFunction.split("/");
+                                       boolean b = true;
+                                       if (roleFunctionArray.length == path.length) {
+                                               for (int i = 0; i < roleFunctionArray.length; i++) {
+                                                       if (b) {
+                                                               if (!roleFunctionArray[i].equals("*")) {
+                                                                       Pattern p = Pattern.compile(Pattern.quote(path[i]), Pattern.CASE_INSENSITIVE);
+                                                                       Matcher m = p.matcher(roleFunctionArray[i]);
+                                                                       b = m.matches();
+
+                                                               }
+                                                       }
+                                               }
+                                                       if (b)
+                                                               return b;
+                                       }
+                               }
+                       }
+               } else {
+                       for (String roleFunction : roleFunctions) {
+                               if (portalApiPath.matches(roleFunction))
+                                       return true;
+                       }
+               }
+               return false;
+       }
+
+       protected void handleSessionUpdates(HttpServletRequest request) {
+               PortalTimeoutHandler.handleSessionUpdatesNative(request, null, null, null, null, manageService);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/HealthMonitor.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/HealthMonitor.java
new file mode 100644 (file)
index 0000000..0bc5c4c
--- /dev/null
@@ -0,0 +1,364 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.listener;
+
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.ueb.EPUebHelper;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+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.EnableAspectJAutoProxy;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class HealthMonitor {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthMonitor.class);
+
+       @Autowired
+       private SessionFactory sessionFactory;
+
+       @Autowired
+       private EPUebHelper epUebHelper;
+
+       private static boolean databaseUp;
+       private static boolean uebUp;
+       private static boolean frontEndUp;
+       private static boolean backEndUp;
+       private static boolean dbClusterStatusOk;
+       private static boolean dbPermissionsOk;
+
+       /**
+        * Read directly by external classes.
+        */
+       public static boolean isSuspended = false;
+
+       private Thread healthMonitorThread;
+
+       public HealthMonitor() {
+       }
+
+       public static boolean isDatabaseUp() {
+               return databaseUp;
+       }
+
+       public static boolean isClusterStatusOk() {
+               return dbClusterStatusOk;
+       }
+
+       public static boolean isDatabasePermissionsOk() {
+               return dbPermissionsOk;
+       }
+
+       public static boolean isUebUp() {
+               return uebUp;
+       }
+
+       public static boolean isFrontEndUp() {
+               return frontEndUp;
+       }
+
+       public static boolean isBackEndUp() {
+               return backEndUp;
+       }
+
+       private void monitorEPHealth() throws InterruptedException {
+
+               int numIntervalsDatabaseHasBeenDown = 0;
+               int numIntervalsClusterNotHealthy = 0;
+               int numIntervalsDatabasePermissionsIncorrect = 0;
+               int numIntervalsUebHasBeenDown = 0;
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "monitorEPHealth thread started");
+
+               long sleepInterval = (Long
+                               .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.HEALTH_POLL_INTERVAL_SECONDS)) * 1000);
+               long numIntervalsBetweenAlerts = Long
+                               .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.HEALTHFAIL_ALERT_EVERY_X_INTERVALS));
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "monitorEPHealth: Polling health every " + sleepInterval + " milliseconds. Alerting every "
+                                               + (sleepInterval * numIntervalsBetweenAlerts) / 1000 + " seconds when component remains down.");
+
+               while (true) {
+                       //
+                       // Get DB status. If down, signal alert once every X intervals.
+                       //
+                       databaseUp = this.checkIfDatabaseUp();
+                       if (databaseUp == false) {
+                               if ((numIntervalsDatabaseHasBeenDown % numIntervalsBetweenAlerts) == 0) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "monitorEPHealth: database down, logging to error log to trigger alert.");
+                                       // Write a Log entry that will generate an alert
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckMySqlError);
+                                       numIntervalsDatabaseHasBeenDown++;
+                               } else {
+                                       numIntervalsDatabaseHasBeenDown = 0;
+                               }
+                       }
+
+                       dbClusterStatusOk = this.checkClusterStatus();
+                       if (dbClusterStatusOk == false) {
+                               if ((numIntervalsClusterNotHealthy % numIntervalsBetweenAlerts) == 0) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "monitorEPHealth: cluster nodes down, logging to error log to trigger alert.");
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckMySqlError);
+                                       numIntervalsClusterNotHealthy++;
+                               } else {
+                                       numIntervalsClusterNotHealthy = 0;
+                               }
+                       }
+
+                       dbPermissionsOk = this.checkDatabasePermissions();
+                       if (dbPermissionsOk == false) {
+                               if ((numIntervalsDatabasePermissionsIncorrect % numIntervalsBetweenAlerts) == 0) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "monitorEPHealth: database permissions incorrect, logging to error log to trigger alert.");
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckMySqlError);
+                                       numIntervalsDatabasePermissionsIncorrect++;
+                               } else {
+                                       numIntervalsDatabasePermissionsIncorrect = 0;
+                               }
+                       }
+
+                       //
+                       // Get UEB status. Publish a bogus message to EP inbox, if 200 OK
+                       // returned, status is Up.
+                       // If down, signal alert once every X intervals.
+                       // EP will ignore this bogus message.
+                       //
+                       uebUp = this.checkIfUebUp();
+                       if (uebUp == false) {
+
+                               if ((numIntervalsUebHasBeenDown % numIntervalsBetweenAlerts) == 0) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "monitorEPHealth: UEB down, logging to error log to trigger alert");
+                                       // Write a Log entry that will generate an alert
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckUebClusterError);
+                                       numIntervalsUebHasBeenDown++;
+                               } else {
+                                       numIntervalsUebHasBeenDown = 0;
+                               }
+                       }
+
+                       // The front end should be up because the API is called through
+                       // proxy front end server.
+                       frontEndUp = true;
+
+                       // If the rest API called, the backend is always up
+                       backEndUp = true;
+
+                       //
+                       // future nice to have...get Partner status
+                       //
+                       // For all apps exposing a rest url, query one of the rest
+                       // urls(/roles?) and manage a list
+                       // of app name/status. We might not return back a non 200 OK in
+                       // health check, but we
+                       // could return information in the json content of a health check.
+                       //
+
+                       //
+                       // Get DB status. If down, signal alert once every X intervals.
+                       //
+                       if (Thread.interrupted()) {
+                               logger.info(EELFLoggerDelegate.errorLogger, "monitorEPHealth: thread interrupted");
+                               break;
+                       }
+
+                       try {
+                               Thread.sleep(sleepInterval);
+                       } catch (InterruptedException e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "monitorEPHealth: sleep interrupted", e);
+                               Thread.currentThread().interrupt();
+                       }
+               }
+       }
+
+       @PostConstruct
+       public void initHealthMonitor() {
+               healthMonitorThread = new Thread("EP HealthMonitor thread") {
+                       public void run() {
+                               try {
+                                       monitorEPHealth();
+                               } catch (InterruptedException e) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "healthMonitorThread interrupted", e);
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "healthMonitorThread failed", e);
+                               }
+                       }
+               };
+               healthMonitorThread.start();
+               
+       }
+
+       @PreDestroy
+       public void closeHealthMonitor() {
+               this.healthMonitorThread.interrupt();
+       }
+
+       /**
+        * This routine checks whether the database can be read. In June 2017 we
+        * experimented with checking if the database can be WRITTEN. Writes failed
+        * with some regularity in a MariaDB Galera cluster, and in that
+        * environment, the resulting alerts in the log triggered a health monitor
+        * cron job to shut down the Tomcat instance. The root cause of the cluster
+        * write failures was not determined.
+        * 
+        * @return true if the database can be read.
+        */
+       private boolean checkIfDatabaseUp() {
+               boolean isUp = false;
+               Session localSession = null;
+               try {
+                       localSession = sessionFactory.openSession();
+                       if (localSession != null) {
+                               String sql = "select app_name from fn_app where app_id=1";
+                               Query query = localSession.createSQLQuery(sql);
+                               @SuppressWarnings("unchecked")
+                               List<String> queryList = query.list();
+                               if (queryList != null) {
+                                       isUp = true;
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkIfDatabaseUp failed", e);
+                       isUp = false;
+               } finally {
+                       if (localSession != null)
+                               localSession.close();
+               }
+               return isUp;
+       }
+
+       private boolean checkClusterStatus() {
+               boolean isUp = false;
+               Session localSession = null;
+               try {
+                       localSession = sessionFactory.openSession();
+                       if (localSession != null) {
+                               // If all nodes are unhealthy in a cluster, this will throw an
+                               // exception
+                               String sql = "select * from mysql.user";
+                               Query query = localSession.createSQLQuery(sql);
+                               @SuppressWarnings("unchecked")
+                               List<String> queryList = query.list();
+                               if (queryList != null) {
+                                       isUp = true;
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "checkClusterStatus failed", e);
+                       if ((e.getCause() != null) && (e.getCause().getMessage() != null)) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "checkClusterStatus failure cause", e.getCause());
+                       }
+                       isUp = false;
+               } finally {
+                       if (localSession != null) {
+                               localSession.close();
+                       }
+               }
+               return isUp;
+       }
+
+       private boolean checkDatabasePermissions() {
+               boolean isUp = false;
+               Session localSession = null;
+               try {
+                       localSession = sessionFactory.openSession();
+                       if (localSession != null) {
+                               String sql = "SHOW GRANTS FOR CURRENT_USER";
+                               Query query = localSession.createSQLQuery(sql);
+                               @SuppressWarnings("unchecked")
+                               List<String> grantsList = query.list();
+                               for (String str : grantsList) {
+                                       if ((str.toUpperCase().contains("ALL"))
+                                                       || (str.toUpperCase().contains("DELETE") && str.toUpperCase().contains("SELECT")
+                                                                       && str.toUpperCase().contains("UPDATE") && str.toUpperCase().contains("INSERT"))) {
+                                               isUp = true;
+                                               break;
+                                       }
+                               }
+                               if (isUp == false) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "checkDatabasePermissions returning false.  SHOW GRANTS FOR CURRENT_USER being dumped:");
+                                       for (String str : grantsList) {
+                                               logger.error(EELFLoggerDelegate.errorLogger, "grants output item = [" + str + "]");
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "checkDatabasePermissions failed", e);
+                       if ((e.getCause() != null) && (e.getCause().getMessage() != null)) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "checkDatabasePermissions failure cause", e.getCause());
+                       }
+                       isUp = false;
+               } finally {
+                       if (localSession != null) {
+                               localSession.close();
+                       }
+               }
+               return isUp;
+       }
+
+       private boolean checkIfUebUp() {
+               boolean uebUp = false;
+               try {
+                       boolean isAvailable = epUebHelper.checkAvailability();
+                       boolean messageCanBeSent = epUebHelper.MessageCanBeSentToTopic();
+                       uebUp = (isAvailable && messageCanBeSent);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "checkIfUebUp failed", e);
+               }
+               return uebUp;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/UserContextListener.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/UserContextListener.java
new file mode 100644 (file)
index 0000000..2d0570f
--- /dev/null
@@ -0,0 +1,69 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.listener;
+
+import java.util.HashMap;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
+
+@WebListener
+public class UserContextListener implements ServletContextListener{
+       @SuppressWarnings("rawtypes")
+       public void contextInitialized(ServletContextEvent event){
+       ServletContext context = event.getServletContext();        
+        //
+        // instanciate a map to store references to all the active
+        // sessions and bind it to context scope.
+        //
+        HashMap activeUsers = new HashMap();
+        context.setAttribute("activeUsers", activeUsers);
+    }
+
+    /**
+     * Needed for the ServletContextListener interface.
+     */
+    public void contextDestroyed(ServletContextEvent event){
+        // To overcome the problem with losing the session references
+        // during server restarts, put code here to serialize the
+        // activeUsers HashMap.  Then put code in the contextInitialized
+        // method that reads and reloads it if it exists...
+    }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/UserSessionListener.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/listener/UserSessionListener.java
new file mode 100644 (file)
index 0000000..8633a41
--- /dev/null
@@ -0,0 +1,140 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.listener;
+
+import java.util.HashMap;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.annotation.WebListener;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.service.SharedContextService;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+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.ApplicationContext;
+import org.springframework.util.StringUtils;
+
+/**
+ * Listens for session-create and session-destroy events.
+ */
+@WebListener
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class UserSessionListener implements HttpSessionListener {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserSessionListener.class);
+
+       /**
+        * Access to the database
+        */
+       @Autowired
+       SharedContextService sharedContextService;
+
+       public void init(ServletConfig config) {
+       }
+
+       /**
+        * Adds sessions to the context scoped HashMap when they begin.
+        */
+       public void sessionCreated(HttpSessionEvent event) {
+               HttpSession session = event.getSession();
+               ServletContext context = session.getServletContext();
+               HashMap activeUsers = (HashMap) context.getAttribute("activeUsers");
+
+               activeUsers.put(session.getId(), session);
+               context.setAttribute("activeUsers", activeUsers);
+               logger.info(EELFLoggerDelegate.debugLogger, "Session Created : " + session.getId());
+       }
+
+       /**
+        * Removes sessions from the context scoped HashMap when they expire or are
+        * invalidated.
+        */
+       public void sessionDestroyed(HttpSessionEvent event) {
+               try {
+                       HttpSession session = event.getSession();
+                       ServletContext context = session.getServletContext();
+                       HashMap activeUsers = (HashMap) context.getAttribute("activeUsers");
+                       activeUsers.remove(session.getId());
+
+                       EPUser user = (EPUser) session
+                                       .getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
+                       if (user != null && !StringUtils.isEmpty(user.getOrgUserId())) {
+                               CollaborateList.delUserName(user.getOrgUserId());
+                       }
+
+                       // Remove any shared context entries for this session.
+                       if (getSharedContextService() != null) {
+                               getSharedContextService().deleteSharedContexts(session.getId());
+
+                               // Clean the shared context each time a session is destroyed.
+                               // TODO: move the threshold to configuration file.
+                               getSharedContextService().expireSharedContexts(60 * 60 * 8);
+                       }
+
+                       logger.info(EELFLoggerDelegate.debugLogger, "Session Destroyed : " + session.getId());
+
+               } catch (Exception e) {
+                       logger.warn(EELFLoggerDelegate.errorLogger, "sessionDestroyed failed", e);
+               }
+       }
+
+       private static ApplicationContext applicationContext;
+
+       public static void setApplicationContext(ApplicationContext _applicationContext) {
+               applicationContext = _applicationContext;
+       }
+
+       public SharedContextService getSharedContextService() {
+               if (sharedContextService == null) {
+                       if (applicationContext != null)
+                               sharedContextService = (SharedContextService) applicationContext.getBean("sharedContextService");
+               }
+
+               return sharedContextService;
+       }
+
+       public void setSharedContextService(SharedContextService sharedContextService) {
+               this.sharedContextService = sharedContextService;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPAuditLog.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPAuditLog.java
new file mode 100644 (file)
index 0000000..8c72ed7
--- /dev/null
@@ -0,0 +1,49 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.aop;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface EPAuditLog {
+    String value() default "";
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java
new file mode 100644 (file)
index 0000000..11fb2fb
--- /dev/null
@@ -0,0 +1,400 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.aop;
+
+import java.net.InetAddress;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.exception.SessionExpiredException;
+import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum;
+import org.onap.portalsdk.core.logging.format.AuditLogFormatter;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.slf4j.MDC;
+
+import com.att.eelf.configuration.Configuration;
+
+@org.springframework.context.annotation.Configuration
+public class EPEELFLoggerAdvice {
+
+       private EELFLoggerDelegate adviceLogger = EELFLoggerDelegate.getLogger(EPEELFLoggerAdvice.class);
+
+       /**
+        * DateTime Format according to the ECOMP Application Logging Guidelines.
+        */
+
+       /**
+        * @return Current date and time in the format specified by the ECOMP
+        *         Application Logging Guidelines.
+        */
+       public static String getCurrentDateTimeUTC() {
+               SimpleDateFormat ecompLogDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
+               String currentDateTime = ecompLogDateFormat.format(new Date());
+               return currentDateTime;
+       }
+
+       /**
+        * Sets logging context with values from HttpServletRequest object.
+        * 
+        * @param req
+        *            HttpServletRequest
+        * @param securityEventType
+        *            SecurityEventTypeEnum
+        */
+       public void loadServletRequestBasedDefaults(HttpServletRequest req, SecurityEventTypeEnum securityEventType) {
+               try {
+                       setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, req.getServletPath());
+               } catch (Exception e) {
+                       adviceLogger.error(EELFLoggerDelegate.errorLogger, "loadServletRequestBasedDefaults failed", e);
+               }
+       }
+
+       /**
+        * 
+        * @param securityEventType
+        * @param args
+        * @param passOnArgs
+        * @return Object array
+        */
+       public Object[] before(SecurityEventTypeEnum securityEventType, Object[] args, Object[] passOnArgs) {
+               String className = "";
+               if (passOnArgs.length > 0 && passOnArgs[0] != null)
+                       className = passOnArgs[0].toString();
+               String methodName = "";
+               if (passOnArgs.length > 1 && passOnArgs[1] != null)
+                       methodName = passOnArgs[1].toString();
+
+               // Initialize Request defaults only for controller methods.
+               MDC.put(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC());
+               MDC.put(EPCommonSystemProperties.TARGET_ENTITY, EPCommonSystemProperties.ECOMP_PORTAL_BE);
+               MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, methodName);
+               if (MDC.get(Configuration.MDC_KEY_REQUEST_ID) == null){
+                       String requestId = UUID.randomUUID().toString();
+                       MDC.put(Configuration.MDC_KEY_REQUEST_ID, requestId);
+               }
+               MDC.put(EPCommonSystemProperties.PARTNER_NAME, "Unknown");
+               MDC.put(Configuration.MDC_SERVICE_NAME, EPCommonSystemProperties.ECOMP_PORTAL_BE);
+
+               if (securityEventType != null) {
+                       MDC.put(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
+                                       getCurrentDateTimeUTC());
+                       HttpServletRequest req = null;
+                       if (args.length > 0 && args[0] != null && args[0] instanceof HttpServletRequest) {
+                               req = (HttpServletRequest) args[0];
+                               this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, methodName);
+                       }
+               }
+
+               EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(className);
+               logger.debug(EELFLoggerDelegate.debugLogger, "EPEELFLoggerAdvice#before: entering {}", methodName);
+               return new Object[] { "" };
+       }
+
+       /**
+        * 
+        * @param securityEventType
+        * @param statusCode
+        * @param responseCode
+        * @param args
+        * @param returnArgs
+        * @param passOnArgs
+        */
+       public void after(SecurityEventTypeEnum securityEventType, String statusCode, String responseCode, Object[] args,
+                       Object[] returnArgs, Object[] passOnArgs) {
+               String className = "";
+               if (passOnArgs.length > 0 && passOnArgs[0] != null)
+                       className = passOnArgs[0].toString();
+               // Method Name
+               String methodName = "";
+               if (passOnArgs.length > 1 && passOnArgs[1] != null)
+                       methodName = passOnArgs[1].toString();
+
+               if (MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME) == null
+                               || MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME) == "")
+                       MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, methodName);
+
+               if (MDC.get(EPCommonSystemProperties.TARGET_ENTITY) == null
+                               || MDC.get(EPCommonSystemProperties.TARGET_ENTITY) == "")
+                       MDC.put(EPCommonSystemProperties.TARGET_ENTITY, EPCommonSystemProperties.ECOMP_PORTAL_BE);
+
+               MDC.put(EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP,
+                               MDC.get(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP));
+               MDC.put(EPCommonSystemProperties.METRICSLOG_END_TIMESTAMP, getCurrentDateTimeUTC());
+               this.calculateDateTimeDifference(MDC.get(EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP),
+                               MDC.get(EPCommonSystemProperties.METRICSLOG_END_TIMESTAMP));
+
+               // Making sure to reload the INCOMING request MDC defaults if they have
+               // been wiped out by either Outgoing or LDAP Phone book search
+               // operations.
+               if (securityEventType != null && args.length > 0 && args[0] != null && args[0] instanceof HttpServletRequest
+                               && securityEventType == SecurityEventTypeEnum.INCOMING_REST_MESSAGE
+                               && (MDC.get(EPCommonSystemProperties.FULL_URL) == null
+                                               || MDC.get(EPCommonSystemProperties.FULL_URL) == "")) {
+                       HttpServletRequest req = (HttpServletRequest) args[0];
+                       this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, methodName);
+               }
+
+               // Use external API response code in case if it resulted in an error.
+               String externalAPIResponseCode = MDC.get(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
+               if (externalAPIResponseCode == null || externalAPIResponseCode == ""
+                               || externalAPIResponseCode.trim().equalsIgnoreCase("200")) {
+                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, responseCode);
+                       MDC.put(EPCommonSystemProperties.STATUS_CODE, statusCode);
+               } else {
+                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, externalAPIResponseCode);
+                       MDC.put(EPCommonSystemProperties.STATUS_CODE, "ERROR");
+               }
+
+               EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(className);
+               logger.debug(EELFLoggerDelegate.debugLogger, "EPEELFLoggerAdvice#after: finished {}", methodName);
+               // add the metrics log
+               logger.info(EELFLoggerDelegate.metricsLogger,  methodName + " operation is completed.");
+
+               // Log security message, if necessary
+               if (securityEventType != null) {
+                       MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
+                                       MDC.get(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP));
+                       MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, getCurrentDateTimeUTC());
+                       this.calculateDateTimeDifference(MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
+                                       MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
+
+                       this.logSecurityMessage(logger, securityEventType, methodName);
+
+                       // Outgoing & LDAP messages are part of Incoming requests so,
+                       // keep "RequestId", "PartnerName", "ServiceName", "LoginId" &
+                       // "ResponseCode" etc. in memory and remove it only when
+                       // finished processing the parent incoming message.
+                       if (securityEventType != SecurityEventTypeEnum.OUTGOING_REST_MESSAGE
+                                       && securityEventType != SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) {
+                               MDC.remove(Configuration.MDC_KEY_REQUEST_ID);
+                               MDC.remove(EPCommonSystemProperties.PARTNER_NAME);
+                               MDC.remove(Configuration.MDC_SERVICE_NAME);
+                               MDC.remove(EPCommonSystemProperties.MDC_LOGIN_ID);
+                               MDC.remove(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
+                       }else{
+                               MDC.remove(Configuration.MDC_KEY_REQUEST_ID);
+                               MDC.remove(EPCommonSystemProperties.PARTNER_NAME);
+                               MDC.remove(Configuration.MDC_SERVICE_NAME);
+                       }
+
+                       // clear when finishes audit logging
+                       MDC.remove(EPCommonSystemProperties.FULL_URL);
+                       MDC.remove(EPCommonSystemProperties.PROTOCOL);
+                       MDC.remove(EPCommonSystemProperties.STATUS_CODE);
+                       MDC.remove(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                       MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
+                       MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
+                       MDC.remove(EPCommonSystemProperties.RESPONSE_CODE);
+               }
+               MDC.remove(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP);
+               MDC.remove(EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP);
+               MDC.remove(EPCommonSystemProperties.METRICSLOG_END_TIMESTAMP);
+               MDC.remove(EPCommonSystemProperties.MDC_TIMER);
+               MDC.remove(EPCommonSystemProperties.TARGET_ENTITY);
+               MDC.remove(EPCommonSystemProperties.TARGET_SERVICE_NAME);
+       
+       }
+
+       /**
+        * 
+        * @param logger
+        * @param securityEventType
+        * @param restMethod
+        */
+       private void logSecurityMessage(EELFLoggerDelegate logger, SecurityEventTypeEnum securityEventType,
+                       String restMethod) {
+               StringBuilder additionalInfoAppender = new StringBuilder();
+               String auditMessage = "";
+
+               if (securityEventType == SecurityEventTypeEnum.OUTGOING_REST_MESSAGE) {
+                       additionalInfoAppender.append(String.format("%s '%s' request was initiated.", restMethod,
+                                       MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME)));
+               } else if (securityEventType == SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) {
+                       additionalInfoAppender.append("LDAP Phonebook search operation is performed.");
+               } else {
+                       additionalInfoAppender.append(String.format("%s request was received.", restMethod));
+
+                       if (securityEventType == SecurityEventTypeEnum.FE_LOGIN_ATTEMPT) {
+                               String loginId = "";
+                               String additionalMessage = " Successfully authenticated.";
+                               loginId = MDC.get(EPCommonSystemProperties.MDC_LOGIN_ID);
+                               if (loginId == null || loginId == "" || loginId == EPCommonSystemProperties.UNKNOWN) {
+                                       additionalMessage = " No cookies are found.";
+                               }
+                               additionalInfoAppender.append(additionalMessage);
+                       } else if (securityEventType == SecurityEventTypeEnum.FE_LOGOUT) {
+                               additionalInfoAppender.append(" User has been successfully logged out.");
+                       }
+               }
+
+               String fullURL = MDC.get(EPCommonSystemProperties.FULL_URL);
+               if (fullURL != null && fullURL != "") {
+                       additionalInfoAppender.append(" Request-URL:" + MDC.get(EPCommonSystemProperties.FULL_URL));
+               }
+
+               auditMessage = AuditLogFormatter.getInstance().createMessage(MDC.get(EPCommonSystemProperties.PROTOCOL),
+                               securityEventType.name(), MDC.get(EPCommonSystemProperties.MDC_LOGIN_ID),
+                               additionalInfoAppender.toString());
+
+               logger.info(EELFLoggerDelegate.auditLogger, auditMessage);
+       }
+
+       /**
+        * 
+        * @param req
+        * @param securityEventType
+        * @param restMethod
+        */
+       private void setHttpRequestBasedDefaultsIntoGlobalLoggingContext(HttpServletRequest req,
+                       SecurityEventTypeEnum securityEventType, String restMethod) {
+               /**
+                * No need to load the request based defaults for the following security
+                * messages since either they are initiated by the Portal BE or not Http
+                * request based.
+                */
+               if (req != null) {
+                       if (securityEventType != SecurityEventTypeEnum.OUTGOING_REST_MESSAGE
+                                       && securityEventType != SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH
+                                       && securityEventType != SecurityEventTypeEnum.INCOMING_UEB_MESSAGE) {
+                               // Load the RequestID (aka TrasactionId) into MDC context.
+                               String requestId = UserUtils.getRequestId(req);
+                               if (requestId == null||requestId.trim().length()==0) {
+                                       requestId = UUID.randomUUID().toString();
+                               }
+                               MDC.put(Configuration.MDC_KEY_REQUEST_ID, requestId);
+
+                               // Load user agent into MDC context, if available.
+                               String accessingClient = "Unknown";
+                               accessingClient = req.getHeader(SystemProperties.USERAGENT_NAME);
+                               if (accessingClient != null && accessingClient.trim().length()==0 && (accessingClient.contains("Mozilla")
+                                               || accessingClient.contains("Chrome") || accessingClient.contains("Safari"))) {
+                                       accessingClient = EPCommonSystemProperties.ECOMP_PORTAL_FE;
+                               }
+                               MDC.put(EPCommonSystemProperties.PARTNER_NAME, accessingClient);
+
+                               // Load loginId into MDC context.
+                               EPUser user = null;
+                               try {
+                                       user = EPUserUtils.getUserSession(req);
+                               } catch (SessionExpiredException se) {
+                                       adviceLogger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "setHttpRequestBasedDefaultsIntoGlobalLoggingContext: No user found in session");
+                               }
+
+                               MDC.put(EPCommonSystemProperties.MDC_LOGIN_ID, (user != null ? user.getOrgUserId() : "NoUser"));
+
+                               // Rest URL & Protocol
+                               String restURL = "";
+                               MDC.put(EPCommonSystemProperties.FULL_URL, EPCommonSystemProperties.UNKNOWN);
+                               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
+                               restURL = UserUtils.getFullURL(req);
+                               if (restURL != null && restURL != "") {
+                                       MDC.put(EPCommonSystemProperties.FULL_URL, restURL);
+                                       if (restURL.toLowerCase().contains("https")) {
+                                               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
+                                       }
+                               }
+
+                               // Rest Path
+                               MDC.put(Configuration.MDC_SERVICE_NAME, restMethod);
+                               String restPath = req.getServletPath();
+                               if (restPath != null && restPath != "") {
+                                       MDC.put(Configuration.MDC_SERVICE_NAME, restPath);
+                               }
+
+                               // Client IPAddress i.e. IPAddress of the remote host who is
+                               // making this request.
+                               String clientIPAddress = "";
+                               clientIPAddress = req.getHeader("X-FORWARDED-FOR");
+                               if (clientIPAddress == null) {
+                                       clientIPAddress = req.getRemoteAddr();
+                               }
+                               MDC.put(EPCommonSystemProperties.CLIENT_IP_ADDRESS, clientIPAddress);
+                       } else if (securityEventType == SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) {
+                               MDC.put(EPCommonSystemProperties.TARGET_ENTITY, "Phonebook");
+                               MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, "search");
+                       }
+               } else {
+                       MDC.put(Configuration.MDC_SERVICE_NAME, restMethod);
+                       MDC.put(EPCommonSystemProperties.PARTNER_NAME, EPCommonSystemProperties.ECOMP_PORTAL_FE);
+               }
+
+               MDC.put(Configuration.MDC_SERVICE_INSTANCE_ID, "");
+               MDC.put(Configuration.MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.severity());
+               try {
+                       MDC.put(Configuration.MDC_SERVER_FQDN, InetAddress.getLocalHost().getCanonicalHostName());
+                       MDC.put(Configuration.MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
+                       MDC.put(Configuration.MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID));
+               } catch (Exception e) {
+                       adviceLogger.error(EELFLoggerDelegate.errorLogger,
+                                       "setHttpRequestBasedDefaultsIntoGlobalLoggingContext failed", e);
+               }
+       }
+
+       /**
+        * 
+        * @param beginDateTime
+        * @param endDateTime
+        */
+       private void calculateDateTimeDifference(String beginDateTime, String endDateTime) {
+               if (beginDateTime != null && endDateTime != null && !beginDateTime.isEmpty()&&!endDateTime.isEmpty()) {
+                       try {
+                               SimpleDateFormat ecompLogDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
+                               Date beginDate = ecompLogDateFormat.parse(beginDateTime);
+                               Date endDate = ecompLogDateFormat.parse(endDateTime);
+                               String timeDifference = String.format("%d", endDate.getTime() - beginDate.getTime());
+                               MDC.put(SystemProperties.MDC_TIMER, timeDifference);
+                       } catch (Exception e) {
+                               adviceLogger.error(EELFLoggerDelegate.errorLogger, "calculateDateTimeDifference failed", e);
+                       }
+               }
+       }
+
+       public String getInternalResponseCode() {
+               return MDC.get(EPCommonSystemProperties.RESPONSE_CODE);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPMetricsLog.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/aop/EPMetricsLog.java
new file mode 100644 (file)
index 0000000..ee52dd8
--- /dev/null
@@ -0,0 +1,49 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.aop;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ElementType.METHOD, ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface EPMetricsLog {
+    String value() default "";
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/ApplicationCodes.properties b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/ApplicationCodes.properties
new file mode 100644 (file)
index 0000000..cd686ce
--- /dev/null
@@ -0,0 +1,141 @@
+###
+# ================================================================================
+# ECOMP Portal
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property
+# ================================================================================
+# 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.
+# ================================================================================
+###
+########################################################################
+#Resource key=Error Code|Message text|Resolution text |Description text
+#######
+#Newlines can be utilized to add some clarity ensuring continuing line
+#has atleast one leading space
+#ResourceKey=\
+#             ERR0000E\
+#             Sample error msg txt\
+#             Sample resolution msg\
+#             Sample description txt
+#
+######
+#Error code classification category
+#100   Permission errors
+#200   Availability errors/Timeouts
+#300   Data errors
+#400   Schema Interface type/validation errors
+#500   Business process errors
+#900   Unknown errors
+#
+########################################################################
+
+# Define Alarm Codes Specific to ECOMP Portal
+BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT= ||Reason: {0}.|\
+                                                                               An Authentication failure occurred during access to UEB server. Please check that UEB keys are configured correctly under fusion.properties file.
+
+BERESTAPIAUTHENTICATIONERROR =                 |||Please check application credentials defined in Database or portal.properties file.
+                                                                               
+INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
+                                                                               
+INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
+
+INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
+
+INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
+
+BEHEALTHCHECKERROR=                                            |||Please check the logs for more information.
+
+BEHEALTHCHECKMYSQLERROR=                               ||Please check the logs for more information.|\
+                                                                               Check connectivity to MYSQL is configured correctly under system.properties file.
+
+BEHEALTHCHECKUEBCLUSTERERROR=                  ||Please check the logs for more information.|\
+                                                                               Check connectivity to UEB cluster which is configured under portal.properties file.
+
+FEHEALTHCHECKERROR=                                            |||Please check connectivity from this FE instance towards BE or BE Load Balancer.
+                                                                               
+BEHEALTHCHECKRECOVERY=                                 |||Please check logs for more specific information about the problem.
+
+BEHEALTHCHECKMYSQLRECOVERY=                            |||Please check logs for more specific information about the problem.
+
+BEHEALTHCHECKUEBCLUSTERRECOVERY=               |||Please check logs for more specific information about the problem.
+
+FEHEALTHCHECKRECOVERY=                                 |||Please check logs for more specific information about the problem.
+
+#UEB communication
+BEUEBCONNECTIONERROR_ONE_ARGUMENT=             ||Reason: {0}.|\
+                                                                               Please check UEB server list and keys configured under Portal.Properties file.
+                                                                               
+BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT=             ||Cannot reach host {0}.|\
+                                                                               Please check UEB server list and keys configured under Portal.Properties file.
+
+#Onboarding apps
+BEUEBREGISTERONBOARDINGAPPERROR=               ||Reason: {0}.|\
+                                                                               Please check UEB server list and keys configured under Portal.Properties file.
+
+#HTTP communication
+BEHTTPCONNECTIONERROR_ONE_ARGUMENT=            ||Reason: {0}.|Please check the logs for more information.
+
+INTERNALCONNECTIONINFO_ONE_ARGUMENT=   ||Description: {0}.|Please check the logs for more information.
+
+INTERNALCONNECTIONWARNING_ONE_ARGUMENT=        ||Description: {0}.|Please check the logs for more information.
+
+INTERNALCONNECTIONERROR_ONE_ARGUMENT=  ||Description: {0}.|Please check the logs for more information.
+
+INTERNALCONNECTIONFATAL_ONE_ARGUMENT=  ||Description: {0}.|Please check the logs for more information.
+
+BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT= ||Data not found: {0}.|\
+                                                                               An error occurred during access to UEB Server, {1} failed to either register or unregister to/from UEB topic.
+
+#Login error codes
+BEUSERMISSINGERROR_ONE_ARGUMENT=               |||\
+                                                                               User {0} must be added to the corresponding application with proper user roles.
+                                                                               
+BEUSERINACTIVEWARNING_ONE_ARGUMENT=            |||\
+                                                                               User {0} must be added to the corresponding application with proper user roles.
+                                                                               
+BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT=        |||\
+                                                                               User {0} should be given proper administrator role for the corresponding application to perform the necessary actions.
+                                                                               
+BEINVALIDJSONINPUT=                                            |||Please check error logs for more information.
+
+BEINCORRECTHTTPSTATUSERROR=                            |||Please check logs for more information.
+
+BEINITIALIZATIONERROR=                                 |||Please check logs for more information.
+
+BEUEBSYSTEMERROR=                                              ||\
+                                                                               Operation: {0}.|\
+                                                                               An error occurred in {1} distribution mechanism. Please check the logs for more information.
+                                                                               
+BEDAOSYSTEMERROR=                                              |||Please check MySQL DB health or look at the logs for more details.
+
+BESYSTEMERROR=                                                 |||Please check logs for more information.
+
+BEEXECUTEROLLBACKERROR=                                        |||Please check MYSQL DB health or look at the logs for more details.
+
+FEHTTPLOGGINGERROR=                                            |||Please check MYSQL DB health or look at the logs for more details.
+                                                                               
+FEPORTALSERVLETERROR=                                  |||Please check logs for more specific information about the problem.
+
+BEDAOCLOSESESSIONERROR=                                        |||Please check MYSQL DB health or look at the logs form more details.
+
+BERESTAPIGENERALERROR=                                 |||Please check error log for more information.
+
+FEHEALTHCHECKGENERALERROR=                             |||Please check error log for more information.
+
+INTERNALUNEXPECTEDINFO_ONE_ARGUMENT=   |||Description: {0}.
+
+INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT=        |||Description: {0}.
+
+INTERNALUNEXPECTEDERROR_ONE_ARGUMENT=  |||Description: {0}.
+
+INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT=  |||Description: {0}.
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/EPAppMessagesEnum.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/EPAppMessagesEnum.java
new file mode 100644 (file)
index 0000000..d7536bf
--- /dev/null
@@ -0,0 +1,298 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.format;
+
+import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum;
+import org.onap.portalsdk.core.logging.format.ErrorSeverityEnum;
+import org.onap.portalsdk.core.logging.format.ErrorTypeEnum;
+
+/**
+ * 
+ * Add ECOMP Portal Specific Error Code Enums here, for generic
+ * ones (ones you think are useful not only Portal but also SDK), add it
+ * to the enum class AppMessagesEnum defined in SDK.
+ */
+public enum EPAppMessagesEnum {
+       /*
+       100-199 Security/Permission Related 
+                                                                               - Authentication problems (from external client, to external server)
+                                                                               - Certification errors
+                                                                               - 
+                                                                                       
+       200-299 Availability/Timeout Related
+                                                                               - connectivity error
+                                                                               - connection timeout
+                                                                               
+       300-399 Data Access/Integrity Related
+                                                                               - Data in graph in invalid(E.g. no creator is found for service) 
+                                                                               - Artifact is missing in ES, but exists in graph.
+                                                                                
+       400-499 Schema Interface Type/Validation
+                                                                               - received Pay-load checksum is invalid
+                                                                               - received JSON is not valid
+                                                         
+       500-599 Business/Flow Processing Related  
+                                                                               -  check out to service is not allowed
+                                                                               -  Roll-back is done
+                                                                               -  failed to generate heat file
+                                                                                 
+
+       600-899 Reserved - do not use
+
+       900-999 Unknown Errors 
+                                                                               - Unexpected exception
+                                                                               */
+       
+       BeUebAuthenticationError(EPErrorCodesEnum.BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                               "ERR100E", "An Authentication failure occurred during access to UEB server", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
+       
+       BeRestApiAuthenticationError(EPErrorCodesEnum.BERESTAPIAUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                               "ERR101E", "Rejected an incoming REST API request due to invalid credentials", "", "Please check application credentials defined in Database or properties files."),
+       
+       InternalAuthenticationInfo(EPErrorCodesEnum.INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                               "ERR199I", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
+       
+       InternalAuthenticationWarning(EPErrorCodesEnum.INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
+                                                               "ERR199W", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
+       
+       InternalAuthenticationError(EPErrorCodesEnum.INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                               "ERR199E", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
+       
+       InternalAuthenticationFatal(EPErrorCodesEnum.INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
+                                                               "ERR199F", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
+       
+       BeHealthCheckError(EPErrorCodesEnum.BeHEALTHCHECKERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                               "ERR200E", "ECOMP-PORTAL Back-end probably lost connectivity to either one of the following components: MySQL DB, UEB Cluster", "", "Please check the logs for more information."),
+
+       BeHealthCheckMySqlError(EPErrorCodesEnum.BEHEALTHCHECKMYSQLERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                               "ERR201E", "ECOMP-PORTAL Back-end probably lost connectivity to MySQL DB", "", "Check connectivity to MYSQL is configured correctly under system.properties file."),
+
+       BeHealthCheckUebClusterError(EPErrorCodesEnum.BEHEALTHCHECKUEBCLUSTERERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                               "ERR203E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "", "Check connectivity to UEB cluster which is configured under portal.properties file."),
+       
+       FeHealthCheckError(EPErrorCodesEnum.FEHEALTHCHECKERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                               "ERR204E", "Unable to connect to a valid ECOMP-PORTAL Back-end Server.", "", "Please check connectivity from this FE instance towards BE or BE Load Balancer."),
+       
+       BeHealthCheckRecovery(EPErrorCodesEnum.BEHEALTHCHECKRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                               "ERR205I", "ECOMP-PORTAL Back-end Recovery to either one of the following components: MySQL DB, UEB Cluster", "", "Please check logs for more specific information about the problem."),
+       
+       BeHealthCheckMySqlRecovery(EPErrorCodesEnum.BEHEALTHCHECKMYSQLRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                               "ERR206I", "ECOMP-PORTAL Back-end connection recovery to MySQL DB", "", "Please check logs for more specific information about the problem."),
+       
+       BeHealthCheckUebClusterRecovery(EPErrorCodesEnum.BEHEALTHCHECKUEBCLUSTERRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                               "ERR208I", "ECOMP-PORTAL Back-end connection recovery to UEB Cluster", "", "Please check logs for more specific information about the problem."),
+       
+       FeHealthCheckRecovery(EPErrorCodesEnum.FEHEALTHCHECKRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                               "ERR209I", "Connectivity to ECOMP-PORTAL Front-end Server is recovered", "", "Please check logs for more specific information about the problem."),
+    
+       BeUebConnectionError(EPErrorCodesEnum.BEUEBCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR210E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
+    
+    BeUebUnkownHostError(EPErrorCodesEnum.BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR211E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "Cannot reach host: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
+       
+    BeUebRegisterOnboardingAppError(EPErrorCodesEnum.BEUEBREGISTERONBOARDINGAPPERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR212E", "Failed to register the On-boarding application with UEB Communication server", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
+    
+    BeHttpConnectionError(EPErrorCodesEnum.BEHTTPCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                               "ERR213E", "It could be that communication to an external application might resulted an exception or failed to reach the external application", 
+                                                               "Details: {0}.", "Please check logs for more information."),
+    
+    InternalConnectionInfo(EPErrorCodesEnum.INTERNALCONNECTIONINFO_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                               "ERR299I", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
+    
+       InternalConnectionWarning(EPErrorCodesEnum.INTERNALCONNECTIONWARNING_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
+                                                               "ERR299W", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
+    
+    InternalConnectionError(EPErrorCodesEnum.INTERNALCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR299E", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
+    
+    InternalConnectionFatal(EPErrorCodesEnum.INTERNALCONNECTIONFATAL_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
+                                                       "ERR299F", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
+    
+    BeUebObjectNotFoundError(EPErrorCodesEnum.BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR303E", "Error occurred during access to U-EB Server.", "Data not found: {0}.", "An error occurred during access to UEB Server, {1} failed to either register or unregister to/from UEB topic."),
+    
+    BeUserMissingError(EPErrorCodesEnum.BEUSERMISSINGERROR_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR310E", "User is not found", "", "User {0} must be added to the corresponding application with proper user roles."),
+    
+    BeUserInactiveWarning(EPErrorCodesEnum.BEUSERINACTIVEWARNING_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
+                                                       "ERR313W", "User is found but in-active", "", "User {0} must be added to the corresponding application with proper user roles."),
+    
+    BeUserAdminPrivilegesInfo(EPErrorCodesEnum.BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
+                                                       "ERR314W", "User is found but don't have administrative privileges", "", "User {0} should be given administrator role for the corresponding application to perform the necessary actions."),
+    
+    BeInvalidJsonInput(EPErrorCodesEnum.BEINVALIDJSONINPUT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR405E", "Failed to convert JSON input to object", "", "Please check logs for more information."),
+    
+    BeIncorrectHttpStatusError(EPErrorCodesEnum.BEINCORRECTHTTPSTATUSERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR407E", "Communication to an external application is resulted in with Incorrect Http response code", "", "Please check logs for more information."),
+    
+    BeInitializationError(EPErrorCodesEnum.BEINITIALIZATIONERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                       "ERR500E", "ECOMP-PORTAL Back-end was not initialized properly", "", "Please check logs for more information."),
+    
+    BeUebSystemError(EPErrorCodesEnum.BEUEBSYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR502E", "Error occurred during access to U-EB Server", "Details: {0}.", "An error occurred in {1} distribution mechanism. Please check the logs for more information."),
+    
+    BeDaoSystemError(EPErrorCodesEnum.BEDAOSYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                       "ERR505E", "Performing DDL or DML operations on database might have failed", "", "Please check MySQL DB health or look at the logs for more details."),
+    
+    BeSystemError(EPErrorCodesEnum.BESYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                       "ERR506E", "Unexpected error during operation", "", "Please check logs for more information."),
+    
+    BeExecuteRollbackError(EPErrorCodesEnum.BEEXECUTEROLLBACKERROR, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR507E", "Roll-back operation towards database has failed", "", "Please check MYSQL DB health or look at the logs for more details."),
+    
+    FeHttpLoggingError(EPErrorCodesEnum.FEHTTPLOGGINGERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR517E", "Error when logging FE HTTP request/response", "", "Please check MYSQL DB health or look at the logs for more details."),
+    
+       FePortalServletError(EPErrorCodesEnum.FEPORTALSERVLETERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                               "ERR518E", "Error when trying to access FE Portal page.", "", "Please check logs for more information."),
+       
+    BeDaoCloseSessionError(EPErrorCodesEnum.BEDAOCLOSESESSIONERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR519E", "Close local session operation with database failed", "", "Please check MYSQL DB health or look at the logs form more details."),
+    
+    BeRestApiGeneralError(EPErrorCodesEnum.BERESTAPIGENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                       "ERR900E", "Unexpected error during ECOMP-PORTAL Back-end REST API execution", "", "Please check error log for more information."),
+    
+    FeHealthCheckGeneralError(EPErrorCodesEnum.FEHEALTHCHECKGENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
+                                                       "ERR901E", "General error during FE Health Check", "", "Please check error log for more information."),
+    
+    InternalUnexpectedInfo(EPErrorCodesEnum.INTERNALUNEXPECTEDINFO_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
+                                                       "ERR999I", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
+    
+    InternalUnexpectedWarning(EPErrorCodesEnum.INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
+                                                       "ERR999W", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
+    
+    InternalUnexpectedError(EPErrorCodesEnum.INTERNALUNEXPECTEDERROR_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                                                       "ERR999E", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
+    
+    InternalUnexpectedFatal(EPErrorCodesEnum.INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
+                                                       "ERR999F", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
+    
+    ExternalAuthAccessConnectionError(EPErrorCodesEnum.EXTERNALAUTHACCESS_CONNECTIONERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR220E", "AAF Connection problem", "Details: {0}.", "Please check logs for more information."),
+
+    ExternalAuthAccessAuthenticationError(EPErrorCodesEnum.EXTERNALAUTHACCESS_AUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR120E", "AAF authentication problem", "Details: {0}.", "Please check logs for more information."),
+    
+    ExternalAuthAccessGeneralError(EPErrorCodesEnum.EXTERNALAUTHACCESS_GENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR520E", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
+    
+    SchedulerAccessConnectionError(EPErrorCodesEnum.SCHEDULER_ACCESS_CONNECTIONERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR240E", "Scheduler Connection problem", "Details: {0}.", "Please check logs for more information."),
+
+    SchedulerAuxAccessAuthenticationError(EPErrorCodesEnum.SCHEDULERAUX_ACCESS_AUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR140E", "SchedulerAux authentication problem", "Details: {0}.", "Please check logs for more information."),
+    
+    SchedulerAccessGeneralError(EPErrorCodesEnum.SCHEDULER_ACCESS_GENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR540E", "Unexpected Scheduler error", "Details: {0}.", "Please check logs for more information."),
+    
+    SchedulerInvalidAttributeError(EPErrorCodesEnum.SCHEDULER_INVALID_ATTRIBUTEERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
+                       "ERR505E", "Unable to create Scheduler", "Details: {0}.", "Please check logs for more information."),
+
+       ;
+       
+       ErrorTypeEnum eType;
+       AlarmSeverityEnum alarmSeverity;
+       EPErrorCodesEnum messageCode;
+       ErrorSeverityEnum errorSeverity;
+       String errorCode;
+       String errorDescription;
+       String details;
+       String resolution;
+       
+       EPAppMessagesEnum(EPErrorCodesEnum messageCode, ErrorTypeEnum eType, AlarmSeverityEnum alarmSeverity, ErrorSeverityEnum errorSeverity, String errorCode, String errorDescription, 
+                                               String details, String resolution) {
+               this.messageCode = messageCode;
+               this.eType = eType;
+               this.alarmSeverity = alarmSeverity;
+               this.errorSeverity = errorSeverity;
+               this.errorCode = errorCode;
+               this.errorDescription = errorDescription;
+               this.details = details;
+               this.resolution = resolution;
+       }
+       
+       public String getDetails() {
+               return this.details;
+       }
+       
+       public String getResolution() {
+               return this.resolution;
+       }
+       public String getErrorCode() {
+               return this.errorCode;
+       }
+       
+       public String getErrorDescription() {
+               return this.errorDescription;
+       }
+       
+       public ErrorSeverityEnum getErrorSeverity() {
+               return this.errorSeverity;
+       }
+       
+       public void setErrorSeverity(ErrorSeverityEnum errorSeverity) {
+               this.errorSeverity = errorSeverity;
+       }
+       
+       public EPErrorCodesEnum getMessageCode() {
+               return messageCode;
+       }
+
+       public void setMessageCode(EPErrorCodesEnum messageCode) {
+               this.messageCode = messageCode;
+       }
+       
+       public AlarmSeverityEnum getAlarmSeverity() {
+               return alarmSeverity;
+       }
+
+       public void setAlarmSeverity(AlarmSeverityEnum alarmSeverity) {
+               this.alarmSeverity = alarmSeverity;
+       }
+       
+       public ErrorTypeEnum getErrorType() {
+               return eType;
+       }
+
+       public void setErrorType(ErrorTypeEnum eType) {
+               this.eType = eType;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/EPErrorCodesEnum.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/format/EPErrorCodesEnum.java
new file mode 100644 (file)
index 0000000..e4cd38e
--- /dev/null
@@ -0,0 +1,121 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.format;
+
+import com.att.eelf.i18n.EELFResolvableErrorEnum;
+import com.att.eelf.i18n.EELFResourceManager;
+
+/**
+ * 
+ * Add ECOMP Portal Specific Error Code Enums here, for generic
+ * ones (ones you think are useful not only Portal but also SDK), add it
+ * to the enum class AppMessagesEnum defined in SDK.
+ */
+public enum EPErrorCodesEnum implements EELFResolvableErrorEnum {
+       BERESTAPIAUTHENTICATIONERROR,
+       BEHTTPCONNECTIONERROR_ONE_ARGUMENT,
+       BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT,
+       
+       INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT,
+       INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT,
+       INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT,
+       INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT,
+       
+       BEHEALTHCHECKRECOVERY,
+       BEHEALTHCHECKMYSQLRECOVERY,
+       BEHEALTHCHECKUEBCLUSTERRECOVERY,
+       FEHEALTHCHECKRECOVERY,
+       BeHEALTHCHECKERROR,
+       
+       BEHEALTHCHECKMYSQLERROR,
+       BEHEALTHCHECKUEBCLUSTERERROR,
+       FEHEALTHCHECKERROR,
+       BEUEBCONNECTIONERROR_ONE_ARGUMENT,
+       BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT,
+       BEUEBREGISTERONBOARDINGAPPERROR,
+       
+       INTERNALCONNECTIONINFO_ONE_ARGUMENT,
+       INTERNALCONNECTIONWARNING_ONE_ARGUMENT,
+       INTERNALCONNECTIONERROR_ONE_ARGUMENT,
+       INTERNALCONNECTIONFATAL_ONE_ARGUMENT,
+       
+       BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT,
+       BEUSERMISSINGERROR_ONE_ARGUMENT,
+       
+       BEUSERINACTIVEWARNING_ONE_ARGUMENT,
+       BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT,
+       
+       BEINVALIDJSONINPUT,
+       BEINCORRECTHTTPSTATUSERROR,
+               
+       BEINITIALIZATIONERROR,
+       BEUEBSYSTEMERROR,
+       BEDAOSYSTEMERROR,
+       BESYSTEMERROR,
+       BEEXECUTEROLLBACKERROR,
+       
+       FEHTTPLOGGINGERROR,
+       FEPORTALSERVLETERROR,
+       BEDAOCLOSESESSIONERROR,
+       
+       BERESTAPIGENERALERROR,
+       FEHEALTHCHECKGENERALERROR,
+       
+       INTERNALUNEXPECTEDINFO_ONE_ARGUMENT,
+       INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT,
+       INTERNALUNEXPECTEDERROR_ONE_ARGUMENT,
+       INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT,
+       
+       EXTERNALAUTHACCESS_CONNECTIONERROR,
+       EXTERNALAUTHACCESS_AUTHENTICATIONERROR,
+       EXTERNALAUTHACCESS_GENERALERROR,
+       
+       SCHEDULER_ACCESS_CONNECTIONERROR,
+       SCHEDULERAUX_ACCESS_AUTHENTICATIONERROR,
+       SCHEDULER_ACCESS_GENERALERROR,
+       SCHEDULER_INVALID_ATTRIBUTEERROR,
+       ;
+       
+       /**
+     * Static initializer to ensure the resource bundles for this class are loaded...
+     * Here this application loads messages from three bundles
+     */
+    static {
+        EELFResourceManager.loadMessageBundle("org/openecomp/portalapp/portal/logging/format/ApplicationCodes");
+    }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/logic/EPLogUtil.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/logging/logic/EPLogUtil.java
new file mode 100644 (file)
index 0000000..c47fb9d
--- /dev/null
@@ -0,0 +1,328 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.logic;
+
+import static com.att.eelf.configuration.Configuration.MDC_ALERT_SEVERITY;
+
+import java.text.MessageFormat;
+
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum;
+import org.onap.portalsdk.core.logging.format.ErrorSeverityEnum;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.slf4j.MDC;
+import org.springframework.http.HttpStatus;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+
+public class EPLogUtil {
+
+       // This class has no logger of its own; it uses loggers passed to it.
+       private static EELFLogger errorLogger = EELFManager.getInstance().getErrorLogger();
+
+       /**
+        * Formats and writes a message to the error log with the class name and the
+        * specified parameters, using log level info, warn or error appropriate for
+        * the specified severity
+        * 
+        * @param classLogger
+        *            Logger for the class where the error occurred; the logger
+        *            carries the class name.
+        * @param epMessageEnum
+        *            Enum carrying alarm and error severity
+        * @param param
+        *            Values used to build the message.
+        */
+       public static void logEcompError(EELFLoggerDelegate classLogger, EPAppMessagesEnum epMessageEnum, String... param) {
+               logEcompError(classLogger, epMessageEnum, null, param);
+       }
+
+       /**
+        * Formats and writes a message to the error log with the class name and the
+        * specified parameters, using log level info, warn or error appropriate for
+        * the specified severity
+        * 
+        * @param epMessageEnum
+        *            Enum carrying alarm and error severity
+        * @param param
+        *            Values used to build the message.
+        */
+       public static void logEcompError(EPAppMessagesEnum epMessageEnum, String... param) {
+               try {
+                       AlarmSeverityEnum alarmSeverityEnum = epMessageEnum.getAlarmSeverity();
+                       ErrorSeverityEnum errorSeverityEnum = epMessageEnum.getErrorSeverity();
+
+                       MDC.put(MDC_ALERT_SEVERITY, alarmSeverityEnum.severity());
+                       MDC.put("ErrorCode", epMessageEnum.getErrorCode());
+                       MDC.put("ErrorDescription", epMessageEnum.getErrorDescription());
+                       MDC.put("ClassName", EPLogUtil.class.getName());
+
+                       String resolution = EPLogUtil
+                                       .formatMessage(epMessageEnum.getDetails() + " " + epMessageEnum.getResolution(), (Object[]) param);
+                       if (errorSeverityEnum == ErrorSeverityEnum.WARN) {
+                               errorLogger.warn(resolution);
+                       } else if (errorSeverityEnum == ErrorSeverityEnum.INFO) {
+                               errorLogger.info(resolution);
+                       } else {
+                               errorLogger.error(resolution);
+                       }
+               } catch (Exception e) {
+                       errorLogger.error("logEcompError failed", e);
+               } finally {
+                       MDC.remove("ErrorCode");
+                       MDC.remove("ErrorDescription");
+                       MDC.remove("ClassName");
+                       MDC.remove(MDC_ALERT_SEVERITY);
+               }
+       }
+
+       /**
+        * Formats and writes a message to the error log with the class name,
+        * throwable and the specified parameters, using log level info, warn or
+        * error appropriate for the specified severity
+        * 
+        * @param classLogger
+        *            Logger for the class where the error occurred; the logger
+        *            carries the class name.
+        * @param epMessageEnum
+        *            Enum carrying alarm and error severity
+        * @param th
+        *            Throwable; ignored if null
+        * @param param
+        *            Array of Strings used to build the message.
+        */
+       @SuppressWarnings("static-access")
+       public static void logEcompError(EELFLoggerDelegate classLogger, EPAppMessagesEnum epMessageEnum, Throwable th,
+                       String... param) {
+
+               AlarmSeverityEnum alarmSeverityEnum = epMessageEnum.getAlarmSeverity();
+               ErrorSeverityEnum errorSeverityEnum = epMessageEnum.getErrorSeverity();
+
+               MDC.put(MDC_ALERT_SEVERITY, alarmSeverityEnum.severity());
+               MDC.put("ErrorCode", epMessageEnum.getErrorCode());
+               MDC.put("ErrorDescription", epMessageEnum.getErrorDescription());
+
+               final String message = EPLogUtil.formatMessage(epMessageEnum.getDetails() + " " + epMessageEnum.getResolution(),
+                               (Object[]) param);
+               if (errorSeverityEnum == ErrorSeverityEnum.INFO) {
+                       if (th == null)
+                               classLogger.info(classLogger.errorLogger, message);
+                       else
+                               classLogger.info(classLogger.errorLogger, message, th);
+               } else if (errorSeverityEnum == ErrorSeverityEnum.WARN) {
+                       if (th == null)
+                               classLogger.warn(classLogger.errorLogger, message);
+                       else
+                               classLogger.warn(classLogger.errorLogger, message, th);
+               } else {
+                       if (th == null)
+                               classLogger.error(classLogger.errorLogger, message);
+                       else
+                               classLogger.error(classLogger.errorLogger, message, th);
+               }
+
+               // Clean up
+               MDC.remove(MDC_ALERT_SEVERITY);
+               MDC.remove("ErrorCode");
+               MDC.remove("ErrorDescription");
+       }
+
+       /**
+        * Builds a string using the format and parameters.
+        * 
+        * @param message
+        * @param args
+        * @return
+        */
+       private static String formatMessage(String message, Object... args) {
+               StringBuilder sbFormattedMessage = new StringBuilder();
+               if (args != null && args.length > 0 && message != null && message != "") {
+                       MessageFormat mf = new MessageFormat(message);
+                       sbFormattedMessage.append(mf.format(args));
+               } else {
+                       sbFormattedMessage.append(message);
+               }
+               return sbFormattedMessage.toString();
+       }
+
+       /**
+        * Builds a comma-separated string of values to document a user action.
+        * 
+        * @param action
+        *            String
+        * @param activity
+        *            String
+        * @param userId
+        *            String
+        * @param affectedId
+        *            String
+        * @param comment
+        *            String
+        * @return Value suitable for writing to the audit log file.
+        */
+       public static String formatAuditLogMessage(String action, String activity, String userId, String affectedId,
+                       String comment) {
+               StringBuilder auditLogMsg = new StringBuilder();
+               auditLogMsg.append("Click_A:[");
+               if (action != null && !action.equals("")) {
+                       auditLogMsg.append(" Action: ");
+                       auditLogMsg.append(action);
+               }
+
+               if (activity != null && !activity.equals("")) {
+                       auditLogMsg.append(",Activity CD: ");
+                       auditLogMsg.append(activity);
+               }
+
+               if (userId != null && !userId.equals("")) {
+                       auditLogMsg.append(",User ID: ");
+                       auditLogMsg.append(userId);
+               }
+
+               if (affectedId != null && !affectedId.equals("")) {
+                       auditLogMsg.append(",Affected ID: ");
+                       auditLogMsg.append(affectedId);
+               }
+
+               if (comment != null && !comment.equals("")) {
+                       auditLogMsg.append(",Comment: ");
+                       auditLogMsg.append(comment);
+               }
+               auditLogMsg.append("]");
+               return auditLogMsg.toString();
+       }
+
+       /**
+        * Builds a comma-separated string of values to document a user browser
+        * action.
+        * 
+        * @param orgUserId
+        *            String
+        * @param appName
+        *            String
+        * @param action
+        *            String
+        * @param activity
+        *            String
+        * @param actionLink
+        *            String
+        * @param page
+        *            String
+        * @param function
+        *            String
+        * @param type
+        *            String
+        * @return String value suitable for writing to the audit log file.
+        */
+       public static String formatStoreAnalyticsAuditLogMessage(String orgUserId, String appName, String action,
+                       String activity, String actionLink, String page, String function, String type) {
+               StringBuilder auditLogStoreAnalyticsMsg = new StringBuilder();
+               auditLogStoreAnalyticsMsg.append("Click_Analytics:[");
+               if (orgUserId != null && !orgUserId.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(" Organization User ID: ");
+                       auditLogStoreAnalyticsMsg.append(orgUserId);
+               }
+
+               if (appName != null && !appName.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",AppName: ");
+                       auditLogStoreAnalyticsMsg.append(appName);
+               }
+
+               if (action != null && !action.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",Action: ");
+                       auditLogStoreAnalyticsMsg.append(action);
+               }
+
+               if (activity != null && !activity.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",Activity: ");
+                       auditLogStoreAnalyticsMsg.append(activity);
+               }
+
+               if (actionLink != null && !actionLink.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",ActionLink: ");
+                       auditLogStoreAnalyticsMsg.append(actionLink);
+               }
+
+               if (page != null && !page.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",Page: ");
+                       auditLogStoreAnalyticsMsg.append(page);
+               }
+
+               if (function != null && !function.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",Function: ");
+                       auditLogStoreAnalyticsMsg.append(function);
+               }
+
+               if (type != null && !type.equals("")) {
+                       auditLogStoreAnalyticsMsg.append(",Type: ");
+                       auditLogStoreAnalyticsMsg.append(type);
+               }
+               auditLogStoreAnalyticsMsg.append("]");
+               return auditLogStoreAnalyticsMsg.toString();
+       }
+
+       public static void logExternalAuthAccessAlarm(EELFLoggerDelegate logger, HttpStatus res) {
+               if (res.equals(HttpStatus.UNAUTHORIZED) || res.equals(HttpStatus.FORBIDDEN)) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.ExternalAuthAccessAuthenticationError);
+               } else if (res.equals(HttpStatus.NOT_FOUND) || res.equals(HttpStatus.NOT_ACCEPTABLE)
+                               || res.equals(HttpStatus.CONFLICT) || res.equals(HttpStatus.BAD_REQUEST)) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.ExternalAuthAccessConnectionError);
+               } else if (!res.equals(HttpStatus.ACCEPTED) && !res.equals(HttpStatus.OK)) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.ExternalAuthAccessGeneralError);
+               }
+       }
+
+       public static void schedulerAccessAlarm(EELFLoggerDelegate logger, int res) {
+               if (res == HttpStatus.UNAUTHORIZED.value() || res == HttpStatus.FORBIDDEN.value()) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.SchedulerAuxAccessAuthenticationError);
+               } else if (res == HttpStatus.NOT_FOUND.value() || res == HttpStatus.NOT_ACCEPTABLE.value()
+                               || res == HttpStatus.CONFLICT.value() || res == HttpStatus.BAD_REQUEST.value()
+                               || res == HttpStatus.REQUEST_TIMEOUT.value()||res==HttpStatus.INTERNAL_SERVER_ERROR.value()) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.SchedulerAccessConnectionError);
+               } else if (res == HttpStatus.PRECONDITION_FAILED.value() || res == HttpStatus.EXPECTATION_FAILED.value()) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.SchedulerInvalidAttributeError);
+               } else if (res != HttpStatus.ACCEPTED.value() && res != HttpStatus.OK.value()
+                               && res != HttpStatus.NO_CONTENT.value()) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.SchedulerAccessGeneralError);
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Other SchedulerErrors failed", res);
+               }
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/RestObject.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/RestObject.java
new file mode 100644 (file)
index 0000000..327354c
--- /dev/null
@@ -0,0 +1,62 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler;
+
+
+public class RestObject<T> {
+       
+    private T t;
+   
+    private int statusCode= 0;
+    
+    public String uuid;
+    
+    public void set(T t) { this.t = t; }
+    
+    public T get() { return t; }
+          
+    public void setStatusCode(int v) { this.statusCode = v; }
+       
+    public int getStatusCode() { return this.statusCode; }
+        
+    public void setUUID(String uuid) { this.uuid = uuid; }
+    
+    public String getUUID() { return this.uuid; }
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerProperties.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerProperties.java
new file mode 100644 (file)
index 0000000..4fcdc4d
--- /dev/null
@@ -0,0 +1,164 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.core.env.Environment;
+
+@Configuration
+@PropertySource(value = { "${container.classpath:}/WEB-INF/conf/scheduler.properties" })
+
+public class SchedulerProperties {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerProperties.class);
+
+       private static Environment environment;
+
+
+       public SchedulerProperties() {
+       }
+
+       protected Environment getEnvironment() {
+               return environment;
+       }
+
+       @Autowired
+       public void setEnvironment(Environment environment) {
+               SchedulerProperties.environment = environment;
+       }
+
+       /**
+        * Tests whether a property value is available for the specified key.
+        * 
+        * @param key
+        *            Property key
+        * @return True if the key is known, otherwise false.
+        */
+       public static boolean containsProperty(String key) {
+               return environment.containsProperty(key);
+       }
+
+       /**
+        * Returns the property value associated with the given key (never
+        * {@code null}), after trimming any trailing space.
+        * 
+        * @param key
+        *            Property key
+        * @return Property value; the empty string if the environment was not
+        *         autowired, which should never happen.
+        * @throws IllegalStateException
+        *             if the key cannot be resolved
+        */
+       public static String getProperty(String key) {
+               String value = "";
+               if (environment == null) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getProperty: environment is null, should never happen!");
+               } else {
+                       value = environment.getRequiredProperty(key);
+                       // java.util.Properties preserves trailing space
+                       if (value != null)
+                               value = value.trim();
+               }
+               return value;
+       }
+
+       public static final String SCHEDULER_USER_NAME_VAL = "scheduler.user.name";
+
+       public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
+
+       public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
+
+       public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
+
+       public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
+
+       public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
+
+       public static final String SCHEDULERAUX_CLIENTAUTH_VAL = "scheduleraux.ClientAuth";
+
+       public static final String SCHEDULERAUX_CLIENT_MECHID_VAL = "scheduleraux.client.mechId";
+
+       public static final String SCHEDULERAUX_CLIENT_PASSWORD_VAL = "scheduleraux.client.password";
+
+       public static final String SCHEDULERAUX_USERNAME_VAL = "scheduleraux.username";
+
+       public static final String SCHEDULERAUX_PASSWORD_VAL = "scheduleraux.password";
+
+       public static final String SCHEDULERAUX_AUTHORIZATION_VAL = "scheduleraux.Authorization";
+
+       public static final String SCHEDULERAUX_SERVER_URL_VAL = "scheduleraux.server.url";
+
+       public static final String SCHEDULERAUX_ENVIRONMENT_VAL = "scheduleraux.environment";
+
+       public static final String SCHEDULERAUX_GET_CONFIG_VAL = "scheduleraux.get.config";
+       
+
+       /** The Constant VID_TRUSTSTORE_FILENAME. */
+       public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
+
+       /** The Constant VID_TRUSTSTORE_PASSWD_X. */
+       public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
+
+       /** The Constant FILESEPARATOR. */
+       public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
+       
+       /** Scheduler UI constant **/
+       public static final String SCHEDULER_DOMAIN_NAME = "scheduler.domain.name";
+
+       public static final String SCHEDULER_SCHEDULE_NAME = "scheduler.schedule.name";
+
+       public static final String SCHEDULER_WORKFLOW_NAME = "scheduler.workflow.name";
+
+       public static final String SCHEDULER_CALLBACK_URL = "scheduler.callback.url";
+       
+       public static final String SCHEDULER_APPROVAL_TYPE = "scheduler.approval.type";
+
+       public static final String SCHEDULER_APPROVAL_SUBMIT_STATUS = "scheduler.approval.submit.status";
+
+       public static final String SCHEDULER_APPROVAL_REJECT_STATUS = "scheduler.approval.reject.status";       
+       
+       public static final String SCHEDULER_INTERVAL_GET_TIMESLOT_RATE = "scheduler.interval.get.timeslot.rate";       
+       
+       public static final String SCHEDULER_POLICY_NAME = "scheduler.policy.name";
+
+       public static final String SCHEDULER_GROUP_ID = "scheduler.group.id";   
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerResponseWrapper.java
new file mode 100644 (file)
index 0000000..510c7cd
--- /dev/null
@@ -0,0 +1,118 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * This wrapper encapsulates the Scheduler response
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+           "status",
+           "entity",
+           "uuid"
+})
+
+public class SchedulerResponseWrapper {
+       
+       @JsonProperty("status")
+       private int status;
+
+       @JsonProperty("entity")
+       private String entity;
+       
+       @JsonProperty("uuid")
+       private String uuid;
+
+       @JsonProperty("entity")
+    public String getEntity() {
+        return entity;
+    }
+       
+       @JsonProperty("status")
+    public int getStatus() {
+        return status;
+    }
+       
+       @JsonProperty("uuid")
+    public String getUuid() {
+        return uuid;
+    }  
+       
+       @JsonProperty("status")
+    public void setStatus(int v) {
+        this.status = v;
+    }
+
+       @JsonProperty("entity")
+    public void setEntity(String v) {
+        this.entity = v;
+    }
+       
+       @JsonProperty("uuid")
+    public void setUuid(String v) {
+        this.uuid = v;
+    }  
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public String getResponse () throws JsonProcessingException,IOException {
+       Map<String, Object> map = new LinkedHashMap<>();
+               map.put("status", getStatus());
+               map.put("entity", getEntity());
+               map.put("uuid", getUuid());
+               ObjectMapper objectMapper = new ObjectMapper();
+               String jsonResponse = objectMapper.writeValueAsString(map);
+               return jsonResponse;
+    }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInt.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInt.java
new file mode 100644 (file)
index 0000000..7ada83b
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+public class SchedulerRestInt {
+       
+       /** The logger. */
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
+       
+       /** The Constant dateFormat. */
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+       
+       /** The request date format. */
+       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
+       
+       public SchedulerRestInt() {
+               requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
+       }
+}
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
new file mode 100644 (file)
index 0000000..26e40c9
--- /dev/null
@@ -0,0 +1,270 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler;
+
+import java.util.Collections;
+
+import javax.security.auth.login.CredentialException;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.lang.StringUtils;
+import org.drools.compiler.lang.DRL5Expressions.neg_operator_key_return;
+import org.eclipse.jetty.util.security.Password;
+import org.json.simple.JSONObject;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.scheduler.client.HttpBasicClient;
+import org.onap.portalapp.portal.scheduler.client.HttpsBasicClient;
+import org.onap.portalapp.portal.scheduler.restobjects.RestObject;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.HttpClientErrorException;
+
+@Service
+public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
+
+       private static final String PASSWORD_IS_EMPTY = "Password is Empty";
+
+       private static Client client = null;
+
+       private MultivaluedHashMap<String, Object> commonHeaders;
+
+       /** The logger. */
+       static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
+
+       public SchedulerRestInterface() {
+               super();
+       }
+
+       public void initRestClient() {
+               logger.debug(EELFLoggerDelegate.debugLogger, "Starting to initialize rest client");
+
+               final String username;
+               final String password;
+
+               String methodName = "initRestClient";
+               /* Setting user name based on properties */
+               String retrievedUsername = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_USER_NAME_VAL);
+               if (retrievedUsername.isEmpty()) {
+                       username = "";
+               } else {
+                       username = retrievedUsername;
+               }
+
+               /* Setting password based on properties */
+               String retrievedPassword = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_PASSWORD_VAL);
+               if (retrievedPassword.isEmpty()) {
+                       password = StringUtils.EMPTY;
+               } else {
+                       if (retrievedPassword.contains("OBF:")) {
+                               password = Password.deobfuscate(retrievedPassword);
+                       } else {
+                               password = retrievedPassword;
+                       }
+               }
+               try {
+                       if (StringUtils.isBlank(password)) {
+                               throw new CredentialException(PASSWORD_IS_EMPTY); 
+                       }
+               } catch (Exception ex) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Unable to initialize rest client", ex);
+               }
+               String authString = username + ":" + password;
+               byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
+               String authStringEnc = new String(authEncBytes);
+
+               commonHeaders = new MultivaluedHashMap<String, Object>();
+               commonHeaders.put("Authorization", Collections.singletonList((Object) ("Basic " + authStringEnc)));
+
+               try {
+                       if (!username.isEmpty()) {
+
+                               client = HttpBasicClient.getClient();
+                       } else {
+
+                               client = HttpsBasicClient.getClient();
+                       }
+               } catch (Exception e) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Unable to initialize rest client");
+
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "Client Initialized");
+
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T> void Get(T t, String sourceId, String path,
+                       org.onap.portalapp.portal.scheduler.restobjects.RestObject<T> restObject) throws Exception {
+
+               String methodName = "Get";
+               String url = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "URL FOR GET : ", url);
+               try {
+                       initRestClient();
+
+                       final Response cres = client.target(url).request().accept("application/json").headers(commonHeaders).get();
+
+                       int status = cres.getStatus();
+                       restObject.setStatusCode(status);
+
+                       t = (T) cres.readEntity(t.getClass());
+                       if (t.equals("")) {
+                               restObject.set(null);
+                       } else {
+                               restObject.set(t);
+                       }
+               } catch (HttpClientErrorException e) {
+                       String message = String.format(
+                                       " HttpClientErrorException: Exception For the POST  . MethodName: %s, Url: %s", methodName,url);
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, e.getStatusCode().value());
+               } catch (Exception e) {
+                       String message = String.format(
+                                       "Exception For the POST . MethodName: %s, Url: %s", methodName,url);
+
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, HttpStatus.INTERNAL_SERVER_ERROR.value());
+
+                       throw e;
+
+               }
+
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T> void Post(T t, JSONObject requestDetails, String path, RestObject<T> restObject) throws Exception {
+
+               String methodName = "Post";
+               String url = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
+               logger.debug(EELFLoggerDelegate.debugLogger, "URL FOR POST : "+ url);
+
+               try {
+
+                       initRestClient();
+
+                       // Change the content length
+                       final Response cres = client.target(url).request().accept("application/json").headers(commonHeaders)
+                                       .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+
+                       if (cres.getEntity() != null) {
+                               t = (T) cres.readEntity(t.getClass());
+                               restObject.set(t);
+                       } else {
+                               t = null;
+                               restObject.set(t);
+                       }
+
+                       int status = cres.getStatus();
+                       restObject.setStatusCode(status);
+
+                       if (status >= 200 && status <= 299) {
+                               String message = String.format(
+                                               " REST api POST was successful!", methodName);
+                               logger.debug(EELFLoggerDelegate.debugLogger, message);
+
+                       } else {
+                               String message = String.format(
+                                               " FAILED with http status  . MethodName: %s, Status: %s, Url: %s", methodName,status,url);
+                               logger.debug(EELFLoggerDelegate.debugLogger, message);
+                       }
+
+               } catch (HttpClientErrorException e) {
+                       String message = String.format(
+                                       " HttpClientErrorException: Exception For the POST  . MethodName: %s, Url: %s", methodName,url);
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, e.getStatusCode().value());
+               } catch (Exception e) {
+                       String message = String.format(
+                                       " HttpClientErrorException: Exception For the POST  . MethodName: %s, Url: %s", methodName,url);
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, HttpStatus.INTERNAL_SERVER_ERROR.value());
+                       throw e;
+               }
+       }
+
+       @Override
+       public void logRequest(JSONObject requestDetails) {
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject) {
+
+               String methodName = "Delete";
+               String url = "";
+               Response cres = null;
+
+               try {
+                       initRestClient();
+
+                       url = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
+
+                       cres = client.target(url).request().accept("application/json").headers(commonHeaders)
+                                       // .entity(r)
+                                       .build("DELETE", Entity.entity(requestDetails, MediaType.APPLICATION_JSON)).invoke();
+                       // .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
+                       // .delete(Entity.entity(r, MediaType.APPLICATION_JSON));
+
+                       int status = cres.getStatus();
+                       restObject.setStatusCode(status);
+                       if (cres.getEntity() != null) {
+                               t = (T) cres.readEntity(t.getClass());
+                               restObject.set(t);
+                       }
+
+               } catch (HttpClientErrorException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, " HttpClientErrorException:Exception For the Delete",
+                                       methodName, url, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, e.getStatusCode().value());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception For the Delete", methodName, url, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, HttpStatus.INTERNAL_SERVER_ERROR.value());
+                       throw e;
+               }
+       }
+
+       public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException {
+               return clazz.newInstance();
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterfaceFactory.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterfaceFactory.java
new file mode 100644 (file)
index 0000000..75ae6d3
--- /dev/null
@@ -0,0 +1,51 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler;
+
+public class SchedulerRestInterfaceFactory {
+
+       
+       public static SchedulerRestInterfaceIfc getInstance () {
+               SchedulerRestInterfaceIfc obj = null;
+
+               obj = new SchedulerRestInterface();
+               
+               return ( obj );
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterfaceIfc.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerRestInterfaceIfc.java
new file mode 100644 (file)
index 0000000..5d1da5e
--- /dev/null
@@ -0,0 +1,58 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler;
+
+import org.json.simple.JSONObject;
+import org.onap.portalapp.portal.scheduler.restobjects.RestObject;
+import org.springframework.stereotype.Service;
+
+
+@Service
+public interface SchedulerRestInterfaceIfc {
+
+       public void initRestClient();
+
+       public <T> void Get(T t, String sourceId, String path, org.onap.portalapp.portal.scheduler.restobjects.RestObject<T> restObject ) throws Exception;
+
+       public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject)
+                       throws Exception;
+
+       public <T> void Post(T t, JSONObject r, String path, RestObject<T> restObject) throws Exception;
+
+       public void logRequest(JSONObject requestDetails);
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerUtil.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/SchedulerUtil.java
new file mode 100644 (file)
index 0000000..2da5f69
--- /dev/null
@@ -0,0 +1,136 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.onap.portalapp.portal.scheduler.restobjects.GetTimeSlotsRestObject;
+import org.onap.portalapp.portal.scheduler.restobjects.PostCreateNewVnfRestObject;
+import org.onap.portalapp.portal.scheduler.restobjects.PostSubmitVnfChangeRestObject;
+import org.onap.portalapp.portal.scheduler.wrapper.GetTimeSlotsWrapper;
+import org.onap.portalapp.portal.scheduler.wrapper.PostCreateNewVnfWrapper;
+import org.onap.portalapp.portal.scheduler.wrapper.PostSubmitVnfChangeTimeSlotsWrapper;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class SchedulerUtil {
+       
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerUtil.class);
+       
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+       public static GetTimeSlotsWrapper getTimeSlotsWrapResponse (GetTimeSlotsRestObject<String> rs) {        
+               
+               String resp_str = "";
+               int status = 0;
+               
+               if ( rs != null ) {
+                       resp_str = rs.get();
+                       status = rs.getStatusCode();
+               }
+                               
+               GetTimeSlotsWrapper w = new GetTimeSlotsWrapper();
+               
+               w.setEntity(resp_str);
+               w.setStatus (status);
+               
+               return (w);
+       }
+       
+       public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse (PostSubmitVnfChangeRestObject<String> rs) {     
+               
+               String resp_str = "";
+               int status = 0;
+               String uuid = "";
+               
+               if ( rs != null ) {
+                       resp_str = rs.get();
+                       status = rs.getStatusCode();
+                       uuid = rs.getUUID();
+               }
+                               
+               PostSubmitVnfChangeTimeSlotsWrapper w = new PostSubmitVnfChangeTimeSlotsWrapper();
+               
+               w.setEntity(resp_str);
+               w.setStatus (status);
+               w.setUuid(uuid);
+               
+               return (w);
+       }
+       
+       public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse (PostCreateNewVnfRestObject<String> rs) {    
+               
+               String resp_str = "";
+               int status = 0;
+               String uuid = "";
+               
+               if ( rs != null ) {
+                       resp_str = rs.get();
+                       status = rs.getStatusCode();
+                       uuid = rs.getUUID();
+               }
+                               
+               PostCreateNewVnfWrapper w = new PostCreateNewVnfWrapper();
+               
+               w.setEntity(resp_str);
+               w.setStatus (status);
+               w.setUuid(uuid);
+               
+               return (w);
+       }
+       
+       public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
+               
+               String methodName = "convertPojoToString";
+               ObjectMapper mapper = new ObjectMapper();
+               String r_json_str = "";
+           if ( t != null ) {
+                   try {
+                       r_json_str = mapper.writeValueAsString(t);
+                   }
+                   catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
+                   }
+           }
+           return (r_json_str);
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/client/HttpBasicClient.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/client/HttpBasicClient.java
new file mode 100644 (file)
index 0000000..8d64b2e
--- /dev/null
@@ -0,0 +1,85 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler.client;
+
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.onap.portalapp.portal.scheduler.util.CustomJacksonJaxBJsonProvider;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ *  General HTTP client.
+ */
+
+public class HttpBasicClient{
+       
+       /** The servlet context. */
+       @Autowired 
+       private ServletContext servletContext;
+       
+       /** The logger. */
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
+       
+       /** The Constant dateFormat. */
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+       
+       /**
+        * Obtain a basic HTTP client .
+        *
+        * @return Client client object
+        * @throws Exception the exception
+        */
+       public static Client getClient() throws Exception {
+               
+               ClientConfig config = new ClientConfig();
+               config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+               
+               return ClientBuilder.newClient(config)
+                               .register(CustomJacksonJaxBJsonProvider.class);
+       }       
+}  
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/client/HttpsBasicClient.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/client/HttpsBasicClient.java
new file mode 100644 (file)
index 0000000..53848e0
--- /dev/null
@@ -0,0 +1,162 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler.client;
+
+import java.io.File;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.eclipse.jetty.util.security.Password;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.onap.portalapp.portal.scheduler.SchedulerProperties;
+import org.onap.portalapp.portal.scheduler.util.CustomJacksonJaxBJsonProvider;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
+
+ /**
+  *  General SSL client using the VID tomcat keystore. It doesn't use client certificates.
+  */
+public class HttpsBasicClient{
+       
+       /** The logger. */
+       static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsBasicClient.class);
+       
+       /** The Constant dateFormat. */
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+       
+       /**
+        * Retrieve an SSL client.
+        *
+        * @return Client The SSL client
+        * @throws Exception the exception
+        */
+       public static Client getClient() throws Exception {
+               String methodName = "getClient";
+               ClientConfig config = new ClientConfig();
+               //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
+               //config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
+       
+               SSLContext ctx = null;
+               
+               try {
+                       
+                       config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+                       
+                       String truststore_path = SchedulerProperties.getProperty(SchedulerProperties.VID_TRUSTSTORE_FILENAME);
+                       logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " truststore_path=" + truststore_path);
+                       String truststore_password = SchedulerProperties.getProperty(SchedulerProperties.VID_TRUSTSTORE_PASSWD_X);
+                       
+                       
+                       String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+                       //logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
+                       
+                       File tr = new File (truststore_path);
+                       logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute truststore path=" + tr.getAbsolutePath());
+                       
+                       //String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
+                       //String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
+                       //String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
+                       
+                   System.setProperty("javax.net.ssl.trustStore", truststore_path);
+                   System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
+                       HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
+                           public boolean verify(String string,SSLSession ssls) {
+                               return true;
+                           }
+                       });
+       
+                       //May need to make the algorithm a parameter. MSO requires TLSv1.1      or TLSv1.2
+                       ctx = SSLContext.getInstance("TLSv1.2");
+                       
+                       /* 
+                       KeyManagerFactory kmf = null;
+                       try {
+                               kmf = KeyManagerFactory.getInstance("SunX509");
+                               FileInputStream fin = new FileInputStream(keystore_path);
+                               KeyStore ks = KeyStore.getInstance("PKCS12");
+                               char[] pwd = decrypted_keystore_password.toCharArray();
+                               ks.load(fin, pwd);
+                               kmf.init(ks, pwd);
+                       } catch (Exception e) {
+                               System.out.println("Error setting up kmf: exiting");
+                               e.printStackTrace();
+                               System.exit(1);
+                       }
+
+                       ctx.init(kmf.getKeyManagers(), null, null);
+                       */
+                       ctx.init(null, null, null);
+                       //config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, 
+                       //                                                      new HTTPSProperties( , ctx));
+                       
+                       return ClientBuilder.newBuilder()
+                               .sslContext(ctx)
+                               .hostnameVerifier(new HostnameVerifier() {
+                                       @Override
+                                       public boolean verify( String s, SSLSession sslSession ) {
+                                               return true;
+                                       }
+                               }).withConfig(config)
+                               .build()
+                               .register(CustomJacksonJaxBJsonProvider.class);
+                       
+               } catch (Exception e) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
+                       //System.out.println("Error setting up config: exiting");
+                       e.printStackTrace();
+                       return null;
+               }
+                       
+               //Client client = ClientBuilder.newClient(config);
+               // uncomment this line to get more logging for the request/response
+               // client.addFilter(new LoggingFilter(System.out));
+               
+               //return client;
+       }
+}  
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/policy/rest/RequestDetails.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/policy/rest/RequestDetails.java
new file mode 100644 (file)
index 0000000..66b77fa
--- /dev/null
@@ -0,0 +1,125 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler.policy.rest;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+/*
+       [
+         {
+           "policyConfigMessage": "Config Retrieved! ",
+           "policyConfigStatus": "CONFIG_RETRIEVED",
+           "type": "JSON",
+           "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_zone_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_zone\"}}",
+           "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
+           "policyVersion": "1",
+           "matchingConditions": {
+             "ECOMPName": "SNIRO-Placement",
+             "ConfigName": "",
+             "service": "TimeLimitAndVerticalTopology",
+             "uuid": "",
+             "Location": ""
+           },
+           "responseAttributes": {},
+           "property": null
+         },
+         {
+           "policyConfigMessage": "Config Retrieved! ",
+           "policyConfigStatus": "CONFIG_RETRIEVED",
+           "type": "JSON",
+           "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_pserver_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_pserver\"}}",
+           "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_pserver_localTime.1.xml",
+           "policyVersion": "1",
+           "matchingConditions": {
+             "ECOMPName": "SNIRO-Placement",
+             "ConfigName": "",
+             "service": "TimeLimitAndVerticalTopology",
+             "uuid": "",
+             "Location": ""
+           },
+           "responseAttributes": {},
+           "property": null
+         },
+         {
+           "policyConfigMessage": "Config Retrieved! ",
+           "policyConfigStatus": "CONFIG_RETRIEVED",
+           "type": "JSON",
+           "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_vnf_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf\"}}",
+           "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_vnf_localTime.1.xml",
+           "policyVersion": "1",
+           "matchingConditions": {
+             "ECOMPName": "SNIRO-Placement",
+             "ConfigName": "",
+             "service": "TimeLimitAndVerticalTopology",
+             "uuid": "",
+             "Location": ""
+           },
+           "responseAttributes": {},
+           "property": null
+         }
+       ]
+*/
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+    "policyConfigMessage",
+    "policyConfigStatus",
+    "type",
+    "config",
+    "policyName",
+    "policyVersion",
+    "matchingConditions"
+})
+public class RequestDetails {
+       
+       @JsonProperty("policyName")
+    private String policyName;  
+    
+       @JsonProperty("policyName")
+    public String getPolicyName() {
+        return policyName;
+    }
+
+    @JsonProperty("policyName")
+    public void setPolicyName(String policyName) {
+        this.policyName = policyName;
+    }
+    
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/GetTimeSlotsRestObject.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/GetTimeSlotsRestObject.java
new file mode 100644 (file)
index 0000000..6adf59c
--- /dev/null
@@ -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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.restobjects;
+
+public class GetTimeSlotsRestObject<T> extends RestObject<T> {
+
+       public String uuid;
+       
+       public void setUUID(String uuid) { this.uuid = uuid; }
+           
+       public String getUUID() { return this.uuid; }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/PostCreateNewVnfRestObject.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/PostCreateNewVnfRestObject.java
new file mode 100644 (file)
index 0000000..757b818
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.restobjects;
+
+public class PostCreateNewVnfRestObject<T> extends RestObject<T> {
+       
+       public String uuid;
+       
+       public void setUUID(String uuid) { this.uuid = uuid; }
+           
+       public String getUUID() { return this.uuid; }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/PostSubmitVnfChangeRestObject.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/PostSubmitVnfChangeRestObject.java
new file mode 100644 (file)
index 0000000..3f75315
--- /dev/null
@@ -0,0 +1,47 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.restobjects;
+
+public class PostSubmitVnfChangeRestObject<T> extends RestObject<T> {
+       
+       public String uuid;
+       
+       public void setUUID(String uuid) { this.uuid = uuid; }
+           
+       public String getUUID() { return this.uuid; }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/RestObject.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/restobjects/RestObject.java
new file mode 100644 (file)
index 0000000..b2f4d5c
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler.restobjects;
+
+
+public class RestObject<T> {
+       
+    private T t;
+   
+    private int statusCode= 0;
+        
+    public void set(T t) { this.t = t; }
+    
+    public T get() { return t; }
+          
+    public void setStatusCode(int v) { this.statusCode = v; }
+       
+    public int getStatusCode() { return this.statusCode; }
+        
+}
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/util/CustomJacksonJaxBJsonProvider.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/util/CustomJacksonJaxBJsonProvider.java
new file mode 100644 (file)
index 0000000..9f7b092
--- /dev/null
@@ -0,0 +1,91 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduler.util;
+
+
+import javax.ws.rs.ext.Provider;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
+import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
+
+/**
+ * The Class CustomJacksonJaxBJsonProvider.
+ */
+@Provider
+public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider {
+
+           /** The common mapper. */
+       private static ObjectMapper commonMapper = null;
+
+           /**
+        * Instantiates a new custom jackson jax B json provider.
+        */
+       public CustomJacksonJaxBJsonProvider() {
+               if (commonMapper == null) {
+                   ObjectMapper mapper = new ObjectMapper();
+
+                   mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+                   
+                   mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
+                   mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
+                   mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+
+                   mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                   mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
+
+                   mapper.registerModule(new JaxbAnnotationModule());
+
+                   commonMapper = mapper;
+               }
+               super.setMapper(commonMapper);
+           }
+           
+           /**
+        * Gets the mapper.
+        *
+        * @return the mapper
+        */
+       public ObjectMapper getMapper() {
+               return commonMapper;
+           }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/GetTimeSlotsWrapper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/GetTimeSlotsWrapper.java
new file mode 100644 (file)
index 0000000..43f4e36
--- /dev/null
@@ -0,0 +1,42 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.wrapper;
+
+public class GetTimeSlotsWrapper extends SchedulerResponseWrapper {
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/PostCreateNewVnfWrapper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/PostCreateNewVnfWrapper.java
new file mode 100644 (file)
index 0000000..fce04d8
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.wrapper;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({ "uuid" })
+public class PostCreateNewVnfWrapper extends SchedulerResponseWrapper {
+
+       @JsonProperty("uuid")
+       private String uuid;
+
+       @JsonProperty("uuid")
+       public String getUuid() {
+               return uuid;
+       }
+
+       @JsonProperty("uuid")
+       public void setUuid(String v) {
+               this.uuid = v;
+       }
+
+       @Override
+       public String toString() {
+               return ToStringBuilder.reflectionToString(this);
+       }
+
+       public String getResponse() throws JsonProcessingException, IOException {
+
+               Map<String, Object> map = new LinkedHashMap<>();
+               map.put("status", getStatus());
+               map.put("entity", getEntity());
+               map.put("uuid", getUuid());
+               ObjectMapper objectMapper = new ObjectMapper();
+               String jsonResponse = objectMapper.writeValueAsString(map);
+               return jsonResponse;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/PostSubmitVnfChangeTimeSlotsWrapper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/PostSubmitVnfChangeTimeSlotsWrapper.java
new file mode 100644 (file)
index 0000000..bd588e0
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.wrapper;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({ "uuid" })
+public class PostSubmitVnfChangeTimeSlotsWrapper extends SchedulerResponseWrapper {
+       @JsonProperty("uuid")
+       private String uuid;
+
+       @JsonProperty("uuid")
+       public String getUuid() {
+               return uuid;
+       }
+
+       @JsonProperty("uuid")
+       public void setUuid(String v) {
+               this.uuid = v;
+       }
+
+       @Override
+       public String toString() {
+               return ToStringBuilder.reflectionToString(this);
+       }
+
+       public String getResponse() throws JsonProcessingException, IOException {
+
+               Map<String, Object> map = new LinkedHashMap<>();
+               map.put("status", getStatus());
+               map.put("entity", getEntity());
+               map.put("uuid", getUuid());
+               ObjectMapper objectMapper = new ObjectMapper();
+               String jsonResponse = objectMapper.writeValueAsString(map);
+               return jsonResponse;
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/SchedulerResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduler/wrapper/SchedulerResponseWrapper.java
new file mode 100644 (file)
index 0000000..67ded99
--- /dev/null
@@ -0,0 +1,107 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduler.wrapper;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * This wrapper encapsulates the Scheduler response
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({ "status", "entity" })
+
+public class SchedulerResponseWrapper {
+
+       @JsonProperty("status")
+       private int status;
+
+       @JsonProperty("entity")
+       private String entity;
+
+       @JsonProperty("entity")
+       public String getEntity() {
+               return entity;
+       }
+
+       @JsonProperty("status")
+       public int getStatus() {
+               return status;
+       }
+
+       @JsonProperty("status")
+       public void setStatus(int v) {
+               this.status = v;
+       }
+
+       @JsonProperty("entity")
+       public void setEntity(String v) {
+               this.entity = v;
+       }
+
+       @Override
+       public String toString() {
+               return ToStringBuilder.reflectionToString(this);
+       }
+
+       public String getResponse() throws JsonProcessingException, IOException {
+               /*
+                * StringBuilder b = new StringBuilder ("{ \"status\": ");
+                * 
+                * b.append(getStatus()).append(", \"entity\": "
+                * ).append(this.getEntity()).append("}"); return (b.toString());
+                */
+
+               Map<String, Object> map = new LinkedHashMap<>();
+               map.put("status", getStatus());
+               map.put("entity", getEntity());
+               ObjectMapper objectMapper = new ObjectMapper();
+               String jsonResponse = objectMapper.writeValueAsString(map);
+               return jsonResponse;
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/RestObject.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/RestObject.java
new file mode 100644 (file)
index 0000000..f9755a0
--- /dev/null
@@ -0,0 +1,86 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduleraux;
+
+/**
+ * The Class RestObject.
+ *
+ * @param <T> the generic type
+ */
+public class RestObject<T> {
+
+       /**
+        * Generic version of the RestObject class.
+        *
+        */
+    // T stands for "Type"
+    private T t;
+    
+    /** The status code. */
+    private int statusCode= 0;
+    
+    /**
+     * Sets the.
+     *
+     * @param t the t
+     */
+    public void set(T t) { this.t = t; }
+    
+    /**
+     * Gets the.
+     *
+     * @return the t
+     */
+    public T get() { return t; }
+       
+    /**
+     * Sets the status code.
+     *
+     * @param v the new status code
+     */
+    public void setStatusCode(int v) { this.statusCode = v; }
+    
+    /**
+     * Gets the status code.
+     *
+     * @return the status code
+     */
+    public int getStatusCode() { return this.statusCode; }
+    
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxResponseWrapper.java
new file mode 100644 (file)
index 0000000..35becb6
--- /dev/null
@@ -0,0 +1,93 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduleraux;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+/**
+ * This wrapper encapsulates the Policy response
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+           "status",
+           "entity"
+})
+
+public class SchedulerAuxResponseWrapper {
+       
+       @JsonProperty("status")
+       private int status;
+
+       @JsonProperty("entity")
+       private String entity;
+
+       @JsonProperty("entity")
+    public String getEntity() {
+        return entity;
+    }
+       
+       @JsonProperty("status")
+    public int getStatus() {
+        return status;
+    }  
+       
+       @JsonProperty("status")
+    public void setStatus(int v) {
+        this.status = v;
+    }
+
+       @JsonProperty("entity")
+    public void setEntity(String v) {
+        this.entity = v;
+    }
+
+    @Override
+    public String toString() {
+        return ToStringBuilder.reflectionToString(this);
+    }
+
+    public String getResponse () {
+       
+       StringBuilder b = new StringBuilder ("{ \"status\": ");
+        b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
+        return (b.toString());
+    }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInt.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInt.java
new file mode 100644 (file)
index 0000000..18f4ce8
--- /dev/null
@@ -0,0 +1,85 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.scheduleraux;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.onap.portalapp.portal.scheduler.policy.rest.RequestDetails;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class SchedulerAuxRestInt {
+       
+       /** The logger. */
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxRestInterface.class);
+       
+       /** The Constant dateFormat. */
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+       
+       /** The request date format. */
+       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
+       
+       public SchedulerAuxRestInt() {
+               requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
+       }
+
+       /**
+        * Log request.
+        *
+        * @param r the r
+        */
+       public void logRequest ( RequestDetails r ) {
+       String methodName = "logRequest";
+           ObjectMapper mapper = new ObjectMapper();
+           String r_json_str = "";
+           if ( r != null ) {
+               r_json_str = r.toString();
+                   try {
+                       r_json_str = mapper.writeValueAsString(r);
+                   }
+                   catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
+                   }
+           }
+           logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");  
+    }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterface.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterface.java
new file mode 100644 (file)
index 0000000..bf0fa51
--- /dev/null
@@ -0,0 +1,278 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduleraux;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Date;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jetty.util.security.Password;
+import org.json.simple.JSONObject;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.scheduler.SchedulerProperties;
+import org.onap.portalapp.portal.scheduler.client.HttpBasicClient;
+import org.onap.portalapp.portal.scheduler.policy.rest.RequestDetails;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.client.HttpClientErrorException;
+
+public class SchedulerAuxRestInterface extends SchedulerAuxRestInt implements SchedulerAuxRestInterfaceIfc {
+
+       /** The logger. */
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxRestInterface.class);
+
+       /** The Constant dateFormat. */
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+       /** The client. */
+       private static Client client = null;
+
+       /** The common headers. */
+       private MultivaluedHashMap<String, Object> commonHeaders;
+
+       public SchedulerAuxRestInterface() {
+               super();
+       }
+
+       public void initRestClient() {
+               final String methodname = "initRestClient()";
+               final String mechId = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_CLIENT_MECHID_VAL);
+               final String clientPassword = SchedulerProperties
+                               .getProperty(SchedulerProperties.SCHEDULERAUX_CLIENT_PASSWORD_VAL);
+               final String username = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_USERNAME_VAL);
+               final String password = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_PASSWORD_VAL);
+               final String environment = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_ENVIRONMENT_VAL);
+               final String clientAuth = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_CLIENTAUTH_VAL);
+               final String decrypted_client_password = Password.deobfuscate(clientPassword);
+               String mechAuthString = mechId + ":" + decrypted_client_password;
+               byte[] mechAuthEncBytes = Base64.encodeBase64(mechAuthString.getBytes());
+               final String decrypted_password = Password.deobfuscate(password);
+               String authString = username + ":" + decrypted_password;
+               byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
+               String authorization = new String(authEncBytes);
+
+               commonHeaders = new MultivaluedHashMap<String, Object>();
+               commonHeaders.put("ClientAuth", Collections.singletonList((Object) ("Basic " + clientAuth)));
+               commonHeaders.put("Authorization", Collections.singletonList((Object) ("Basic " + authorization)));
+               commonHeaders.put("Environment", Collections.singletonList((Object) (environment)));
+
+               if (client == null) {
+
+                       try {
+                               client = HttpBasicClient.getClient();
+                       } catch (Exception e) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, " Unable to get the SSL client", methodname);
+
+                       }
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T> void Get(T t, String sourceId, String path, RestObject<T> restObject) throws Exception {
+               String methodName = "Get";
+
+               logger.debug(EELFLoggerDelegate.debugLogger, " start", methodName);
+
+               String url = "";
+               restObject.set(t);
+
+               url = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_SERVER_URL_VAL) + path;
+               logger.debug(EELFLoggerDelegate.debugLogger, " sending request to url: ", dateFormat.format(new Date()),
+                               methodName, url);
+
+               initRestClient();
+
+               final Response cres = client.target(url).request().accept("application/json").headers(commonHeaders).get();
+
+               int status = cres.getStatus();
+               restObject.setStatusCode(status);
+
+               if (status == 200) {
+                       t = (T) cres.readEntity(t.getClass());
+                       restObject.set(t);
+                       logger.debug(EELFLoggerDelegate.debugLogger, " REST api was successfull!", dateFormat.format(new Date()),
+                                       methodName);
+
+               } else {
+                       throw new Exception(methodName + " with status=" + status + ", url= " + url);
+               }
+
+               logger.debug(EELFLoggerDelegate.debugLogger, " received status", methodName, status);
+
+               return;
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
+
+               String methodName = "Delete";
+               String url = "";
+               Response cres = null;
+
+               logRequest(r);
+
+               try {
+                       initRestClient();
+
+                       url = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_SERVER_URL_VAL) + path;
+                       logger.debug(EELFLoggerDelegate.debugLogger, " methodName sending request to: ",
+                                       dateFormat.format(new Date()), url, methodName);
+
+                       cres = client.target(url).request().accept("application/json").headers(commonHeaders)
+                                       // .entity(r)
+                                       .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
+                       // .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
+                       // .delete(Entity.entity(r, MediaType.APPLICATION_JSON));
+
+                       int status = cres.getStatus();
+                       restObject.setStatusCode(status);
+
+                       if (status == 404) { // resource not found
+                               String msg = "Resource does not exist...: " + cres.getStatus();
+                               logger.debug(EELFLoggerDelegate.debugLogger, "msg", dateFormat.format(new Date()), msg);
+                       } else if (status == 200 || status == 204) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Resource--deleted:url", dateFormat.format(new Date()),
+                                               url);
+                       } else if (status == 202) {
+                               String msg = "Delete in progress: " + status;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "msg ", dateFormat.format(new Date()), msg);
+                       } else {
+                               String msg = "Deleting Resource failed: " + status;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "msg", dateFormat.format(new Date()), msg);
+                       }
+
+                       try {
+                               t = (T) cres.readEntity(t.getClass());
+                               restObject.set(t);
+                       } catch (HttpClientErrorException e) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               " HttpClientErrorException:No response entity, this is probably ok, e=", methodName, e);
+                               EPLogUtil.schedulerAccessAlarm(logger, e.getStatusCode().value());
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "No response entity, this is probably ok, e=", methodName,
+                                               e);
+                               EPLogUtil.schedulerAccessAlarm(logger, HttpStatus.INTERNAL_SERVER_ERROR.value());
+
+                       }
+
+               } catch (HttpClientErrorException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, " HttpClientErrorException:Exception with the URL", methodName,
+                                       url, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, e.getStatusCode().value());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception with the URL ", dateFormat.format(new Date()),
+                                       methodName, url, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, HttpStatus.INTERNAL_SERVER_ERROR.value());
+
+                       throw e;
+
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       public <T> void Post(T t, JSONObject requestDetails, String uuid, String path, RestObject<T> restObject)
+                       throws HttpClientErrorException, Exception {
+
+               String methodName = "Post";
+               String url = "";
+               Response cres = null;
+               logger.debug(EELFLoggerDelegate.debugLogger, "POST policy rest interface");
+               // logRequest (requestDetails);
+               try {
+
+                       initRestClient();
+
+                       url = SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_SERVER_URL_VAL) + path;
+                       logger.debug(EELFLoggerDelegate.debugLogger, " sending request to url= ", methodName, url);
+                       // Change the content length
+
+                       cres = client.target(url).request().accept("application/json").headers(commonHeaders)
+                                       // .header("content-length", 201)
+                                       // .header("X-FromAppId", sourceID)
+                                       .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+
+                       t = (T) cres.readEntity(t.getClass());
+                       if (t.equals("")) {
+                               restObject.set(null);
+                       } else {
+                               restObject.set(t);
+                       }
+
+                       int status = cres.getStatus();
+
+                       restObject.setStatusCode(status);
+
+                       if (status >= 200 && status <= 299) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, " REST api POST was successful!", methodName);
+
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "methodname with Status and URL", methodName, status, url);
+                       }
+
+               } catch (HttpClientErrorException e) {
+                       String message = String.format(
+                                       " HttpClientErrorException:Exception with the URL . MethodName: %s, Url: %s", methodName,url);
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       EPLogUtil.schedulerAccessAlarm(logger, e.getStatusCode().value());
+               } catch (Exception e) {
+                       String message = String.format(
+                                       " Exception with the URL . MethodName: %s, Url: %s", methodName,url);
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);                       
+                       EPLogUtil.schedulerAccessAlarm(logger, HttpStatus.BAD_REQUEST.value());
+                       throw e;
+
+               }
+       }
+
+       public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException {
+               return clazz.newInstance();
+       }
+
+       @Override
+       public void logRequest(RequestDetails r) {
+               // TODO Auto-generated method stub
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterfaceFactory.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterfaceFactory.java
new file mode 100644 (file)
index 0000000..55ab036
--- /dev/null
@@ -0,0 +1,50 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduleraux;
+
+public class SchedulerAuxRestInterfaceFactory {
+
+       
+       public static SchedulerAuxRestInterfaceIfc getInstance () {
+               SchedulerAuxRestInterfaceIfc obj = null;
+
+               obj = new SchedulerAuxRestInterface();
+               
+               return ( obj );
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterfaceIfc.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/scheduleraux/SchedulerAuxRestInterfaceIfc.java
new file mode 100644 (file)
index 0000000..4c0d64e
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduleraux;
+
+import org.json.simple.JSONObject;
+import org.onap.portalapp.portal.scheduler.policy.rest.RequestDetails;
+
+public interface SchedulerAuxRestInterfaceIfc {        
+       /**
+        * Inits the rest client.
+        */
+       public void initRestClient();
+       
+       /**
+        * Gets the.
+        *
+        * @param <T> the generic type
+        * @param t the t
+        * @param sourceId the source id
+        * @param path the path
+        * @param restObject the rest object
+        * @throws Exception the exception
+        */
+       public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
+       
+       /**
+        * Delete.
+        *
+        * @param <T> the generic type
+        * @param t the t
+        * @param r the r
+        * @param sourceID the source ID
+        * @param path the path
+        * @param restObject the rest object
+        * @throws Exception the exception
+        */
+       public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+       
+       /**
+        * Post.
+        *
+        * @param <T> the generic type
+        * @param t the t
+        * @param r the r
+        * @param sourceID the source ID
+        * @param path the path
+        * @param restObject the rest object
+        * @throws Exception the exception
+        */
+       public <T> void Post(T t, JSONObject r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+       
+       /***
+        * Log request.
+        *
+        * @param r the r
+        */
+       public void logRequest ( RequestDetails r  );
+       
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..678073c
--- /dev/null
@@ -0,0 +1,108 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.scheduleraux;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.glassfish.jersey.client.ClientResponse;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+/*import org.openecomp.vid.policy.PolicyResponseWrapper;
+import org.openecomp.vid.policy.PolicyUtil;
+import org.openecomp.vid.policy.RestObject;*/
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class SchedulerAuxUtil {
+       
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerAuxUtil.class);
+       
+       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+       
+       public static SchedulerAuxResponseWrapper wrapResponse ( String body, int statusCode ) {
+               
+               SchedulerAuxResponseWrapper w = new SchedulerAuxResponseWrapper();
+               w.setStatus (statusCode);
+               w.setEntity(body);
+               
+               return w;
+       }
+       
+       public static SchedulerAuxResponseWrapper wrapResponse (ClientResponse cres) {  
+               String resp_str = "";
+               if ( cres != null ) {
+                       resp_str = cres.readEntity(String.class);
+               }
+               int statuscode = cres.getStatus();
+               SchedulerAuxResponseWrapper w = SchedulerAuxUtil.wrapResponse ( resp_str, statuscode );
+               return (w);
+       }
+       
+       public static SchedulerAuxResponseWrapper wrapResponse (RestObject<String> rs) {        
+               String resp_str = "";
+               int status = 0;
+               if ( rs != null ) {
+                       resp_str = rs.get();
+                       status = rs.getStatusCode();
+               }
+               SchedulerAuxResponseWrapper w = SchedulerAuxUtil.wrapResponse ( resp_str, status );
+               return (w);
+       }
+       
+       public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
+               
+               String methodName = "convertPojoToString";
+               ObjectMapper mapper = new ObjectMapper();
+               String r_json_str = "";
+           if ( t != null ) {
+                   try {
+                       r_json_str = mapper.writeValueAsString(t);
+                   }
+                   catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
+                   }
+           }
+           return (r_json_str);
+       }
+       
+       
+       public static void main(String[] args) {
+               // TODO Auto-generated method stub              
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AdminRolesService.java
new file mode 100644 (file)
index 0000000..49ab1a0
--- /dev/null
@@ -0,0 +1,77 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+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.transport.AppsListWithAdminRole;
+
+public interface AdminRolesService {
+
+       public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(String orgUserId);
+
+       public boolean setAppsWithAdminRoleStateForUser(AppsListWithAdminRole newAppsListWithAdminRoles);
+
+       /**
+        * Attention! User roles in ECOMP PORTAL cannot be managed by this function.
+        * @param user
+        * @return 'true' if user has Super Administrator role SYS_ADMIN_ROLE_ID (1 for now) in ECOMP PORTAL, 'false' otherwise
+        */
+       public boolean isSuperAdmin(EPUser user);
+       
+       /**
+        * Attention! User roles in ECOMP PORTAL cannot be managed by this function.
+        * @param user
+        * @return 'true' if user has Account Administrator role ACCOUNT_ADMIN_ROLE_ID (999 for now) for any application except ECOMP Portal, 'false' otherwise
+        */
+       public boolean isAccountAdmin(EPUser user);
+
+       /**
+        * Attention! User roles in ECOMP PORTAL cannot be managed by this function.
+        * @param user
+        * @return 'true' if user has any remote(!) role within any application (ECOMP Portal roles are not included), 'false' otherwise
+        */
+       public boolean isUser(EPUser user);
+
+       List<EPRole> getRolesByApp(EPUser user, Long appId);
+       
+       public boolean isAccountAdminOfApplication(EPUser user, EPApp app);
+}
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
new file mode 100644 (file)
index 0000000..653e974
--- /dev/null
@@ -0,0 +1,529 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+
+import javax.annotation.PostConstruct;
+
+import org.apache.cxf.common.util.StringUtils;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.json.JSONArray;
+import org.json.JSONObject;
+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.UserIdRoleId;
+import org.onap.portalapp.portal.domain.UserRole;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.transport.AppNameIdIsAdmin;
+import org.onap.portalapp.portal.transport.AppsListWithAdminRole;
+import org.onap.portalapp.portal.transport.ExternalAccessUser;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Service("adminRolesService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+
+public class AdminRolesServiceImpl implements AdminRolesService {
+
+       private Long SYS_ADMIN_ROLE_ID = 1L;
+       private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
+       private Long ECOMP_APP_ID = 1L;
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminRolesServiceImpl.class);
+
+       @Autowired
+       private SessionFactory sessionFactory;
+       @Autowired
+       private DataAccessService dataAccessService;
+       @Autowired
+       private SearchService searchService;
+       @Autowired
+       private EPAppService appsService;
+
+       private RestTemplate template = new RestTemplate();
+
+       @PostConstruct
+       private void init() {
+               try {
+                       SYS_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.SYS_ADMIN_ROLE_ID));
+                       ACCOUNT_ADMIN_ROLE_ID = Long
+                                       .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
+                       ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
+               }
+       }
+
+       @Override
+       @EPMetricsLog
+       @SuppressWarnings("unchecked")
+       public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(String orgUserId) {
+               AppsListWithAdminRole appsListWithAdminRole = null;
+
+               try {
+                       List<EPUser> userList = null;
+                       Map<String, String> userParams = new HashMap<>();
+                       userParams.put("org_user_id", orgUserId);
+                       try {
+                               userList = dataAccessService.executeNamedQuery("getEPUserByOrgUserId", userParams, null);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getEPUserByOrgUserId failed", e);                 
+                       }
+                               
+                       HashMap<Long, Long> appsUserAdmin = new HashMap<Long, Long>();
+                       if (userList!= null && userList.size() > 0) {
+                               EPUser user = userList.get(0);
+                               List<EPUserApp> userAppList = null;
+                               try {
+                                       userAppList = dataAccessService.getList(EPUserApp.class,
+                                                       " where userId = " + user.getId() + " and role.id = " + ACCOUNT_ADMIN_ROLE_ID, null, null);
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 1 failed", e);
+                                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError);
+                               }
+                               for (EPUserApp userApp : userAppList) {
+                                       appsUserAdmin.put(userApp.getAppId(), userApp.getUserId());
+                               }
+                       }
+
+                       appsListWithAdminRole = new AppsListWithAdminRole();
+                       appsListWithAdminRole.orgUserId = orgUserId;
+                       List<EPApp> appsList = null;
+                       try {
+                               appsList = dataAccessService.getList(EPApp.class,
+                                               "  where ( enabled = 'Y' or id = " + ECOMP_APP_ID + ")", null, null);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 2 failed", e);
+                               EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError);
+                       }
+                       for (EPApp app : appsList) {
+                               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
+                               appNameIdIsAdmin.id = app.getId();
+                               appNameIdIsAdmin.appName = app.getName();
+                               appNameIdIsAdmin.isAdmin = new Boolean(appsUserAdmin.containsKey(app.getId()));
+                               appNameIdIsAdmin.restrictedApp = app.isRestrictedApp();
+                               appsListWithAdminRole.appsRoles.add(appNameIdIsAdmin);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 3 failed", e);
+               }
+
+               return appsListWithAdminRole;
+       }
+
+       private static final Object syncRests = new Object();
+
+       @Override
+       @EPMetricsLog
+       @SuppressWarnings("unchecked")
+       public boolean setAppsWithAdminRoleStateForUser(AppsListWithAdminRole newAppsListWithAdminRoles) {
+               boolean result = false;
+               // No changes if no new roles list or no userId.
+               if (!StringUtils.isEmpty(newAppsListWithAdminRoles.orgUserId) && newAppsListWithAdminRoles.appsRoles != null) {
+                       synchronized (syncRests) {
+                               List<EPApp> apps = appsService.getAppsFullList();
+                               HashMap<Long, EPApp> enabledApps = new HashMap<Long, EPApp>();
+                               for (EPApp app : apps) {
+                                       if (app.getEnabled().booleanValue() || app.getId() == ECOMP_APP_ID) {
+                                               enabledApps.put(app.getId(), app);
+                                       }
+                               }
+                               List<AppNameIdIsAdmin> newAppsWhereUserIsAdmin = new ArrayList<AppNameIdIsAdmin>();
+                               for (AppNameIdIsAdmin adminRole : newAppsListWithAdminRoles.appsRoles) {
+                                       // user Admin role may be added only for enabled apps
+                                       if (adminRole.isAdmin.booleanValue() && enabledApps.containsKey(adminRole.id)) {
+                                               newAppsWhereUserIsAdmin.add(adminRole);
+                                       }
+                               }
+                               EPUser user = null;
+                               boolean createNewUser = false;
+                               String orgUserId = newAppsListWithAdminRoles.orgUserId.trim();
+                               List<EPUser> localUserList = dataAccessService.getList(EPUser.class,
+                                               " where org_user_id='" + orgUserId + "'", null, null);
+                               List<EPUserApp> oldAppsWhereUserIsAdmin = new ArrayList<EPUserApp>();
+                               if (localUserList.size() > 0) {
+                                       EPUser tmpUser = localUserList.get(0);
+                                       oldAppsWhereUserIsAdmin = dataAccessService.getList(EPUserApp.class,
+                                                       " where userId = " + tmpUser.getId() + " and role.id = " + ACCOUNT_ADMIN_ROLE_ID, null,
+                                                       null);
+                                       if (oldAppsWhereUserIsAdmin.size() > 0 || newAppsWhereUserIsAdmin.size() > 0) {
+                                               user = tmpUser;
+                                       }
+                               } else if (newAppsWhereUserIsAdmin.size() > 0) {
+                                       // we create new user only if he has Admin Role for any App
+                                       createNewUser = true;
+                               }
+                               if (user != null || createNewUser) {
+                                       Session localSession = null;
+                                       Transaction transaction = null;
+                                       try {
+                                               localSession = sessionFactory.openSession();
+                                               transaction = localSession.beginTransaction();
+                                               if (createNewUser) {
+                                                       user = this.searchService.searchUserByUserId(orgUserId);
+                                                       if (user != null) {
+                                                               // insert the user with active true in order to
+                                                               // pass login phase.
+                                                               user.setActive(true);
+                                                               localSession.save(EPUser.class.getName(), user);
+                                                       }
+                                               }
+                                               for (EPUserApp oldUserApp : oldAppsWhereUserIsAdmin) {
+                                                       // user Admin role may be deleted only for enabled
+                                                       // apps
+                                                       if (enabledApps.containsKey(oldUserApp.getAppId())) {
+                                                               localSession.delete(oldUserApp);
+                                                       }
+                                               }
+                                               for (AppNameIdIsAdmin appNameIdIsAdmin : newAppsWhereUserIsAdmin) {
+                                                       EPApp app = (EPApp) localSession.get(EPApp.class, appNameIdIsAdmin.id);
+                                                       EPRole role = (EPRole) localSession.get(EPRole.class, new Long(ACCOUNT_ADMIN_ROLE_ID));
+                                                       EPUserApp newUserApp = new EPUserApp();
+                                                       newUserApp.setUserId(user.getId());
+                                                       newUserApp.setApp(app);
+                                                       newUserApp.setRole(role);
+                                                       localSession.save(EPUserApp.class.getName(), newUserApp);
+                                               }
+                                               transaction.commit();
+                                               if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                                       // Add user admin role for list of centralized applications in external system
+                                                       addAdminRoleInExternalSystem(user, localSession, newAppsWhereUserIsAdmin);
+                                               }       
+                                       } catch (Exception e) {
+                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                               "setAppsWithAdminRoleStateForUser: exception in point 2", e);
+                                               try {
+                                                       if(transaction!=null)
+                                                               transaction.rollback();
+                                                       else
+                                                               logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: transaction is null cannot rollback");
+                                               } catch (Exception ex) {
+                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeExecuteRollbackError, e);
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "setAppsWithAdminRoleStateForUser: exception in point 3", ex);
+                                               }
+                                       } finally {
+                                               try {
+                                                       localSession.close();
+                                               } catch (Exception e) {
+                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoCloseSessionError, e);
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "setAppsWithAdminRoleStateForUser: exception in point 4", e);
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               return result;
+       }
+
+       @SuppressWarnings("unchecked")
+       private boolean addAdminRoleInExternalSystem(EPUser user, Session localSession,
+                       List<AppNameIdIsAdmin> newAppsWhereUserIsAdmin) {
+               boolean result = false;
+               try {
+                       // Reset All admin role for centralized applications
+                       List<EPApp> appList = dataAccessService.executeNamedQuery("getCentralizedApps", null, null);
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                       for (EPApp app : appList) {
+                               String name = "";
+                               if (EPCommonSystemProperties
+                                               .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
+                                       name = user.getOrgUserId() + SystemProperties
+                                                       .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
+                               }
+                               String extRole = app.getNameSpace() + "." + PortalConstants.ADMIN_ROLE.replaceAll(" ", "_");
+                               HttpEntity<String> entity = new HttpEntity<>(headers);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Connecting to External Access system");
+                               try {
+                                       ResponseEntity<String> getResponse = template
+                                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                       + "roles/" + extRole, HttpMethod.GET, entity, String.class);
+
+                                       if (getResponse.getBody().equals("{}")) {
+                                               String addDesc = "{\"name\":\"" + extRole + "\"}";
+                                               HttpEntity<String> roleEntity = new HttpEntity<>(addDesc, headers);
+                                               template.exchange(
+                                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                               + "role",
+                                                               HttpMethod.POST, roleEntity, String.class);
+                                       } else {
+                                               try {
+                                                       HttpEntity<String> deleteUserRole = new HttpEntity<>(headers);
+                                                       template.exchange(
+                                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                                       + "userRole/" + name + "/" + extRole,
+                                                                       HttpMethod.DELETE, deleteUserRole, String.class);
+                                               } catch (Exception e) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       " Role not found for this user may be it gets deleted before", e);
+                                               }
+                                       }
+                               } catch (Exception e) {
+                                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
+                                               logger.debug(EELFLoggerDelegate.debugLogger, "Application Not found for app {}",
+                                                               app.getNameSpace(), e.getMessage());
+                                       } else {
+                                               logger.error(EELFLoggerDelegate.errorLogger, "Application Not found for app {}",
+                                                               app.getNameSpace(), e);
+                                       }
+                               }
+                       }
+                       // Add admin role in external application
+                       // application
+                       for (AppNameIdIsAdmin appNameIdIsAdmin : newAppsWhereUserIsAdmin) {
+                               EPApp app = (EPApp) localSession.get(EPApp.class, appNameIdIsAdmin.id);
+                               try {
+                                       if (app.getCentralAuth()) {
+                                               String extRole = app.getNameSpace() + "." + PortalConstants.ADMIN_ROLE.replaceAll(" ", "_");
+                                               HttpEntity<String> entity = new HttpEntity<>(headers);
+                                               String name = "";
+                                               if (EPCommonSystemProperties
+                                                               .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
+                                                       name = user.getOrgUserId() + SystemProperties
+                                                                       .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
+                                               }
+                                               logger.debug(EELFLoggerDelegate.debugLogger, "Connecting to External Access system");
+                                               ResponseEntity<String> getUserRolesResponse = template.exchange(
+                                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                               + "userRoles/user/" + name,
+                                                               HttpMethod.GET, entity, String.class);
+                                               logger.debug(EELFLoggerDelegate.debugLogger, "Connected to External Access system");
+                                               if (!getUserRolesResponse.getBody().equals("{}")) {
+                                                       JSONObject jsonObj = new JSONObject(getUserRolesResponse.getBody());
+                                                       JSONArray extRoles = jsonObj.getJSONArray("userRole");
+                                                       final Map<String, JSONObject> extUserRoles = new HashMap<>();
+                                                       for (int i = 0; i < extRoles.length(); i++) {
+                                                               String userRole = extRoles.getJSONObject(i).getString("role");
+                                                               if (userRole.startsWith(app.getNameSpace() + ".")
+                                                                               && !userRole.equals(app.getNameSpace() + ".admin")
+                                                                               && !userRole.equals(app.getNameSpace() + ".owner")) {
+
+                                                                       extUserRoles.put(userRole, extRoles.getJSONObject(i));
+                                                               }
+                                                       }
+                                                       if (!extUserRoles.containsKey(extRole)) {
+                                                               // Assign with new apps user admin
+                                                               try {
+                                                                       ExternalAccessUser extUser = new ExternalAccessUser(name, extRole);
+                                                                       // Assign user role for an application in external access system
+                                                                       ObjectMapper addUserRoleMapper = new ObjectMapper();
+                                                                       String userRole = addUserRoleMapper.writeValueAsString(extUser);
+                                                                       HttpEntity<String> addUserRole = new HttpEntity<>(userRole, headers);
+                                                                       template.exchange(
+                                                                                       SystemProperties.getProperty(
+                                                                                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "userRole",
+                                                                                       HttpMethod.POST, addUserRole, String.class);
+                                                               } catch (Exception e) {
+                                                                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to add user admin role", e);
+                                                               }
+
+                                                       }
+                                               }
+                                       }
+                                       result = true;
+                               } catch (Exception e) {
+                                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
+                                               logger.debug(EELFLoggerDelegate.errorLogger,
+                                                               "Application name space not found in External system for app {} due to bad rquest name space ",
+                                                               app.getNameSpace(), e.getMessage());
+                                       } else {
+                                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to assign admin role for application {}",
+                                                               app.getNameSpace(), e);
+                                               result = false;
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       result = false;
+                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to assign admin roles operation", e);
+               }
+               return result;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public boolean isSuperAdmin(EPUser user) {
+               if ((user != null) /* && (user.getId() == null) */ && (user.getOrgUserId() != null)) {
+                       String sql = "SELECT user.USER_ID, user.org_user_id, userrole.ROLE_ID, userrole.APP_ID FROM fn_user_role userrole "
+                                       + "INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID " + "WHERE user.org_user_id = '"
+                                       + user.getOrgUserId() + "' " + "AND userrole.ROLE_ID = '" + SYS_ADMIN_ROLE_ID + "' "
+                                       + "AND userrole.APP_ID = '" + ECOMP_APP_ID + "';";
+                       try {
+                               List<UserRole> userRoleList = dataAccessService.executeSQLQuery(sql, UserIdRoleId.class, null);
+                               if (userRoleList != null && userRoleList.size() > 0) {
+                                       return true;
+                               }
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Exception occurred while executing isSuperAdmin operation", e);
+                       }
+               }
+               // else
+               // {
+               // User currentUser = user != null ? (User)
+               // dataAccessService.getDomainObject(User.class, user.getId(), null) :
+               // null;
+               // if (currentUser != null && currentUser.getId() != null) {
+               // for (UserApp userApp : currentUser.getUserApps()) {
+               // if (userApp.getApp().getId().equals(ECOMP_APP_ID) &&
+               // userApp.getRole().getId().equals(SYS_ADMIN_ROLE_ID)) {
+               // // Super Administrator role is global, no need to keep iterating
+               // return true;
+               // }
+               // }
+               // }
+               // }
+               return false;
+       }
+
+       public boolean isAccountAdmin(EPUser user) {
+               try {
+                       EPUser currentUser = user != null
+                                       ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null)
+                                       : null;
+                       if (currentUser != null && currentUser.getId() != null) {
+                               for (EPUserApp userApp : currentUser.getEPUserApps()) {
+                                       if (// !userApp.getApp().getId().equals(ECOMP_APP_ID)
+                                               // &&
+                                       userApp.getRole().getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
+                                               // Account Administrator sees only the applications
+                                               // he/she is Administrator
+                                               return true;
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isAccountAdmin operation",
+                                       e);
+               }
+               return false;
+       }
+
+       public boolean isUser(EPUser user) {
+               try {
+                       EPUser currentUser = user != null
+                                       ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null)
+                                       : null;
+                       if (currentUser != null && currentUser.getId() != null) {
+                               for (EPUserApp userApp : currentUser.getEPUserApps()) {
+                                       if (!userApp.getApp().getId().equals(ECOMP_APP_ID)) {
+                                               EPRole role = userApp.getRole();
+                                               if (!role.getId().equals(SYS_ADMIN_ROLE_ID) && !role.getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
+                                                       if (role.getActive()) {
+                                                               return true;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isUser operation", e);
+               }
+               return false;
+       }
+
+       @Override
+       @EPMetricsLog
+       public List<EPRole> getRolesByApp(EPUser user, Long appId) {
+               List<EPRole> list = new ArrayList<>();
+               String sql = "SELECT * FROM FN_ROLE WHERE UPPER(ACTIVE_YN) = 'Y' AND APP_ID = " + appId;
+               @SuppressWarnings("unchecked")
+               List<EPRole> roles = dataAccessService.executeSQLQuery(sql, EPRole.class, null);
+               for (EPRole role : roles) {
+                       list.add(role);
+               }
+               return list;
+       }
+
+       @Override
+       public boolean isAccountAdminOfApplication(EPUser user, EPApp app) {
+               try {
+                       EPUser currentUser = user != null
+                                       ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null) : null;
+                       if (currentUser != null && currentUser.getId() != null) {
+                               SortedSet<EPUserApp> userApps = currentUser.getEPUserApps();
+                               EPUserApp userApp = userApps.stream()
+                                               .filter(x -> x.getRole().getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)
+                                                               && x.getApp().getId().equals(app.getId()))
+                                               .findAny().orElse(null);
+                               if (userApp != null) {
+                                       return true;
+                               }
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "Exception occurred while executing isAccountAdminOfApplication operation", e);
+               }
+               return false;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppContactUsService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppContactUsService.java
new file mode 100644 (file)
index 0000000..874f7d0
--- /dev/null
@@ -0,0 +1,73 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
+import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
+
+public interface AppContactUsService {
+       
+       /**
+        * Gets a list of contact-us information for all entries in
+        * the fn_app_contact_us table, sorted by app name.  If an application is active but has no fn_app_contact_us entry, it will have no entry in this result.
+       * 
+        * @return List of AppContactUsItem, one for each item in fn_app_contact_us table.
+        * @throws Exception
+        */
+       public List<AppContactUsItem> getAppContactUs() throws Exception;
+
+       /**
+        * Gets a list of contact-us information for all applications
+        * in the fn_app table, extended with any information in the fn_app_contact_us table.
+        * 
+        * @return List of AppContactUsItem, one for each item in fn_app table.
+        * @throws Exception
+        */
+       public List<AppContactUsItem> getAppsAndContacts() throws Exception;
+       
+       public List<AppCategoryFunctionsItem> getAppCategoryFunctions() throws Exception;
+       
+       public String saveAppContactUs(List<AppContactUsItem> contactUs) throws Exception;
+       
+       public String saveAppContactUs(AppContactUsItem contactUs) throws Exception;
+
+       public String deleteContactUs(Long id) throws Exception;
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppContactUsServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppContactUsServiceImpl.java
new file mode 100644 (file)
index 0000000..edffafc
--- /dev/null
@@ -0,0 +1,206 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.onap.portalapp.portal.domain.AppContactUs;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
+import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+/**
+ * Provides database access for the contact-us page controllers.
+ */
+@Transactional
+@org.springframework.context.annotation.Configuration
+public class AppContactUsServiceImpl implements AppContactUsService {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppContactUsServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.AppContactUsService#
+        * getAppContactUs()
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<AppContactUsItem> getAppContactUs() throws Exception {
+               List<AppContactUsItem> contactUsItemList = (List<AppContactUsItem>) getDataAccessService()
+                               .executeNamedQuery("getAppContactUsItems", null, null);
+               Collections.sort(contactUsItemList, new AppContactUsItemCompare());
+               return contactUsItemList;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.AppContactUsService#
+        * getAllAppsAndContacts()
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<AppContactUsItem> getAppsAndContacts() throws Exception {
+               List<AppContactUsItem> contactUsItemList = (List<AppContactUsItem>) getDataAccessService()
+                               .executeNamedQuery("getAppsAndContacts", null, null);
+               Collections.sort(contactUsItemList, new AppContactUsItemCompare());
+               return contactUsItemList;
+       }
+
+       /**
+        * Assists in sorting app-contact-us items by application name.
+        */
+       class AppContactUsItemCompare implements Comparator<AppContactUsItem> {
+               @Override
+               public int compare(AppContactUsItem o1, AppContactUsItem o2) {
+                       return o1.getAppName().compareTo(o2.getAppName());
+               }
+       }
+
+       /**
+        * Gets a table of category and function details for apps that participate
+        * in the functional menu.
+        */
+       @Override
+       public List<AppCategoryFunctionsItem> getAppCategoryFunctions() throws Exception {
+               @SuppressWarnings("unchecked")
+               // This named query requires no parameters.
+               List<AppCategoryFunctionsItem> list = (List<AppCategoryFunctionsItem>) dataAccessService
+                               .executeNamedQuery("getAppCategoryFunctions", null, null);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getAppCategoryFunctions: result list size is " + list.size());
+               return list;
+       }
+
+       /**
+        * Saves the list of contact-us objects to the database.
+        */
+       @Override
+       @Transactional(rollbackFor = Exception.class)
+       public String saveAppContactUs(List<AppContactUsItem> contactUsModelList) throws Exception {
+               try {
+                       for (AppContactUsItem contactUs : contactUsModelList) {
+                               String status = saveAppContactUs(contactUs);
+                               if (!status.equals("success"))
+                                       throw new Exception("saveAppContaatUsFailed: service returned " + status);
+                       }
+                       return "success";
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "", e);
+                       throw new Exception(e);
+               }
+
+       }
+
+       /**
+        * Saves a single contact-us object to the database, either creating a new
+        * row or updating if the argument has the ID of an existing row.
+        */
+       @Override
+       @Transactional(rollbackFor = Exception.class)
+       public String saveAppContactUs(AppContactUsItem contactUsModel) throws Exception {
+               try {
+                       HashMap<String, Object> map = new HashMap<String, Object>();
+                       AppContactUs contactUs = null;
+                       try {
+                               contactUs = (AppContactUs) getDataAccessService().getDomainObject(AppContactUs.class,
+                                               contactUsModel.getAppId(), map);
+                       } catch (Exception e) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "saveAppContactUs: not found for App {}, adding new entry",
+                                               contactUsModel.getAppName());
+                               contactUs = new AppContactUs();
+                       }
+
+                       // Populate the AppContactUs model for the database.
+                       EPApp app = (EPApp) getDataAccessService().getDomainObject(EPApp.class, contactUsModel.getAppId(), map);
+                       if (app == null || app.getId() == null)
+                               throw new Exception("saveAppContactus: App not found for Id " + contactUsModel.getAppId());
+                       contactUs.setApp(app);
+                       contactUs.setDescription(contactUsModel.getDescription());
+                       contactUs.setContactName(contactUsModel.getContactName());
+                       contactUs.setContactEmail(contactUsModel.getContactEmail());
+                       contactUs.setActiveYN(contactUsModel.getActiveYN());
+                       contactUs.setUrl(contactUsModel.getUrl());
+                       getDataAccessService().saveDomainObject(contactUs, map);
+                       return "success";
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveAppContactUs failed", e);
+                       throw e;
+                       // return "failure";
+               }
+       }
+
+       /**
+        * Deletes the row from the app contact us table with the specified ID.
+        */
+       @Override
+       public String deleteContactUs(Long id) throws Exception {
+               try {
+                       HashMap<String, Object> map = new HashMap<String, Object>();
+                       AppContactUs contactUs = (AppContactUs) getDataAccessService().getDomainObject(AppContactUs.class, id, map);
+                       if (contactUs.getApp() == null)
+                               throw new Exception("Delete unsuccessful for Id " + id);
+                       getDataAccessService().deleteDomainObject(contactUs, map);
+                       return "success";
+               } catch (Exception e) {
+
+                       logger.info(EELFLoggerDelegate.errorLogger, "", e);
+                       throw e;
+               }
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientService.java
new file mode 100644 (file)
index 0000000..b3f376a
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import org.apache.cxf.transport.http.HTTPException;
+import org.onap.portalapp.util.SystemType;
+
+public interface ApplicationsRestClientService {
+       public <T> T get(Class<T> clazz, long app, String restPath) throws HTTPException;
+       public String getIncomingJsonString(long appId, String restPath) throws HTTPException;
+
+       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException;
+       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath, SystemType type) throws HTTPException;
+
+       public <T> T put(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException;
+
+       /**
+        * Sends a GET request to the specified application at the specified path.
+        * This is a workaround for a problem triggered by a superclass/subclass
+        * with identical field names.
+        * 
+        * @param clazz
+        *            Expected response type
+        * @param appId
+        *            Application ID
+        * @param restPath
+        *            Path at the remote application
+        * @param useJacksonMapper
+        *            If true, uses a com.fasterxml.jackson.databind.ObjectMapper to
+        *            translate the remote application response from JSON to an
+        *            object. Otherwise, uses a com.google.gson.Gson.
+        * @return Instance of the specified class
+        * @throws HTTPException
+        */
+       public <T> T get(Class<T> clazz, long appId, String restPath, boolean useJacksonMapper) throws HTTPException;
+}
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
new file mode 100644 (file)
index 0000000..1871720
--- /dev/null
@@ -0,0 +1,428 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+
+import java.lang.reflect.Type;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Base64;
+import java.util.Date;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.transport.http.HTTPException;
+import org.onap.portalapp.portal.service.AppsCacheService;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.SystemType;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+
+@Service("applicationsRestClientService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class ApplicationsRestClientServiceImpl implements ApplicationsRestClientService {
+
+       private static final String PASSWORD_HEADER = "password";
+
+       private static final String APP_USERNAME_HEADER = "username";
+
+       private static final String BASIC_AUTHENTICATION_HEADER = "Authorization";
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ApplicationsRestClientServiceImpl.class);
+
+       @Autowired
+       private AppsCacheService appsCacheService;
+
+       Gson gson = null;
+
+       private final ObjectMapper mapper = new ObjectMapper();
+
+       @PostConstruct
+       private void init() {
+               logger.debug(EELFLoggerDelegate.debugLogger, "initializing");
+               GsonBuilder builder = new GsonBuilder();
+
+               // Register an adapter to manage the date types as long values
+               builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
+                       public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
+                                       throws JsonParseException {
+                               return new Date(json.getAsJsonPrimitive().getAsLong());
+                       }
+               });
+
+               gson = builder.create();
+       }
+
+       // TODO: do we need to do additional logging for remote API calls?
+       private static WebClient createClientForPath(String baseUri, String path) {
+               logger.info(EELFLoggerDelegate.debugLogger, "Creating web client for " + baseUri + "   +   " + path);
+               WebClient client = WebClient.create(baseUri);
+               client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
+               client.path(path);
+               return client;
+       }
+
+       @EPMetricsLog
+       private void verifyResponse(Response response) throws HTTPException {
+               int status = response.getStatus();
+               logger.debug(EELFLoggerDelegate.debugLogger, "http response status=" + status);
+               MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(status));
+               if (!isHttpSuccess(status)) {
+                       String errMsg = "Failed. Status=" + status + "; [" + response.getStatusInfo().getReasonPhrase().toString()
+                                       + "]";
+                       URL url = null;
+                       try {
+                               // must not be null to avoid NPE in HTTPException constructor
+                               url = new URL("http://null");
+                               if (response.getLocation() != null)
+                                       url = response.getLocation().toURL();
+                       } catch (MalformedURLException e) {
+                               // never mind. it is only for the debug message.
+                               logger.warn(EELFLoggerDelegate.errorLogger, "Failed to build URL", e);
+                       }
+                       logger.error(EELFLoggerDelegate.errorLogger, "http response failed. " + errMsg + "; url=" + url);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeIncorrectHttpStatusError);
+                       throw new HTTPException(status, errMsg, url);
+               }
+       }
+
+       private static boolean isHttpSuccess(int status) {
+               return status / 100 == 2;
+       }
+       
+       
+       private WebClient createClientForApp(long appId, String restPath) {
+               return createClientFor(appId, restPath, SystemType.APPLICATION);
+       }
+
+       //TODO Need to implement the mylogins once the endpoint is confirmed
+       @EPMetricsLog
+       private WebClient createClientFor(long appSystemId, String restPath, SystemType type) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "creating client for appId=" + appSystemId + "; restPath=" + restPath);
+               EPApp externalApp = null;
+               
+               if(type == SystemType.APPLICATION){
+               externalApp = appsCacheService.getApp(appSystemId);
+               }else{
+                       // TO DO 
+               }
+               
+               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 appName = (type == SystemType.APPLICATION) ? externalApp.getName(): "";
+                       String decreptedAppPwd = StringUtils.EMPTY;
+
+                       // Set local context
+                       MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
+                       if (appBaseUri != null && appBaseUri.contains("https")) {
+                               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
+                       }
+                       MDC.put(EPCommonSystemProperties.FULL_URL, appBaseUri + restPath);
+                       MDC.put(EPCommonSystemProperties.TARGET_ENTITY, appName);
+                       MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath);
+
+                       try {
+                               decreptedAppPwd = CipherUtil.decryptPKC(encriptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "createClientFor failed to decrypt", e);
+                       }
+                       
+                       WebClient client = createClientForPath(appBaseUri, restPath);
+
+                       // support basic authentication for some partners
+                       String encoding = Base64.getEncoder().encodeToString((username + ":" + decreptedAppPwd).getBytes());
+                       String encodingStr = "Basic " + encoding;
+                       client.header(BASIC_AUTHENTICATION_HEADER, encodingStr);
+
+                       // But still keep code downward compatible for non compliant apps
+                       client.header(APP_USERNAME_HEADER, username);
+                       client.header(PASSWORD_HEADER, decreptedAppPwd);
+
+                       client.header(SystemProperties.ECOMP_REQUEST_ID, MDC.get(MDC_KEY_REQUEST_ID));
+                       client.header(SystemProperties.USERAGENT_NAME, EPCommonSystemProperties.ECOMP_PORTAL_BE);
+                       
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       String.format("App %d found, baseUri=[%s], Headers: [%s=%s, %s=%s, %s=%s]", appSystemId, appBaseUri,
+                                                       APP_USERNAME_HEADER, username, PASSWORD_HEADER, encriptedPwd, BASIC_AUTHENTICATION_HEADER, encodingStr));
+
+                       return client;
+               }
+               return null;
+       }
+
+       @Override
+       public <T> T get(Class<T> clazz, long appId, String restPath) throws HTTPException {
+               T t = null;
+               Response response = getResponse(appId, restPath);
+
+               if (response != null) {
+                       verifyResponse(response);
+                       String str = response.readEntity(String.class);
+                       EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
+                       try {
+                               t = gson.fromJson(str, clazz);
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+                       }
+               }
+
+               return t;
+       }
+       
+       @Override
+       public String getIncomingJsonString(long appId, String restPath) throws HTTPException {
+               Response response = getResponse(appId, restPath);
+
+               if (response != null) {
+                       verifyResponse(response);
+                       String incomingJson = response.readEntity(String.class);
+                       return incomingJson;
+               }
+               
+               return "";
+       }
+
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.openecomp.portalapp.portal.service.ApplicationsRestClientService#get(
+        * java.lang.Class, long, java.lang.String, boolean)
+        */
+       @Override
+       public <T> T get(Class<T> clazz, long appId, String restPath, boolean useJacksonMapper) throws HTTPException {
+
+               if (!useJacksonMapper)
+                       return get(clazz, appId, restPath);
+
+               T t = null;
+               Response response = getResponse(appId, restPath);
+
+               if (response != null) {
+                       verifyResponse(response);
+                       String str = response.readEntity(String.class);
+                       EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
+
+                       try {
+                               t = mapper.readValue(str, clazz);
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+                       }
+               }
+
+               return t;
+       }
+
+       protected Response getResponse(long appId, String restPath) {
+               WebClient webClient = null;
+               Response response = null;
+
+               webClient = createClientForApp(appId, restPath);
+               EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET request =", "no-payload");
+
+               try {
+                       if (webClient != null) {
+                               response = webClient.get();
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
+                       }
+               } catch (Exception e) {
+                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the GET REST API call", e);
+               }
+               return response;
+       }
+       
+       
+       @Override
+       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath, SystemType type) throws HTTPException {
+               WebClient client = null;
+               Response response = null;
+               T t = null;
+
+               client = createClientFor(appId, restPath, type);
+               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST request =", payload);
+
+               try {
+                       if (client != null) {
+                               response = client.post(payload);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
+                       }
+               } catch (Exception e) {
+                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call", e);
+               }
+
+               if (response != null) {
+                       verifyResponse(response);
+
+                       // String contentType = response.getHeaderString("Content-Type");
+                       if (clazz != null) {
+                               String str = response.readEntity(String.class);
+                               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
+                               try {
+                                       t = gson.fromJson(str, clazz);
+                               } catch (Exception e) {
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+                               }
+                       }
+               }
+               return t;
+       }
+
+       @Override
+       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException {
+               return post( clazz, appId, payload, restPath, SystemType.APPLICATION);
+       }
+
+       //@Override
+       public <T> T postForClass(Class<T> clazz, long appId, Object payload, String restPath, Class<T> forClass) throws HTTPException {
+               WebClient client = null;
+               Response response = null;
+               T t = null;
+
+               client = createClientForApp(appId, restPath);
+               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST request =", payload);
+
+               try {
+                       if (client != null) {
+                               response = client.post(payload);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
+                       }
+               } catch (Exception e) {
+                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call", e);
+               }
+
+               if (response != null) {
+                       verifyResponse(response);
+
+                       // String contentType = response.getHeaderString("Content-Type");
+                       if (clazz != null) {
+                               String str = response.readEntity(String.class);
+                               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
+                               try {
+                                       t = gson.fromJson(str, clazz);
+                               } catch (Exception e) {
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+                               }
+                       }
+               }
+               return t;
+       }
+
+       
+       @Override
+       public <T> T put(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException {
+               WebClient client = null;
+               Response response = null;
+               T t = null;
+
+               client = createClientForApp(appId, restPath);
+               EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT request =", payload);
+
+               try {
+                       if (client != null) {
+                               response = client.put(payload);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
+                       }
+               } catch (Exception e) {
+                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
+                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the PUT REST API call", e);
+               }
+
+               if (response != null) {
+                       verifyResponse(response);
+                       String str = response.readEntity(String.class);
+                       EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT result =", str);
+                       try {
+                               t = gson.fromJson(str, clazz);
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+                       }
+               }
+               return t;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java
new file mode 100644 (file)
index 0000000..edaf113
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalapp.portal.domain.EPApp;
+
+public interface AppsCacheService {
+       
+       /**
+        * returns an app by id from the cache
+        * @param appId
+        * @return corresponding App
+        */
+       EPApp getApp(Long appId);
+       
+       /**
+        * returns the corresponding application endpoint
+        * @param appId
+        * @return if appId exists in cache, then return corresponding application endpoint, null otherwise.
+        */
+       String getAppEndpoint(Long appId);
+
+       EPApp getAppForAnalytics(String appKey);
+}
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
new file mode 100644 (file)
index 0000000..c318f19
--- /dev/null
@@ -0,0 +1,155 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalapp.portal.service.AppsCacheService;
+import org.onap.portalapp.portal.service.AppsCacheServiceImple;
+
+@Service("appsCacheService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class AppsCacheServiceImple implements AppsCacheService {
+       @Autowired
+       EPAppService appsService;
+       
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsCacheServiceImple.class);
+       
+       final class CacheConfiguration {
+               
+               private long updateTime = 0;
+               private int updateInterval = 10;
+               
+               public CacheConfiguration (long _updateTime, int _updateInterval) {
+                       updateTime = _updateTime;
+                       updateInterval = _updateInterval;
+               }
+       }
+       
+       CacheConfiguration appConf = null;
+       CacheConfiguration analyticsAppConf = null;
+       
+       
+       private static volatile Map<Long, EPApp> appsMap;
+       private static volatile Map<String, EPApp> anlyticsAppsMap;
+       
+       @PostConstruct
+       public void init() {
+               appConf = new CacheConfiguration(0, 10);
+               analyticsAppConf = new CacheConfiguration(0, 3600);
+               
+               this.refreshAppsMap(appConf);
+       }
+
+       private Map<Long, EPApp> refreshAppsMap(CacheConfiguration conf) {
+               long now = System.currentTimeMillis();
+               
+               if(noNeedToUpdate(now, conf))
+                       return null;
+               
+               synchronized (this) {
+                       if(noNeedToUpdate(now, conf))
+                               return null;
+                       List<EPApp> allApps = appsService.getAppsFullList();
+                       Map<Long, EPApp> newAppsMap = new HashMap<Long, EPApp>();
+                       for (EPApp app : allApps) {
+                               newAppsMap.put(app.getId(), app);
+                       }
+                       
+                       Map<String, EPApp> newAnalyticsAppsMap = new HashMap<String, EPApp>();
+                       for (EPApp app : allApps) {
+                               newAnalyticsAppsMap.put(app.getUebKey(), app);
+                       }
+                       // Switch cache with the new one.
+                       appsMap = newAppsMap;
+                       anlyticsAppsMap = newAnalyticsAppsMap;
+                       conf.updateTime = now;
+               }
+               
+               return appsMap;
+       }
+
+       private boolean noNeedToUpdate(long now, CacheConfiguration conf) {
+               long secondsPassed = (now - conf.updateTime)/1000;
+               if(secondsPassed < conf.updateInterval){
+                       logger.debug(EELFLoggerDelegate.debugLogger, "no need to refresh yet, seconds since last refresh: " + secondsPassed + ", refresh interval (sec) = " + conf.updateInterval);
+                       return true; // no need to update cache
+               }
+               return false; // its time to update
+       }
+
+       @Override
+       public String getAppEndpoint(Long appId) {
+               refreshAppsMap(appConf);
+               EPApp app = appsMap.get(appId);
+               if(app != null)
+                       return app.getAppRestEndpoint();
+               return null;
+       }
+       
+       @Override
+       public EPApp getApp(Long appId) {
+               refreshAppsMap(appConf);
+               EPApp app = appsMap.get(appId);
+               if(app != null)
+                       return app;
+               return null;            
+       }
+       
+       @Override
+       public EPApp getAppForAnalytics(String appKey) {
+               refreshAppsMap(analyticsAppConf);
+               EPApp app = anlyticsAppsMap.get(appKey);
+               if(app != null)
+                       return app;
+               return null;            
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthAccountService.java
new file mode 100644 (file)
index 0000000..2b3c3f3
--- /dev/null
@@ -0,0 +1,101 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.BasicAuthCredentials;
+import org.onap.portalapp.portal.domain.EPEndpoint;
+
+public interface BasicAuthAccountService {
+
+       /**
+        * Saves Basic Authentication account for external systems
+        * 
+        * @param newCredential
+        *            BasicAuthCredentials
+        * @return Id of the newly created account
+        * @throws Exception
+        */
+       Long saveBasicAuthAccount(BasicAuthCredentials newCredential) throws Exception;
+
+       /**
+        * Saves Endpoint associated with a Basic Auth account
+        * 
+        * @param endpoint
+        *            EPEndpoint
+        * @return Id of the newly created endpoint
+        * @throws Exception
+        */
+       Long saveEndpoints(EPEndpoint endpoint) throws Exception;
+
+       /**
+        * Saves Endpoint associated with a Basic Auth account
+        * 
+        * @param accountId
+        * @param endpointId
+        * @throws Exception
+        */
+       void saveEndpointAccount(Long accountId, Long endpointId) throws Exception;
+
+       /**
+        * Returns list of all BasicAuthCredentials in the sytem
+        * 
+        * @return List<BasicAuthCredentials>
+        * @throws Exception
+        */
+       List<BasicAuthCredentials> getAccountData() throws Exception;
+
+       /**
+        * Deletes BasicAuthenticationAccount
+        * 
+        * @param accountId
+        * @throws Exception
+        */
+       void deleteEndpointAccout(Long accountId) throws Exception;
+
+       /**
+        * Updates BasicAuthenticationAccount
+        * 
+        * @param accountId
+        * @param newCredential
+        *            BasicAuthCredentials
+        * @throws Exception
+        */
+       void updateBasicAuthAccount(Long accountId, BasicAuthCredentials newCredential) throws Exception;
+}
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
new file mode 100644 (file)
index 0000000..e6b7c6e
--- /dev/null
@@ -0,0 +1,247 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.BasicAuthCredentials;
+import org.onap.portalapp.portal.domain.EPEndpoint;
+import org.onap.portalapp.portal.domain.EPEndpointAccount;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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;
+
+@Service("basicAuthAccountService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class BasicAuthAccountServiceImpl implements BasicAuthAccountService{
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @Override
+       public Long saveBasicAuthAccount(BasicAuthCredentials newCredential) throws Exception {
+               if (newCredential.getPassword() != null)
+                       newCredential.setPassword(encryptedPassword(newCredential.getPassword()));
+               try{
+                       getDataAccessService().saveDomainObject(newCredential, null);
+               }catch(Exception e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveBasicAuthAccount() failed", e);
+                       throw e;
+               }
+               return newCredential.getId();
+       }
+       
+
+       @Override
+       @SuppressWarnings("unchecked")
+       public Long saveEndpoints(EPEndpoint endpoint) throws Exception {
+               
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion NameCrit = Restrictions.eq("name", endpoint.getName());
+               restrictionsList.add(NameCrit);
+
+               List<EPEndpoint> tempList = (List<EPEndpoint>) dataAccessService.getList(EPEndpoint.class, null,
+                               restrictionsList, null);
+               if (tempList.size() != 0) {
+                       return tempList.get(0).getId();
+               } else {
+                       getDataAccessService().saveDomainObject(endpoint, null);
+                       return endpoint.getId();
+               }
+               
+       }
+       
+       @Override
+       public void saveEndpointAccount(Long accountId, Long endpointId) throws Exception {
+               EPEndpointAccount record = new EPEndpointAccount();
+               record.setAccount_id(accountId);
+               record.setEp_id(endpointId);
+               try {
+                       getDataAccessService().saveDomainObject(record, null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveEndpointAccount() failed", e);
+                       throw e;
+               }
+
+       }
+       
+       @Override
+       @SuppressWarnings("unchecked")
+       public void updateBasicAuthAccount(Long accountId, BasicAuthCredentials newCredential) throws Exception {
+               try {
+                       newCredential.setId(accountId);
+                       if (newCredential.getPassword() != null)
+                               newCredential.setPassword(encryptedPassword(newCredential.getPassword()));
+                       getDataAccessService().saveDomainObject(newCredential, null);
+                       
+                       List<EPEndpoint> endpoints = newCredential.getEndpoints();
+                       List<EPEndpoint> orig_points = getEPEndpoints(accountId);
+                       
+                       for(EPEndpoint temp_ep: orig_points){
+                               boolean flag = false;
+                               for(EPEndpoint temp_ep2: endpoints){
+                                       if(temp_ep2.getId() == temp_ep.getId())
+                                               flag = true;
+                               }
+                               if(!flag){
+                                       Map<String, String> params = new HashMap<String, String>();
+                                       params.put("accountId", Long.toString(accountId));
+                                       params.put("epId", Long.toString(temp_ep.getId()));
+                                       dataAccessService.executeNamedQuery("deleteAccountEndpointRecord", params, null);
+                               }
+                       }
+                       
+                       
+                       for(int i = 0; i < endpoints.size(); i++){
+                               
+                               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                               Criterion IdCrit = Restrictions.eq("id", endpoints.get(i).getId());
+                               restrictionsList.add(IdCrit);
+                               Criterion NameCrit = Restrictions.eq("name", endpoints.get(i).getName());
+                               restrictionsList.add(NameCrit);
+                               List<EPEndpoint> tempList = (List<EPEndpoint>) dataAccessService
+                                               .getList(EPEndpoint.class, null, restrictionsList, null);
+                               if(tempList.size() == 0){
+                                       if(endpoints.get(i).getId() != null){
+                                               //delete the record endpoints.get(i).getId(), accountId                                         
+                                               Map<String, String> params = new HashMap<String, String>();
+                                               params.put("accountId", Long.toString(accountId));
+                                               params.put("epId", Long.toString(endpoints.get(i).getId()));
+                                               dataAccessService.executeNamedQuery("deleteAccountEndpointRecord", params, null);
+                                               endpoints.get(i).setId(null);
+                                       }
+                                       //create a new endpoint
+                                       Long ep_id = saveEndpoints(endpoints.get(i));
+                                       saveEndpointAccount(accountId, ep_id);                                           
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "updateBasicAuthAccount() failed", e);
+                       throw e;
+               }
+       }
+
+       @Override
+       public List<BasicAuthCredentials> getAccountData() throws Exception {
+               @SuppressWarnings("unchecked")
+               List<BasicAuthCredentials> list = (List<BasicAuthCredentials>) dataAccessService.getList(BasicAuthCredentials.class, null);
+               for (int i = 0; i < list.size(); i++) {
+                       if (list.get(i).getPassword() != null)
+                               list.get(i).setPassword(decryptedPassword(list.get(i).getPassword()));
+                       list.get(i).setEndpoints(getEPEndpoints(list.get(i).getId()));
+               }
+               return list;
+       }
+       
+       @SuppressWarnings("unchecked")
+       private List<EPEndpoint> getEPEndpoints(long accountId) {
+               List<EPEndpoint> result = new ArrayList<>();
+               List<EPEndpointAccount> list = null;
+               Map<String, Long> params = new HashMap<>();
+               params.put("account_id", accountId);
+               try {
+                       list = this.getDataAccessService().executeNamedQuery("getEPEndpointAccountByAccountId", params, null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getEPEndpointAccountByAccountId failed", e);                      
+               }
+               
+               for(int i = 0; list != null && i < list.size(); i++){
+                       result.add((EPEndpoint) dataAccessService.getDomainObject(EPEndpoint.class, list.get(i).getEp_id(), null));
+               }
+               return result;
+       }
+       
+       @Override
+       public void deleteEndpointAccout(Long accountId) throws Exception {
+               try{
+                       Map<String, String> params = new HashMap<String, String>();
+                       params.put("accountId", Long.toString(accountId));
+                       
+                       dataAccessService.executeNamedQuery("deleteAccountEndpoint", params, null);
+                       dataAccessService.executeNamedQuery("deleteBasicAuthAccount", params, null);
+                       
+               }catch(Exception e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteEndpointAccout() failed", e);
+                       throw e;
+               }
+       }
+       
+       private String decryptedPassword(String encryptedPwd) throws Exception {
+               String result = "";
+               if (encryptedPwd != null & encryptedPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.decryptPKC(encryptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword() failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+
+       private String encryptedPassword(String decryptedPwd) throws Exception {
+               String result = "";
+               if (decryptedPwd != null & decryptedPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.encryptPKC(decryptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+       
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/BasicAuthenticationCredentialService.java
new file mode 100644 (file)
index 0000000..b95b725
--- /dev/null
@@ -0,0 +1,53 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalapp.portal.domain.BasicAuthCredentials;
+
+public interface BasicAuthenticationCredentialService {
+       /**
+        * Gets the basic authentication credential for the specified appName from
+        * table ep_basic_auth_account
+        * 
+        * @param username
+        *            External user name
+        * @return BasicAuthCredentials for the specified app; null if the username
+        *         is not known.
+        */
+       public BasicAuthCredentials getBasicAuthCredentialByUsernameAndPassword(String username, String password);
+}
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
new file mode 100644 (file)
index 0000000..b50eb39
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.BasicAuthCredentials;
+import org.onap.portalapp.portal.domain.EPEndpoint;
+import org.onap.portalapp.portal.domain.EPEndpointAccount;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+@Service("basicAuthenticationCredentialService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class BasicAuthenticationCredentialServiceImpl implements BasicAuthenticationCredentialService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BasicAuthenticationCredentialServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @Override
+       public BasicAuthCredentials getBasicAuthCredentialByUsernameAndPassword(String username, String password) {
+
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion contextUserNameCrit = Restrictions.eq("username", username);
+               restrictionsList.add(contextUserNameCrit);
+               Criterion contextPasswordCrit = Restrictions.eq("password", password);
+               restrictionsList.add(contextPasswordCrit);
+
+               @SuppressWarnings("unchecked")
+               List<BasicAuthCredentials> credList = (List<BasicAuthCredentials>) dataAccessService
+                               .getList(BasicAuthCredentials.class, null, restrictionsList, null);
+               if (credList == null || credList.size() == 0) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "getBasicAuthCredentialByAppName: no credential(s) for " + username);
+                       return null;
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "getBasicAuthCredentialByAppName: cred list size: " + credList.size());
+               BasicAuthCredentials cred = (BasicAuthCredentials) credList.get(0);
+               cred.setEndpoints(getEndpointsByAccountId(cred.getId()));
+               return cred;
+       }
+
+       private List<EPEndpoint> getEndpointsByAccountId(long id) {
+               List<EPEndpoint> list = new ArrayList<>();
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion contextIdCrit = Restrictions.eq("account_id", id);
+               restrictionsList.add(contextIdCrit);
+               @SuppressWarnings("unchecked")
+               List<EPEndpointAccount> epList = (List<EPEndpointAccount>) dataAccessService.getList(EPEndpointAccount.class,
+                               null, restrictionsList, null);
+               for (EPEndpointAccount ep : epList) {
+                       list.add((EPEndpoint) dataAccessService.getDomainObject(EPEndpoint.class, ep.getEp_id(), null));
+               }
+               return list;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ConsulHealthService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ConsulHealthService.java
new file mode 100644 (file)
index 0000000..87d2071
--- /dev/null
@@ -0,0 +1,62 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.exceptions.NoHealthyServiceException;
+
+import com.ecwid.consul.ConsulException;
+import com.orbitz.consul.model.health.ServiceHealth;
+
+public interface ConsulHealthService {
+       /**
+        * This method returns the location of one healthy node if found in Consul -
+        * If not found in / by Consul, it falls back to 'localhost'
+        * 
+        * @param service
+        * @param fallbackPortOnLocalhost
+        *            value provided by the calling service
+        * @return Service location
+        */
+       public String getServiceLocation(String service, String fallbackPortOnLocalhost) throws NoHealthyServiceException;
+
+       public List<ServiceHealth> getAllHealthyNodes(String service) throws ConsulException;
+
+       public List<ServiceHealth> getAllNodes(String service) throws ConsulException;
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ConsulHealthServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ConsulHealthServiceImpl.java
new file mode 100644 (file)
index 0000000..ebb4376
--- /dev/null
@@ -0,0 +1,114 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.stereotype.Component;
+
+import com.ecwid.consul.ConsulException;
+import com.orbitz.consul.Consul;
+import com.orbitz.consul.HealthClient;
+import com.orbitz.consul.model.health.ServiceHealth;
+
+@Component
+public class ConsulHealthServiceImpl implements ConsulHealthService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ConsulHealthServiceImpl.class);
+
+       @Override
+       public String getServiceLocation(String service, String fallbackPortOnLocalHost) {
+
+               List<ServiceHealth> nodes = null;
+
+               try {
+                       Consul consul = Consul.builder().build();
+                       HealthClient healthClient = consul.healthClient();
+                       nodes = healthClient.getHealthyServiceInstances(service).getResponse();
+               } catch (Exception e) {
+                       String localFallbackServiceLocation = EcompPortalUtils.localOrDockerHost() + ":" + fallbackPortOnLocalHost;
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       " problem getting nodes for service {1}. Defaulting to {2}. Exception: {3}", service,
+                                       localFallbackServiceLocation, e.getMessage());
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       " problem getting nodes for service {1}. Defaulting to {2}. Exception: {3}", service,
+                                       localFallbackServiceLocation, e);
+                       return localFallbackServiceLocation;
+               }
+
+               if (nodes == null || nodes.size() == 0) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "No healthy node found in the consul cluster running service " + service
+                                       + ". Defaulting to localhost");
+                       return EcompPortalUtils.localOrDockerHost() + ":" + fallbackPortOnLocalHost;
+               } else {
+                       String locationFromConsul;
+                       ServiceHealth node = nodes.get(0);
+                       locationFromConsul = node.getNode().getNode() + ":" + node.getService().getPort();
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "Found healthy service location using consul - returning location " + locationFromConsul);
+
+                       // if locationFromConsul is null for some reason (very unlikely at
+                       // this point), default to localhost
+                       if (null == locationFromConsul || "".equals(locationFromConsul)) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "Couldn't get location from consul for service " + service + ". Defaulting to localhost");
+                               return "localhost:" + fallbackPortOnLocalHost;
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Found service location from consul for service " + service
+                                               + ". Location is " + locationFromConsul);
+                               return locationFromConsul;
+                       }
+               }
+       }
+
+       @Override
+       public List<ServiceHealth> getAllHealthyNodes(String service) throws ConsulException {
+               Consul consul = Consul.builder().build();
+               HealthClient healthClient = consul.healthClient();
+               return healthClient.getHealthyServiceInstances(service).getResponse();
+       }
+
+       @Override
+       public List<ServiceHealth> getAllNodes(String service) {
+               Consul consul = Consul.builder().build();
+               HealthClient healthClient = consul.healthClient();
+               return healthClient.getAllServiceInstances(service).getResponse();
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/DashboardSearchService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/DashboardSearchService.java
new file mode 100644 (file)
index 0000000..82a40b7
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+
+public interface DashboardSearchService {
+       public Map<String, List<SearchResultItem>> searchResults(String userId, String searchString);
+       public List<String> getRelatedUsers(String userId);
+       
+       public CommonWidgetMeta getWidgetData(String resourceType);
+       public String saveWidgetDataBulk(CommonWidgetMeta commonWidgetMetaData);
+       public String saveWidgetData(CommonWidget commonWidgetData);
+       public String deleteWidgetData(CommonWidget eventWidget);       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/DashboardSearchServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/DashboardSearchServiceImpl.java
new file mode 100644 (file)
index 0000000..776bd61
--- /dev/null
@@ -0,0 +1,117 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+@Component
+public class DashboardSearchServiceImpl implements DashboardSearchService {
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       public Map<String, List<SearchResultItem>> searchResults(String userId, String searchString) {
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);
+               params.put("searchQuery", searchString);
+               // Named query is stored in a *.hbm.xml file, mapped to SearchResultItem
+               @SuppressWarnings("unchecked")
+               List<SearchResultItem> list = dataAccessService.executeNamedQuery("searchPortal", params, null);
+               Map<String, List<SearchResultItem>> finalJson = null;
+               if (list.size() > 0) {
+                       finalJson = new HashMap<String, List<SearchResultItem>>();
+                       for (SearchResultItem thisResult : list) {
+                               List<SearchResultItem> thisList = finalJson.get(thisResult.getCategory().toLowerCase());
+                               if (thisList == null)
+                                       thisList = new ArrayList<SearchResultItem>();
+                               thisList.add(thisResult);
+                               finalJson.put(thisResult.getCategory().toLowerCase(), thisList);
+                       }
+               }
+               return finalJson;
+       }
+
+       @Override
+       public List<String> getRelatedUsers(String userId) {
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);
+               @SuppressWarnings("unchecked")
+               List<String> activeUsers = dataAccessService.executeNamedQuery("relatedUsers", params, null);
+               return activeUsers;
+       }
+
+       @Override
+       public CommonWidgetMeta getWidgetData(String resourceType) {
+               Map<String, String> params = new HashMap<>();
+               params.put("cat", resourceType);
+               @SuppressWarnings("unchecked")
+               List<CommonWidget> widgetItems = (List<CommonWidget>) dataAccessService.executeNamedQuery("getCommonWidgetItem", params, null);
+               return new CommonWidgetMeta(resourceType, widgetItems);
+       }
+
+       @Override
+       public String saveWidgetDataBulk(CommonWidgetMeta commonMetaWidgetData) {
+               for (CommonWidget widgetData : commonMetaWidgetData.getItems()) {
+                       widgetData.setCategory(commonMetaWidgetData.getCategory());
+                       dataAccessService.saveDomainObject(widgetData, null);
+               }
+               return "success";
+       }
+
+       @Override
+       public String saveWidgetData(CommonWidget commonWidgetData) {
+               dataAccessService.saveDomainObject(commonWidgetData, null);
+               return "success";
+       }
+
+       @Override
+       public String deleteWidgetData(CommonWidget eventWidget) {
+               dataAccessService.deleteDomainObject(eventWidget, null);
+               return "success";
+       }
+}
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
new file mode 100644 (file)
index 0000000..8c055b2
--- /dev/null
@@ -0,0 +1,1666 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.AdminUserApp;
+import org.onap.portalapp.portal.domain.AdminUserApplications;
+import org.onap.portalapp.portal.domain.AppIdAndNameTransportModel;
+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.EPUserAppRolesRequest;
+import org.onap.portalapp.portal.domain.EPUserAppRolesRequestDetail;
+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.UserRole;
+import org.onap.portalapp.portal.domain.UserRoles;
+import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.transport.EPAppsManualPreference;
+import org.onap.portalapp.portal.transport.EPAppsSortPreference;
+import org.onap.portalapp.portal.transport.EPDeleteAppsManualSortPref;
+import org.onap.portalapp.portal.transport.EPWidgetsSortPreference;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.LocalRole;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.portal.ueb.EPUebHelper;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+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.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.att.nsa.apiClient.http.HttpException;
+import com.att.nsa.cambria.client.CambriaClient.CambriaApiException;
+import com.att.nsa.cambria.client.CambriaClientBuilders;
+import com.att.nsa.cambria.client.CambriaIdentityManager;
+import com.att.nsa.cambria.client.CambriaTopicManager;
+import com.google.common.primitives.Ints;
+
+public class EPAppCommonServiceImpl implements EPAppService {
+
+       protected String ECOMP_APP_ID = "1";
+       protected String SUPER_ADMIN_ROLE_ID = "1";
+       protected String ACCOUNT_ADMIN_ROLE_ID = "999";
+       protected String RESTRICTED_APP_ROLE_ID = "900";
+
+       private static final String urlField = "url";
+       private static final String nameField = "name";
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAppCommonServiceImpl.class);
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+       @Autowired
+       protected SessionFactory sessionFactory;
+       @Autowired
+       private DataAccessService dataAccessService;
+       @Autowired
+       private EPUebHelper epUebHelper;        
+
+       @PostConstruct
+       private void init() {
+               SUPER_ADMIN_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.SYS_ADMIN_ROLE_ID);
+               ACCOUNT_ADMIN_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID);
+               ECOMP_APP_ID = SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID);
+               RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.RESTRICTED_APP_ROLE_ID);
+       }
+
+       @Override
+       public List<EPApp> getUserAsAdminApps(EPUser user) {
+               if (adminRolesService.isAccountAdmin(user)) {
+                       String sql = "SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID=FN_APP.APP_ID where "
+                                       + "FN_USER_ROLE.USER_ID=" + user.getId() + " AND FN_USER_ROLE.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
+                                       + " AND FN_APP.ENABLED = 'Y'";
+                       logQuery(sql);
+                       try {
+                               @SuppressWarnings("unchecked")
+                               List<EPApp> adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null);
+                               return adminApps;
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                               return null;
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "getUserAsAdminApps: only Account Admin may invoke this function!");
+                       return new ArrayList<EPApp>();
+               }
+       }
+
+       @Override
+       public List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId) {
+               String format = "SELECT * FROM FN_APP app INNER JOIN FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
+                               + "INNER JOIN FN_USER user on user.USER_ID = userrole.USER_ID "
+                               + "WHERE user.org_user_id = '%s' AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
+                               + " AND FN_APP.ENABLED = 'Y'";
+
+               String sql = String.format(format, orgUserId);
+               logQuery(sql);
+
+               try {
+                       @SuppressWarnings("unchecked")
+                       List<EPApp> adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null);
+                       return adminApps;
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       return null;
+               }
+       }
+
+       @Override
+       public List<EPApp> getAppsFullList() {
+               @SuppressWarnings("unchecked")
+               List<EPApp> apps = dataAccessService.getList(EPApp.class, null);
+               return apps;
+       }
+
+       @Override
+       public List<EcompApp> getEcompAppAppsFullList() {
+               return transformAppsToEcompApps(getAppsFullList());
+       }
+
+       @Override
+       public List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList) {
+               List<EcompApp> ecompAppList = new ArrayList<EcompApp>();
+               for (EPApp app : appsList) {
+                       EcompApp ecompApp = new EcompApp();
+                       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.setUebTopicName(app.getUebTopicName());
+                       ecompApp.setUebKey(app.getUebKey());
+                       ecompApp.setUebSecret(app.getUebSecret());
+                       ecompApp.setEnabled(app.getEnabled());
+                       ecompApp.setCentralAuth(app.getCentralAuth());
+                       ecompApp.setNameSpace(app.getNameSpace());
+                       ecompApp.setRestrictedApp(app.isRestrictedApp());
+                       ecompAppList.add(ecompApp);
+               }
+               return ecompAppList;
+       }
+
+       @Override
+       public EPApp getApp(Long appId) {
+               try {
+                       return (EPApp) dataAccessService.getDomainObject(EPApp.class, appId, null);
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       return null;
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<AppIdAndNameTransportModel> getAdminApps(EPUser user) {
+               if (adminRolesService.isAccountAdmin(user)) {
+                       String format = "SELECT app.APP_ID, app.APP_NAME, app.APP_TYPE FROM FN_APP app inner join FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
+                                       + "where userrole.USER_ID = %d AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
+                                       + " AND (app.ENABLED = 'Y' OR app.APP_ID=1)";
+                       String sql = String.format(format, user.getId());
+                       // sql += " AND app.APP_REST_ENDPOINT IS NOT NULL AND
+                       // app.APP_REST_ENDPOINT <> ''";
+                       logQuery(sql);
+                       try {
+                               return dataAccessService.executeSQLQuery(sql, AppIdAndNameTransportModel.class, null);
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Exception occurred while fetching the adminApps for user " + user.getLoginId(), e);
+                       }
+               }
+               return new ArrayList<AppIdAndNameTransportModel>();
+       }
+
+       @Override
+       public EPApp getAppDetail(String appName) {
+               final Map<String, String> params = new HashMap<String, String>();
+               try {
+                       params.put("appName", appName);
+                       @SuppressWarnings("unchecked")
+                       List<EPApp> apps = (List<EPApp>) dataAccessService.executeNamedQuery("getMyloginAppDetails", params, null);
+                       return (apps.size() > 0) ? apps.get(0) : null;
+               } catch(Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       return null;
+               }
+       }
+       
+       @Override
+       public EPApp getAppDetailByAppName(String appName) {
+               final Map<String, String> params = new HashMap<String, String>();
+               try {
+                       params.put("appName", appName);
+                       @SuppressWarnings("unchecked")
+                       List<EPApp> apps = (List<EPApp>) dataAccessService.executeNamedQuery("getAppDetailsByAppName", params, null);
+                       if (apps.size() > 0) {
+                               EPApp app = apps.get(0);
+                               if (!EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                       app.setCentralAuth(false);
+                               }
+                               return app;
+                       } else{
+                               return null;
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       return null;
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user) {
+               if (adminRolesService.isSuperAdmin(user) || adminRolesService.isAccountAdmin(user)) {
+                       String format = "";
+                       String sql = "";
+                       if (adminRolesService.isSuperAdmin(user)) {
+                               format = "SELECT app.APP_ID, app.APP_NAME, app.APP_TYPE FROM FN_APP app "
+                                               + "where app.ENABLED = 'Y' AND app.app_type = 1";
+                       } else {
+                               format = "SELECT app.APP_ID, app.APP_NAME, APP_TYPE FROM FN_APP app inner join FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
+                                               + "where userrole.USER_ID = %d AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
+                                               + " AND app.ENABLED = 'Y' AND app.app_type = 1";
+                       }
+                       sql = String.format(format, user.getId());
+                       // sql += " AND app.APP_REST_ENDPOINT IS NOT NULL AND
+                       // app.APP_REST_ENDPOINT <> ''";
+                       logQuery(sql);
+                       try {
+                               return dataAccessService.executeSQLQuery(sql, AppIdAndNameTransportModel.class, null);
+                       } catch (Exception e) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Exception occurred while fetching the adminApps for user " + user.getLoginId(), e);
+                       }
+               }
+               return new ArrayList<AppIdAndNameTransportModel>();
+       }
+
+       protected void logQuery(String sql) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "logQuery: " + sql);
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<AdminUserApplications> getAppsAdmins() {
+               try {
+                       Map<String, String> params = new HashMap<>();
+                       params.put("accountAdminRoleId", ACCOUNT_ADMIN_ROLE_ID);
+                       List<AdminUserApp> adminApps = (List<AdminUserApp>) dataAccessService.executeNamedQuery("getAppsAdmins",
+                                       params, null);
+                       return aggregateRowsResultsByUserId(adminApps);
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       return null;
+               }
+       }
+
+       private List<AdminUserApplications> aggregateRowsResultsByUserId(List<AdminUserApp> adminApps) {
+               HashMap<Long, AdminUserApplications> adminUserApplications = new HashMap<Long, AdminUserApplications>();
+               for (AdminUserApp app : adminApps) {
+                       Long userId = app.getUser_Id();
+                       if (adminUserApplications.get(userId) == null)
+                               adminUserApplications.put(userId, new AdminUserApplications(app));
+                       else
+                               adminUserApplications.get(userId).addApp(app.getAppId(), app.getAppName());
+               }
+               return new ArrayList<AdminUserApplications>(adminUserApplications.values());
+       }
+
+       @Override
+       public List<AppsResponse> getAllApps(Boolean all) {
+               // If all is true, return both active and inactive apps. Otherwise, just
+               // active apps.
+               @SuppressWarnings("unchecked")
+               // Sort the list by application name so the drop-down looks pretty.
+               List<EPApp> apps = all
+                               ? (List<EPApp>) dataAccessService.getList(EPApp.class, " where id != " + ECOMP_APP_ID, "name", null)
+                               : (List<EPApp>) dataAccessService.getList(EPApp.class,
+                                               " where ( enabled = 'Y' or id = " + ECOMP_APP_ID + ")", "name", null);
+
+               List<AppsResponse> appsModified = new ArrayList<AppsResponse>();
+               for (EPApp app : apps) {
+                       appsModified.add(new AppsResponse(app.getId(), app.getName(), app.isRestrictedApp(), app.getEnabled()));
+               }
+               return appsModified;
+       }
+
+       @Override
+       public UserRoles getUserProfile(String loginId) {
+               final Map<String, String> params = new HashMap<>();
+               params.put("org_user_id", loginId);
+               @SuppressWarnings("unchecked")
+               List<UserRole> userRoleList = dataAccessService.executeNamedQuery( "getUserRoles", params, null);
+               ArrayList<UserRoles> usersRolesList = aggregateUserProfileRowsResultsByRole(userRoleList);
+               if (usersRolesList == null || usersRolesList.size() < 1)
+                       return null;
+
+               return usersRolesList.get(0);
+       }
+
+       @Override
+       public UserRoles getUserProfileNormalized(EPUser user) {
+               // Check database.
+               UserRoles userAndRoles = getUserProfile(user.getLoginId());
+               // If no roles are defined, treat this user as a guest.
+               if (user.isGuest() || userAndRoles == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getUserProfile: treating user {} as guest",
+                                       user.getLoginId());
+                       UserRole userRole = new UserRole();
+                       userRole.setUser_Id(user.getId());
+                       userRole.setOrgUserId(user.getLoginId());
+                       userRole.setFirstName(user.getFirstName());
+                       userRole.setLastName(user.getLastName());
+                       userRole.setRoleId(-1L);
+                       userRole.setRoleName("Guest");
+                       userRole.setUser_Id(-1L);
+                       userAndRoles = new UserRoles(userRole);
+               }
+
+               return userAndRoles;
+       }
+
+       protected ArrayList<UserRoles> aggregateUserProfileRowsResultsByRole(List<UserRole> userRoleList) {
+               HashMap<String, UserRoles> userRoles = new HashMap<String, UserRoles>();
+               for (UserRole user : userRoleList) {
+                       String orgUserId = user.getOrgUserId();
+                       if (userRoles.get(orgUserId) == null)
+                               userRoles.put(orgUserId, new UserRoles(user));
+                       else
+                               userRoles.get(orgUserId).addRole(user.getRoleName());
+               }
+               return new ArrayList<UserRoles>(userRoles.values());
+       }
+
+       private boolean isRestrictedApp(Long appId) {
+               EPApp app = getApp(appId);
+               return app.isRestrictedApp();
+       }
+
+       // For the functional menu edit
+       @Override
+       public List<LocalRole> getAppRoles(Long appId) {
+               String sql = "";
+               if (isRestrictedApp(appId)) {
+                       sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where UPPER(ACTIVE_YN) = 'Y' AND ROLE_ID = '" + RESTRICTED_APP_ROLE_ID + "'";
+               }else if(appId == 1){
+                       sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where UPPER(ACTIVE_YN) = 'Y' AND APP_ID IS NULL";
+               }else{
+                       sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where UPPER(ACTIVE_YN) = 'Y' AND APP_ID = '" + appId + "'";
+               }
+               logQuery(sql);
+               @SuppressWarnings("unchecked")
+               List<LocalRole> appRoles = dataAccessService.executeSQLQuery(sql, LocalRole.class, null);
+               return appRoles;
+       }
+
+       protected String userAppsQuery(EPUser user) {
+               StringBuilder query = new StringBuilder();
+               if (adminRolesService.isSuperAdmin(user)) {
+                       query.append("SELECT * FROM FN_APP where FN_APP.ENABLED = 'Y' ORDER BY APP_NAME");
+               } else {
+                       query.append("SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where ");
+                       query.append(
+                                       "FN_USER_ROLE.USER_ID = " + user.getId() + " AND FN_USER_ROLE.ROLE_ID != " + SUPER_ADMIN_ROLE_ID);
+                       query.append(" AND FN_APP.ENABLED = 'Y'");
+               }
+               return query.toString();
+       }
+
+       protected FieldsValidator onboardingAppFieldsChecker(OnboardingApp onboardingApp) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               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 && onboardingApp.id.equals(ECOMP_APP_ID))
+                               // For a normal app (appType==1), these fields must be filled
+                               // in.
+                               // For a restricted app (appType==2), they will be empty.
+                               || ((!onboardingApp.restrictedApp)
+                                               && (onboardingApp.username == null || onboardingApp.username.length() == 0
+                                                               || onboardingApp.appPassword == null || onboardingApp.appPassword.length() == 0))) {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+               }
+               return fieldsValidator;
+       }
+
+       @Override
+       public List<EPApp> getUserApps(EPUser user) {
+               List<EPApp> openApps = getOpenApps();
+
+               if (user.isGuest()) {
+                       return openApps;
+               } else {
+                       String sql = userAppsQuery(user);
+                       logQuery(sql);
+
+                       // TreeSet<EPApp> distinctApps = new TreeSet<EPApp>();
+                       List<EPApp> appsList = new ArrayList<>();
+                       @SuppressWarnings("unchecked")
+                       List<EPApp> adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null);
+                       HashSet<EPApp> appSet = new HashSet<>();
+                       for (EPApp app : adminApps) {
+                               appSet.add(app);
+                               appsList.add(app);
+                       }
+
+                       for (EPApp app : openApps) {
+                               if (!appSet.contains(app))
+                                       appsList.add(app);
+                       }
+
+                       return appsList;
+               }
+       }
+
+       @Override
+       public List<EPApp> getPersAdminApps(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               params.put("userId", user.getId());
+               // Named query is stored in EP.hbm.xml, mapped to EPApp
+               @SuppressWarnings("unchecked")
+               List<EPApp> list = dataAccessService.executeNamedQuery("getPersAdminApps", params, null);
+               return list;
+       }
+
+       @Override
+       public List<EPApp> getPersUserApps(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               params.put("userId", user.getId());
+               // Named query is stored in EP.hbm.xml, mapped to EPApp
+               @SuppressWarnings("unchecked")
+               List<EPApp> list = dataAccessService.executeNamedQuery("getPersUserApps", params, null);
+               return list;
+       }
+
+       /*
+        * (non-Javadoc)
+        *
+        * @see
+        * org.openecomp.portalapp.portal.service.EPAppService#getAppCatalog(
+        * org.openecomp.portalapp.portal.domain.EPUser)
+        */
+       @Override
+       public List<AppCatalogItem> getUserAppCatalog(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               params.put("userId", user.getId());
+               // Named query is stored in EP.hbm.xml, mapped to AppCatalogItem
+               @SuppressWarnings("unchecked")
+               List<AppCatalogItem> list = dataAccessService.executeNamedQuery("getUserAppCatalog", params, null);
+               return list;
+       }
+
+       /*
+        * (non-Javadoc)
+        *
+        * @see
+        * org.openecomp.portalapp.portal.service.EPAppService#getAdminAppCatalog(
+        * org.openecomp.portalapp.portal.domain.EPUser)
+        */
+       @Override
+       public List<AppCatalogItem> getAdminAppCatalog(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               params.put("userId", user.getId());
+               // Named query is stored in EP.hbm.xml, mapped to AppCatalogItem
+               @SuppressWarnings("unchecked")
+               List<AppCatalogItem> list = dataAccessService.executeNamedQuery("getAdminAppCatalog", params, null);
+               return list;
+       }
+
+       private List<EPApp> getOpenApps() {
+               @SuppressWarnings("unchecked")
+               List<EPApp> openApps = dataAccessService.getList(EPApp.class, " where open='Y' and enabled='Y'", null, null);
+               return openApps;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPApp> getAppsOrderByName(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               List<EPApp> sortedAppsByName = null;
+               try {
+                       if (adminRolesService.isSuperAdmin(user)) {
+                               params.put("userId", user.getId());
+                               sortedAppsByName = dataAccessService.executeNamedQuery("getPersAdminAppsOrderByName", params, null);
+                       } else {
+                               params.put("userId", user.getId());
+                               sortedAppsByName = dataAccessService.executeNamedQuery("getPersUserAppsOrderByName", params, null);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByName failed", e);
+               }
+               return sortedAppsByName;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPApp> getAppsOrderByLastUsed(EPUser user) {
+
+               final Map<String, Long> params = new HashMap<>();
+               List<EPApp> sortedAppsByLastUsed = new ArrayList<EPApp>();
+               List<EPApp> finalsortedAppsByLastUsed = new ArrayList<EPApp>();
+               try {
+                       if (adminRolesService.isSuperAdmin(user)) {
+                               params.put("userId", user.getId());
+                               sortedAppsByLastUsed = dataAccessService.executeNamedQuery("getAdminAppsOrderByLastUsed", params, null);
+                       } else {
+                               params.put("userId", user.getId());
+                               sortedAppsByLastUsed = dataAccessService.executeNamedQuery("getUserAppsOrderByLastUsed", params, null);
+                       }
+                       Set<String> epAppSet = new HashSet<String>();
+                       for (EPApp eapp : sortedAppsByLastUsed)
+                               if (!epAppSet.contains(eapp.getName())) {
+                                       finalsortedAppsByLastUsed.add(eapp);
+                                       epAppSet.add(eapp.getName());
+                               }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByLastUsed failed", e);
+               }
+               return finalsortedAppsByLastUsed;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPApp> getAppsOrderByMostUsed(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               List<EPApp> sortedAppsByMostUsed = new ArrayList<EPApp>();
+               List<EPApp> finalsortedAppsByMostUsed = new ArrayList<EPApp>();
+               try {
+                       if (adminRolesService.isSuperAdmin(user)) {
+                               params.put("userId", user.getId());
+                               sortedAppsByMostUsed = dataAccessService.executeNamedQuery("getAdminAppsOrderByMostUsed", params, null);
+                       } else {
+                               params.put("userId", user.getId());
+                               sortedAppsByMostUsed = dataAccessService.executeNamedQuery("getUserAppsOrderByMostUsed", params, null);
+                       }
+                       Set<String> epAppSet = new HashSet<String>();
+
+                       for (EPApp eapp : sortedAppsByMostUsed) {
+                               if (!epAppSet.contains(eapp.getName())) {
+                                       finalsortedAppsByMostUsed.add(eapp);
+                                       epAppSet.add(eapp.getName());
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByMostUsed failed", e);
+               }
+
+               return finalsortedAppsByMostUsed;
+       }
+
+       /*
+        * This Method retrieves the User Apps by Sort Manual Preference
+        *
+        * @param: user--contains LoggedIn User Data
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPApp> getAppsOrderByManual(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               List<EPApp> sortedAppsByManual = new ArrayList<EPApp>();
+               List<EPApp> finalsortedAppsByManual = new ArrayList<EPApp>();
+               try {
+                       if (adminRolesService.isSuperAdmin(user)) {
+                               params.put("userId", user.getId());
+                               sortedAppsByManual = dataAccessService.executeNamedQuery("getAdminAppsOrderByManual", params, null);
+                       } else {
+                               params.put("userId", user.getId());
+                               sortedAppsByManual = dataAccessService.executeNamedQuery("getUserAppsOrderByManual", params, null);
+                       }
+                       Set<String> epAppSet = new HashSet<String>();
+
+                       for (EPApp eapp : sortedAppsByManual) {
+                               if (!epAppSet.contains(eapp.getName())) {
+                                       finalsortedAppsByManual.add(eapp);
+                                       epAppSet.add(eapp.getName());
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByManual failed", e);
+               }
+               return finalsortedAppsByManual;
+       }
+
+       @Override
+       public List<OnboardingApp> getOnboardingApps() {
+               @SuppressWarnings("unchecked")
+               List<EPApp> apps = dataAccessService.getList(EPApp.class, " where id!=" + ECOMP_APP_ID, null, null);
+               List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
+               for (EPApp app : apps) {
+                       OnboardingApp onboardingApp = new OnboardingApp();
+                       createOnboardingFromApp(app, onboardingApp);
+                       onboardingAppsList.add(onboardingApp);
+               }
+               return onboardingAppsList;
+       }
+
+       @Override
+       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);
+               List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
+               for (EPApp app : apps) {
+                       OnboardingApp onboardingApp = new OnboardingApp();
+                       createOnboardingFromApp(app, onboardingApp);
+                       onboardingAppsList.add(onboardingApp);
+               }
+               return onboardingAppsList;
+       }
+
+       @SuppressWarnings("unchecked")
+       private void validateOnboardingApp(OnboardingApp onboardingApp, FieldsValidator fieldsValidator) {
+               boolean duplicatedUrl = false;
+               boolean duplicatedName = false;
+               List<EPApp> apps;
+               if (onboardingApp.id == null) {
+                       List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                       Criterion urlCrit =Restrictions.eq("url", onboardingApp.url);
+                       Criterion nameCrit = Restrictions.eq("name",onboardingApp.name);                        
+                       Criterion orCrit = Restrictions.or(urlCrit, nameCrit);
+                       
+                       restrictionsList.add(orCrit);
+                       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 urlCrit =Restrictions.eq("url", onboardingApp.url);
+                       Criterion nameCrit = Restrictions.eq("name",onboardingApp.name);                        
+                       Criterion orCrit = Restrictions.or(idCrit, urlCrit, nameCrit);
+                       
+                       restrictionsList.add(orCrit);
+                       apps = (List<EPApp>) dataAccessService.getList(EPApp.class, null, restrictionsList, null);
+                       
+               }
+               for (EPApp app : apps) {
+                       if (onboardingApp.id != null && onboardingApp.id.equals(app.getId())) {
+                               continue;
+                       }
+                       if (!duplicatedUrl && app.getUrl().equalsIgnoreCase(onboardingApp.url)) {
+                               duplicatedUrl = true;
+                               if (duplicatedName) {
+                                       break;
+                               }
+                       }
+                       if (!duplicatedName && app.getName().equalsIgnoreCase(onboardingApp.name)) {
+                               duplicatedName = true;
+                               if (duplicatedUrl) {
+                                       break;
+                               }
+                       }
+               }
+               if (duplicatedUrl || duplicatedName) {
+                       if (duplicatedUrl) {
+                               fieldsValidator.addProblematicFieldName(urlField);
+                       }
+                       if (duplicatedName) {
+                               fieldsValidator.addProblematicFieldName(nameField);
+                       }
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
+                       fieldsValidator.errorCode = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
+               }
+       }
+
+       @Override
+       public FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "LR: entering modifyOnboardingApp");
+               FieldsValidator fieldsValidator = onboardingAppFieldsChecker(modifiedOnboardingApp);
+               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                       validateOnboardingApp(modifiedOnboardingApp, fieldsValidator);
+               }
+               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                       if (modifiedOnboardingApp.id != null) {
+                               updateApp(modifiedOnboardingApp.id, modifiedOnboardingApp, fieldsValidator, user);
+                       } else {
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+                       }
+               }
+               return fieldsValidator;
+       }
+
+       @Override
+       public FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user) {
+               FieldsValidator fieldsValidator = onboardingAppFieldsChecker(newOnboardingApp);
+               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                       validateOnboardingApp(newOnboardingApp, fieldsValidator);
+               }
+               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                       if (newOnboardingApp.id == null) {
+                               updateApp(null, newOnboardingApp, fieldsValidator, user);
+                       } else {
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+                       }
+               }
+               return fieldsValidator;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public FieldsValidator deleteOnboardingApp(EPUser user, Long appid) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_FORBIDDEN);
+                       return fieldsValidator;
+               }
+               final Map<String, Long> params = new HashMap<>();
+               params.put("app_id", appid);
+               List<EPUserAppRolesRequest> EPUserAppRolesRequestList= new ArrayList<>();
+               EPUserAppRolesRequestList = dataAccessService.executeNamedQuery( "getRequestIdsForApp", params, null);
+           for(int i=0;i<EPUserAppRolesRequestList.size();i++)
+           {
+            dataAccessService.deleteDomainObjects(EPUserAppRolesRequestDetail.class , "req_id=" + EPUserAppRolesRequestList.get(i).getId(),null);
+               
+           }
+           Session localSession = null;
+               Transaction transaction = null;
+               Boolean result = false;
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       
+                       // 1) Remove the URL for any functional menu item associated with
+                       // this app
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting URL for any functional menu item associated with app");
+                       // Named query is stored in EP.hbm.xml, mapped to EPApp
+                        dataAccessService.executeNamedQuery("updateMenuFunctionalAndRoles", params, null);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp:  Deleted URL for any functional menu item associated with app");
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting favorites associated with a menu item that is associated with this app");
+                       // 2)Remove any favorites associated with a menu item that is
+                       // associated with this app
+                       dataAccessService.executeNamedQuery("removeAppFromMenuFavorites", params, null);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted favorites associated with a menu item that is associated with this app");
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting role, appid records from fn_menu_functional_role that are associated with this app");
+                       // 3)Remove all role, appid records from fn_menu_functional_role
+                       // that are associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromMenuFunctionalRoles", params, null);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted role, appid records from fn_menu_functional_role that are associated with this app");
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting all roles, rolefunctions, appid records from ep_app_role_function that are associated with this app");
+                       // 4)Remove all roles, rolefunctions, appid records from ep_app_role_function
+                       // that are associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromEpAppRoleFunction", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted all roles, rolefunctions, appid records from ep_app_role_function that are associated with this app");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting all rolefunctions, appid records from ep_app_function that are associated with this app");
+                       // 5)Remove all rolefunctions, appid records from ep_app_function
+                       // that are associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromEpAppFunction", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp:  Deleted all rolefunctions, appid records from ep_app_function that are associated with this app");
+        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting all records from fn_user_role associated with this app");
+                       // 6)Remove all records from fn_user_role associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromFnUserRole", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted all records from fn_user_role associated with this app");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting any widgets associated with this app");
+                       // 7)Remove any widgets associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromEpWidgetCatalogRole", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted widgets associated with this app");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting any roles associated with this app");
+                       // 8)Remove any roles associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromEpRoleNotification", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted roles associated with this app");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting all records from fn_role associated with this app");
+                       // 9)Remove all records from fn_role associated with this app
+                        dataAccessService.executeNamedQuery("removeAppFromFnRole", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted all records from fn_role associated with this app");
+                       
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting in table fn_app_contact_us entries associated with this app");
+                        // 10)Remove app contact us entries
+                        dataAccessService.executeNamedQuery("removeAppFromAppContactUs", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted in table fn_app_contact_us entries associated with this app");
+
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting rows in the fn_pers_user_app_sel table");
+                       // 11)Remove rows in the app personalization selection table
+                        dataAccessService.executeNamedQuery("removeAppFromEpPersUserAppSel", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted rows in the fn_pers_user_app_sel table");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting rows in the ep_pers_user_app_man_sort table");
+                       // 12)Remove rows in the app personalization sort table
+                        dataAccessService.executeNamedQuery("removeAppFromEpPersUserAppManSort", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted rows in the ep_pers_user_app_man_sort table");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting rows in the ep_user_roles_request table");
+                       // 13)Remove rows in the app personalization sort table
+                        dataAccessService.executeNamedQuery("removeAppFromEpUserRolesRequest", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted rows in the ep_user_roles_request table");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting rows in the ep_web_analytics_source");
+                       // 14)Remove rows in the ep_web_analytics_source
+                        dataAccessService.executeNamedQuery("removeAppFromEpWebAnalytics", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted rows in the ep_web_analytics_source");
+                        
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleting the app ");
+                       // 15)Delete the app
+                        dataAccessService.executeNamedQuery("removeAppFromFnApp", params, null);
+                        logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp: Deleted the app");
+                       
+                       /*
+                       // 1) Remove the URL for any functional menu item associated with
+                       // this app
+                       String sql = "UPDATE fn_menu_functional m, fn_menu_functional_roles mr SET m.url='' "
+                                       + " WHERE m.menu_id=mr.menu_id " + " AND mr.app_id='" + appid + "'";
+                       logQuery(sql);
+                       Query query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove any favorites associated with a menu item that is
+                       // associated with this app
+                       sql = "Delete from fn_menu_favorites " + " using fn_menu_favorites inner join fn_menu_functional_roles "
+                                       + " where fn_menu_functional_roles.app_id='" + appid + "' "
+                                       + " AND fn_menu_functional_roles.menu_id=fn_menu_favorites.menu_id";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove all role, appid records from fn_menu_functional_role
+                       // that are associated with this app
+                       sql = "delete from fn_menu_functional_roles where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       
+                       
+                       // Remove all roles, rolefunctions, appid records from ep_app_role_function
+                       // that are associated with this app
+                   sql = "DELETE FROM ep_app_role_function WHERE app_id='" + appid + "'";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                        query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       
+                       //Remove all rolefunctions, appid records from ep_app_function
+                       // that are associated with this app
+                       sql = "DELETE FROM ep_app_function WHERE app_id='" + appid + "'";
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove all records from fn_user_role associated with this app
+                       sql = "delete from fn_user_role where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove any widgets associated with this app
+                       sql = "delete from ep_widget_catalog_role where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove any roles associated with this app
+                       sql = "delete from ep_role_notification " + " using ep_role_notification inner join fn_role "
+                                       + " where fn_role.app_id='" + appid + "' " + " and ep_role_notification.role_id= fn_role.role_id";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove all records from fn_role associated with this app
+                       sql = "delete from fn_role where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove app contact us entries
+                       sql = "delete from fn_app_contact_us where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove rows in the app personalization selection table
+                       sql = "delete from fn_pers_user_app_sel where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove rows in the app personalization sort table
+                       sql = "delete from ep_pers_user_app_man_sort where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove rows in the app personalization sort table
+                       sql = "delete from ep_user_roles_request where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Remove rows in the app personalization sort table
+                       sql = "delete from ep_web_analytics_source where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Delete the app
+                       sql = "delete from fn_app where app_id='" + appid + "'";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       transaction.commit();
+                       */
+                       result = true;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteOnboardingApp success");
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteOnboardingApp failed", e);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
+                       EcompPortalUtils.rollbackTransaction(transaction, "deleteOnboardingApp rollback, exception = " + e);
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "deleteOnboardingApp");
+               }
+               if (!result) {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       private static Object syncRests = new Object();
+
+       // An app has been enabled/disabled. Must enable/disable all associated
+       // functional menu items.
+       protected void setFunctionalMenuItemsEnabled(Session localSession, Boolean enabled, Long appId) {
+               String active_yn = enabled ? "Y" : "N";
+               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 = '" + appId + "' ";
+               logQuery(sql);
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
+               for (FunctionalMenuItem menuItem : menuItems) {
+                       FunctionalMenuItem myMenuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class,
+                                       menuItem.menuId);
+                       myMenuItem.active_yn = active_yn;
+                       localSession.save(myMenuItem);
+               }
+       }
+
+       // Attention! If (appId == null) we use this function to create application
+       // otherwise we use it to modify existing application
+       protected void updateApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator, EPUser user) {
+               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) {
+                       boolean result = false;
+                       Session localSession = null;
+                       Transaction transaction = null;
+                       try {
+                               localSession = sessionFactory.openSession();
+                               transaction = localSession.beginTransaction();
+                               EPApp app;
+                               if (appId == null) {
+                                       app = new EPApp();
+                               } else {
+                                       app = (EPApp) localSession.get(EPApp.class, appId);
+                                       if (app == null || app.getId() == null) { // App is already
+                                               // deleted!
+                                               transaction.commit();
+                                               localSession.close();
+                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
+                                               return;
+                                       }
+                               }
+                               createAppFromOnboarding(app, onboardingApp, localSession);
+                               localSession.saveOrUpdate(app);
+                               // Enable or disable all menu items associated with this app
+                               setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
+                               transaction.commit();
+                               result = true;
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "updateApp failed", e);
+                               EcompPortalUtils.rollbackTransaction(transaction,
+                                               "updateApp rollback, exception = " + e.toString());
+                       } finally {
+                               EcompPortalUtils.closeLocalSession(localSession, "updateApp");
+                       }
+                       if (!result) {
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+
+               } else {
+                       updateRestrictedApp(appId, onboardingApp, fieldsValidator, user);
+                       
+               }
+       }
+
+       protected void updateRestrictedApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator,
+                       EPUser user) {
+               synchronized (syncRests) {
+                       boolean result = false;
+                       Session localSession = null;
+                       Transaction transaction = null;
+                       try {
+                               localSession = sessionFactory.openSession();
+                               transaction = localSession.beginTransaction();
+                               EPApp app;
+                               if (appId == null) {
+                                       app = new EPApp();
+                                       // -------------------------------------------------------------------------------------------
+                                       // Register this App with the UEB communication server.
+                                       // Save
+                                       // the App's unique mailbox/topic
+                                       // name and keys to the FN_APP table. The App's mailbox
+                                       // and
+                                       // keys will be visible to the
+                                       // admin on the ECOMP portal.
+                                       // -------------------------------------------------------------------------------------------
+                                       TopicManager topicManager = new TopicManager() {
+
+                                               EPAppCommonServiceImpl service;
+
+                                               public void init(EPAppCommonServiceImpl _service) {
+                                                       service = _service;
+                                               }
+
+                                               public void createTopic(String key, String secret, String topicName,
+                                                               String topicDescription) throws HttpException, CambriaApiException, IOException {
+
+                                                       init(EPAppCommonServiceImpl.this);
+                                                       final LinkedList<String> urlList = (LinkedList<String>) Helper.uebUrlList();
+                                                       if (logger.isInfoEnabled()) {
+                                                               logger.info("==> createTopic");
+                                                               logger.info("topicName: " + topicName);
+                                                               logger.info("topicDescription: " + topicDescription);
+                                                       }
+                                                       CambriaTopicManager tm = null;
+                                                       try {
+                                                               tm = service.getTopicManager(urlList, key, secret);
+                                                       } catch (Exception e) {
+                                                               logger.error("pub.build Exception ", e);
+                                                               throw new CambriaApiException(topicName);
+                                                       }
+                                                       tm.createTopic(topicName, topicDescription, 1, 1);
+                                               }
+
+                                               public void addPublisher(String topicOwnerKey, String topicOwnerSecret, String publisherKey,
+                                                               String topicName) throws HttpException, CambriaApiException, IOException {
+                                                       logger.info("==> addPublisher to topic " + topicName);
+                                                       final LinkedList<String> urlList = (LinkedList<String>) Helper.uebUrlList();
+                                                       CambriaTopicManager tm = null;
+                                                       try {
+                                                               tm = service.getTopicManager(urlList, topicOwnerKey, topicOwnerSecret);
+                                                       } catch (Exception e) {
+                                                               logger.error("pub.build Exception ", e);
+                                                               throw new CambriaApiException(topicName);
+                                                       }
+                                                       tm.allowProducer(topicName, publisherKey);
+                                               }
+
+                                       };
+                                       final CambriaIdentityManager im = new CambriaClientBuilders.IdentityManagerBuilder()
+                                                       .usingHosts(Helper.uebUrlList()).build();
+                                       com.att.nsa.apiClient.credentials.ApiCredential credential = im.createApiKey(user.getEmail(),
+                                                       "ECOMP Portal Owner");
+                                       String appKey = credential.getApiKey();
+                                       String appSecret = credential.getApiSecret();
+                                       String appMailboxName = null;
+
+                                       int maxNumAttemptsToCreateATopic = 3;
+                                       boolean successfullyCreatedMailbox = false;
+                                       for (int i = 0; i < maxNumAttemptsToCreateATopic; i++) {
+                                               appMailboxName = "ECOMP-PORTAL-OUTBOX-" + (int) (Math.random() * 100000.0);
+
+                                               try {
+                                                       topicManager.createTopic(
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
+                                                                       appMailboxName, "ECOMP outbox for app" + onboardingApp.name);
+                                                       successfullyCreatedMailbox = true;
+                                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                       "Successfully created " + appMailboxName + " for App " + onboardingApp.name);
+                                                       logger.debug(EELFLoggerDelegate.debugLogger, "    Key = " + appKey + " Secret = "
+                                                                       + appSecret + " generated using = " + user.getEmail());
+                                                       break;
+                                               } catch (HttpException e) {
+                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, e);
+                                                       if (e.getStatusCode() == 409) {
+                                                               logger.error(EELFLoggerDelegate.errorLogger, "Topic/mailbox " + appMailboxName
+                                                                               + " already exists. Will try using a different name", e);
+                                                       } else {
+                                                               logger.error(EELFLoggerDelegate.errorLogger, "HttpException when onboarding App: ",
+                                                                               e);
+                                                       }
+                                               }
+                                       }
+
+                                       if (successfullyCreatedMailbox) {
+                                               onboardingApp.setUebTopicName(appMailboxName);
+                                               onboardingApp.setUebKey(appKey);
+                                               onboardingApp.setUebSecret(appSecret);
+
+                                               try {
+                                                       /*
+                                                        * EP is a publisher to this App's new mailbox
+                                                        */
+                                                       topicManager.addPublisher(
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+                                                                       appMailboxName);
+
+                                                       /*
+                                                        * This App is a subscriber of its own mailbox
+                                                        */
+                                                       topicManager.addSubscriber(
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), appKey,
+                                                                       appMailboxName);
+
+                                                       /*
+                                                        * This App is a publisher to EP
+                                                        */
+                                                       topicManager.addPublisher(
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), appKey,
+                                                                       PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+                                               } catch (HttpException | CambriaApiException | IOException e) {
+                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "Error when configuring Publisher/Subscriber for App's new mailbox", e);
+                                                       transaction.commit();
+                                                       localSession.close();
+                                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
+                                                       return;
+                                               }
+                                       } else {
+                                               transaction.commit();
+                                               localSession.close();
+                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
+                                               return;
+                                       }
+                               } else {
+                                       app = (EPApp) localSession.get(EPApp.class, appId);
+                                       if (app == null || app.getId() == null) {
+                                               // App is already deleted!
+                                               transaction.commit();
+                                               localSession.close();
+                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
+                                               return;
+                                       }
+                               }
+                               logger.debug(EELFLoggerDelegate.debugLogger, "LR: about to call createAppFromOnboarding");
+                               createAppFromOnboarding(app, onboardingApp, localSession);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "LR: updateApp: finished calling createAppFromOnboarding");
+                               localSession.saveOrUpdate(app);
+                               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);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "LR: updateApp: finished calling setFunctionalMenuItemsEnabled");
+                               transaction.commit();
+                               logger.debug(EELFLoggerDelegate.debugLogger, "LR: updateApp: finished calling transaction.commit");
+                               epUebHelper.addPublisher(app);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "LR: updateApp: finished calling epUebHelper.addPublisher");
+                               result = true;
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "updateApp failed", e);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                               EcompPortalUtils.rollbackTransaction(transaction,
+                                               "updateApp rollback, exception = " + e.toString());
+                       } finally {
+                               EcompPortalUtils.closeLocalSession(localSession, "updateApp");
+                       }
+                       if (!result) {
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+               }
+
+       }
+
+       public CambriaTopicManager getTopicManager(List<String> urlList, String key, String secret)
+                       throws GeneralSecurityException, Exception {
+               throw new Exception("This method can only be invoked from child class");
+       }
+
+       /**
+        * Populates a transport model of the application from a database row model.
+        * Leaves out the thumbnail because the FE fetches images via a different
+        * API.
+        * 
+        * @param app
+        *            Model of database row
+        * @param onboardingApp
+        *            Model for transport as JSON
+        */
+       @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 = 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.setRestrictedApp(app.isRestrictedApp());
+               // if (app.getThumbnail() != null)
+               // onboardingApp.thumbnail = new
+               // String(Base64.getEncoder().encode(app.getThumbnail()));
+       }
+
+       /**
+        * Creates a database object for an application from an uploaded transport
+        * model. Must decode the thumbnail, if any.
+        * 
+        * @param app
+        * @param onboardingApp
+        * @param localSession
+        * @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);
+               app.setAppPassword(this.encryptedPassword(onboardingApp.appPassword, 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)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: onboarding thumbnail is NOT empty");
+                       String[] splitBase64Thumbnail = onboardingApp.thumbnail.split("base64,");
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "createAppFromOnboarding: length of splitBase64Thumbnail: " + splitBase64Thumbnail.length);
+                       if (splitBase64Thumbnail.length > 1) {
+                               // This occurs when we have a new image, not an existing image
+                               byte[] decodedImage = Base64.getDecoder().decode(splitBase64Thumbnail[1].getBytes());
+                               logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: finished calling decode");
+                               // This is basically a boolean indicator that an image is
+                               // present.
+                               app.setImageUrl(constructImageName(onboardingApp));
+                               app.setThumbnail(decodedImage);
+                       }
+               } else if (app.getThumbnail() != null && onboardingApp.imageLink == null) {
+                       // The thumbnail that came in from the json is empty; the previous
+                       // thumbnail is NOT empty. Must delete it.
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "createAppFromOnboarding: onboarding thumbnail is empty; db thumbnail is NOT null");
+                       app.setImageUrl(null);
+                       app.setThumbnail(null);
+               } else {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "createAppFromOnboarding: making no changes to thumbnail as imageLink is not null");
+               }
+               return app;
+       }
+
+       protected String constructImageName(OnboardingApp onboardingApp) {
+               return "portal_" + String.valueOf(onboardingApp.url.hashCode() + "_" + (int) (Math.random() * 100000.0))
+                               + ".png";
+       }
+
+       // Don't encrypt or decrypt the password if it is null or the empty string
+       private String decryptedPassword(String encryptedAppPwd, EPApp app) {
+               String result = "";
+               if (encryptedAppPwd != null & encryptedAppPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.decryptPKC(encryptedAppPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed for app " + app.getName(), e);
+                       }
+               }
+               return result;
+       }
+
+       protected String encryptedPassword(String decryptedAppPwd, EPApp app) {
+               String result = "";
+               if (decryptedAppPwd != null & decryptedAppPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.encryptPKC(decryptedAppPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed for app " + app.getName(), e);
+                       }
+               }
+               return result;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               final Map<String, Long> params = new HashMap<>();
+               List<EPWidgetsManualSortPreference> epManualWidgets = new ArrayList<EPWidgetsManualSortPreference>();
+
+               try {
+                       params.put("userId", user.getId());
+                       epManualWidgets = dataAccessService.executeNamedQuery("userWidgetManualSortPrfQuery", params, null);
+                       Map<Long, EPWidgetsManualSortPreference> existingWidgetsIds = new HashMap<Long, EPWidgetsManualSortPreference>();
+                       for (EPWidgetsManualSortPreference userWidgetManualPref : epManualWidgets) {
+                               existingWidgetsIds.put(userWidgetManualPref.getWidgetId(), userWidgetManualPref);
+                       }
+                       for (EPWidgetsSortPreference epWidgetsManPref : widgetsSortManual) {
+                               if (epWidgetsManPref.getWidgetid() != null) {
+                                       Long widgetid = epWidgetsManPref.getWidgetid();
+                                       if (existingWidgetsIds.containsKey(widgetid)) {
+                                               EPWidgetsManualSortPreference epWidgetsManualSort = existingWidgetsIds.get(widgetid);
+                                               epWidgetsManualSort.setWidgetRow(epWidgetsManPref.getRow());
+                                               epWidgetsManualSort.setWidgetCol(epWidgetsManPref.getCol());
+                                               epWidgetsManualSort.setWidgetWidth(epWidgetsManPref.getSizeX());
+                                               epWidgetsManualSort.setWidgetHeight(epWidgetsManPref.getSizeY());
+                                               HashMap<String, Integer> additionalUpdateParam = new HashMap<String, Integer>();
+                                               additionalUpdateParam.put("userId", epWidgetsManualSort.getUserId());
+                                               dataAccessService.saveDomainObject(epWidgetsManualSort, additionalUpdateParam);
+                                       } else {
+                                               EPWidgetsManualSortPreference epWidgetsManualSort = new EPWidgetsManualSortPreference();
+                                               epWidgetsManualSort.setWidgetId(epWidgetsManPref.getWidgetid());
+                                               epWidgetsManualSort.setWidgetRow(epWidgetsManPref.getRow());
+                                               epWidgetsManualSort.setWidgetCol(epWidgetsManPref.getCol());
+                                               epWidgetsManualSort.setWidgetWidth(epWidgetsManPref.getSizeX());
+                                               epWidgetsManualSort.setWidgetHeight(epWidgetsManPref.getSizeY());
+                                               epWidgetsManualSort.setUserId(Ints.checkedCast(user.getId()));
+                                               dataAccessService.saveDomainObject(epWidgetsManualSort, null);
+                                       }
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveWidgetsSortManual failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               final Map<String, Long> params = new HashMap<>();
+               List<EPWidgetsManualSortPreference> epWidgets = new ArrayList<EPWidgetsManualSortPreference>();
+               try {
+                       params.put("userId", user.getId());
+                       epWidgets = dataAccessService.executeNamedQuery("userWidgetManualSortPrfQuery", params, null);
+                       Map<Long, EPWidgetsManualSortPreference> existingWidgetIds = new HashMap<Long, EPWidgetsManualSortPreference>();
+                       for (EPWidgetsManualSortPreference userWidgetSortPref : epWidgets) {
+                               existingWidgetIds.put(userWidgetSortPref.getWidgetId(), userWidgetSortPref);
+                       }
+                       for (EPWidgetsSortPreference delEpWidgetsManPref : delWidgetSortPref) {
+                               if (delEpWidgetsManPref.getWidgetid() != null) {
+                                       Long widgetId = delEpWidgetsManPref.getWidgetid();
+                                       if (existingWidgetIds.containsKey(widgetId)) {
+                                               params.put("widgetId",widgetId);
+                                               dataAccessService.executeNamedQuery("deleteUserWidgetPlacement", params, null);
+                                       }
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserWidgetSortPref failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       /*
+        * This Method Stores the Sort Order of User Apps by Sort Manual Preference
+        *
+        * @param: appsSortManual--contains User Apps Data
+        *
+        * @param: user--contains LoggedIn User Data
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               final Map<String, Long> params = new HashMap<>();
+               List<EPUserAppsManualSortPreference> epManualApps = new ArrayList<EPUserAppsManualSortPreference>();
+
+               try {
+                       params.put("userId", user.getId());
+                       epManualApps = dataAccessService.executeNamedQuery("userAppsManualSortPrfQuery", params, null);
+                       Map<Long, EPUserAppsManualSortPreference> existingAppIds = new HashMap<Long, EPUserAppsManualSortPreference>();
+                       for (EPUserAppsManualSortPreference userAppManualPref : epManualApps) {
+                               existingAppIds.put(userAppManualPref.getAppId(), userAppManualPref);
+                       }
+                       for (EPAppsManualPreference epAppsManPref : appsSortManual) {
+                               if (epAppsManPref.getAppid() != null) {
+                                       Long appid = epAppsManPref.getAppid();
+                                       if (existingAppIds.containsKey(appid)) {
+                                               EPUserAppsManualSortPreference epAppsManualSort = existingAppIds.get(appid);
+                                               epAppsManualSort
+                                                               .setAppManualSortOrder((epAppsManPref.getCol() + (6 * epAppsManPref.getRow())) + 1);
+                                               HashMap<String, Integer> additionalUpdateParam = new HashMap<String, Integer>();
+                                               additionalUpdateParam.put("userId", epAppsManualSort.getUserId());
+                                               dataAccessService.saveDomainObject(epAppsManualSort, additionalUpdateParam);
+                                       } else {
+                                               EPUserAppsManualSortPreference epAppsManualSort = new EPUserAppsManualSortPreference();
+                                               epAppsManualSort.setAppId(epAppsManPref.getAppid());
+                                               epAppsManualSort
+                                                               .setAppManualSortOrder((epAppsManPref.getCol() + (6 * epAppsManPref.getRow())) + 1);
+                                               epAppsManualSort.setUserId(Ints.checkedCast(user.getId()));
+                                               dataAccessService.saveDomainObject(epAppsManualSort, null);
+                                       }
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveAppsSortManual failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       /*
+        * (non-Javadoc)
+        *
+        * @see org.openecomp.portalapp.portal.service.EPAppService#
+        * deleteUserAppSortManual(java.lang.String,
+        * org.openecomp.portalapp.portal.domain.EPUser)
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               final Map<String, Long> params = new HashMap<>();
+               List<EPUserAppsManualSortPreference> epManualApps = new ArrayList<EPUserAppsManualSortPreference>();
+               try {
+                       params.put("userId", user.getId());
+                       epManualApps = dataAccessService.executeNamedQuery("userAppsManualSortPrfQuery", params, null);
+                       Map<Long, EPUserAppsManualSortPreference> existingAppIds = new HashMap<Long, EPUserAppsManualSortPreference>();
+                       for (EPUserAppsManualSortPreference userAppPref : epManualApps) {
+                               existingAppIds.put(userAppPref.getAppId(), userAppPref);
+                       }
+                       if (existingAppIds.containsKey(delAppSortManual.getAppId()) && !delAppSortManual.isSelect()) {
+                               dataAccessService.deleteDomainObjects(EPUserAppsManualSortPreference.class,
+                                               "app_id=" + delAppSortManual.getAppId() + " AND user_id=" + user.getId(), null);
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserAppSortManual failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               final Map<String, Long> params = new HashMap<>();
+               List<EPUserAppsSortPreference> epSortTypes = new ArrayList<EPUserAppsSortPreference>();
+               EPUserAppsSortPreference usrSortPr = null;
+               try {
+                       params.put("userId", user.getId());
+                       epSortTypes = dataAccessService.executeNamedQuery("userAppsSortPreferenceQuery", params, null);
+                       if (epSortTypes.size() == 0) {
+                               usrSortPr = new EPUserAppsSortPreference();
+                               usrSortPr.setUserId(Ints.checkedCast(user.getId()));
+                               usrSortPr.setSortPref(appsSortPreference.getValue());
+                               dataAccessService.saveDomainObject(usrSortPr, null);
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+                       } else {
+                               usrSortPr = epSortTypes.get(0);
+                               usrSortPr.setSortPref(appsSortPreference.getValue());
+                               HashMap<String, Integer> additionalUpdateParam = new HashMap<String, Integer>();
+                               additionalUpdateParam.put("userId", usrSortPr.getUserId());
+                               dataAccessService.saveDomainObject(usrSortPr, additionalUpdateParam);
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveAppsSortPreference failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public String getUserAppsSortTypePreference(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               List<EPUserAppsSortPreference> userSortPrefs = new ArrayList<EPUserAppsSortPreference>();
+               try {
+                       params.put("userId", user.getId());
+                       userSortPrefs = dataAccessService.executeNamedQuery("userAppsSortPreferenceQuery", params, null);
+                       if (userSortPrefs.size() > 0)
+                               return userSortPrefs.get(0).getSortPref();
+                       else
+                               return null;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppsSortTypePreference failed", e);
+               }
+               return null;
+
+       }
+
+       @Override
+       public List<EPApp> getUserRemoteApps(String id) {
+               throw new RuntimeException(" Cannot be called from parent class");
+       }
+       
+       @Override
+       public UserRoles getUserProfileForLeftMenu(String loginId) {
+               final Map<String, String> params = new HashMap<>();
+               params.put("org_user_id", loginId);
+               @SuppressWarnings("unchecked")
+               List<UserRole> userRoleList = dataAccessService.executeNamedQuery( "getUserRolesForLeftMenu", params, null);
+               ArrayList<UserRoles> usersRolesList = aggregateUserProfileRowsResultsByRole(userRoleList);
+               if (usersRolesList == null || usersRolesList.size() < 1)
+                       return null;
+
+               return usersRolesList.get(0);
+       }
+       
+       
+       @Override
+       public UserRoles getUserProfileForRolesLeftMenu(String loginId) {
+               final Map<String, String> params = new HashMap<>();
+               params.put("org_user_id", loginId);
+               @SuppressWarnings("unchecked")
+               List<UserRole> userRoleList = dataAccessService.executeNamedQuery( "getRolesForLeftMenu", params, null);
+               ArrayList<UserRoles> usersRolesList = aggregateUserProfileRowsResultsByRole(userRoleList);
+               if (usersRolesList == null || usersRolesList.size() < 1)
+                       return null;
+
+               return usersRolesList.get(0);
+       }
+       
+       @Override
+       public UserRoles getUserProfileNormalizedForLeftMenu(EPUser user) {
+               // Check database.
+               UserRoles userAndRoles = getUserProfileForLeftMenu(user.getLoginId());
+               // If no roles are defined, treat this user as a guest.
+               if (user.isGuest() || userAndRoles == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getUserProfileForLeftMenu: treating user {} as guest",
+                                       user.getLoginId());
+                       userAndRoles = createUserRoles(user);
+               }
+
+               return userAndRoles;
+       }
+       
+       @Override
+       public UserRoles getUserProfileNormalizedForRolesLeftMenu(EPUser user) {
+               // Check database.
+               UserRoles userAndRoles = getUserProfileForRolesLeftMenu(user.getLoginId());
+               // If no roles are defined, treat this user as a guest.
+               if (user.isGuest() || userAndRoles == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getUserProfileForLeftMenu: treating user {} as guest",
+                                       user.getLoginId());
+                       userAndRoles = createUserRoles(user);
+               }
+
+               return userAndRoles;
+       }
+
+       
+       public UserRoles createUserRoles(EPUser user)
+       {
+               UserRole userRole = new UserRole();
+               userRole.setUser_Id(user.getId());
+               userRole.setOrgUserId(user.getLoginId());
+               userRole.setFirstName(user.getFirstName());
+               userRole.setLastName(user.getLastName());
+               userRole.setRoleId(-1L);
+               userRole.setRoleName("Guest");
+               userRole.setUser_Id(-1L);
+               UserRoles userAndRoles = new UserRoles(userRole);
+               return userAndRoles;
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAppService.java
new file mode 100644 (file)
index 0000000..3dd18a6
--- /dev/null
@@ -0,0 +1,248 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.AdminUserApplications;
+import org.onap.portalapp.portal.domain.AppIdAndNameTransportModel;
+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.UserRoles;
+import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
+import org.onap.portalapp.portal.transport.EPAppsManualPreference;
+import org.onap.portalapp.portal.transport.EPAppsSortPreference;
+import org.onap.portalapp.portal.transport.EPDeleteAppsManualSortPref;
+import org.onap.portalapp.portal.transport.EPWidgetsSortPreference;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.LocalRole;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+
+public interface EPAppService {
+
+       /**
+        * Get all applications adminId is an admin
+        * 
+        * @param user
+        *            the admin user
+        * @return the admin's applications
+        */
+       List<EPApp> getUserAsAdminApps(EPUser user);
+
+       List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId);
+
+       /**
+        * Gets all rows and all fields from the fn_app table.
+        * 
+        * @return list of EPApp objects
+        */
+       List<EPApp> getAppsFullList();
+
+       /**
+        * Gets all rows and most fields from the fn_app table.
+        * 
+        * @return list of EcompApp objects.
+        */
+       List<EcompApp> getEcompAppAppsFullList();
+
+       /**
+        * Get apps with app app admins
+        * 
+        * @return List of AdminUserApplications
+        */
+       List<AdminUserApplications> getAppsAdmins();
+
+       /**
+        * Get all apps from fn_app table (index, name, title only).
+        * 
+        * @param all
+        *            If all is true, returns active and inactive apps; otherwise,
+        *            just active apps.
+        * @return List of AppsResponse objects.
+        */
+       List<AppsResponse> getAllApps(Boolean all);
+
+       UserRoles getUserProfile(String loginId);
+
+       UserRoles getUserProfileNormalized(EPUser user);
+
+       List<LocalRole> getAppRoles(Long appId);
+
+       List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
+
+       List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
+
+       /**
+        * Gets the applications accessible to the specified user, which includes
+        * all enabled open applications, plus all enabled applications for which
+        * the user has a defined role for that app.
+        * 
+        * @param user
+        *            EPUser object with the user's Org User ID
+        * @return the user's list of applications, which may be empty.
+        */
+       List<EPApp> getUserApps(EPUser user);
+
+       /**
+        * Gets the user-personalized list of applications for the Portal (super)
+        * admin, which includes enabled open applications, enabled applications for
+        * which the user has a defined role for that app, and/or enabled
+        * applications which the user has chosen to show.
+        * 
+        * @param user
+        *            EPUser object with the user's Org User ID
+        * @return the user's personalized list of applications, which may be empty.
+        */
+       List<EPApp> getPersAdminApps(EPUser user);
+
+       /**
+        * Gets the user-personalized list of accessible applications, which
+        * includes enabled open applications and/or enabled applications for which
+        * the user has a defined role for that app. Personalization means the user
+        * can indicate an accessible application should be excluded from this
+        * result.
+        * 
+        * @param user
+        *            EPUser object with the user's Org User ID
+        * @return the user's personalized list of applications, which may be empty.
+        */
+       List<EPApp> getPersUserApps(EPUser user);
+
+       /**
+        * Gets the application catalog for the specified user who is a super admin.
+        * This includes all enabled applications. Each item indicates whether the
+        * user has access (open or via a role), and whether the application is
+        * selected for showing in the user's home (applications) page. Admin sees
+        * slightly different behavior - can force an app onto the home page using
+        * the personalization feature (user-app-selection table).
+        * 
+        * @param user
+        * @return list of all enabled applications, which may be empty
+        */
+       List<AppCatalogItem> getAdminAppCatalog(EPUser user);
+
+       /**
+        * Gets the application catalog for the specified user, who is a regular
+        * user. This includes all enabled applications. Each item indicates whether
+        * the user has access (open or via a role), and whether the application is
+        * selected for showing in the user's home (applications) page.
+        * 
+        * @param user
+        * @return list of all enabled applications, which may be empty
+        */
+       List<AppCatalogItem> getUserAppCatalog(EPUser user);
+
+       List<OnboardingApp> getOnboardingApps();
+
+       List<OnboardingApp> getEnabledNonOpenOnboardingApps();
+
+       FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
+
+       FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
+
+       /**
+        * Deletes the specified application from all tables where the app_id is
+        * used, and ultimately from the fn_app table.
+        * 
+        * @param user
+        *            Must be Portal (super) administrator
+        * @param onboardingAppId
+        *            ID of application to be deleted
+        * @return Status code
+        */
+       FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
+
+       List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
+
+       EPApp getApp(Long appId);
+
+       EPApp getAppDetail(String appName);
+       
+       /**
+        * 
+        * It return app information 
+        * 
+        * @param appName it contains application name
+        * @return EPApp 
+        */
+       EPApp getAppDetailByAppName(String appName);
+
+       List<EPApp> getAppsOrderByName(EPUser user);
+
+       FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user);
+
+       FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user);
+
+       FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user);
+
+       /**
+        * Deletes the sort order of user apps by sort manual preference
+        * 
+        * @param delAppSortManual
+        *            User Apps Data
+        * @param user
+        *            LoggedIn User Data
+        * @return FieldsValidator
+        */
+       FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user);
+
+       FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user);
+
+       String getUserAppsSortTypePreference(EPUser user);
+
+       List<EPApp> getAppsOrderByLastUsed(EPUser user);
+
+       List<EPApp> getAppsOrderByMostUsed(EPUser user);
+
+       List<EPApp> getAppsOrderByManual(EPUser user);
+
+       List<EPApp> getUserRemoteApps(String id);
+
+       void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp);
+
+       UserRoles getUserProfileNormalizedForLeftMenu(EPUser user);
+
+       UserRoles getUserProfileForLeftMenu(String loginId);
+
+       UserRoles getUserProfileForRolesLeftMenu(String loginId);
+
+       UserRoles getUserProfileNormalizedForRolesLeftMenu(EPUser user);
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAuditService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAuditService.java
new file mode 100644 (file)
index 0000000..d147917
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.Date;
+
+public interface EPAuditService {
+       public Date getGuestLastLogin(String userId);
+       public void delAuditLogFromDay();
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAuditServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPAuditServiceImpl.java
new file mode 100644 (file)
index 0000000..1b3dfad
--- /dev/null
@@ -0,0 +1,129 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.time.LocalDate;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+@Service("epAuditService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class EPAuditServiceImpl implements EPAuditService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAuditServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @Override
+       /*
+        * get the guest last login time with orgUserId as param. If record not
+        * found in table, return null.
+        * 
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.openecomp.portalapp.portal.service.EPUserService#getGuestLastLogin(
+        * java.lang.String)
+        */
+       public Date getGuestLastLogin(String userId) {
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);
+               @SuppressWarnings("unchecked")
+               List<Date> list = getDataAccessService().executeNamedQuery("getGuestLastLogin", params, null);
+               Date date = null;
+               if (list != null) {
+                       /*
+                        * if list only contains one item, meaning this is the first time
+                        * user logs in or record not found in db
+                        */
+                       if (list.size() == 1)
+                               date = list.get(0); /* the guest's current log in time */
+                       else if (list.size() == 2)
+                               date = list.get(1); /* most recent login date from db */
+               }
+               return date;
+       }
+
+       /*
+        * Cleans all the records in fn_audit_log table that are less than defined
+        * date in system.property
+        * 
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.openecomp.portalapp.portal.service.EPAuditService#delAuditLogFromDay(
+        * )
+        */
+       @Override
+       public void delAuditLogFromDay() {
+               if (EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.AUDITLOG_DEL_DAY_FROM)) {
+                       String day = EPCommonSystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_DEL_DAY_FROM);
+                       LocalDate removeDateFrom = LocalDate.now().minusDays(Integer.valueOf(day));
+                       getDataAccessService().deleteDomainObjects(AuditLog.class, "audit_date  <'" + removeDateFrom + "'", null);
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "delAuditLogFromDay Exception = system.propertiy value is empty on"
+                                                       + EPCommonSystemProperties.AUDITLOG_DEL_DAY_FROM);
+               }
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLdapService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLdapService.java
new file mode 100644 (file)
index 0000000..7721cbc
--- /dev/null
@@ -0,0 +1,49 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalsdk.core.command.support.SearchResult;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+
+public interface EPLdapService {
+
+    // search POST for users based on the criteria selected in the Request
+    SearchResult searchPost(DomainVo searchCriteria, String sortBy1, String sortBy2, String sortBy3, int pageNo, int dataSize, int userId) throws Exception;
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLdapServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLdapServiceImpl.java
new file mode 100644 (file)
index 0000000..941acaf
--- /dev/null
@@ -0,0 +1,269 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalsdk.core.command.support.SearchResult;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.support.FusionService;
+import org.onap.portalsdk.core.service.support.ServiceLocator;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.owasp.esapi.ESAPI;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service("epLdapService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class EPLdapServiceImpl extends FusionService implements EPLdapService {
+       @Autowired
+       private ServiceLocator serviceLocator;
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLdapServiceImpl.class);
+
+       @EPAuditLog
+       @SuppressWarnings({ "rawtypes", "unchecked" })
+       public SearchResult searchPost(DomainVo searchCriteria, String sortBy1, String sortBy2, String sortBy3, int pageNo,
+                       int dataSize, int userId) throws Exception {
+
+               String remoteHost = "";
+
+               // initialize the directory context to access POST
+               DirContext dirContext = serviceLocator.getDirContext(
+                               SystemProperties.getProperty(SystemProperties.POST_INITIAL_CONTEXT_FACTORY),
+                               SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
+                               SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
+
+               SearchResult searchResult = new SearchResult();
+
+               try {
+
+                       remoteHost = String.format("%s/%s", SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
+                                       SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
+                       MDC.put(EPCommonSystemProperties.FULL_URL, remoteHost);
+
+                       String[] postAttributes = { "nickname", "givenName", "initials", "sn", "employeeNumber", "mail",
+                                       "telephoneNumber", "departmentNumber", "a1", "street", "roomNumber", "l", "st", "postalCode",
+                                       "zip4", "physicalDeliveryOfficeName", "bc", "friendlyCountryName", "bd", "bdname", "bu", "buname",
+                                       "jtname", "mgrid", "a2", "compcode", "compdesc", "costcenter", "silo", "b2" };
+
+                       SearchControls searchControls = new SearchControls();
+                       searchControls.setTimeLimit(5000);
+                       searchControls.setReturningAttributes(postAttributes);
+
+                       StringBuffer filterClause = new StringBuffer("(&(objectClass=*)");
+
+                       EPUser user = (EPUser) searchCriteria;
+
+                       if (Utilities.nvl(user.getFirstName()).length() > 0) {
+                               filterClause.append("(givenName=").append(user.getFirstName()).append("*)");
+                       }
+                       if (Utilities.nvl(user.getLastName()).length() > 0) {
+                               filterClause.append("(sn=").append(user.getLastName()).append("*)");
+                       }
+                       if (Utilities.nvl(user.getHrid()).length() > 0) {
+                               filterClause.append("(employeeNumber=").append(user.getHrid()).append("*)");
+                       }
+                       if (Utilities.nvl(user.getOrgManagerUserId()).length() > 0) {
+                               filterClause.append("(mgrid=").append(user.getOrgManagerUserId()).append("*)");
+                       }
+                       if (Utilities.nvl(user.getOrgCode()).length() > 0) {
+                               filterClause.append("(departmentNumber=").append(user.getOrgCode()).append("*)");
+                       }
+                       if (Utilities.nvl(user.getEmail()).length() > 0) {
+                               filterClause.append("(mail=").append(user.getEmail()).append("*)");
+                       }
+                       if (Utilities.nvl(user.getOrgUserId()).length() > 0) {
+                               filterClause.append("(a1=").append(user.getOrgUserId()).append("*)");
+                       }
+                       filterClause.append("(c3=N)"); // this has been added to filter CP09 entries on the LDAP server that are
+                                                                                       // duplicates of existing individuals
+                       filterClause.append(")");
+
+                       List list = new ArrayList();
+                       if (!filterClause.toString().equals("(&(objectClass=*))")) {
+                               NamingEnumeration e = dirContext.search(
+                                               SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL) + "/"
+                                                               + SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL),
+                                                               ESAPI.encoder().encodeForDN(filterClause.toString()), searchControls);
+                               list = processResults(e);
+                       }
+
+                       Collections.sort(list);
+
+                       searchResult = new SearchResult(list);
+                       searchResult.setPageNo(pageNo);
+                       if (dataSize >= 0) {
+                               searchResult.setDataSize(dataSize);
+                       } else {
+                               searchResult.setDataSize(list.size());
+                       }
+               } catch (NamingException ne) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchPost failed with naming exception", ne);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchPost failed", e);
+               } finally {
+                       dirContext.close();
+               }
+
+               return searchResult;
+       }
+
+       @SuppressWarnings({ "rawtypes", "unchecked" })
+       @EPMetricsLog
+       private ArrayList processResults(NamingEnumeration e) throws NamingException {
+               ArrayList results = new ArrayList();
+               int count = 0;
+
+               while (e.hasMore()) {
+                       javax.naming.directory.SearchResult searchResult = (javax.naming.directory.SearchResult) e.next();
+                       results.add(processAttributes(searchResult.getAttributes()));
+                       count++;
+
+                       if (count > Integer.parseInt(SystemProperties.getProperty(SystemProperties.POST_MAX_RESULT_SIZE))) {
+                               break;
+                       }
+               }
+               return results;
+       }
+
+       @SuppressWarnings("rawtypes")
+       @EPMetricsLog
+       private DomainVo processAttributes(Attributes resultAttributes) throws NamingException {
+               EPUser user = new EPUser();
+
+               try {
+                       if (resultAttributes == null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "This result has no attributes");
+                       } else {
+                               for (NamingEnumeration e = resultAttributes.getAll(); e.hasMore();) { // why the nested loop?
+                                       Attribute attribute = (Attribute) e.next();
+                                       for (NamingEnumeration ie = attribute.getAll(); ie.hasMore();) {
+                                               if (attribute.getID().equalsIgnoreCase("nickname")) {
+                                                       user.setFirstName((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("initials")) {
+                                                       user.setMiddleInitial((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("sn")) {
+                                                       user.setLastName((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("employeeNumber")) {
+                                                       user.setHrid((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("mail")) {
+                                                       user.setEmail((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("telephoneNumber")) {
+                                                       user.setPhone((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("departmentNumber")) {
+                                                       user.setOrgCode((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("a1")) {
+                                                       user.setOrgUserId((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("street")) {
+                                                       user.setAddress1((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("roomNumber")) {
+                                                       user.setAddress2((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("l")) {
+                                                       user.setCity((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("st")) {
+                                                       user.setState((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("postalCode")) {
+                                                       user.setZipCode((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("zip4")) {
+                                                       user.setZipCodeSuffix((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("physicalDeliveryOfficeName")) {
+                                                       user.setLocationClli((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("bc")) {
+                                                       user.setBusinessCountryCode((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("friendlyCountryName")) {
+                                                       user.setBusinessCountryName((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("bd")) {
+                                                       user.setDepartment((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("bdname")) {
+                                                       user.setDepartmentName((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("jtname")) {
+                                                       user.setJobTitle((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("mgrid")) {
+                                                       user.setOrgManagerUserId((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("a2")) {
+                                                       user.setCommandChain((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("compcode")) {
+                                                       user.setCompanyCode((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("compdesc")) {
+                                                       user.setCompany((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("bu")) {
+                                                       user.setBusinessUnit((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("buname")) {
+                                                       user.setBusinessUnitName((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("silo")) {
+                                                       user.setSiloStatus((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("costcenter")) {
+                                                       user.setCostCenter((String) ie.next());
+                                               } else if (attribute.getID().equalsIgnoreCase("b2")) {
+                                                       user.setFinancialLocCode((String) ie.next());
+                                               } else { // we don't care about returned attribute, let's move on
+                                                       ie.next();
+                                               }
+
+                                       }
+                               }
+                       }
+               } catch (NamingException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "processAttributes failed with naming exception", e);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "processAttributes failed", e);
+               }
+
+               return user;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLeftMenuService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLeftMenuService.java
new file mode 100644 (file)
index 0000000..822776f
--- /dev/null
@@ -0,0 +1,62 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.Set;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalsdk.core.domain.MenuData;
+
+public interface EPLeftMenuService {
+       
+       /**
+        * Builds a JSON suitable for populating the front-end left menu from the supplied set of menu items.
+        * @param user 
+        * 
+        * @param fullMenuSet
+        * @param roleFunctionSet 
+        * @return JSON String of this form:
+        * <PRE>
+        * {"navItems":[
+        *              {"name":"Home","imageSrc":"icon-location-pin","state":"root.applicationsHome"},
+        *      ...
+        * ] }
+        * </PRE>
+        */
+       String getLeftMenuItems(EPUser user, Set<MenuData> fullMenuSet, Set<String> roleFunctionSet);
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImpl.java
new file mode 100644 (file)
index 0000000..98d31b1
--- /dev/null
@@ -0,0 +1,179 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.portalapp.portal.domain.CentralizedApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.domain.MenuData;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service("leftMenuService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+
+public class EPLeftMenuServiceImpl implements EPLeftMenuService {
+
+       private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLeftMenuServiceImpl.class);
+
+       
+       @Autowired
+       private ExternalAccessRolesService externalAccessRolesService;
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.openecomp.portalapp.portal.service.EPLeftMenuService#getLeftMenuItems
+        * (java.util.Set)
+        */
+       @Override
+       public String getLeftMenuItems(EPUser user, Set<MenuData> fullMenuSet, Set<String> roleFunctionSet) {
+               final Map<String, JSONObject> defaultNavMap = new LinkedHashMap<String, JSONObject>();
+               resetNavMap(defaultNavMap);
+               loadDefaultNavMap(defaultNavMap);
+               loadNavMapByRole(defaultNavMap, fullMenuSet , user);
+               return convertToSideBarModel(defaultNavMap);
+       }
+
+       /**
+        * Clears the map
+        * 
+        * @param defaultNavMap
+        */
+       private void resetNavMap(Map<String, JSONObject> defaultNavMap) {
+               defaultNavMap.clear();
+       }
+
+       /**
+        * 
+        * @param defaultNavMap
+        * @param fullMenuSet
+        */
+       private void loadNavMapByRole(Map<String, JSONObject> defaultNavMap, Set<MenuData> fullMenuSet , EPUser user) {
+
+               class SortOrderComparator implements Comparator<MenuData> {
+                       @Override
+                       public int compare(MenuData e1, MenuData e2) {
+                               return e1.getSortOrder().compareTo(e2.getSortOrder());
+                       }
+               }
+
+               SortedSet<MenuData> sortMenuSet = new TreeSet<MenuData>(new SortOrderComparator());
+               for (MenuData mn : fullMenuSet) {
+                       sortMenuSet.add(mn);
+               }
+               
+               // Remove Roles from left menu if user doesnt have admin access on
+               // centralized application
+               List<CentralizedApp> applicationsList = null;
+               applicationsList = externalAccessRolesService.getCentralizedAppsOfUser(user.getOrgUserId());
+               if (applicationsList.size() == 0)
+                       sortMenuSet.removeIf(x -> x.getLabel().contains("Roles"));
+
+               for (MenuData mn : sortMenuSet) {
+                       JSONObject navItemsDetails = new JSONObject();
+                       navItemsDetails.put("name", mn.getLabel());
+                       navItemsDetails.put("state", mn.getAction());
+                       navItemsDetails.put("imageSrc", mn.getImageSrc());
+                       defaultNavMap.put(mn.getAction(), navItemsDetails);
+               }
+       }
+
+       /**
+        * 
+        * @param defaultNavMap
+        * @return
+        */
+       private String convertToSideBarModel(Map<String, JSONObject> defaultNavMap) {
+               JSONObject sidebarModel = new JSONObject();
+               JSONArray navItems = new JSONArray();
+               Collection<JSONObject> jsonObjs = defaultNavMap.values();
+
+               for (JSONObject navItemsDetail : jsonObjs)
+                       navItems.put(navItemsDetail);
+
+               sidebarModel.put("label", "ECOMP portal");
+               sidebarModel.put("navItems", navItems);
+               return sidebarModel.toString();
+       }
+
+       /**
+        * Loads default entries for regular user.
+        * 
+        * @param defaultNavMap
+        */
+       private void loadDefaultNavMap(Map<String, JSONObject> defaultNavMap) {
+
+               JSONObject navItemsDetails1 = new JSONObject();
+               navItemsDetails1.put("name", "Home");
+               navItemsDetails1.put("state", "root.applicationsHome");
+               navItemsDetails1.put("imageSrc", "icon-building-home");
+               defaultNavMap.put("root.applicationsHome", navItemsDetails1);
+
+               JSONObject navItemsDetails2 = new JSONObject();
+               navItemsDetails2.put("name", "Application Catalog");
+               navItemsDetails2.put("state", "root.appCatalog");
+               navItemsDetails2.put("imageSrc", "icon-apps-marketplace");
+               defaultNavMap.put("root.appCatalog", navItemsDetails2);
+
+               JSONObject navItemsDetails3 = new JSONObject();
+               navItemsDetails3.put("name", "Widget Catalog");
+               navItemsDetails3.put("state", "root.widgetCatalog");
+               navItemsDetails3.put("imageSrc", "icon-apps-marketplace");
+               defaultNavMap.put("root.widgetCatalog", navItemsDetails3);
+
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLoginService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLoginService.java
new file mode 100644 (file)
index 0000000..4fd9baa
--- /dev/null
@@ -0,0 +1,90 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.HashMap;
+
+import org.onap.portalapp.command.EPLoginBean;
+import org.onap.portalapp.portal.domain.EPUser;
+
+public interface EPLoginService {
+
+       /**
+        * Calls {@link #findUser(EPLoginBean, String, HashMap, boolean)} with the
+        * last parameter set to true.
+        * 
+        * @param bean
+        * @param menuPropertiesFilename
+        * @param additionalParams
+        * @return EPUser object; null on error or if no match.
+        * @throws Exception
+        */
+       @SuppressWarnings("rawtypes")
+       EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams) throws Exception;
+
+       /**
+        * Searches the fn_user table for a row that matches information in the
+        * bean. Uses the bean's Organization User ID property if present; if not,
+        * uses the bean's LoginId property and (optionally, depending on
+        * matchPassword parameter) loginPwd property.
+        * 
+        * @param bean
+        *            EPLoginBean
+        * @param menuPropertiesFileName
+        *            Always ignored
+        * @param additionalParams
+        *            Used by DataAccessService when updating a matched user object
+        * @param matchPassword
+        *            If true, the search must match the password
+        * @return EPUser object; null on error or if no match.
+        * @throws Exception
+        */
+       @SuppressWarnings("rawtypes")
+       EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFileName, HashMap additionalParams,
+                       boolean matchPassword) throws Exception;
+
+       /**
+        * Searches the fn_user table for a row with a value in column login_id that
+        * matches the specified value.
+        * 
+        * @param loginId
+        *            Login name
+        * @return EPUser object; null on error or if no match.
+        */
+       public EPUser findUserWithoutPwd(String loginId);
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLoginServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPLoginServiceImpl.java
new file mode 100644 (file)
index 0000000..eff297f
--- /dev/null
@@ -0,0 +1,240 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.onap.portalapp.command.EPLoginBean;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.menu.MenuBuilder;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.support.FusionService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.AppUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service("eploginService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class EPLoginServiceImpl extends FusionService implements EPLoginService {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLoginServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       /*
+        * (non-Javadoc)
+        * @see org.openecomp.portalapp.portal.service.EPLoginService#findUser(org.openecomp.portalapp.command.EPLoginBean, java.lang.String, java.util.HashMap)
+        */
+       @SuppressWarnings("rawtypes")
+       public EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams)
+                       throws Exception {
+               return findUser(bean, menuPropertiesFilename, additionalParams, true);
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.openecomp.portalapp.portal.service.EPLoginService#findUser(org.openecomp.portalapp.command.EPLoginBean, java.lang.String, java.util.HashMap, boolean)
+        */
+       @SuppressWarnings("rawtypes")
+       public EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename_ignored, HashMap additionalParams,
+                       boolean matchPassword) throws Exception {
+               EPUser user = null;
+               EPUser userCopy = null;
+
+               if (bean.getOrgUserId() != null) {
+                       user = (EPUser) findUser(bean);
+               } else {
+                       if (matchPassword)
+                               user = (EPUser) findUser(bean.getLoginId(), bean.getLoginPwd());
+                       else
+                               user = (EPUser) findUserWithoutPwd(bean.getLoginId());
+               }
+
+               // run this command to fetch more information from the lazily loaded
+               // object
+
+               // This is funny - commenting out the following method call
+               // 1. What are we doing with the returned values of the following two
+               // methods? Nothing.
+               // 2. Use a guest user scenario - user object will be null - clealry,
+               // NPE.
+               // 3. A check of if(user !=null) is made AFTER these bogus calls :) - If
+               // these calls WERE doing anything significat (which they are not),
+               // shouln't they have been moved inside that if check?
+
+               // user.getEPUserApps();
+
+               // Comments
+               // 1. This method is clearly doing more than 'getting roles' - Not a
+               // good name -
+               // 2. Also, there is no null check - guest user scenarios will break the
+               // code with NPE - added the check - Do not want to remove the call
+               // altogether - not sure how it will effect things.
+
+               if (user != null) {
+                       user.getEPRoles();
+
+                       // raise an error if the portal application is locked and the user
+                       // does not
+                       // have system administrator privileges
+                       if (AppUtils.isApplicationLocked()
+                                       && !EPUserUtils.hasRole(user, SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID))) {
+                               bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_APPLICATION_LOCKED);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUserAdminPrivilegesInfo, user.getLoginId());
+                       }
+
+                       // raise an error if the user is inactive
+                       if (!user.getActive()) {
+                               bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_USER_INACTIVE);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUserInactiveWarning, user.getLoginId());
+                       }
+
+                       // only login the user if no errors have occurred
+                       if (bean.getLoginErrorMessage() == null) {
+
+                               // this will be a snapshot of the user's information as
+                               // retrieved from the database
+                               userCopy = (EPUser) user.clone();
+
+                               // update the last logged in date for the user
+                               user.setLastLoginDate(new Date());
+                               getDataAccessService().saveDomainObject(user, additionalParams);
+
+                               // create the application menu based on the user's privileges
+                               MenuBuilder menuBuilder = new MenuBuilder();
+                               Set appMenu = menuBuilder.getMenu(
+                                               SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME), dataAccessService);
+                               bean.setMenu(appMenu != null ? appMenu : new HashSet());
+                               Set businessDirectMenu = menuBuilder.getMenu(
+                                               SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_SET_NAME),
+                                               dataAccessService);
+                               bean.setBusinessDirectMenu(businessDirectMenu != null ? businessDirectMenu : new HashSet());
+
+                               bean.setUser(userCopy);
+                       }
+
+               } else {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUserMissingError, bean.getOrgUserId());
+               }
+
+               return bean;
+       }
+
+       /**
+        * Searches the fn_user table for a row that matches the specified login_id
+        * and login_pwd values.
+        * 
+        * @param loginId
+        * @param password
+        * @return EPUser object; null on error or if no match.
+        */
+       @SuppressWarnings("rawtypes")
+       private EPUser findUser(String loginId, String password) {
+               Map<String, String> params = new HashMap<>();
+               params.put("login_id", loginId);
+               params.put("login_pwd", password);
+               List list = null;
+               try {
+                       list = dataAccessService.executeNamedQuery("getEPUserByLoginIdLoginPwd", params, new HashMap());
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "findUser failed on " + loginId, e);
+               }
+               return (list == null || list.isEmpty()) ? null : (EPUser) list.get(0);
+       }
+
+       @SuppressWarnings("rawtypes")
+       public EPUser findUserWithoutPwd(String loginId) {
+               Map<String, String> params = new HashMap<>();
+               params.put("login_id", loginId);
+               List list = null;
+               try {
+                       list = dataAccessService.executeNamedQuery("getEPUserByLoginId", params, new HashMap());
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "findUserWithoutPwd failed on " + loginId, e);
+               }
+               return (list == null || list.isEmpty()) ? null : (EPUser) list.get(0);
+       }
+
+       /**
+        * Searches the fn_user table for a row that matches the value of the bean's
+        * Organization User ID property.
+        * 
+        * @param bean
+        * @return EPUser object; null on error or if no match.
+        */
+       @SuppressWarnings("rawtypes")
+       private EPUser findUser(EPLoginBean bean) {
+               Map<String, String> params = new HashMap<>();
+               params.put("org_user_id", bean.getOrgUserId());
+               List list = null;
+               try {
+                       list = dataAccessService.executeNamedQuery("getEPUserByOrgUserId", params, new HashMap());
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "findUser(EPLoginBean) failed", e);
+               }
+               return (list == null || list.isEmpty()) ? null : (EPUser) list.get(0);
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionService.java
new file mode 100644 (file)
index 0000000..044225a
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.codec.DecoderException;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.exceptions.RoleFunctionException;
+import org.onap.portalsdk.core.domain.RoleFunction;
+
+public interface EPRoleFunctionService {
+       
+       /**
+        * Builds a set of role functions and sets a session attribute with it.
+        * 
+        * @return Set of role functions that was built.
+        */
+       public List<RoleFunction> getRoleFunctions();
+
+       /**
+        * Builds a set of role functions of user
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param user
+        *            EPUser
+        * @return Set of role functions that was built.
+        * @throws RoleFunctionException 
+        */
+       public Set getRoleFunctions(HttpServletRequest request, EPUser user) throws RoleFunctionException;
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceCentralizedImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceCentralizedImpl.java
new file mode 100644 (file)
index 0000000..c202805
--- /dev/null
@@ -0,0 +1,132 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.hibernate.SessionFactory;
+import org.onap.portalapp.portal.controller.RoleManageController;
+import org.onap.portalapp.portal.domain.CentralV2RoleFunction;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.exceptions.RoleFunctionException;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Transactional
+public class EPRoleFunctionServiceCentralizedImpl implements EPRoleFunctionService{
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPRoleFunctionServiceCentralizedImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       
+       @Autowired
+       private  SessionFactory sessionFactory;
+       
+       @Autowired
+       private  ExternalAccessRolesService externalAccessRolesService;
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<RoleFunction> getRoleFunctions() {
+               List<CentralV2RoleFunction> getRoleFuncList = null;
+               List<RoleFunction> getRoleFuncListOfPortal = new ArrayList<>();
+               final Map<String, Long> params = new HashMap<>();
+               params.put("appId", (long) 1);
+               //Sync all functions from external system into Ecomp portal DB
+               getRoleFuncList = dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null);
+               for(CentralV2RoleFunction roleFunction : getRoleFuncList)
+               {
+                       RoleFunction roleFun = new RoleFunction();
+                       String code = EcompPortalUtils.getFunctionCode(roleFunction.getCode());
+                       roleFun.setCode(code);
+                       roleFun.setName(roleFunction.getName());
+                       getRoleFuncListOfPortal.add(roleFun);
+               }
+               return getRoleFuncListOfPortal;
+       }
+
+       @SuppressWarnings({ "unchecked", "rawtypes" })
+       @Override
+       public Set getRoleFunctions(HttpServletRequest request, EPUser user) throws RoleFunctionException {
+               HttpSession session = request.getSession();
+               String userId = user.getId().toString();
+               final Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);
+               List getRoleFuncListOfPortal = dataAccessService.executeNamedQuery("getRoleFunctionsOfUser", params, null);
+               Set<String> getRoleFuncListOfPortalSet = new HashSet<>(getRoleFuncListOfPortal);
+               Set<String> roleFunSet = new HashSet<>();
+               roleFunSet = getRoleFuncListOfPortalSet.stream().filter(x -> x.contains("|")).collect(Collectors.toSet());
+               if (roleFunSet.size() > 0)
+                       for (String roleFunction : roleFunSet) {
+                               String roleFun = EcompPortalUtils.getFunctionCode(roleFunction);
+                               getRoleFuncListOfPortalSet.remove(roleFunction);
+                               getRoleFuncListOfPortalSet.add(roleFun);
+                       }
+
+               Set<String> finalRoleFunctionSet = new HashSet<>();
+               for (String roleFn : getRoleFuncListOfPortalSet) {
+                       finalRoleFunctionSet.add(EPUserUtils.decodeFunctionCode(roleFn));
+               }
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME),
+                               finalRoleFunctionSet);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "getRoleFunctions: RoleFunctions Of User" + finalRoleFunctionSet);
+               return finalRoleFunctionSet;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceImpl.java
new file mode 100644 (file)
index 0000000..130d9ca
--- /dev/null
@@ -0,0 +1,116 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+@Transactional
+public class EPRoleFunctionServiceImpl implements EPRoleFunctionService {
+       @Autowired
+       private DataAccessService dataAccessService;
+       
+       
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<RoleFunction> getRoleFunctions() {
+               return getDataAccessService().getList(RoleFunction.class, null);
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public Set getRoleFunctions(HttpServletRequest request, EPUser user) {
+               HashSet roleFunctions = null;
+
+               HttpSession session = request.getSession();
+               roleFunctions = (HashSet) session
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
+
+               if (roleFunctions == null) {
+                       HashMap roles = EPUserUtils.getRoles(request);
+                       roleFunctions = new HashSet();
+
+                       Iterator i = roles.keySet().iterator();
+
+                       while (i.hasNext()) {
+                               Long roleKey = (Long) i.next();
+                               EPRole role = (EPRole) roles.get(roleKey);
+
+                               Iterator j = role.getRoleFunctions().iterator();
+
+                               while (j.hasNext()) {
+                                       RoleFunction function = (RoleFunction) j.next();
+                                       roleFunctions.add(function.getCode());
+                               }
+                       }
+
+                       session.setAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME),
+                                       roleFunctions);
+               }
+
+               return roleFunctions;
+       }
+       
+       
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleService.java
new file mode 100644 (file)
index 0000000..d29e649
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalsdk.core.domain.RoleFunction;
+
+
+public interface EPRoleService {
+       
+       // Used by ECOMP. Get cached role by two columns used by ECOMP only. app id, and external app role id.
+       EPRole getRole(Long appId, Long appRoleid);
+       public void saveRole(EPRole domainRole);
+       EPRole getAppRole(String roleName, Long appId);
+       public List<RoleFunction> getRoleFunctions();
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/EPRoleServiceImpl.java
new file mode 100644 (file)
index 0000000..3e73d8d
--- /dev/null
@@ -0,0 +1,196 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+@Service("epRoleService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class EPRoleServiceImpl implements EPRoleService {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPRoleServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @SuppressWarnings("unchecked")
+       public List<RoleFunction> getRoleFunctions() {
+               // List msgDB = getDataAccessService().getList(Profile.class, null);
+               return getDataAccessService().getList(RoleFunction.class, null);
+       }
+
+       @SuppressWarnings("unchecked")
+       public List<EPRole> getAvailableChildRoles(Long roleId) {
+               List<EPRole> availableChildRoles = (List<EPRole>) getDataAccessService().getList(EPRole.class, null);
+               if (roleId == null || roleId == 0) {
+                       return availableChildRoles;
+               }
+
+               EPRole currentRole = (EPRole) getDataAccessService().getDomainObject(EPRole.class, roleId, null);
+               Set<EPRole> allParentRoles = new TreeSet<EPRole>();
+               allParentRoles = getAllParentRolesAsList(currentRole, allParentRoles);
+
+               Iterator<EPRole> availableChildRolesIterator = availableChildRoles.iterator();
+               while (availableChildRolesIterator.hasNext()) {
+                       EPRole role = availableChildRolesIterator.next();
+                       if (!role.getActive() || allParentRoles.contains(role) || role.getId().equals(roleId)) {
+                               availableChildRolesIterator.remove();
+                       }
+               }
+               return availableChildRoles;
+       }
+
+       private Set<EPRole> getAllParentRolesAsList(EPRole role, Set<EPRole> allParentRoles) {
+               Set<EPRole> parentRoles = role.getParentRoles();
+               allParentRoles.addAll(parentRoles);
+               Iterator<EPRole> parentRolesIterator = parentRoles.iterator();
+               while (parentRolesIterator.hasNext()) {
+                       getAllParentRolesAsList(parentRolesIterator.next(), allParentRoles);
+               }
+               return allParentRoles;
+       }
+
+       public RoleFunction getRoleFunction(String code) {
+               return (RoleFunction) getDataAccessService().getDomainObject(RoleFunction.class, code, null);
+       }
+
+       public void saveRoleFunction(RoleFunction domainRoleFunction) {
+               getDataAccessService().saveDomainObject(domainRoleFunction, null);
+       }
+
+       public void deleteRoleFunction(RoleFunction domainRoleFunction) {
+               getDataAccessService().deleteDomainObject(domainRoleFunction, null);
+       }
+
+       public EPRole getRole(Long id) {
+               return (EPRole) getDataAccessService().getDomainObject(EPRole.class, id, null);
+       }
+
+       // TODO: refactor
+       private static final String getAppRoleSqlFormat = "SELECT * FROM fn_role where APP_ID = %s AND APP_ROLE_ID = %s";
+
+       @SuppressWarnings("unchecked")
+       public EPRole getRole(Long appId, Long appRoleid) {
+               if (appId == null || appRoleid == null) {
+                       logger.error(EELFLoggerDelegate.errorLogger, String.format(
+                                       "getRole does not support null appId or roleId. appRoleid=%s, appRoleid=%s", appId, appRoleid));
+                       return null;
+               }
+
+               String sql = String.format(getAppRoleSqlFormat, appId, appRoleid);
+
+               List<EPRole> roles = (List<EPRole>) dataAccessService.executeSQLQuery(sql, EPRole.class, null);
+               int resultsCount = roles.size();
+               if (resultsCount > 1) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       String.format(
+                                                       "search by appId=%s, appRoleid=%s should have returned 0 or 1 results. Got %d. This is an internal server error.",
+                                                       appId, appRoleid, resultsCount));
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar.");
+                       return roles.get(0);
+               } else if (resultsCount == 1) {
+                       return roles.get(0);
+               }
+               return null;
+       }
+
+       @SuppressWarnings("unchecked")
+       public EPRole getAppRole(String roleName, Long appId) {
+
+               final Map<String, String> params = new HashMap<String, String>();
+               final Map<String, String> portalParams = new HashMap<String, String>();
+               List<EPRole> roles = null;
+               params.put("appId", appId.toString());
+               params.put("roleName", roleName);
+               portalParams.put("appRoleName", roleName);
+               if (appId == 1 || roleName.equals(PortalConstants.ADMIN_ROLE)) {
+                       roles = (List<EPRole>) dataAccessService.executeNamedQuery("getPortalAppRoles", portalParams, null);
+               } else if (appId != 1 && !roleName.equals(PortalConstants.ADMIN_ROLE)) {
+                       roles = (List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles", params, null);
+               }
+               int resultsCount = (roles == null ? 0 : roles.size());
+               if (resultsCount > 1) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar.");
+                       return roles.get(0);
+               } else if (resultsCount == 1) {
+                       return roles.get(0);
+               }
+               return null;
+       }
+
+       public void saveRole(EPRole domainRole) {
+               getDataAccessService().saveDomainObject(domainRole, null);
+       }
+
+       public void deleteRole(EPRole domainRole) {
+               getDataAccessService().deleteDomainObject(domainRole, null);
+       }
+
+       @SuppressWarnings("unchecked")
+       public List<EPRole> getAvailableRoles() {
+               return getDataAccessService().getList(EPRole.class, null);
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ExternalAccessRolesService.java
new file mode 100644 (file)
index 0000000..d65f115
--- /dev/null
@@ -0,0 +1,436 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.Session;
+import org.json.JSONArray;
+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.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.ExternalRoleDetails;
+import org.onap.portalapp.portal.transport.CentralRole;
+import org.onap.portalapp.portal.transport.CentralUser;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpClientErrorException;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public interface ExternalAccessRolesService {
+       
+       /**
+        * It gets list of application roles 
+        * 
+        * @param appId
+        * @return List
+        * @throws Exception 
+        */
+       public List<EPRole> getAppRoles(Long appId) throws Exception;
+       
+       /**
+        * It returns single app record
+        * 
+        * @param uebkey
+        * @return List
+        * @throws Exception 
+        */             
+       public List<EPApp> getApp(String uebkey) throws Exception;
+       
+       /**
+        * Adds role in the external access system if fails throws exception
+        * 
+        * @param addRoles
+        * @param uebkey
+        * @return boolean
+        * @throws Exception
+        */
+       public boolean addRole(Role addRoles, String uebkey) throws Exception;
+
+       /**
+        * It returns complete user information
+        * 
+        * @param loginId
+        * @return EPUser object
+        * @throws Exception
+        */
+       List<EPUser> getUser(String loginId) throws Exception;
+       
+       /**
+        * It returns complete user information including application roles permissions
+        * 
+        * @param loginId
+        * @param uebkey
+        * @return String
+        * @throws Exception
+        */
+       String getV2UserWithRoles(String loginId, String uebkey) throws Exception;
+
+       /**
+        * It returns list of all role functions
+        * @param string 
+        * @return List
+        * @throws Exception 
+        */
+       List<CentralV2RoleFunction> getRoleFuncList(String string) throws Exception;
+       
+       /**
+        * It return list of role provided by the app uebkey and roleId
+        * 
+        * @param roleId
+        * @param uebkey
+        * @return CentralRole
+        * @throws Exception
+        */
+       CentralV2Role getRoleInfo(Long roleId, String uebkey) throws Exception;
+       
+       /**
+        *  It returns the CentralRoleFunction object 
+        *   
+        * @param functionCode
+        * @param uebkey 
+        * @return CentralRoleFunction
+        * @throws Exception 
+        */
+       public CentralV2RoleFunction getRoleFunction(String functionCode, String uebkey) throws Exception;
+
+       /**
+        *  It saves role function in the DB
+        *  
+        * @param domainCentralRoleFunction
+        * @param requestedApp 
+        * @return true else false
+        * @throws Exception 
+        */
+       public boolean saveCentralRoleFunction(CentralV2RoleFunction domainCentralRoleFunction, EPApp requestedApp) throws Exception;
+
+       /**
+        * It deletes role function in the DB
+        * 
+        * @param code
+        * @param app 
+        */
+       public boolean deleteCentralRoleFunction(String code, EPApp app);
+
+       /**
+        * It gets all roles the applications
+        * 
+        * @param uebkey
+        * @return List
+        * @throws Exception 
+        */
+       public List<CentralV2Role> getRolesForApp(String uebkey) throws Exception;
+       
+       /**
+        * 
+        * It saves role function in the DB
+        * 
+        * @param saveRole
+        * @param uebkey
+        * @return message and true or false  
+        * @throws Exception
+        */
+       ExternalRequestFieldsValidator saveRoleForApplication(Role saveRole, String uebkey) throws Exception;
+
+       /**
+        *  It deletes role in the DB
+        *  
+        * @param code
+        * @param uebkey
+        * @return true else false
+        * @throws Exception 
+        */
+       boolean deleteRoleForApplication(String code, String uebkey) throws Exception;
+       
+       /**
+        * It gets all active roles for single application 
+        * 
+        * @param uebkey
+        * @return List
+        * @throws Exception
+        */
+       List<CentralV2Role> getActiveRoles(String uebkey) throws Exception;
+       
+       /**
+        * It deletes user related roles for an application in the table
+        * @param roleId
+        * @param uebkey
+        * @param LoginId 
+        * @return true else false
+        * @throws Exception 
+        */
+       public ExternalRequestFieldsValidator deleteDependencyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception;
+       
+       /**
+        * It sync new functions codes and names from and updates role functions from external access system
+        * 
+        * @param app
+        * @throws Exception
+        */
+       public void syncRoleFunctionFromExternalAccessSystem(EPApp app) throws Exception;
+
+       /**
+        * It uploads portal functions into external auth system
+        * @param uebkey
+        * @return
+        * @throws Exception
+        */
+       public Integer bulkUploadFunctions(String uebkey) throws Exception;
+
+       /**
+        * It uploads portal roles into external auth system
+        * @param uebkey
+        * @return
+        * @throws Exception
+        */
+       public Integer bulkUploadRoles(String uebkey) throws Exception;
+
+       /**
+        * It uploads partner application role functions into external auth system
+        * 
+        * @param uebkey
+        * @param upload
+        * @throws Exception
+        */
+       public void bulkUploadPartnerFunctions(String uebkey, List<RoleFunction> upload) throws Exception;
+
+       /** 
+        * It uploads partner application role functions into external auth system
+        * 
+        * @param uebkey
+        * @param upload
+        * @throws Exception
+        */
+       public void bulkUploadPartnerRoles(String uebkey, List<Role> upload) throws Exception;
+
+       /**
+        * It returns total no. of portal application role functions records added in external auth system 
+        * @param uebkey
+        * @return
+        * @throws Exception
+        */
+       Integer bulkUploadRolesFunctions(String uebkey) throws Exception;
+       
+       /**
+        *  It syncs the roles and rolefunctions to the ecomp DB from AAF
+        * @param app
+        * @throws Exception
+        */
+       void syncApplicationRolesWithEcompDB(EPApp app) throws Exception;
+
+       /**
+        * It uploads list of user roles of the application into external auth system 
+        * 
+        * @param uebkey
+        * @return
+        * @throws Exception
+        */
+       public Integer bulkUploadUserRoles(String uebkey) throws Exception;
+
+       /**
+        * It Uploads partner application role functions into external auth system
+        * 
+        * @param uebkey
+        * @param roleList
+        * @throws Exception
+        */
+       void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception;
+
+       /**
+        * it deletes all dependency role records 
+        * 
+        * @param localSession
+        * @param roleId
+        * @param appId
+        * @param isPortalRequest 
+        * @throws Exception
+        */
+       public void deleteRoleDependencyRecords(Session localSession, Long roleId, Long appId, boolean isPortalRequest) throws Exception;
+
+       /**
+        * It returns list of applications functions along with functions associated with global role
+        * 
+        * @param uebkey
+        * @return
+        * @throws Exception
+        */
+       List<String> getMenuFunctionsList(String uebkey) throws Exception;
+       
+       /**
+        * 
+        * @param uebkey applications UebKey
+        * @return
+        * @throws Exception
+        * Method getAllUsers returns all the active users of application
+        */
+       List<EcompUser> getAllAppUsers(String uebkey) throws Exception;
+       
+       /**
+        * 
+        * @param result
+        * @return returns Role Object
+        * Method ConvertCentralRoleToRole converts the CentralRole String to Role Object
+        */
+       public Role ConvertCentralRoleToRole(String result);
+       
+       /**
+        * It returns the list of centralized applications
+        * 
+        * @param userId
+        * @return List
+        */
+       public List<CentralizedApp> getCentralizedAppsOfUser(String userId);
+       
+       /**
+        * It returns the list of globalRoles of Portal
+        * @return
+        */
+       public  List<EPRole> getGlobalRolesOfPortal();
+       
+       /**
+        * It converts list of CentralRoleFunction objects to RoleFunction objects
+        * @param answer contains list of CentralRoleFunction objects
+        * @return List of RoleFunction objects
+        */
+       public List<RoleFunction> convertCentralRoleFunctionToRoleFunctionObject(List<CentralV2RoleFunction> answer);
+       
+       /**
+        * 
+        * It returns user roles for older version
+        * 
+        * @param loginId
+        * @param uebkey
+        * @return EPUser
+        * @throws Exception 
+        */
+       public CentralUser getUserRoles(String loginId, String uebkey) throws Exception;
+       
+       /**
+        * It converts list of V2 CentralRole objects to old version CentralRole objects
+        * 
+        * @param v2CenRole
+        * @return List of CentralRole objects
+        */
+       public List<CentralRole> convertV2CentralRoleListToOldVerisonCentralRoleList(List<CentralV2Role> v2CenRole);
+       
+       /**
+        * 
+        * It finds namespace in external auth system if found returns namespace information
+        * 
+        * @param epApp
+        * @return Http response
+        */
+       public ResponseEntity<String> getNameSpaceIfExists(EPApp epApp) throws Exception, HttpClientErrorException;
+       
+       /**
+        * 
+        * It converts V2 CentralRole objects to old version CentralRole objects
+        * 
+        * @param answer
+        * @return
+        */
+       public CentralRole convertV2CentralRoleToOldVerisonCentralRole(CentralV2Role answer);
+
+       /**
+        * 
+        * Returns list of EPRole Objects if exists
+        * 
+        * @param app
+        * @return List of EPRole objects
+        */
+       Map<String, EPRole> getCurrentRolesInDB(EPApp app);
+    
+       
+       /**
+        * 
+        * It uploads list of users for single role when role name is re-named
+        * 
+        * @param header
+        * @param roleId
+        * @param roleName 
+        * @return number of user roles added in External Auth System
+        * @throws Exception 
+        */
+       public Integer bulkUploadUsersSingleRole(String uebkey, Long roleId, String roleName) throws Exception;
+       
+       /**
+        * 
+        * It returns JSON array of external auth roles and its corresponding functions
+        * 
+        * @param app
+        * @return JSON Array
+        * @throws Exception
+        */
+       public JSONArray getAppRolesJSONFromExtAuthSystem(EPApp app) throws Exception;
+       
+       /**
+        * It encodes the function code  based on Hex encoding
+        * @param funCode
+        * 
+        */
+       public String encodeFunctionCode(String funCode);
+       
+       /**
+        * 
+        * It returns list of ExternalRoleDetails which is converted from JSON array of roles
+        * 
+        * @param app 
+        * @param mapper
+        * @param extRole contains external auth application roles JSON array
+        * @return List of ExternalRoleDetails objects
+        * @throws IOException
+        * @throws JsonParseException
+        * @throws JsonMappingException
+        */
+       public List<ExternalRoleDetails> getExternalRoleDetailsList(EPApp app,
+                       ObjectMapper mapper, JSONArray extRole) throws IOException, JsonParseException, JsonMappingException;
+       
+       public JSONArray getAllUsersByRole(String roleName) throws Exception;
+
+}
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
new file mode 100644 (file)
index 0000000..e867c3d
--- /dev/null
@@ -0,0 +1,3497 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.lang.StringUtils;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.json.JSONArray;
+import org.json.JSONObject;
+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.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.ExternalRoleDetails;
+import org.onap.portalapp.portal.exceptions.DeleteDomainObjectFailedException;
+import org.onap.portalapp.portal.exceptions.ExternalAuthSystemException;
+import org.onap.portalapp.portal.exceptions.InactiveApplicationException;
+import org.onap.portalapp.portal.exceptions.InvalidApplicationException;
+import org.onap.portalapp.portal.exceptions.InvalidUserException;
+import org.onap.portalapp.portal.exceptions.RoleFunctionException;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.transport.BulkUploadRoleFunction;
+import org.onap.portalapp.portal.transport.BulkUploadUserRoles;
+import org.onap.portalapp.portal.transport.CentralApp;
+import org.onap.portalapp.portal.transport.CentralRole;
+import org.onap.portalapp.portal.transport.CentralRoleFunction;
+import org.onap.portalapp.portal.transport.CentralUser;
+import org.onap.portalapp.portal.transport.CentralUserApp;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.CentralV2User;
+import org.onap.portalapp.portal.transport.CentralV2UserApp;
+import org.onap.portalapp.portal.transport.EcompUserRoles;
+import org.onap.portalapp.portal.transport.ExternalAccessPerms;
+import org.onap.portalapp.portal.transport.ExternalAccessPermsDetail;
+import org.onap.portalapp.portal.transport.ExternalAccessRole;
+import org.onap.portalapp.portal.transport.ExternalAccessRolePerms;
+import org.onap.portalapp.portal.transport.ExternalAccessUser;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalapp.portal.transport.ExternalRoleDescription;
+import org.onap.portalapp.portal.transport.GlobalRoleWithApplicationRoleFunction;
+import org.onap.portalapp.portal.transport.LocalRole;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
+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.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+
+@Service("externalAccessRolesService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+@EPAuditLog
+public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesService {
+
+       private static final String APP_ROLE_NAME_PARAM = "appRoleName";
+
+       private static final String GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM = "getRoletoUpdateInExternalAuthSystem";
+
+       private static final String GET_PORTAL_APP_ROLES_QUERY = "getPortalAppRoles";
+
+       private static final String GET_ROLE_FUNCTION_QUERY = "getRoleFunction";
+
+       private static final String FUNCTION_CODE_PARAMS = "functionCode";
+
+       private static final String AND_FUNCTION_CD_EQUALS = " and function_cd = '";
+
+       private static final String OWNER = ".owner";
+
+       private static final String ADMIN = ".admin";
+
+       private static final String ACCOUNT_ADMINISTRATOR = ".Account_Administrator";
+
+       private static final String FUNCTION_PIPE = "|";
+
+       private static final String IS_NULL_STRING = "null";
+
+       private static final String EXTERNAL_AUTH_PERMS = "perms";
+
+       private static final String EXTERNAL_AUTH_ROLE_DESCRIPTION = "description";
+
+       private static final String IS_EMPTY_JSON_STRING = "{}";
+
+       private static final String CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE = "Connecting to External Auth system";
+
+       private static final String APP_ROLE_ID = "appRoleId";
+
+       private static final String APP_ID = "appId";
+
+       private static final String PRIORITY = "priority";
+
+       private static final String ACTIVE = "active";
+
+       private static final String ROLE_NAME = "name";
+
+       private static final String ID = "id";
+
+       private static final String APP_ID_EQUALS = " app_id = ";
+       
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAccessRolesServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       
+       @Autowired
+       private EPAppService epAppService;
+       
+       @Autowired
+       private SessionFactory sessionFactory;
+       
+       @Autowired
+       EPRoleService ePRoleService;
+
+       RestTemplate template = new RestTemplate();
+       
+       
+       // These decode values are based on HexDecoder
+       static final String decodeValueOfForwardSlash = "2f";
+       static final String decodeValueOfHiphen = "2d";
+       static final String decodeValueOfStar = "2a";
+
+       @SuppressWarnings("unchecked")
+       public List<EPRole> getAppRoles(Long appId) throws Exception {
+               List<EPRole> applicationRoles = null;
+               final Map<String, Long> appParams = new HashMap<>();
+               try {
+                       if (appId == 1) {
+                               applicationRoles = dataAccessService.executeNamedQuery("getPortalAppRolesList", null, null);
+                       } else {
+                               appParams.put("appId", appId);
+                               applicationRoles = dataAccessService.executeNamedQuery("getPartnerAppRolesList", appParams, null);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAppRoles: failed", e);
+                       throw e;
+               }
+               return applicationRoles;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPApp> getApp(String uebkey) throws Exception {
+               List<EPApp> app = null;
+               try {
+                       final Map<String, String> appUebkeyParams = new HashMap<>();
+                       appUebkeyParams.put("appKey", uebkey);
+                       app = dataAccessService.executeNamedQuery("getMyAppDetailsByUebKey", appUebkeyParams, null);
+                       if(!app.isEmpty() && !app.get(0).getEnabled() && !app.get(0).getId().equals(PortalConstants.PORTAL_APP_ID)){
+                               throw new InactiveApplicationException("Application:"+app.get(0).getName()+" is Unavailable");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getApp: failed", e);
+                       throw e;
+               }
+               return app;
+       }
+
+       /**
+        * It returns  single application role from external auth system 
+        * @param addRole
+        * @param app
+        * @return JSON string which contains application role details
+        * @throws Exception
+        */
+       private String getSingleAppRole(String addRole, EPApp app) throws Exception {
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(headers);
+               ResponseEntity<String> response = null;
+               logger.debug(EELFLoggerDelegate.debugLogger, "getSingleAppRole: Connecting to External Auth system");
+               response = template.exchange(
+                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "roles/"
+                                               + app.getNameSpace()
+                                               + "." + addRole
+                                                               .replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"),
+                               HttpMethod.GET, entity, String.class);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "getSingleAppRole: Finished GET app role from External Auth system and status code: {} ",
+                               response.getStatusCode().value());
+               return response.getBody();
+       }
+
+       @Override
+       public boolean addRole(Role addRole, String uebkey) throws Exception {
+               boolean response = false;
+               ResponseEntity<String> addResponse = null;
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               EPApp app = getApp(uebkey).get(0);
+               String newRole = updateExistingRoleInExternalSystem(addRole, app);
+               HttpEntity<String> entity = new HttpEntity<>(newRole, headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "addRole: Connecting to External Auth system");
+               addResponse = template.exchange(
+                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
+                               HttpMethod.POST, entity, String.class);
+               if (addResponse.getStatusCode().value() == 201) {
+                       response = true;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "addRole: Finished adding role in the External Auth system  and response code: {} ", addResponse.getStatusCode().value());
+               }
+               if (addResponse.getStatusCode().value() == 406) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "addRole: Failed to add in the External Auth system due to {} and status code: {}", addResponse.getBody(), addResponse.getStatusCode().value());
+               }
+               return response;
+       }
+
+       /**
+        * 
+        * It deletes record in external auth system
+        * 
+        * @param delRole
+        * @return JSON String which has status code and response body 
+        * @throws Exception
+        */
+       private ResponseEntity<String> deleteRoleInExternalSystem(String delRole) throws Exception {
+               ResponseEntity<String> delResponse = null;
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(delRole, headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleInExternalSystem: {} for DELETE: {}" , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, delRole);
+               delResponse = template.exchange(
+                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role?force=true",
+                               HttpMethod.DELETE, entity, String.class);
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleInExternalSystem: Finished DELETE operation in the External Auth system {} and status code: {} ", delRole, delResponse.getStatusCode().value());
+               return delResponse;
+       }
+
+       /**
+        * It updates role in external auth system
+        * 
+        * @param updateExtRole
+        * @param app
+        * @return true if success else false
+        * @throws Exception
+        *                                      If updateRoleInExternalSystem fails we catch it in logger for detail message
+        */
+       @SuppressWarnings("unchecked")
+       private boolean updateRoleInExternalSystem(Role updateExtRole, EPApp app, boolean isGlobalRole) throws Exception {
+               boolean response = false;
+               ObjectMapper mapper = new ObjectMapper();
+               ResponseEntity<String> deleteResponse = null;
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               List<EPRole> epRoleList = null;
+               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)
+                               || (isGlobalRole && !app.getId().equals(PortalConstants.PORTAL_APP_ID))) {
+                       epRoleList = getPortalAppRoleInfo(updateExtRole.getId());
+               } else {
+                       epRoleList = getPartnerAppRoleInfo(updateExtRole.getId(), app);
+               }
+
+               // Assigning functions to global role
+               if ((isGlobalRole && !app.getId().equals(PortalConstants.PORTAL_APP_ID))) {
+                       List<RoleFunction> globalRoleFunctionListNew = convertSetToListOfRoleFunctions(updateExtRole);
+                       EPApp portalAppInfo = epAppService.getApp(PortalConstants.PORTAL_APP_ID);
+                       addFunctionsTOGlobalRole(epRoleList, updateExtRole, globalRoleFunctionListNew, mapper, app, portalAppInfo);
+                       response = true;
+               } else {
+                       String appRole = getSingleAppRole(epRoleList.get(0).getName(), app);
+                       List<RoleFunction> roleFunctionListNew = convertSetToListOfRoleFunctions(updateExtRole);
+                       if (!appRole.equals(IS_EMPTY_JSON_STRING)) {
+                               JSONObject jsonObj = new JSONObject(appRole);
+                               JSONArray extRole = jsonObj.getJSONArray("role");
+                               if (!extRole.getJSONObject(0).has(EXTERNAL_AUTH_ROLE_DESCRIPTION)) {
+                                       String roleName = extRole.getJSONObject(0).getString(ROLE_NAME);
+                                       Map<String, String> delRoleKeyMapper = new HashMap<>();
+                                       delRoleKeyMapper.put(ROLE_NAME, roleName);
+                                       String delRoleKeyValue = mapper.writeValueAsString(delRoleKeyMapper);
+                                       deleteResponse = deleteRoleInExternalSystem(delRoleKeyValue);
+                                       if (deleteResponse.getStatusCode().value() != 200) {
+                                               throw new ExternalAuthSystemException(deleteResponse.getBody());
+                                       }
+                                       addRole(updateExtRole, app.getUebKey());
+                               } else {
+                                       String desc = extRole.getJSONObject(0).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
+                                       String name = extRole.getJSONObject(0).getString(ROLE_NAME);
+                                       List<ExternalAccessPerms> list = new ArrayList<>();
+                                       if (extRole.getJSONObject(0).has(EXTERNAL_AUTH_PERMS)) {
+                                               JSONArray perms = extRole.getJSONObject(0).getJSONArray(EXTERNAL_AUTH_PERMS);
+                                               list = mapper.readValue(perms.toString(), TypeFactory.defaultInstance()
+                                                               .constructCollectionType(List.class, ExternalAccessPerms.class));
+                                       }
+                                       ExternalRoleDescription sysRoleList = mapper.readValue(desc, ExternalRoleDescription.class);
+                                       // If role name or role functions are updated then delete
+                                       // record in External System and add new record to avoid
+                                       // conflicts
+                                       Boolean existingRoleActive;
+                                       boolean isActiveValueChanged;
+                                       // check role active status
+                                       existingRoleActive = new Boolean(sysRoleList.getActive());
+                                       isActiveValueChanged = existingRoleActive.equals(updateExtRole.getActive());
+                                       boolean isRoleNameChanged = false;
+                                       if (!sysRoleList.getName().equals(updateExtRole.getName())) {
+                                               isRoleNameChanged = true;
+                                               Map<String, String> delRoleKeyMapper = new HashMap<>();
+                                               delRoleKeyMapper.put(ROLE_NAME, name);
+                                               String delRoleKeyValue = mapper.writeValueAsString(delRoleKeyMapper);
+                                               deleteResponse = deleteRoleInExternalSystem(delRoleKeyValue);
+                                               if (deleteResponse.getStatusCode().value() != 200) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                                       "updateRoleInExternalSystem:  Failed to delete role in external system due to {} ",
+                                                                       deleteResponse.getBody());
+                                                       throw new ExternalAuthSystemException(deleteResponse.getBody());
+                                               }
+                                               addRole(updateExtRole, app.getUebKey());
+                                               // add partner functions to the global role in External Auth System
+                                               if(!list.isEmpty() && isGlobalRole){
+                                                       addPartnerHasRoleFunctionsToGlobalRole(list, mapper, app, updateExtRole);       
+                                               }
+                                               list.removeIf(perm -> EcompPortalUtils.checkNameSpaceMatching(perm.getType(), app.getNameSpace()));
+                                               // if role name is changes please ignore the previous functions in External Auth and update with user requested functions
+                                               addRemoveFunctionsToRole(updateExtRole, app, mapper, roleFunctionListNew, name,
+                                                               list);
+                                       }
+                                       boolean checkPriorityStatus = StringUtils.equals(String.valueOf(sysRoleList.getPriority()),
+                                                       String.valueOf(updateExtRole.getPriority()));
+                                       ExternalAccessRole updateRole = new ExternalAccessRole();
+                                       if (!isActiveValueChanged || !checkPriorityStatus || sysRoleList.getId().equals(IS_NULL_STRING)
+                                                       || !sysRoleList.getId().equals(String.valueOf(epRoleList.get(0).getId()))) {
+                                               String updateDesc = "";
+                                               List<EPRole> getRole;
+                                               final Map<String, String> getAppRoleByName =  new HashMap<>();
+                                               getAppRoleByName.put(APP_ROLE_NAME_PARAM, updateExtRole.getName());
+                                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                                       getRole = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, getAppRoleByName,
+                                                                       null);
+                                               } else {
+                                                       getAppRoleByName.put("appId", String.valueOf(app.getId()));
+                                                       getRole = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM,
+                                                                       getAppRoleByName, null);
+                                               }
+                                               Map<String, String> extSystemUpdateRoleJsonMapper = new LinkedHashMap<>();
+                                               extSystemUpdateRoleJsonMapper.put(ID, String.valueOf(getRole.get(0).getId()));
+                                               extSystemUpdateRoleJsonMapper.put(ROLE_NAME, String.valueOf(updateExtRole.getName()));
+                                               extSystemUpdateRoleJsonMapper.put(ACTIVE, String.valueOf(updateExtRole.getActive()));
+                                               extSystemUpdateRoleJsonMapper.put(PRIORITY, String.valueOf(updateExtRole.getPriority()));
+                                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                                       extSystemUpdateRoleJsonMapper.put(APP_ID, "null");
+                                                       extSystemUpdateRoleJsonMapper.put(APP_ROLE_ID, "null");
+                                               } else {
+                                                       extSystemUpdateRoleJsonMapper.put(APP_ID, String.valueOf(app.getId()));
+                                                       extSystemUpdateRoleJsonMapper.put(APP_ROLE_ID,
+                                                                       String.valueOf(getRole.get(0).getAppRoleId()));
+
+                                               }
+                                               updateDesc = mapper.writeValueAsString(extSystemUpdateRoleJsonMapper);
+                                               updateRole.setName(app.getNameSpace() + "." + updateExtRole.getName().replaceAll(
+                                                               EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                                               updateRole.setDescription(updateDesc);
+                                               String updateRoleDesc = mapper.writeValueAsString(updateRole);
+                                               HttpEntity<String> entity = new HttpEntity<>(updateRoleDesc, headers);
+                                               logger.debug(EELFLoggerDelegate.debugLogger, "updateRoleInExternalSystem: {} for PUT: {}",
+                                                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, updateRoleDesc);
+                                               ResponseEntity<String> updatePermsResponse = template.exchange(
+                                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                               + "role",
+                                                               HttpMethod.PUT, entity, String.class);
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "updateRoleInExternalSystem: Finished updating in External Auth system {} and status code: {} ",
+                                                               updateRoleDesc, updatePermsResponse.getStatusCode().value());
+                                       }
+                                       if(!isRoleNameChanged) {
+                                               response = addRemoveFunctionsToRole(updateExtRole, app, mapper, roleFunctionListNew, name,
+                                                               list);
+                                       }
+                               }
+                       } else {
+                               // It seems like role exists in local DB but not in External
+                               // Access system
+                               addRole(updateExtRole, app.getUebKey());
+                               List<RoleFunction> roleFunctionListUpdate = convertSetToListOfRoleFunctions(updateExtRole);
+                               response = true;
+                               if (!roleFunctionListUpdate.isEmpty()) {
+                                       addRoleFunctionsInExternalSystem(updateExtRole, mapper, app);
+                               }
+                       }
+               }
+               return response;
+       }
+
+       private boolean addRemoveFunctionsToRole(Role updateExtRole, EPApp app, ObjectMapper mapper,
+                       List<RoleFunction> roleFunctionListNew, String name, List<ExternalAccessPerms> list) throws Exception {
+               boolean response;
+               Map<String, RoleFunction> updateRoleFunc = new HashMap<>();
+               for (RoleFunction addPerm : roleFunctionListNew) {
+                       updateRoleFunc.put(addPerm.getCode(), addPerm);
+               }
+               final Map<String, ExternalAccessPerms> extRolePermMap = new HashMap<>();
+               final Map<String, ExternalAccessPerms> extRolePermMapPipes = new HashMap<>();
+               list.removeIf(perm -> !EcompPortalUtils.checkNameSpaceMatching(perm.getType(), app.getNameSpace()));
+               // Update permissions in the ExternalAccess System
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               if (!list.isEmpty()) {
+                       for (ExternalAccessPerms perm : list) {
+                               RoleFunction roleFunc =  updateRoleFunc.get(perm.getType().substring(app.getNameSpace().length()+1) + FUNCTION_PIPE + perm.getInstance() + FUNCTION_PIPE + perm.getAction());   
+                               if (roleFunc==null) {
+                                       RoleFunction roleFuncPipeFilter =  updateRoleFunc.get(perm.getInstance());
+                                       if(roleFuncPipeFilter == null)
+                                       removePermForRole(perm, mapper, name, headers);
+                               }
+                               extRolePermMap.put(perm.getInstance(), perm);
+                               extRolePermMapPipes.put(
+                                               perm.getType().substring(app.getNameSpace().length()+1) + FUNCTION_PIPE + perm.getInstance() + FUNCTION_PIPE + perm.getAction(), perm);
+                       }
+               }
+               response = true;
+               if (!roleFunctionListNew.isEmpty()) {
+                       for (RoleFunction roleFunc : roleFunctionListNew) {
+                               if(roleFunc.getCode().contains(FUNCTION_PIPE)) {
+                                       ExternalAccessPerms perm = extRolePermMapPipes.get(roleFunc.getCode());
+                                       if (perm == null) {
+                                               response = addFunctionsToRoleInExternalAuthSystem(updateExtRole, app, mapper, headers,
+                                                               roleFunc);
+                                       }
+                               } else {
+                                       if (!extRolePermMap.containsKey(EcompPortalUtils.getFunctionCode(roleFunc.getCode()))) {
+                                               response = addFunctionsToRoleInExternalAuthSystem(updateExtRole, app, mapper, headers,
+                                                               roleFunc);
+                                       }
+                               }
+                       }
+               }
+               return response;
+       }
+       
+       /*
+        * Adds function to the role in the external auth system while editing a role or updating new functions to a role 
+        *
+        */
+       private boolean addFunctionsToRoleInExternalAuthSystem(Role updateExtRole, EPApp app, ObjectMapper mapper,
+                       HttpHeaders headers, RoleFunction roleFunc) throws JsonProcessingException {
+               boolean response;
+               ExternalAccessRolePerms extRolePerms;
+               ExternalAccessPerms extPerms;
+               String code = "";
+               String type = "";
+               String action = "";
+               if (roleFunc.getCode().contains(FUNCTION_PIPE)) {
+                       code = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
+                       type = getFunctionType(roleFunc.getCode());
+                       action = getFunctionAction(roleFunc.getCode());
+               } else {
+                       code = roleFunc.getCode();
+                       type = roleFunc.getCode().contains("menu") ? "menu" : "url";
+                       action = "*";
+               }
+               extPerms = new ExternalAccessPerms(app.getNameSpace() + "." + type, code, action);
+               extRolePerms = new ExternalAccessRolePerms(extPerms,
+                               app.getNameSpace() + "."
+                                               + updateExtRole.getName().replaceAll(
+                                                               EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS,
+                                                               "_"));
+               String updateRolePerms = mapper.writeValueAsString(extRolePerms);
+               HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "updateRoleInExternalSystem: {} for POST: {}",
+                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, updateRolePerms);
+               ResponseEntity<String> addResponse = template.exchange(
+                               SystemProperties.getProperty(
+                                               EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/perm",
+                               HttpMethod.POST, entity, String.class);
+               if (addResponse.getStatusCode().value() != 201 && addResponse.getStatusCode().value()!= 409) {
+                       response = false;
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "updateRoleInExternalSystem: Connected to External Auth system but something went wrong! due to {} and statuscode: {}",
+                                       addResponse.getStatusCode().getReasonPhrase(),
+                                       addResponse.getStatusCode().value());
+               } else {
+                       response = true;
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "updateRoleInExternalSystem: Finished adding permissions to roles in External Auth system {} and status code: {} ",
+                                       updateRolePerms, addResponse.getStatusCode().value());
+               }
+               return response;
+       }
+       
+       private void addPartnerHasRoleFunctionsToGlobalRole(List<ExternalAccessPerms> permslist, ObjectMapper mapper,
+                       EPApp app, Role updateExtRole) throws Exception {
+               for (ExternalAccessPerms perm : permslist) {
+                       if (!EcompPortalUtils.checkNameSpaceMatching(perm.getType(), app.getNameSpace())) {
+                               ExternalAccessRolePerms extAddGlobalRolePerms = null;
+                               ExternalAccessPerms extAddPerms = null;
+                               extAddPerms = new ExternalAccessPerms(perm.getType(), perm.getInstance(), perm.getAction());
+                               extAddGlobalRolePerms = new ExternalAccessRolePerms(extAddPerms,
+                                               app.getNameSpace() + "." + updateExtRole.getName().replaceAll(
+                                                               EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                               String addPerms = mapper.writeValueAsString(extAddGlobalRolePerms);
+                               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                               HttpEntity<String> entity = new HttpEntity<>(addPerms, headers);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addPartnerHasRoleFunctionsToGlobalRole: {} ",
+                                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+                               try {
+                                       ResponseEntity<String> addResponse = template
+                                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                       + "role/perm", HttpMethod.POST, entity, String.class);
+                                       if (addResponse.getStatusCode().value() != 201) {
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "addPartnerHasRoleFunctionsToGlobalRole: While adding permission to the role in  External Auth system something went wrong! due to {} and statuscode: {}",
+                                                               addResponse.getStatusCode().getReasonPhrase(), addResponse.getStatusCode().value());
+                                       } else {
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "addPartnerHasRoleFunctionsToGlobalRole: Finished adding permissions to roles in External Auth system and status code: {} ",
+                                                               addResponse.getStatusCode().value());
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "addPartnerHasRoleFunctionsToGlobalRole: Failed for POST request: {} due to ",
+                                                       addPerms, e);
+                               }
+                       }
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       private void addFunctionsTOGlobalRole(List<EPRole> epRoleList, Role updateExtRole, List<RoleFunction> roleFunctionListNew, ObjectMapper mapper, EPApp app, EPApp portalAppInfo)
+                       throws Exception {
+               try {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering into addFunctionsTOGlobalRole");
+                       //GET Permissions from External Auth System
+                       JSONArray extPerms = getExtAuthPermissions(app);
+                       List<ExternalAccessPermsDetail> permsDetailList = getExtAuthPerrmissonList(app, extPerms);
+                       final Map<String, ExternalAccessPermsDetail> existingPermsWithRoles = new HashMap<>();
+                       final Map<String, ExternalAccessPermsDetail> existingPermsWithRolesWithPipes = new HashMap<>();
+                       final Map<String, RoleFunction> userRquestedFunctionsMap = new HashMap<>();
+                       final Map<String, RoleFunction> userRquestedFunctionsMapPipesFilter = new HashMap<>();
+                       for (ExternalAccessPermsDetail permDetail : permsDetailList) {
+                               existingPermsWithRoles.put(EcompPortalUtils.getFunctionCode(permDetail.getInstance()), permDetail);
+                               existingPermsWithRolesWithPipes.put(permDetail.getInstance(), permDetail);
+
+                       }
+                       // Add If function does not exists for role in External Auth System
+                       for (RoleFunction roleFunc : roleFunctionListNew) {
+                               String roleFuncCode = "";
+                               ExternalAccessPermsDetail permsDetail;
+                               if(roleFunc.getCode().contains(FUNCTION_PIPE)) {
+                                       roleFuncCode = roleFunc.getCode();
+                                       permsDetail = existingPermsWithRolesWithPipes.get(roleFunc.getCode());
+                               } else {
+                                       roleFuncCode = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
+                                       permsDetail = existingPermsWithRoles.get(roleFuncCode);
+                               }
+                               if (null == permsDetail.getRoles() || !permsDetail.getRoles()
+                                               .contains(portalAppInfo.getNameSpace() + FUNCTION_PIPE + epRoleList.get(0).getName().replaceAll(
+                                                               EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"))) {
+                                       addRoleFunctionsToGlobalRoleInExternalSystem(roleFunc, updateExtRole, mapper, app, portalAppInfo);
+                               }
+                               userRquestedFunctionsMap.put(roleFuncCode, roleFunc);
+                               userRquestedFunctionsMapPipesFilter.put(EcompPortalUtils.getFunctionCode(roleFuncCode), roleFunc);
+                       }                       
+                       // Delete functions if exists in External Auth System but not in incoming request
+                       final Map<String, Long> epAppRoleFuncParams =  new HashMap<>();
+                       epAppRoleFuncParams.put("requestedAppId", app.getId());
+                       epAppRoleFuncParams.put("roleId",updateExtRole.getId());
+                       List<GlobalRoleWithApplicationRoleFunction> globalRoleFunctionList = dataAccessService.executeNamedQuery("getGlobalRoleForRequestedApp", epAppRoleFuncParams, null);
+                       for(GlobalRoleWithApplicationRoleFunction globalRoleFunc: globalRoleFunctionList){
+                               String globalRoleFuncWithoutPipes = "";
+                               RoleFunction roleFunc = null;
+                               if(globalRoleFunc.getFunctionCd().contains(FUNCTION_PIPE)) {
+                                       globalRoleFuncWithoutPipes = globalRoleFunc.getFunctionCd();
+                                       roleFunc = userRquestedFunctionsMap.get(globalRoleFuncWithoutPipes);
+                               }else {
+                                       globalRoleFuncWithoutPipes  = EcompPortalUtils.getFunctionCode(globalRoleFunc.getFunctionCd());
+                                       roleFunc = userRquestedFunctionsMapPipesFilter.get(globalRoleFuncWithoutPipes);
+                               }
+                               if(roleFunc == null){
+                                       ExternalAccessPermsDetail permDetailFromMap = globalRoleFunc.getFunctionCd().contains(FUNCTION_PIPE) ? existingPermsWithRolesWithPipes.get(globalRoleFuncWithoutPipes) : existingPermsWithRoles.get(globalRoleFuncWithoutPipes);
+                                       ExternalAccessPerms perm = new ExternalAccessPerms(permDetailFromMap.getType(), EcompPortalUtils.getFunctionCode(permDetailFromMap.getInstance()), permDetailFromMap.getAction());
+                                       String roleName = portalAppInfo.getNameSpace()+"."+globalRoleFunc.getRoleName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_");
+                                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                                       removePermForRole(perm, mapper, roleName, headers);
+                               }
+                       }
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Finished addFunctionsTOGlobalRole");
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "addFunctionsTOGlobalRole: Failed",e);
+                       throw e;
+               }
+       }
+
+       private void addRoleFunctionsToGlobalRoleInExternalSystem(RoleFunction addFunction, Role globalRole, ObjectMapper mapper, EPApp app,
+                       EPApp portalAppInfo) throws Exception {
+               try {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering into addRoleFunctionsToGlobalRoleInExternalSystem");
+                       ExternalAccessRolePerms extAddRolePerms = null;
+                       ExternalAccessPerms extAddPerms = null;
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                               String code = "";
+                               String type = "";
+                               String action = "";
+                               if (addFunction.getCode().contains(FUNCTION_PIPE)) {
+                                       code = EcompPortalUtils.getFunctionCode(addFunction.getCode());
+                                       type = getFunctionType(addFunction.getCode());
+                                       action = getFunctionAction(addFunction.getCode());
+                               } else {
+                                       code = addFunction.getCode();
+                                       type = addFunction.getCode().contains("menu") ? "menu" : "url";
+                                       action = "*";
+                               }
+                               extAddPerms = new ExternalAccessPerms(app.getNameSpace() + "." + type, code, action);
+                               extAddRolePerms = new ExternalAccessRolePerms(extAddPerms,
+                                               portalAppInfo.getNameSpace() + "." + globalRole.getName().replaceAll(
+                                                               EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                               String updateRolePerms = mapper.writeValueAsString(extAddRolePerms);
+                               HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionsInExternalSystem: {} ",
+                                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+                               ResponseEntity<String> addResponse = template
+                                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                               + "role/perm", HttpMethod.POST, entity, String.class);
+                               if (addResponse.getStatusCode().value() != 201) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "addRoleFunctionsInExternalSystem: While adding permission to the role in  External Auth system something went wrong! due to {} and statuscode: {}",
+                                                       addResponse.getStatusCode().getReasonPhrase(), addResponse.getStatusCode().value());
+                               } else {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "addRoleFunctionsInExternalSystem: Finished adding permissions to roles in External Auth system and status code: {} ",
+                                                       addResponse.getStatusCode().value());
+                               }
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Finished addRoleFunctionsToGlobalRoleInExternalSystem");
+               }catch(Exception e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionsToGlobalRoleInExternalSystem: Failed",e);
+                       throw e;
+               }
+       }
+
+       /**
+        * 
+        * It adds functions to the role in external auth system 
+        * 
+        * @param updateExtRole
+        * @param addPermsMapper
+        * @param app
+        * @return true if success else false
+        * @throws Exception
+        */
+       private boolean addRoleFunctionsInExternalSystem(Role updateExtRole, ObjectMapper addPermsMapper, EPApp app)
+                       throws Exception {
+               boolean response = false;
+               ExternalAccessRolePerms extAddRolePerms = null;
+               ExternalAccessPerms extAddPerms = null;
+               List<RoleFunction> roleFunctionListAdd = convertSetToListOfRoleFunctions(updateExtRole);
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               for (RoleFunction roleFunc : roleFunctionListAdd) {
+                       String code = "";
+                       String type= "";
+                       String action = "";
+                       if (roleFunc.getCode().contains(FUNCTION_PIPE)) {
+                               code = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
+                               type = getFunctionType(roleFunc.getCode());
+                               action = getFunctionAction(roleFunc.getCode());
+                       } else {
+                               code = roleFunc.getCode();
+                               type = roleFunc.getCode().contains("menu") ? "menu" : "url";
+                               action = "*";
+                       }
+                       extAddPerms = new ExternalAccessPerms(app.getNameSpace() + "." + type, code, action);
+                       extAddRolePerms = new ExternalAccessRolePerms(extAddPerms,
+                                       app.getNameSpace() + "." + updateExtRole.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                       String updateRolePerms = addPermsMapper.writeValueAsString(extAddRolePerms);
+                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionsInExternalSystem: {} for POST: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, updateRolePerms);
+                       ResponseEntity<String> addResponse = template.exchange(
+                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/perm",
+                                       HttpMethod.POST, entity, String.class);
+                       if (addResponse.getStatusCode().value() != 201) {
+                               response = false;
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "addRoleFunctionsInExternalSystem: While adding permission to the role in  External Auth system something went wrong! due to {} and statuscode: {}",
+                                               addResponse.getStatusCode().getReasonPhrase(), addResponse.getStatusCode().value());
+                       } else {
+                               response = true;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionsInExternalSystem: Finished adding permissions to roles in External Auth system {} and status code: {} ", updateRolePerms, addResponse.getStatusCode().value());
+                       }
+               }
+               return response;
+       }
+
+       /**
+        * 
+        * It converts list of functions in updateExtRole parameter to the RoleFunction object
+        * 
+        * @param updateExtRole
+        * @return list of functions 
+        */
+       @SuppressWarnings("unchecked")
+       private List<RoleFunction> convertSetToListOfRoleFunctions(Role updateExtRole) {
+               Set<RoleFunction> roleFunctionSetList = updateExtRole.getRoleFunctions();
+               List<RoleFunction> roleFunctionList = new ArrayList<>();
+               ObjectMapper roleFuncMapper = new ObjectMapper();
+               Iterator<RoleFunction> itetaror = roleFunctionSetList.iterator();
+               while (itetaror.hasNext()) {
+                       Object nextValue = itetaror.next();
+                       RoleFunction roleFunction = roleFuncMapper.convertValue(nextValue, RoleFunction.class);
+                       roleFunctionList.add(roleFunction);
+               }
+               return roleFunctionList.stream().distinct().collect(Collectors.toList());
+       }
+
+       /**
+        * It delete permissions/functions in the external auth system
+        * 
+        * @param perm
+        * @param permMapper
+        * @param name
+        * @param headers
+        * @throws JsonProcessingException 
+        * @throws Exception
+        */
+       private void removePermForRole(ExternalAccessPerms perm, ObjectMapper permMapper, String name, HttpHeaders headers)
+                       throws ExternalAuthSystemException, JsonProcessingException {
+               ExternalAccessRolePerms extAccessRolePerms = new ExternalAccessRolePerms(perm, name);
+               String permDetails = permMapper.writeValueAsString(extAccessRolePerms);
+               try{
+               HttpEntity<String> deleteEntity = new HttpEntity<>(permDetails, headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "removePermForRole: {} for DELETE: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, permDetails);
+               ResponseEntity<String> deletePermResponse = template
+                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/"
+                                               + name + "/perm", HttpMethod.DELETE, deleteEntity, String.class);
+               if (deletePermResponse.getStatusCode().value() != 200) {
+                       throw new ExternalAuthSystemException(deletePermResponse.getBody());
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "removePermForRole: Finished deleting permission to role in External Auth system: {} and status code: {}",
+                               permDetails, deletePermResponse.getStatusCode().value());
+               } catch(Exception e){
+                       if(e.getMessage().contains("404")){
+                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to add role for DELETE request: {} due to {}", permDetails, e.getMessage());                               
+                       } else{
+                               throw e;
+                       }
+               }
+       }
+
+       /**
+        * It will create new role in the External Auth System
+        * 
+        * @param newRole
+        * @param app
+        * @return true if successfully added in the system else false
+        * @throws Exception
+        *             If fails to add role in the system
+        */
+       private void addNewRoleInExternalSystem(List<EPRole> newRole, EPApp app) throws Exception, HttpClientErrorException {
+               try{
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               ObjectMapper mapper = new ObjectMapper();
+               String addNewRole = "";
+               ExternalAccessRole extRole = new ExternalAccessRole();
+               String addDesc = null;
+               Map<String, String> extSystemJsonMapper = new LinkedHashMap<>();
+               extSystemJsonMapper.put(ID, String.valueOf(newRole.get(0).getId()));
+               extSystemJsonMapper.put(ROLE_NAME, String.valueOf(newRole.get(0).getName()));
+               extSystemJsonMapper.put(ACTIVE, String.valueOf(newRole.get(0).getActive()));
+               extSystemJsonMapper.put(PRIORITY, String.valueOf(newRole.get(0).getPriority()));
+               extSystemJsonMapper.put(APP_ID, String.valueOf(newRole.get(0).getAppId()));
+               extSystemJsonMapper.put(APP_ROLE_ID, String.valueOf(newRole.get(0).getAppRoleId()));
+               addDesc = mapper.writeValueAsString(extSystemJsonMapper);
+               extRole.setName(app.getNameSpace() + "." + newRole.get(0).getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+               extRole.setDescription(addDesc);
+               addNewRole = mapper.writeValueAsString(extRole);
+               HttpEntity<String> postEntity = new HttpEntity<>(addNewRole, headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "addNewRoleInExternalSystem: {} for POST: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, addNewRole);
+               ResponseEntity<String> addNewRoleInExternalSystem = template.exchange(
+                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
+                               HttpMethod.POST, postEntity, String.class);
+                       if (addNewRoleInExternalSystem.getStatusCode().value() == 201) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "addNewRoleInExternalSystem: Finished adding into External Auth system for POST: {} and status code: {}",
+                                               addNewRole, addNewRoleInExternalSystem.getStatusCode().value());
+                       }
+               }catch(HttpClientErrorException ht){
+                       dataAccessService.deleteDomainObjects(EPRole.class, " role_id = "+ newRole.get(0).getId(), null);
+                       logger.error(EELFLoggerDelegate.debugLogger, "addNewRoleInExternalSystem: Failed to add in External Auth system and status code: {}",
+                                       ht);
+                       throw new HttpClientErrorException(ht.getStatusCode());
+               }
+       }
+
+       /**
+        * 
+        * It updates existing role in the External Auth System
+        * 
+        * @param addRole
+        *            It Contains role information
+        * @param app
+        * @return string which is formatted to match with the external auth system
+        * @throws JsonProcessingException
+        */
+       private String updateExistingRoleInExternalSystem(Role addRole, EPApp app) throws JsonProcessingException {
+               ObjectMapper mapper = new ObjectMapper();
+               String addNewRole = "";
+               ExternalAccessRole extRole = new ExternalAccessRole();
+               List<EPRole> role = null;
+               String addDesc = null;
+               Map<String, String> extSystemUpdateRole = new LinkedHashMap<>();
+               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                       role = getPortalAppRoleInfo(addRole.getId());
+               } else {
+                       role = getPartnerAppRoleInfo(addRole.getId(), app);
+               }
+               extSystemUpdateRole.put(ID, String.valueOf(role.get(0).getId()));
+               extSystemUpdateRole.put(ROLE_NAME, String.valueOf(addRole.getName()));
+               extSystemUpdateRole.put(ACTIVE, String.valueOf(role.get(0).getActive()));
+               extSystemUpdateRole.put(PRIORITY, String.valueOf(role.get(0).getPriority()));
+               extSystemUpdateRole.put(APP_ID, String.valueOf(role.get(0).getAppId()));
+               extSystemUpdateRole.put(APP_ROLE_ID, String.valueOf(role.get(0).getAppRoleId()));
+               addDesc = mapper.writeValueAsString(extSystemUpdateRole);
+               extRole.setName(app.getNameSpace() + "." + addRole.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+               extRole.setDescription(addDesc);
+               addNewRole = mapper.writeValueAsString(extRole);
+               return addNewRole;
+       }
+
+       /**
+        * It create a role in the external auth system and then in our local 
+        * 
+        * @param addRoleInDB
+        * @param app
+        * @return true else false
+        * @throws Exception
+        */
+       @SuppressWarnings("unchecked")
+       @Transactional(rollbackFor = Exception.class)
+       private boolean addRoleInEcompDB(Role addRoleInDB, EPApp app) throws Exception {                
+               boolean result = false;
+               EPRole epRole = null;
+               Set<RoleFunction> roleFunctionList = addRoleInDB.getRoleFunctions();
+               List<RoleFunction> roleFunctionListNew = new ArrayList<>();
+               ObjectMapper mapper = new ObjectMapper();
+               Iterator<RoleFunction> itetaror = roleFunctionList.iterator();
+               while (itetaror.hasNext()) {
+                       Object nextValue = itetaror.next();
+                       RoleFunction roleFunction = mapper.convertValue(nextValue, RoleFunction.class);
+                       roleFunctionListNew.add(roleFunction);
+               }
+               List<RoleFunction> listWithoutDuplicates = roleFunctionListNew.stream().distinct().collect(Collectors.toList());
+               try {
+                       if (addRoleInDB.getId() == null) { // check if it is new role
+                               if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                       checkIfRoleExitsInExternalSystem(addRoleInDB, app);
+                               }
+                               EPRole epRoleNew = new EPRole();
+                               epRoleNew.setActive(addRoleInDB.getActive());
+                               epRoleNew.setName(addRoleInDB.getName());
+                               epRoleNew.setPriority(addRoleInDB.getPriority());
+                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                       epRoleNew.setAppId(null);
+                               } else {
+                                       epRoleNew.setAppId(app.getId());
+                               }
+                               dataAccessService.saveDomainObject(epRoleNew, null);
+                               List<EPRole> getRoleCreated = null;
+                               final Map<String, String> epAppRoleParams =  new HashMap<>();
+                               final Map<String, String> epAppPortalRoleParams =  new HashMap<>();
+                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                       epAppRoleParams.put("appId", String.valueOf(app.getId()));
+                                       epAppRoleParams.put(APP_ROLE_NAME_PARAM, addRoleInDB.getName());
+                                       List<EPRole> roleCreated = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, epAppRoleParams, null);
+                                       EPRole epUpdateRole = roleCreated.get(0);
+                                       epUpdateRole.setAppRoleId(epUpdateRole.getId());
+                                       dataAccessService.saveDomainObject(epUpdateRole, null);
+                                       getRoleCreated = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, epAppRoleParams, null);
+                               } else {
+                                       epAppPortalRoleParams.put(APP_ROLE_NAME_PARAM, addRoleInDB.getName());
+                                       getRoleCreated = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, epAppPortalRoleParams, null);
+                               }
+                               // Add role in External Auth system
+                               if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                       addNewRoleInExternalSystem(getRoleCreated, app);
+                               }
+                       } else { // if role already exists then update it
+                               EPRole globalRole = null;
+                               List<EPRole> applicationRoles;
+                               List<EPRole> globalRoleList = getGlobalRolesOfPortal();
+                               boolean isGlobalRole = false;
+                               if (!globalRoleList.isEmpty()) {
+                                       EPRole role = globalRoleList.stream().filter(x -> addRoleInDB.getId().equals(x.getId())).findAny()
+                                                       .orElse(null);
+                                       if (role != null) {
+                                               globalRole = role;
+                                               isGlobalRole = true;
+                                       }
+                               }
+                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)
+                                               || (globalRole != null && app.getId() != globalRole.getAppId())) {
+                                       applicationRoles = getPortalAppRoleInfo(addRoleInDB.getId());
+                               } else {
+                                       applicationRoles = getPartnerAppRoleInfo(addRoleInDB.getId(), app);
+                               }
+                               if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                       updateRoleInExternalSystem(addRoleInDB, app, isGlobalRole);
+                                       // Add all user to the re-named role in external auth system
+                                       if (!applicationRoles.isEmpty()
+                                                       && !addRoleInDB.getName().equals(applicationRoles.get(0).getName())) {
+                                               bulkUploadUsersSingleRole(app.getUebKey(), applicationRoles.get(0).getId(),
+                                                               addRoleInDB.getName());
+                                       }
+                               }
+                               deleteRoleFunction(app, applicationRoles);
+                               if (!applicationRoles.isEmpty()) {
+                                       epRole = applicationRoles.get(0);
+                                       epRole.setName(addRoleInDB.getName());
+                                       epRole.setPriority(addRoleInDB.getPriority());
+                                       epRole.setActive(addRoleInDB.getActive());
+                                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                               epRole.setAppId(null);
+                                               epRole.setAppRoleId(null);
+                                       } else if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)
+                                                       && applicationRoles.get(0).getAppRoleId() == null) {
+                                               epRole.setAppRoleId(epRole.getId());
+                                       }
+                                       dataAccessService.saveDomainObject(epRole, null);
+                               }
+                               Long roleAppId = null;
+                               if (globalRole != null && !app.getId().equals(globalRole.getAppId()))
+                                       roleAppId = PortalConstants.PORTAL_APP_ID;
+                               saveRoleFunction(listWithoutDuplicates, app, applicationRoles, roleAppId);
+                               result = true;
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "addRoleInEcompDB is failed", e);
+                       throw e;
+               }
+               return result;
+       }
+
+       /**
+        * 
+        * It validates whether role exists in external auth system
+        * 
+        * @param checkRole
+        * @param app
+        * @throws Exception
+        *                                      If role exits
+        */
+       private void checkIfRoleExitsInExternalSystem(Role checkRole, EPApp app) throws Exception {
+               getNameSpaceIfExists(app);
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               String roleName = app.getNameSpace() + "." + checkRole.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_");
+               HttpEntity<String> checkRoleEntity = new HttpEntity<>(headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "checkIfRoleExitsInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+               ResponseEntity<String> checkRoleInExternalSystem = template
+                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "roles/"
+                                               + roleName, HttpMethod.GET, checkRoleEntity, String.class);
+               if (!checkRoleInExternalSystem.getBody().equals(IS_EMPTY_JSON_STRING)) {
+                       logger.debug("checkIfRoleExitsInExternalSystem: Role already exists in external system {} and status code: {} ", checkRoleInExternalSystem.getBody(), checkRoleInExternalSystem.getStatusCode().value());
+                       throw new ExternalAuthSystemException(" Role already exists in external system");
+               }
+       }
+
+       /**
+        * It saves list of functions to the role in portal
+        * 
+        * @param roleFunctionListNew
+        * @param app
+        * @param applicationRoles
+        * @throws Exception
+        */
+       @SuppressWarnings("unchecked")
+       private void saveRoleFunction(List<RoleFunction> roleFunctionListNew, EPApp app, List<EPRole> applicationRoles ,Long roleAppId)
+                       throws Exception {      
+               final Map<String, String> getAppFunctionParams = new HashMap<>(); 
+
+               for (RoleFunction roleFunc : roleFunctionListNew) {
+                       String code = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
+                       EPAppRoleFunction appRoleFunc = new EPAppRoleFunction();
+                       appRoleFunc.setAppId(app.getId());
+                       appRoleFunc.setRoleId(applicationRoles.get(0).getId());
+                       appRoleFunc.setRoleAppId(String.valueOf(roleAppId));
+                       getAppFunctionParams.put("appId", String.valueOf(app.getId()));
+                       getAppFunctionParams.put(FUNCTION_CODE_PARAMS, roleFunc.getCode());
+                       // query to check if function code has pipes
+                       List<CentralV2RoleFunction> roleFunction = dataAccessService.executeNamedQuery(GET_ROLE_FUNCTION_QUERY, getAppFunctionParams, null);
+                       if(roleFunction.isEmpty()){
+                               getAppFunctionParams.put(FUNCTION_CODE_PARAMS, code);
+                               roleFunction = dataAccessService.executeNamedQuery(GET_ROLE_FUNCTION_QUERY, getAppFunctionParams, null);
+                       }
+                       if(roleFunction.size() > 1){
+                               CentralV2RoleFunction getExactFunctionCode = appFunctionListFilter(code, roleFunction);
+                               appRoleFunc.setCode(getExactFunctionCode.getCode());
+                       } else{
+                               appRoleFunc.setCode(roleFunction.get(0).getCode());
+                       }
+                       
+                       dataAccessService.saveDomainObject(appRoleFunc, null);
+               }
+       }
+
+       /**
+        * 
+        * It filters the app functions which starts with similar name in the result set
+        * 
+        * @param roleFunc
+        * @param roleFunction
+        * @return CentralRoleFunction 
+        */
+       private CentralV2RoleFunction appFunctionListFilter(String roleFuncCode, List<CentralV2RoleFunction> roleFunction) {
+               final Map<String, CentralV2RoleFunction> appFunctionsFilter = new HashMap<>(); 
+               final Map<String, CentralV2RoleFunction> appFunctionsFilterPipes = new HashMap<>(); 
+               CentralV2RoleFunction getExactFunctionCode = null;
+               for(CentralV2RoleFunction cenRoleFunction : roleFunction){
+                       appFunctionsFilter.put(cenRoleFunction.getCode(), cenRoleFunction);
+                       appFunctionsFilterPipes.put(EcompPortalUtils.getFunctionCode(cenRoleFunction.getCode()), cenRoleFunction);
+               }
+               getExactFunctionCode = appFunctionsFilter.get(roleFuncCode);
+               if(getExactFunctionCode == null){
+                       getExactFunctionCode = appFunctionsFilterPipes.get(roleFuncCode);
+               }
+               return getExactFunctionCode;
+       }
+       
+       /**
+        * It deletes all EPAppRoleFunction records in the portal
+        * 
+        * @param app
+        * @param role
+        */
+       @SuppressWarnings("unchecked")
+       private void deleteRoleFunction(EPApp app, List<EPRole> role) {
+               final Map<String, Long> appRoleFuncsParams = new HashMap<>();
+               appRoleFuncsParams.put("appId", app.getId());
+               appRoleFuncsParams.put("roleId", role.get(0).getId());
+               List<EPAppRoleFunction> appRoleFunctionList =  dataAccessService.executeNamedQuery("getAppRoleFunctionOnRoleIdandAppId", appRoleFuncsParams, null);
+               if (!appRoleFunctionList.isEmpty()) {
+                       for (EPAppRoleFunction approleFunction : appRoleFunctionList) {
+                               dataAccessService.deleteDomainObject(approleFunction, null);
+                       }
+               }
+       }
+       
+       @Override
+       @SuppressWarnings("unchecked")
+       public List<EPUser> getUser(String loginId){
+               final Map<String, String> userParams = new HashMap<>();
+               userParams.put("org_user_id", loginId);
+               return (List<EPUser>) dataAccessService.executeNamedQuery("getEPUserByOrgUserId", userParams, null);
+       }
+
+       @Override
+       public String getV2UserWithRoles(String loginId, String uebkey) throws Exception {
+               final Map<String, String> params = new HashMap<>();
+               List<EPUser> userList = null;
+               CentralV2User cenV2User = null;
+               String result = null;
+               try {
+                       params.put("orgUserIdValue", loginId);
+                       List<EPApp> appList = getApp(uebkey);
+                       if (!appList.isEmpty()) {
+                               userList = getUser(loginId);
+                               if (!userList.isEmpty()) {
+                                       ObjectMapper mapper = new ObjectMapper();
+                                       cenV2User = getV2UserAppRoles(loginId, uebkey);
+                                       result = mapper.writeValueAsString(cenV2User);
+                               } else if (userList.isEmpty()) {
+                                       throw new InvalidUserException("User not found");
+                               }
+                       } else {
+                               throw new InactiveApplicationException("Application not found");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUser: failed", e);
+                       throw e;
+               }
+               return result;
+       }
+
+       @Override
+       public List<CentralV2Role> getRolesForApp(String uebkey) throws Exception {
+               logger.debug(EELFLoggerDelegate.debugLogger, "getRolesForApp: Entering into getRolesForApp");
+               List<CentralV2Role> roleList = new ArrayList<>();
+               final Map<String, Long> params = new HashMap<>();
+               try {
+                       List<EPApp> app = getApp(uebkey);
+                       List<EPRole> appRolesList = getAppRoles(app.get(0).getId());
+                       roleList = createCentralRoleObject(app, appRolesList, roleList, params);
+                       if(app.get(0).getId() != PortalConstants.PORTAL_APP_ID){
+                           List<CentralV2Role> globalRoleList = getGlobalRolesOfApplication(app.get(0).getId());
+                               List<EPRole> globalRolesList = getGlobalRolesOfPortal();
+                           List<CentralV2Role> portalsGlobalRolesFinlaList = new ArrayList<>();
+                               if (!globalRolesList.isEmpty()) {
+                                       for (EPRole eprole : globalRolesList) {
+                                               CentralV2Role cenRole = convertRoleToCentralV2Role(eprole);
+                                               portalsGlobalRolesFinlaList.add(cenRole);
+                                       }
+                                       roleList.addAll(globalRoleList);
+                                       for (CentralV2Role role : portalsGlobalRolesFinlaList) {
+                                               CentralV2Role result = roleList.stream()
+                                                                       .filter(x -> role.getId().equals(x.getId())).findAny().orElse(null);
+                                                       if (result == null)
+                                                               roleList.add(role);
+                                       }
+                               } else {
+                                       for (EPRole role : globalRolesList) {
+                                               CentralV2Role cenRole = convertRoleToCentralV2Role(role);
+                                               roleList.add(cenRole);
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRolesForApp: Failed!", e);
+                       throw e;
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "getRolesForApp: Finished!");
+               return roleList.stream().distinct().collect(Collectors.toList());
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<CentralV2RoleFunction> getRoleFuncList(String uebkey) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               List<CentralV2RoleFunction> finalRoleList = new ArrayList<>();
+               final Map<String, Long> params = new HashMap<>();
+               params.put(APP_ID, app.getId());
+               List<CentralV2RoleFunction> getRoleFuncList = dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null);
+               for (CentralV2RoleFunction roleFuncItem : getRoleFuncList) {
+                       String code = EcompPortalUtils.getFunctionCode(roleFuncItem.getCode());
+                       String type = getFunctionType(roleFuncItem.getCode());
+                       String action = getFunctionAction(roleFuncItem.getCode());
+                       roleFuncItem.setCode(EPUserUtils.decodeFunctionCode(code));
+                       roleFuncItem.setType(type);
+                       roleFuncItem.setAction(action);
+                       finalRoleList.add(roleFuncItem);
+               }
+               return finalRoleList;
+       }
+
+
+       /**
+        * It return function action
+        * 
+        * @param roleFuncItem
+        * @return String action
+        */
+       private String getFunctionAction(String roleFuncItem) {
+               return (!roleFuncItem.contains(FUNCTION_PIPE)) ? "*"
+                               : EcompPortalUtils.getFunctionAction(roleFuncItem);
+       }
+
+       /**
+        * 
+        * It check function code has any pipes, if found return function type
+        * 
+        * @param roleFuncItem
+        * @param type
+        * @return function type
+        */
+       private String getFunctionType(String roleFuncItem) {
+               String type = null;
+               if ((roleFuncItem.contains(FUNCTION_PIPE) && roleFuncItem.contains("menu"))
+                               || (!roleFuncItem.contains(FUNCTION_PIPE) && roleFuncItem.contains("menu"))) {
+                       type = "menu";
+               } else if (checkIfCodeHasNoPipesAndHasTypeUrl(roleFuncItem)
+                               ||checkIfCodeHasPipesAndHasTypeUrl(roleFuncItem)
+                               ||checkIfCodeHasNoPipesAndHasNoTypeUrl(roleFuncItem)) {
+                       type = "url";
+               } else if (roleFuncItem.contains(FUNCTION_PIPE)
+                               && (!roleFuncItem.contains("menu") || roleFuncItem.contains("url"))) {
+                       type = EcompPortalUtils.getFunctionType(roleFuncItem);
+               }
+               return type;
+       }
+
+       /**
+        * 
+        * It check whether function code has no pipes and no url string in it
+        * 
+        * @param roleFuncItem
+        * @return true or false
+        */
+       private boolean checkIfCodeHasNoPipesAndHasNoTypeUrl(String roleFuncItem) {
+               return !roleFuncItem.contains(FUNCTION_PIPE) && !roleFuncItem.contains("url");
+       }
+       
+       /**
+        * 
+        * It check whether function code has pipes and url string in it  
+        * 
+        * @param roleFuncItem
+        * @return true or false
+        */
+       private boolean checkIfCodeHasPipesAndHasTypeUrl(String roleFuncItem) {
+               return roleFuncItem.contains(FUNCTION_PIPE) && roleFuncItem.contains("url");
+       }
+
+       /**
+        * 
+        * It check whether function code has no pipes and has url string in it 
+        * 
+        * @param roleFuncItem
+        * @return true or false
+        */
+       private boolean checkIfCodeHasNoPipesAndHasTypeUrl(String roleFuncItem) {
+               return !roleFuncItem.contains(FUNCTION_PIPE) && roleFuncItem.contains("url");
+       }
+
+       /**
+        * It returns user detail information which is deep copy of EPUser.class object
+        * 
+        * @param userInfo
+        * @param userAppSet
+        * @param app
+        * @return
+        * @throws Exception
+        */
+       @SuppressWarnings("unchecked")
+       private CentralV2User createEPUser(EPUser userInfo, Set<EPUserApp> userAppSet, EPApp app) throws Exception {
+
+               final Map<String, Long> params = new HashMap<>();
+               CentralV2User userAppList = new CentralV2User();
+               CentralV2User user1 = null;
+               try {
+                       userAppList.setUserApps(new TreeSet<CentralV2UserApp>());
+                       for (EPUserApp userApp : userAppSet) {
+                               if (userApp.getRole().getActive()) {
+                                       EPApp epApp = userApp.getApp();
+                                       String globalRole = userApp.getRole().getName().toLowerCase();
+                                       if (((epApp.getId().equals(app.getId()))
+                                                       && (!userApp.getRole().getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)))
+                                                       || ((epApp.getId().equals(PortalConstants.PORTAL_APP_ID))
+                                                                       && (globalRole.toLowerCase().startsWith("global_")))) {
+                                               CentralV2UserApp cua = new CentralV2UserApp();
+                                               cua.setUserId(null);
+                                               CentralApp cenApp = new CentralApp(1L, epApp.getCreated(), epApp.getModified(),
+                                                               epApp.getCreatedId(), epApp.getModifiedId(), epApp.getRowNum(), epApp.getName(),
+                                                               epApp.getImageUrl(), epApp.getDescription(), epApp.getNotes(), epApp.getUrl(),
+                                                               epApp.getAlternateUrl(), epApp.getAppRestEndpoint(), epApp.getMlAppName(),
+                                                               epApp.getMlAppAdminId(), String.valueOf(epApp.getMotsId()), epApp.getAppPassword(),
+                                                               String.valueOf(epApp.getOpen()), String.valueOf(epApp.getEnabled()),
+                                                               epApp.getThumbnail(), epApp.getUsername(), epApp.getUebKey(), epApp.getUebSecret(),
+                                                               epApp.getUebTopicName());
+                                               cua.setApp(cenApp);
+                                               params.put("roleId", userApp.getRole().getId());
+                                               params.put(APP_ID, userApp.getApp().getId());
+                                               CentralV2Role centralRole;
+                                               List<EPRole> globalRoleList;
+                                               globalRoleList = getGlobalRolesOfPortal();
+                                               EPRole result = globalRoleList.stream().filter(x -> userApp.getRole().getId().equals(x.getId()))
+                                                               .findAny().orElse(null);
+                                               if (result != null && userApp.getApp().getId() != app.getId()) {
+                                                       userApp.getRole().setId(result.getId());
+                                                       centralRole = getGlobalRoleForRequestedApp(app.getId(), userApp.getRole().getId());
+                                                       cua.setRole(centralRole);
+                                               } else {
+                                                       List<CentralV2RoleFunction> appRoleFunctionList = dataAccessService
+                                                                       .executeNamedQuery("getAppRoleFunctionList", params, null);
+                                                       SortedSet<CentralV2RoleFunction> roleFunctionSet = new TreeSet<>();
+                                                       for (CentralV2RoleFunction roleFunc : appRoleFunctionList) {
+                                                               String functionCode = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
+                                                               CentralV2RoleFunction cenRoleFunc = new CentralV2RoleFunction(roleFunc.getId(),
+                                                                               functionCode, roleFunc.getName(), null, null);
+                                                               roleFunctionSet.add(cenRoleFunc);
+                                                       }
+                                                       Long userRoleId = null;
+                                                       if (globalRole.toLowerCase().startsWith("global_")
+                                                                       && epApp.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                                               userRoleId = userApp.getRole().getId();
+                                                       } else {
+                                                               userRoleId = userApp.getRole().getAppRoleId();
+                                                       }
+                                                       CentralV2Role cenRole = new CentralV2Role(userRoleId, userApp.getRole().getCreated(),
+                                                                       userApp.getRole().getModified(), userApp.getRole().getCreatedId(),
+                                                                       userApp.getRole().getModifiedId(), userApp.getRole().getRowNum(),
+                                                                       userApp.getRole().getName(), userApp.getRole().getActive(),
+                                                                       userApp.getRole().getPriority(), roleFunctionSet, null, null);
+                                                       cua.setRole(cenRole);
+                                               }
+                                               userAppList.getUserApps().add(cua);
+                                       }
+                               }
+                       }
+
+                       user1 = new CentralV2User(null, userInfo.getCreated(), userInfo.getModified(), userInfo.getCreatedId(),
+                                       userInfo.getModifiedId(), userInfo.getRowNum(), userInfo.getOrgId(), userInfo.getManagerId(),
+                                       userInfo.getFirstName(), userInfo.getMiddleInitial(), userInfo.getLastName(), userInfo.getPhone(),
+                                       userInfo.getFax(), userInfo.getCellular(), userInfo.getEmail(), userInfo.getAddressId(),
+                                       userInfo.getAlertMethodCd(), userInfo.getHrid(), userInfo.getOrgUserId(), userInfo.getOrgCode(),
+                                       userInfo.getAddress1(), userInfo.getAddress2(), userInfo.getCity(), userInfo.getState(),
+                                       userInfo.getZipCode(), userInfo.getCountry(), userInfo.getOrgManagerUserId(),
+                                       userInfo.getLocationClli(), userInfo.getBusinessCountryCode(), userInfo.getBusinessCountryName(),
+                                       userInfo.getBusinessUnit(), userInfo.getBusinessUnitName(), userInfo.getDepartment(),
+                                       userInfo.getDepartmentName(), userInfo.getCompanyCode(), userInfo.getCompany(),
+                                       userInfo.getZipCodeSuffix(), userInfo.getJobTitle(), userInfo.getCommandChain(),
+                                       userInfo.getSiloStatus(), userInfo.getCostCenter(), userInfo.getFinancialLocCode(),
+                                       userInfo.getLoginId(), userInfo.getLoginPwd(), userInfo.getLastLoginDate(), userInfo.getActive(),
+                                       userInfo.getInternal(), userInfo.getSelectedProfileId(), userInfo.getTimeZoneId(),
+                                       userInfo.isOnline(), userInfo.getChatId(), userAppList.getUserApps(), null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "createEPUser: createEPUser failed", e);
+                       throw e;
+               }
+               return user1;
+       }
+
+       @Override
+       public CentralV2Role getRoleInfo(Long roleId, String uebkey) throws Exception {
+               final Map<String, Long> params = new HashMap<>();
+               List<CentralV2Role> roleList = new ArrayList<>();
+               CentralV2Role cenRole = new CentralV2Role();
+               List<EPRole> roleInfo = null;
+               List<EPApp> app = null;
+               try {
+                       app = getApp(uebkey);
+                       if (app.isEmpty()) {
+                               throw new InactiveApplicationException("Application not found");
+                       }
+                       if (app.get(0).getId() != PortalConstants.PORTAL_APP_ID) {
+                               List<EPRole> globalRoleList = new ArrayList<>();
+                               globalRoleList = getGlobalRolesOfPortal();
+                               if (globalRoleList.size() > 0) {
+                                       EPRole result = globalRoleList.stream().filter(x -> roleId.equals(x.getId())).findAny()
+                                                       .orElse(null);
+                                       if (result != null)
+                                               return getGlobalRoleForRequestedApp(app.get(0).getId(), roleId);
+                               }
+                       }
+                       if (app.get(0).getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                               roleInfo = getPortalAppRoleInfo(roleId);
+                       } else {
+                               roleInfo = getPartnerAppRoleInfo(roleId, app.get(0));
+                       }
+                       roleList = createCentralRoleObject(app, roleInfo, roleList, params);
+                       if (roleList.isEmpty()) {
+                               return cenRole;
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleInfo: failed", e);
+                       throw e;
+
+               }
+               return roleList.get(0);
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<EPRole> getPartnerAppRoleInfo(Long roleId, EPApp app) {
+               List<EPRole> roleInfo;
+               final Map<String, Long> getPartnerAppRoleParams = new HashMap<>();
+               getPartnerAppRoleParams.put("appRoleId", roleId);
+               getPartnerAppRoleParams.put("appId", app.getId());                              
+               roleInfo = dataAccessService.executeNamedQuery("getPartnerAppRoleByRoleId", getPartnerAppRoleParams, null);
+               if(roleInfo.isEmpty()) {
+                       getPartnerAppRoleParams.put("appRoleId", roleId);
+                       roleInfo = dataAccessService.executeNamedQuery("getPartnerAppRoleById", getPartnerAppRoleParams, null);
+               }
+               return roleInfo;
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<EPRole> getPortalAppRoleInfo(Long roleId) {
+               List<EPRole> roleInfo;
+               final Map<String, Long> getPortalAppRoleParams = new HashMap<>();
+               getPortalAppRoleParams.put("roleId", roleId);
+               roleInfo = dataAccessService.executeNamedQuery("getPortalAppRoleByRoleId", getPortalAppRoleParams, null);
+               return roleInfo;
+       }
+       
+       /**
+        * 
+        * It returns list of app roles along with role functions and which went through deep copy
+        * 
+        * @param app
+        * @param roleInfo
+        * @param roleList
+        * @param params
+        * @return
+        * @throws DecoderException 
+        */
+       @SuppressWarnings("unchecked")
+       private List<CentralV2Role> createCentralRoleObject(List<EPApp> app, List<EPRole> roleInfo,
+                       List<CentralV2Role> roleList, Map<String, Long> params) throws RoleFunctionException {
+               for (EPRole role : roleInfo) {
+                       params.put("roleId", role.getId());
+                       params.put(APP_ID, app.get(0).getId());
+                       List<CentralV2RoleFunction> cenRoleFuncList = dataAccessService.executeNamedQuery("getAppRoleFunctionList",
+                                       params, null);
+                       SortedSet<CentralV2RoleFunction> roleFunctionSet = new TreeSet<>();
+                       for (CentralV2RoleFunction roleFunc : cenRoleFuncList) {
+                               String functionCode = EcompPortalUtils.getFunctionCode(roleFunc.getCode());
+                               functionCode = EPUserUtils.decodeFunctionCode(functionCode);
+                               String type = getFunctionType(roleFunc.getCode());
+                               String action = getFunctionAction(roleFunc.getCode());
+                               CentralV2RoleFunction cenRoleFunc = new CentralV2RoleFunction(role.getId(), functionCode,
+                                               roleFunc.getName(), null, type, action, null);
+                               roleFunctionSet.add(cenRoleFunc);
+                       }
+                       SortedSet<CentralV2Role> childRoles = new TreeSet<>();
+                       SortedSet<CentralV2Role> parentRoles = new TreeSet<>();
+                       CentralV2Role cenRole = null;
+                       if (role.getAppRoleId() == null) {
+                               cenRole = new CentralV2Role(role.getId(), role.getCreated(), role.getModified(), role.getCreatedId(),
+                                               role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(), role.getPriority(),
+                                               roleFunctionSet, childRoles, parentRoles);
+                       } else {
+                               cenRole = new CentralV2Role(role.getAppRoleId(), role.getCreated(), role.getModified(),
+                                               role.getCreatedId(), role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(),
+                                               role.getPriority(), roleFunctionSet, childRoles, parentRoles);
+                       }
+                       roleList.add(cenRole);
+               }
+               return roleList;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public CentralV2RoleFunction getRoleFunction(String functionCode, String uebkey) throws Exception {
+               if (functionCode.contains("|"))
+                       functionCode = EcompPortalUtils.getFunctionCode(functionCode);
+               functionCode = encodeFunctionCode(functionCode);
+               CentralV2RoleFunction roleFunc = null;
+               EPApp app = getApp(uebkey).get(0);
+               List<CentralV2RoleFunction> getRoleFuncList = null;
+               final Map<String, String> params = new HashMap<>();
+               try {
+                       params.put(FUNCTION_CODE_PARAMS, functionCode);
+                       params.put(APP_ID, String.valueOf(app.getId()));
+                       getRoleFuncList = dataAccessService.executeNamedQuery(GET_ROLE_FUNCTION_QUERY, params, null);
+                       if (getRoleFuncList.isEmpty()) {
+                               return roleFunc;
+                       } else {
+                               if (getRoleFuncList.size() > 1) {
+                                       CentralV2RoleFunction cenV2RoleFunction = appFunctionListFilter(functionCode, getRoleFuncList);
+                                       if(cenV2RoleFunction == null)
+                                               return roleFunc;
+                                       roleFunc = checkIfPipesExitsInFunctionCode(cenV2RoleFunction);
+                               } else {
+                                       roleFunc = checkIfPipesExitsInFunctionCode(getRoleFuncList.get(0));
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunction: failed", e);
+                       throw e;
+               }
+               return roleFunc;
+       }
+
+       private CentralV2RoleFunction checkIfPipesExitsInFunctionCode(CentralV2RoleFunction getRoleFuncList) {
+               CentralV2RoleFunction roleFunc;
+               String functionCodeFormat = getRoleFuncList.getCode();
+               if (functionCodeFormat.contains(FUNCTION_PIPE)) {
+                       String newfunctionCodeFormat = EcompPortalUtils.getFunctionCode(functionCodeFormat);
+                       String newfunctionTypeFormat = EcompPortalUtils.getFunctionType(functionCodeFormat);
+                       String newfunctionActionFormat = EcompPortalUtils.getFunctionAction(functionCodeFormat);
+                       roleFunc = new CentralV2RoleFunction(getRoleFuncList.getId(), newfunctionCodeFormat,
+                                       getRoleFuncList.getName(), getRoleFuncList.getAppId(), newfunctionTypeFormat, newfunctionActionFormat,
+                                       getRoleFuncList.getEditUrl());
+               } else {
+                       roleFunc = new CentralV2RoleFunction(getRoleFuncList.getId(), functionCodeFormat,
+                                       getRoleFuncList.getName(), getRoleFuncList.getAppId(),
+                                       getRoleFuncList.getEditUrl());
+               }
+               return roleFunc;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public boolean saveCentralRoleFunction(CentralV2RoleFunction domainCentralRoleFunction, EPApp app) throws Exception {
+               boolean saveOrUpdateFunction = false;
+               try {
+                       domainCentralRoleFunction.setCode(encodeFunctionCode(domainCentralRoleFunction.getCode()));
+                       final Map<String, String> functionParams = new HashMap<>();
+                       functionParams.put("appId", String.valueOf(app.getId()));
+                       List<CentralV2RoleFunction> appRoleFuncWithPipe = new ArrayList<>();
+                       // If request coming from portal application we use type, instance/code and action to fetch record
+                       if(domainCentralRoleFunction.getType()!=null && domainCentralRoleFunction.getAction()!=null){
+                               functionParams.put(FUNCTION_CODE_PARAMS, domainCentralRoleFunction.getType()+FUNCTION_PIPE
+                                               +domainCentralRoleFunction.getCode()+FUNCTION_PIPE+domainCentralRoleFunction.getAction());
+                               appRoleFuncWithPipe =  dataAccessService.executeNamedQuery(GET_ROLE_FUNCTION_QUERY, functionParams, null);
+                               if(appRoleFuncWithPipe.isEmpty()){
+                                       functionParams.put(FUNCTION_CODE_PARAMS, domainCentralRoleFunction.getCode());
+                                       appRoleFuncWithPipe =  dataAccessService.executeNamedQuery(GET_ROLE_FUNCTION_QUERY, functionParams, null);
+                               }
+                       } 
+                       // If request coming from SDK applications we use just function code to fetch record
+                       else{
+                               functionParams.put(FUNCTION_CODE_PARAMS, domainCentralRoleFunction.getCode());
+                       }               
+                       CentralV2RoleFunction appFunctionCode = null;
+                       if(!appRoleFuncWithPipe.isEmpty()){
+                               // Make sure we extract correct record if similar records are found as query uses like condition 
+                          appFunctionCode = appFunctionListFilter(domainCentralRoleFunction.getCode(), appRoleFuncWithPipe);   
+                          if(appFunctionCode == null){
+                                  appFunctionCode = domainCentralRoleFunction;
+                          }
+                       } else{
+                               appFunctionCode = domainCentralRoleFunction;
+                       }
+                       appFunctionCode.setName(domainCentralRoleFunction.getName());
+                       if(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                               addRoleFunctionInExternalSystem(appFunctionCode, app);                  
+                       }
+                       if(domainCentralRoleFunction.getType() != null && domainCentralRoleFunction.getAction() != null){
+                               appFunctionCode.setCode(domainCentralRoleFunction.getType()+
+                                       FUNCTION_PIPE+domainCentralRoleFunction.getCode()+FUNCTION_PIPE+domainCentralRoleFunction.getAction());
+                       }
+                       appFunctionCode.setAppId(app.getId());
+                       dataAccessService.saveDomainObject(appFunctionCode, null);
+                       saveOrUpdateFunction = true;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveCentralRoleFunction: failed", e);
+                       throw e;
+               }
+               return saveOrUpdateFunction;
+       }
+       
+       /**
+        * It creates application permission in external auth system
+        * 
+        * @param domainCentralRoleFunction
+        * @param app
+        * @throws Exception
+        */
+       private void addRoleFunctionInExternalSystem(CentralV2RoleFunction domainCentralRoleFunction, EPApp app)
+                       throws Exception {
+               ObjectMapper mapper = new ObjectMapper();
+               ExternalAccessPerms extPerms = new ExternalAccessPerms();
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth(); 
+               String type = "";
+               String instance = "";
+               String action = "";
+               if((domainCentralRoleFunction.getType()!=null && domainCentralRoleFunction.getAction()!=null) || domainCentralRoleFunction.getCode().contains(FUNCTION_PIPE)){
+                       type =  domainCentralRoleFunction.getCode().contains(FUNCTION_PIPE) ? EcompPortalUtils.getFunctionType(domainCentralRoleFunction.getCode()) : domainCentralRoleFunction.getType(); 
+                       instance =  domainCentralRoleFunction.getCode().contains(FUNCTION_PIPE) ?  EcompPortalUtils.getFunctionCode(domainCentralRoleFunction.getCode()) : domainCentralRoleFunction.getCode();
+                       action =  domainCentralRoleFunction.getCode().contains(FUNCTION_PIPE) ? EcompPortalUtils.getFunctionAction(domainCentralRoleFunction.getCode()) : domainCentralRoleFunction.getAction();
+               } else{
+                       type = domainCentralRoleFunction.getCode().contains("menu") ? "menu" : "url";
+                       instance = domainCentralRoleFunction.getCode();
+                       action = "*"; 
+               }               
+               // get Permissions from External Auth System
+               JSONArray extPermsList = getExtAuthPermissions(app);
+               List<ExternalAccessPermsDetail> permsDetailList = getExtAuthPerrmissonList(app, extPermsList);
+               String requestedPerm = type+FUNCTION_PIPE+instance+FUNCTION_PIPE+action;
+               boolean checkIfFunctionsExits = permsDetailList.stream().anyMatch(permsDetail -> permsDetail.getInstance().equals(requestedPerm));
+               if (!checkIfFunctionsExits) {
+                       try {
+                               extPerms.setAction(action);
+                               extPerms.setInstance(instance);
+                               extPerms.setType(app.getNameSpace() + "." + type);
+                               extPerms.setDescription(domainCentralRoleFunction.getName());
+                               String addFunction = mapper.writeValueAsString(extPerms);
+                               HttpEntity<String> entity = new HttpEntity<>(addFunction, headers);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: {} for POST: {}" , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, addFunction);
+                               ResponseEntity<String> addPermResponse= template.exchange(
+                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "perm",
+                                               HttpMethod.POST, entity, String.class);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: Finished adding permission for POST: {} and status code: {} ", addPermResponse.getStatusCode().value(), addFunction);
+                       } catch(HttpClientErrorException e){
+                               logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to add function in external central auth system", e);
+                               EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+                               throw e;
+                       }catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionInExternalSystem: Failed to add fucntion in external central auth system",
+                                               e);
+                               throw e;
+                       }
+               } else {
+                       try {
+                               extPerms.setAction(action);
+                               extPerms.setInstance(instance);
+                               extPerms.setType(app.getNameSpace() + "." + type);
+                               extPerms.setDescription(domainCentralRoleFunction.getName());
+                               String updateRoleFunction = mapper.writeValueAsString(extPerms);
+                               HttpEntity<String> entity = new HttpEntity<>(updateRoleFunction, headers);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: {} for PUT: {}" , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, updateRoleFunction);
+                               ResponseEntity<String> updatePermResponse = template.exchange(
+                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "perm",
+                                               HttpMethod.PUT, entity, String.class);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: Finished updating permission in External Auth system {} and response: {} ", updateRoleFunction, updatePermResponse.getStatusCode().value());
+                       } catch(HttpClientErrorException e){
+                               logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to add function in external central auth system", e);
+                               EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+                               throw e;
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionInExternalSystem: Failed to update function in external central auth system",e);
+                               throw e;
+                       }
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       @Transactional(rollbackFor = Exception.class)
+       public boolean deleteCentralRoleFunction(String code, EPApp app) {
+               boolean deleteFunctionResponse = false;
+               try {
+                       final Map<String, String> params = new HashMap<>();
+                       params.put(FUNCTION_CODE_PARAMS, code);
+                       params.put(APP_ID, String.valueOf(app.getId()));
+                       List<CentralV2RoleFunction> domainCentralRoleFunction = dataAccessService
+                                       .executeNamedQuery(GET_ROLE_FUNCTION_QUERY, params, null);
+                       CentralV2RoleFunction appFunctionCode = appFunctionListFilter(code, domainCentralRoleFunction);
+                       if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                               deleteRoleFunctionInExternalSystem(appFunctionCode, app);
+                               // Delete role function dependency records
+                               deleteAppRoleFunctions(appFunctionCode.getCode(), app);
+                       }
+                       dataAccessService.deleteDomainObject(appFunctionCode, null);
+                       deleteFunctionResponse = true;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteCentralRoleFunction: failed", e);
+               }
+               return deleteFunctionResponse;
+       }
+
+       /**
+        * It deletes app function record in portal 
+        * 
+        * @param code
+        * @param app
+        */
+       private void deleteAppRoleFunctions(String code, EPApp app) {
+               dataAccessService.deleteDomainObjects(EPAppRoleFunction.class,
+                               APP_ID_EQUALS + app.getId() + AND_FUNCTION_CD_EQUALS + code + "'", null);
+       }
+       
+       /**
+        * 
+        * It deletes permission in the external auth system  
+        * 
+        * @param domainCentralRoleFunction
+        * @param app
+        * @throws Exception
+        */
+       private void deleteRoleFunctionInExternalSystem(CentralV2RoleFunction domainCentralRoleFunction, EPApp app)
+                       throws Exception {
+               try {
+                       ObjectMapper mapper = new ObjectMapper();
+                       ExternalAccessPerms extPerms = new ExternalAccessPerms();
+                       String instanceValue = EcompPortalUtils.getFunctionCode(domainCentralRoleFunction.getCode());
+                       String checkType = getFunctionType(domainCentralRoleFunction.getCode());
+                       String actionValue = getFunctionAction(domainCentralRoleFunction.getCode());
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                       extPerms.setAction(actionValue);
+                       extPerms.setInstance(instanceValue);
+                       extPerms.setType(app.getNameSpace() + "." + checkType);
+                       extPerms.setDescription(domainCentralRoleFunction.getName());
+                       String deleteRoleFunction = mapper.writeValueAsString(extPerms);
+                       HttpEntity<String> entity = new HttpEntity<>(deleteRoleFunction, headers);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleFunctionInExternalSystem: {} for DELETE: {} ",
+                                       CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE, deleteRoleFunction);
+                       ResponseEntity<String> delPermResponse = template
+                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                       + "perm?force=true", HttpMethod.DELETE, entity, String.class);
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "deleteRoleFunctionInExternalSystem: Finished deleting permission in External Auth system {} and status code: {} ",
+                                       deleteRoleFunction, delPermResponse.getStatusCode().value());
+               } catch(HttpClientErrorException e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to delete functions in External System", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               " deleteRoleFunctionInExternalSystem: It seems like function is already deleted in external central auth system  but exists in local DB",
+                                               e.getMessage());
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunctionInExternalSystem: Failed to delete functions in External System", e);
+                       }
+               }
+       }
+
+       @Override
+       public ExternalRequestFieldsValidator saveRoleForApplication(Role saveRole, String uebkey) throws Exception {
+               boolean response = false;
+               String message = "";
+               try {
+                       EPApp app = getApp(uebkey).get(0);
+                       addRoleInEcompDB(saveRole, app);
+                       response = true;
+               } catch (Exception e) {
+                       message = e.getMessage();
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveRoleForApplication failed", e);
+               }
+               return new ExternalRequestFieldsValidator(response,message);
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public boolean deleteRoleForApplication(String deleteRole, String uebkey) throws Exception {
+               Session localSession = sessionFactory.openSession();
+               Transaction transaction = null;
+               boolean result = false;
+               try {
+                       List<EPRole> epRoleList = null;
+                       EPApp app = getApp(uebkey).get(0);
+                       final Map<String, String> deleteRoleParams = new HashMap<>();
+                       deleteRoleParams.put(APP_ROLE_NAME_PARAM, deleteRole);
+                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                               epRoleList = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, deleteRoleParams, null);
+                       } else {
+                               deleteRoleParams.put(APP_ID, String.valueOf(app.getId()));
+                               epRoleList = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, deleteRoleParams, null);
+                       }
+                       if (!epRoleList.isEmpty()) {
+                               transaction = localSession.beginTransaction();
+                               // Delete app role functions before deleting role
+                               deleteRoleFunction(app, epRoleList);
+                               if (app.getId() == 1) {
+                                       // Delete fn_user_ role
+                                       dataAccessService.deleteDomainObjects(EPUserApp.class,
+                                                       APP_ID_EQUALS + app.getId() + " and role_id = " + epRoleList.get(0).getId(), null);
+                                       boolean isPortalRequest = false;
+                                       deleteRoleDependencyRecords(localSession, epRoleList.get(0).getId(), app.getId(), isPortalRequest);
+                               }
+                               deleteRoleInExternalAuthSystem(epRoleList, app);
+                               transaction.commit();
+                               logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleForApplication: committed the transaction");
+                               dataAccessService.deleteDomainObject(epRoleList.get(0), null);
+                       }
+                       result = true;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleForApplication: failed", e);
+                       result = false;
+               } finally {
+                       localSession.close();
+               }
+               return result;
+       }
+       
+       /**
+        * 
+        * It deletes role for application in external auth system 
+        * 
+        * @param epRoleList contains role information
+        * @param app contains application information
+        * @throws Exception
+        */
+       private void deleteRoleInExternalAuthSystem(List<EPRole> epRoleList, EPApp app) throws Exception {
+               ResponseEntity<String> deleteResponse;
+               ResponseEntity<String> res = getNameSpaceIfExists(app);
+               if (res.getStatusCode() == HttpStatus.OK) {
+               // Delete Role in External System
+               String deleteRoleKey = "{\"name\":\"" + app.getNameSpace() + "." + epRoleList.get(0).getName()
+                               .replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_") + "\"}";
+               deleteResponse = deleteRoleInExternalSystem(deleteRoleKey);
+               if (deleteResponse.getStatusCode().value() != 200 || deleteResponse.getStatusCode().value() != 404) {
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, deleteResponse.getStatusCode());
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "deleteRoleForApplication: Failed to delete role in external auth system! due to {} ",
+                                       deleteResponse.getBody());
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "deleteRoleForApplication: about to commit the transaction");
+               }
+       }
+
+       /**
+        * 
+        * It deletes application user role in external auth system
+        * 
+        * @param role
+        * @param app
+        * @param LoginId
+        * @throws Exception
+        */
+       private void deleteUserRoleInExternalSystem(EPRole role, EPApp app, String LoginId) throws Exception {
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(headers);
+               getNameSpaceIfExists(app);
+               logger.debug(EELFLoggerDelegate.debugLogger,"deleteUserRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+               ResponseEntity<String> getResponse = template
+                               .exchange(
+                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "userRole/"
+                                                               + LoginId
+                                                               + SystemProperties
+                                                                               .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)
+                                                               + "/" + app.getNameSpace() + "." + role.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"),
+                                               HttpMethod.GET, entity, String.class);
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteUserRoleInExternalSystem: Finished GET user roles from External Auth system and response: {} ", getResponse.getBody());
+               if (getResponse.getStatusCode().value() != 200) {
+                       throw new ExternalAuthSystemException(getResponse.getBody());
+               }
+               String res = getResponse.getBody();
+               if (!res.equals(IS_EMPTY_JSON_STRING)) {
+                       HttpEntity<String> userRoleentity = new HttpEntity<>(headers);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteUserRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+                       ResponseEntity<String> deleteResponse = template
+                                       .exchange(
+                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                       + "userRole/" + LoginId
+                                                                       + SystemProperties
+                                                                                       .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)
+                                                                       + "/" + app.getNameSpace() + "." + role.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"),
+                                                       HttpMethod.DELETE, userRoleentity, String.class);
+                       if (deleteResponse.getStatusCode().value() != 200) {
+                               throw new ExternalAuthSystemException("Failed to delete user role");
+                       }
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteUserRoleInExternalSystem: Finished deleting user role in External Auth system and status code: {} ", deleteResponse.getStatusCode().value());
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<CentralV2Role> getActiveRoles(String uebkey) throws Exception {
+               List<CentralV2Role> roleList = new ArrayList<>();
+               try {
+                       List<EPApp> app = getApp(uebkey);
+                       final Map<String, Long> params = new HashMap<>();
+                       // check if portal
+                       Long appId = null;
+                       if (!app.get(0).getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                               appId = app.get(0).getId();
+                       }
+                       List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                       Criterion active_ynCrt = Restrictions.eq("active", Boolean.TRUE);
+                       Criterion appIdCrt;
+                       if (appId == null)
+                               appIdCrt = Restrictions.isNull("appId");
+                       else
+                               appIdCrt = Restrictions.eq("appId", appId);
+                       Criterion andCrit = Restrictions.and(active_ynCrt, appIdCrt);
+                       restrictionsList.add(andCrit);
+                       List<EPRole> epRole = (List<EPRole>) dataAccessService.getList(EPRole.class, null, restrictionsList, null);
+                       roleList = createCentralRoleObject(app, epRole, roleList, params);
+                       List<CentralV2Role> globalRoleList = getGlobalRolesOfApplication(app.get(0).getId());
+                       if (globalRoleList.size() > 0)
+                               roleList.addAll(globalRoleList);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveRoles: failed", e);
+                       throw e;
+               }
+               return roleList;
+
+       }
+
+       @Override
+       @Transactional(rollbackFor = Exception.class)
+       public ExternalRequestFieldsValidator deleteDependencyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception {
+               Session localSession = sessionFactory.openSession();
+               String message = "";
+               Transaction transaction = null;
+               boolean response = false;
+               EPApp app = null;
+               try {
+                       transaction = localSession.beginTransaction();
+                       List<EPRole> epRoleList = null;
+                       app = getApp(uebkey).get(0);
+                       if(app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+                               epRoleList = getPortalAppRoleInfo(roleId);
+                       } else{
+                               epRoleList = getPartnerAppRoleInfo(roleId, app);
+                       }
+                       if(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                               // Delete User Role in External System before deleting role
+                               deleteUserRoleInExternalSystem(epRoleList.get(0), app, LoginId);        
+                       }
+                       // Delete user app roles
+                       dataAccessService.deleteDomainObjects(EPUserApp.class,
+                                       APP_ID_EQUALS + app.getId() + " and role_id = " + epRoleList.get(0).getId(), null);
+                       boolean isPortalRequest = false;
+                       deleteRoleDependencyRecords(localSession, epRoleList.get(0).getId(), app.getId(), isPortalRequest);
+                       transaction.commit();
+                       if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                               // Final call to delete role once all dependencies has been deleted
+                               deleteRoleInExternalAuthSystem(epRoleList, app);
+                       }
+                       dataAccessService.deleteDomainObjects(EPRole.class, " role_id = "+ epRoleList.get(0).getId(), null);            
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteDependencyRoleRecord: committed the transaction");
+                       response = true;
+               } catch(HttpClientErrorException e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord: HttpClientErrorException", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+                       message = e.getMessage();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord failed", e);
+                       EcompPortalUtils.rollbackTransaction(transaction,
+                                       "deleteDependencyRoleRecord rollback, exception = " + e.toString());
+                       message = e.getMessage();
+               } finally {
+                       localSession.close();
+               }
+               return new ExternalRequestFieldsValidator(response,message);
+       }
+       
+       @Override
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public void syncRoleFunctionFromExternalAccessSystem(EPApp app) {
+               try {
+
+                       // get Permissions from External Auth System
+                       JSONArray extPerms = getExtAuthPermissions(app);
+                       List<ExternalAccessPermsDetail> permsDetailList = getExtAuthPerrmissonList(app, extPerms);
+
+                       // get functions in DB
+                       final Map<String, Long> params = new HashMap<>();
+                       final Map<String, CentralV2RoleFunction> roleFuncMap = new HashMap<>();
+                       params.put(APP_ID, app.getId());
+                       List<CentralV2RoleFunction> appFunctions = dataAccessService.executeNamedQuery("getAllRoleFunctions", params,
+                                       null);
+                       if (!appFunctions.isEmpty()) {
+                               for (CentralV2RoleFunction roleFunc : appFunctions) {
+                                       roleFuncMap.put(roleFunc.getCode(), roleFunc);
+                               }
+                       }
+                       
+                       // get Roles for portal in DB
+                       List<EPRole> portalRoleList = getGlobalRolesOfPortal();
+                       final Map<String, EPRole> existingPortalRolesMap = new HashMap<>();
+                       for(EPRole epRole : portalRoleList){
+                               existingPortalRolesMap.put(epRole.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"), epRole);
+                       }
+                       
+                       // get Roles in DB
+                       final Map<String, EPRole> currentRolesInDB = getCurrentRolesInDB(app);
+                       
+                       // store External Permissions with Pipe and without Pipe (just instance)
+                       final Map<String, ExternalAccessPermsDetail> extAccessPermsContainsPipeMap = new HashMap<>();
+                       final Map<String, ExternalAccessPermsDetail> extAccessPermsMap = new HashMap<>();
+                       for (ExternalAccessPermsDetail permsDetailInfoWithPipe : permsDetailList) {
+                               extAccessPermsContainsPipeMap.put(permsDetailInfoWithPipe.getInstance(), permsDetailInfoWithPipe);
+                               String finalFunctionCodeVal = EcompPortalUtils.getFunctionCode(permsDetailInfoWithPipe.getInstance());
+                               extAccessPermsMap.put(finalFunctionCodeVal, permsDetailInfoWithPipe);
+                       }
+
+                       // Add if new functions and app role functions were added in
+                       // external auth system
+                       for (ExternalAccessPermsDetail permsDetail : permsDetailList) {
+                               String code = permsDetail.getInstance();
+                               CentralV2RoleFunction getFunctionCodeKey = roleFuncMap.get(permsDetail.getInstance());
+                               List<CentralV2RoleFunction> roleFunctionList = addGetLocalFunction(app, roleFuncMap, permsDetail, code,
+                                               getFunctionCodeKey);
+                               List<String> roles = permsDetail.getRoles();
+                               if (roles != null) {
+                                       // Check if function has any roles and which does not exist
+                                       // in External Auth System. If exists delete in local
+                                       addRemoveIfFunctionsRolesIsSyncWithExternalAuth(app, currentRolesInDB, roleFunctionList, roles, existingPortalRolesMap);
+                               }
+                       }
+
+                       // Check if function does exits in External Auth System but exits in
+                       // local then delete function and its dependencies
+                       for (CentralV2RoleFunction roleFunc : appFunctions) {
+                               try {
+                                       ExternalAccessPermsDetail getFunctionCodeContainsPipeKey = extAccessPermsContainsPipeMap
+                                                       .get(roleFunc.getCode());
+                                       if (null == getFunctionCodeContainsPipeKey) {
+                                               ExternalAccessPermsDetail getFunctionCodeKey = extAccessPermsMap.get(roleFunc.getCode());
+                                               if (null == getFunctionCodeKey) {
+                                                       deleteAppRoleFuncDoesNotExitsInExtSystem(app, roleFunc);
+                                               }
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "syncRoleFunctionFromExternalAccessSystem: Failed to delete function", e);
+
+                               }
+                       }
+
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "syncRoleFunctionFromExternalAccessSystem: Finished syncRoleFunctionFromExternalAccessSystem");
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "syncRoleFunctionFromExternalAccessSystem: Failed syncRoleFunctionFromExternalAccessSystem", e);
+
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       private void addRemoveIfFunctionsRolesIsSyncWithExternalAuth(EPApp app, final Map<String, EPRole> currentRolesInDB,
+                       List<CentralV2RoleFunction> roleFunctionList, List<String> roles, Map<String, EPRole> existingPortalRolesMap)
+                       throws Exception {
+               if (!roleFunctionList.isEmpty()) {
+                       final Map<String, String> appRoleFuncParams = new HashMap<>();
+                       final Map<String, LocalRole> currentAppRoleFunctionsMap = new HashMap<>();
+                       final Map<String, String> currentRolesInExtSystem = new HashMap<>();
+                       appRoleFuncParams.put("functionCd", roleFunctionList.get(0).getCode());
+                       appRoleFuncParams.put("appId", String.valueOf(app.getId()));
+                       List<LocalRole> localRoleList = dataAccessService.executeNamedQuery("getCurrentAppRoleFunctions",
+                                       appRoleFuncParams, null);
+                       for (LocalRole localRole : localRoleList) {
+                               currentAppRoleFunctionsMap.put(localRole.getRolename().replaceAll(
+                                               EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"), localRole);
+                       }
+                       for (String addRole : roles) {
+                               currentRolesInExtSystem.put(addRole.substring(addRole.indexOf(FUNCTION_PIPE)+1), addRole);
+                       }
+                       for (String extAuthrole : roles) {
+                               String roleNameSpace = extAuthrole.substring(0, extAuthrole.indexOf(FUNCTION_PIPE));
+                               boolean isNameSpaceMatching = EcompPortalUtils.checkNameSpaceMatching(roleNameSpace, app.getNameSpace());
+                               if (isNameSpaceMatching) {
+                                       if (!currentAppRoleFunctionsMap
+                                                       .containsKey(extAuthrole.substring(app.getNameSpace().length() + 1))) {
+                                               EPRole localAddFuntionRole = currentRolesInDB
+                                                               .get(extAuthrole.substring(app.getNameSpace().length() + 1));
+                                               if (localAddFuntionRole == null) {
+                                                       checkAndAddRoleInDB(app, currentRolesInDB, roleFunctionList, extAuthrole);
+                                               } else {
+                                                       EPAppRoleFunction addAppRoleFunc = new EPAppRoleFunction();
+                                                       addAppRoleFunc.setAppId(app.getId());
+                                                       addAppRoleFunc.setCode(roleFunctionList.get(0).getCode());
+                                                       addAppRoleFunc.setRoleId(localAddFuntionRole.getId());
+                                                       dataAccessService.saveDomainObject(addAppRoleFunc, null);
+                                               }
+                                       }
+                                       // This block is to save global role function if exists
+                               } else {
+                                       String extAuthAppRoleName = extAuthrole.substring(extAuthrole.indexOf(FUNCTION_PIPE) + 1);
+                                       boolean checkIfGlobalRoleExists = existingPortalRolesMap.containsKey(extAuthAppRoleName);
+                                       if (checkIfGlobalRoleExists) {
+                                               final Map<String, Long> params = new HashMap<>();
+                                               EPRole role = existingPortalRolesMap.get(extAuthAppRoleName);
+                                               EPAppRoleFunction addGlobalRoleFunctions = new EPAppRoleFunction();
+                                               params.put("appId", app.getId());
+                                               params.put("roleId", role.getId());
+                                               List<EPAppRoleFunction> currentGlobalRoleFunctionsList = dataAccessService.executeNamedQuery("getAppRoleFunctionOnRoleIdandAppId", params, null);                               
+                                               boolean checkIfRoleFunctionExists = currentGlobalRoleFunctionsList.stream().anyMatch(currentGlobalRoleFunction -> currentGlobalRoleFunction.getCode().equals(roleFunctionList.get(0).getCode()));
+                                               if (role != null && !checkIfRoleFunctionExists) {
+                                                       addGlobalRoleFunctions.setAppId(app.getId());
+                                                       addGlobalRoleFunctions.setRoleId(role.getId());
+                                                       if (!app.getId().equals(role.getAppRoleId())) {
+                                                               addGlobalRoleFunctions.setRoleAppId((PortalConstants.PORTAL_APP_ID).toString());
+                                                       } else {
+                                                               addGlobalRoleFunctions.setRoleAppId(null);
+                                                       }
+                                                       addGlobalRoleFunctions.setCode(roleFunctionList.get(0).getCode());
+                                                       dataAccessService.saveDomainObject(addGlobalRoleFunctions, null);
+                                               }
+                                       }
+                               }
+                       }
+                       for (LocalRole localRoleDelete : localRoleList) {
+                               if (!currentRolesInExtSystem.containsKey(localRoleDelete.getRolename()
+                                               .replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"))) {
+                                       dataAccessService.deleteDomainObjects(EPAppRoleFunction.class,
+                                                       APP_ID_EQUALS + app.getId() + AND_FUNCTION_CD_EQUALS + roleFunctionList.get(0).getCode()
+                                                                       + "'" + " and role_id = " + localRoleDelete.getRoleId().longValue(),
+                                                       null);
+                               }
+                       }
+               }
+       }
+
+       private void deleteAppRoleFuncDoesNotExitsInExtSystem(EPApp app, CentralV2RoleFunction roleFunc) {
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncRoleFunctionFromExternalAccessSystem: Deleting app role function {}",
+                               roleFunc.getCode());
+               dataAccessService.deleteDomainObjects(EPAppRoleFunction.class,
+                               APP_ID_EQUALS + app.getId() + AND_FUNCTION_CD_EQUALS + roleFunc.getCode() +"'", null);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncRoleFunctionFromExternalAccessSystem: Deleted app role function {}",
+                               roleFunc.getCode());
+
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncRoleFunctionFromExternalAccessSystem: Deleting app function {}",
+                               roleFunc.getCode());
+               dataAccessService.deleteDomainObjects(CentralV2RoleFunction.class,
+                               APP_ID_EQUALS + app.getId() + AND_FUNCTION_CD_EQUALS + roleFunc.getCode() +"'", null);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncRoleFunctionFromExternalAccessSystem: Deleted app function {}",
+                               roleFunc.getCode());
+       }
+
+       private void checkAndAddRoleInDB(EPApp app, final Map<String, EPRole> currentRolesInDB,
+                       List<CentralV2RoleFunction> roleFunctionList, String roleList) throws Exception {
+               if (!currentRolesInDB.containsKey(
+                               roleList.substring(app.getNameSpace().length() + 1))) {
+                       Role role = addRoleInDBIfDoesNotExists(app,
+                                       roleList.substring(app.getNameSpace().length() + 1));
+                       addIfRoleDescriptionNotExitsInExtSystem(role, app);
+                       if (!roleFunctionList.isEmpty()) {
+                               try {
+                                       if (!roleFunctionList.isEmpty()) {
+                                               EPAppRoleFunction addAppRoleFunc = new EPAppRoleFunction();
+                                               addAppRoleFunc.setAppId(app.getId());
+                                               addAppRoleFunc.setCode(roleFunctionList.get(0).getCode());
+                                               addAppRoleFunc.setRoleId(role.getId());
+                                               dataAccessService.saveDomainObject(addAppRoleFunc, null);
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "syncRoleFunctionFromExternalAccessSystem: Failed to save app role function ",
+                                                       e);
+                               }
+                       }
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<CentralV2RoleFunction> addGetLocalFunction(EPApp app, final Map<String, CentralV2RoleFunction> roleFuncMap,
+                       ExternalAccessPermsDetail permsDetail, String code, CentralV2RoleFunction getFunctionCodeKey) {
+               String finalFunctionCodeVal = addToLocalIfFunctionNotExists(app, roleFuncMap, permsDetail, code,
+                               getFunctionCodeKey);
+               final Map<String, String> appSyncFuncsParams = new HashMap<>();
+               appSyncFuncsParams.put("appId", String.valueOf(app.getId()));
+               appSyncFuncsParams.put("functionCd", finalFunctionCodeVal);
+               List<CentralV2RoleFunction> roleFunctionList = null;
+               roleFunctionList = dataAccessService.executeNamedQuery("getAppFunctionOnCodeAndAppId", appSyncFuncsParams,
+                               null);
+               if (roleFunctionList.isEmpty()) {
+                       appSyncFuncsParams.put("functionCd", code);
+                       roleFunctionList = dataAccessService.executeNamedQuery("getAppFunctionOnCodeAndAppId", appSyncFuncsParams,
+                                       null);
+               }
+               return roleFunctionList;
+       }
+
+       private String addToLocalIfFunctionNotExists(EPApp app, final Map<String, CentralV2RoleFunction> roleFuncMap,
+                       ExternalAccessPermsDetail permsDetail, String code, CentralV2RoleFunction getFunctionCodeKey
+                       ) {
+               String finalFunctionCodeVal = "";       
+               if (null == getFunctionCodeKey) {
+                       finalFunctionCodeVal = EcompPortalUtils.getFunctionCode(permsDetail.getInstance());
+                       CentralV2RoleFunction checkIfCodeStillExits = roleFuncMap.get(finalFunctionCodeVal);
+                       // If function does not exist in local then add!
+                       if (null == checkIfCodeStillExits) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "syncRoleFunctionFromExternalAccessSystem: Adding function: {} ", code);
+                               addFunctionInEcompDB(app, permsDetail, code);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "syncRoleFunctionFromExternalAccessSystem: Finished adding function: {} ", code);
+                       }
+               }
+               return finalFunctionCodeVal;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public Map<String, EPRole> getCurrentRolesInDB(EPApp app) {
+               final Map<String, EPRole> currentRolesInDB = new HashMap<>();
+               List<EPRole> getCurrentRoleList = null;
+               final Map<String, Long> appParams = new HashMap<>();
+               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                       getCurrentRoleList = dataAccessService.executeNamedQuery("getPortalAppRolesList", null, null);
+               } else {
+                       appParams.put("appId", app.getId());
+                       getCurrentRoleList = dataAccessService.executeNamedQuery("getPartnerAppRolesList", appParams, null);
+               }
+               for (EPRole role : getCurrentRoleList) {
+                       currentRolesInDB.put(role.getName()
+                                       .replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"), role);
+               }
+               return currentRolesInDB;
+       }
+
+       private List<ExternalAccessPermsDetail> getExtAuthPerrmissonList(EPApp app, JSONArray extPerms)
+                       throws IOException{
+               ExternalAccessPermsDetail permDetails = null;
+               List<ExternalAccessPermsDetail> permsDetailList = new ArrayList<>();
+               for (int i = 0; i < extPerms.length(); i++) {
+                       String description = null;
+                       if (extPerms.getJSONObject(i).has("description")) {
+                               description = extPerms.getJSONObject(i).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
+                       } else {
+                               description = extPerms.getJSONObject(i).getString("instance");
+                       }
+                       if (extPerms.getJSONObject(i).has("roles")) {
+                               ObjectMapper rolesListMapper = new ObjectMapper();
+                               JSONArray resRoles = extPerms.getJSONObject(i).getJSONArray("roles");
+                               List<String> list = rolesListMapper.readValue(resRoles.toString(),
+                                               TypeFactory.defaultInstance().constructCollectionType(List.class, String.class));
+                               permDetails = new ExternalAccessPermsDetail(extPerms.getJSONObject(i).getString("type"),
+                                               extPerms.getJSONObject(i).getString("type").substring(app.getNameSpace().length() + 1)
+                                                               + FUNCTION_PIPE + extPerms.getJSONObject(i).getString("instance") + FUNCTION_PIPE
+                                                               + extPerms.getJSONObject(i).getString("action"),
+                                               extPerms.getJSONObject(i).getString("action"), list, description);
+                               permsDetailList.add(permDetails);
+                       } else {
+                               permDetails = new ExternalAccessPermsDetail(extPerms.getJSONObject(i).getString("type"),
+                                               extPerms.getJSONObject(i).getString("type").substring(app.getNameSpace().length() + 1)
+                                                               + FUNCTION_PIPE + extPerms.getJSONObject(i).getString("instance") + FUNCTION_PIPE
+                                                               + extPerms.getJSONObject(i).getString("action"),
+                                               extPerms.getJSONObject(i).getString("action"), description);
+                               permsDetailList.add(permDetails);
+                       }
+               }
+               return permsDetailList;
+       }
+
+       private JSONArray getExtAuthPermissions(EPApp app) throws Exception {
+               ResponseEntity<String> response = null;
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "syncRoleFunctionFromExternalAccessSystem: {} ",
+                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+               response = template
+                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                               + "perms/ns/" + app.getNameSpace(), HttpMethod.GET, entity, String.class);
+
+               String res = response.getBody();
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncRoleFunctionFromExternalAccessSystem: Finished GET permissions from External Auth system and response: {} ",
+                               response.getBody());
+               JSONObject jsonObj = new JSONObject(res);
+               JSONArray extPerms = jsonObj.getJSONArray("perm");
+               for (int i = 0; i < extPerms.length(); i++) {
+                       if (extPerms.getJSONObject(i).getString("type").equals(app.getNameSpace() + ".access")) {
+                               extPerms.remove(i);
+                               i--;
+                       }
+               }
+               return extPerms;
+       }
+       
+       /**
+        * 
+        * Add function into local DB
+        * 
+        * @param app
+        * @param permsDetail
+        * @param code
+        */
+       private void addFunctionInEcompDB(EPApp app, ExternalAccessPermsDetail permsDetail, String code) {
+               try{
+               CentralV2RoleFunction addFunction = new CentralV2RoleFunction();
+               addFunction.setAppId(app.getId());
+               addFunction.setCode(code);
+               addFunction.setName(permsDetail.getDescription());
+               dataAccessService.saveDomainObject(addFunction, null);
+               } catch(Exception e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "addFunctionInEcompDB: Failed to add function", e);
+               }
+       }
+
+       /**
+        * 
+        * It updates description of a role in external auth system
+        * 
+        * @param role
+        * @param app
+        * @throws Exception
+        */
+       private void addIfRoleDescriptionNotExitsInExtSystem(Role role, EPApp app) throws Exception {
+               String addRoleNew = updateExistingRoleInExternalSystem(role, app);
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               try {
+                       HttpEntity<String> entity = new HttpEntity<>(addRoleNew, headers);
+                       template.exchange(
+                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
+                                       HttpMethod.PUT, entity, String.class);
+               } catch (HttpClientErrorException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to addIfRoleDescriptionNotExitsInExtSystem",
+                                       e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "addIfRoleDescriptionNotExitsInExtSystem: Failed",
+                                       e);
+               }
+       }
+
+       /**
+        * 
+        * While sync functions form external auth system if new role found we should add in local and return Role.class object
+        * 
+        * @param app
+        * @param role
+        * @return
+        */
+       @SuppressWarnings("unchecked")
+       private Role addRoleInDBIfDoesNotExists(EPApp app, String role) {
+               Role setNewRole = new Role();
+               try {
+                       // functions can have new role created in External Auth System prevent
+                       // duplication here
+                       boolean isCreated = checkIfRoleExitsElseCreateInSyncFunctions(role, app);
+                       final Map<String, String> getRoleByNameParams = new HashMap<>();
+                       List<EPRole> getRoleCreated = null;
+                       getRoleByNameParams.put(APP_ROLE_NAME_PARAM, role);
+                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                               getRoleByNameParams.put("appId", String.valueOf(app.getId()));
+                               List<EPRole> roleCreated = dataAccessService
+                                               .executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, getRoleByNameParams, null);
+                               if (!isCreated) {
+                                       EPRole epUpdateRole = roleCreated.get(0);
+                                       epUpdateRole.setAppRoleId(epUpdateRole.getId());
+                                       dataAccessService.saveDomainObject(epUpdateRole, null);
+                                       getRoleCreated = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM,
+                                                       getRoleByNameParams, null);
+                               } else {
+                                       getRoleCreated = roleCreated;
+                               }
+                       } else {
+                               getRoleCreated = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, getRoleByNameParams,
+                                               null);
+                       }
+                       if (getRoleCreated != null && !getRoleCreated.isEmpty()) {
+                               EPRole roleObject = getRoleCreated.get(0);
+                               setNewRole.setId(roleObject.getId());
+                               setNewRole.setName(roleObject.getName());
+                               setNewRole.setActive(roleObject.getActive());
+                               setNewRole.setPriority(roleObject.getPriority());
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "addRoleInDBIfDoesNotExists: Failed", e);
+               }
+               return setNewRole;
+       }
+
+       @SuppressWarnings("unchecked")
+       private boolean checkIfRoleExitsElseCreateInSyncFunctions(String role, EPApp app) {
+               boolean isCreated = false;
+               final Map<String, String> roleParams = new HashMap<>();
+               roleParams.put(APP_ROLE_NAME_PARAM, role);
+               List<EPRole> roleCreated = null;
+               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                       roleCreated = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, roleParams,
+                                       null);
+               } else {
+                       roleParams.put("appId", String.valueOf(app.getId()));
+                       roleCreated = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, roleParams,
+                                       null);
+               }
+               if (roleCreated == null || roleCreated.isEmpty()) {
+                       roleParams.put("appId", String.valueOf(app.getId()));
+                       EPRole epRoleNew = new EPRole();
+                       epRoleNew.setActive(true);
+                       epRoleNew.setName(role);
+                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                               epRoleNew.setAppId(null);
+                       } else {
+                               epRoleNew.setAppId(app.getId());
+                       }
+                       dataAccessService.saveDomainObject(epRoleNew, null);
+                       isCreated = false;
+               } else {
+                       isCreated = true;
+               }
+               return isCreated;
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       public Integer bulkUploadFunctions(String uebkey) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               List<RoleFunction> roleFuncList = dataAccessService.executeNamedQuery("getAllFunctions", null, null);
+               CentralV2RoleFunction cenRoleFunc = null;
+               Integer functionsAdded = 0;
+               try {
+                       for (RoleFunction roleFunc : roleFuncList) {
+                               cenRoleFunc = new CentralV2RoleFunction(roleFunc.getCode(), roleFunc.getName());
+                               addRoleFunctionInExternalSystem(cenRoleFunc, app);
+                               functionsAdded++;
+                       }
+               } catch(HttpClientErrorException e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - bulkUploadFunctions failed", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions: failed", e.getMessage(), e);
+               }
+               return functionsAdded;
+       }
+
+       @Override
+       public Integer bulkUploadRoles(String uebkey) throws Exception {
+               List<EPApp> app = getApp(uebkey);
+               List<EPRole> roles = getAppRoles(app.get(0).getId());
+               List<CentralV2Role> cenRoleList = new ArrayList<>();
+               final Map<String, Long> params = new HashMap<>();
+               Integer rolesListAdded = 0;
+               try {
+                       cenRoleList = createCentralRoleObject(app, roles, cenRoleList, params);
+                       ObjectMapper mapper = new ObjectMapper();
+                       mapper.configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false);
+                       String roleList = mapper.writeValueAsString(cenRoleList);
+                       List<Role> roleObjectList = mapper.readValue(roleList,
+                                       TypeFactory.defaultInstance().constructCollectionType(List.class, Role.class));
+                       for (Role role : roleObjectList) {
+                               addRoleInExternalSystem(role, app.get(0));
+                               rolesListAdded++;
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles: failed", e);
+                       throw e;
+               }
+               return rolesListAdded;
+       }
+
+       /**
+        * It creating new role in external auth system while doing bulk upload
+        * 
+        * @param role
+        * @param app
+        * @throws Exception
+        */
+       private void addRoleInExternalSystem(Role role, EPApp app) throws Exception {
+               String addRoleNew = updateExistingRoleInExternalSystem(role, app);
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               try {
+                       HttpEntity<String> entity = new HttpEntity<>(addRoleNew, headers);
+                       template.exchange(
+                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
+                                       HttpMethod.POST, entity, String.class);
+               } catch(HttpClientErrorException e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to addRoleInExternalSystem", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleInExternalSystem: Role already exits but does not break functionality", e);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleInExternalSystem: Failed to addRoleInExternalSystem", e.getMessage());
+                       }
+               }
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       public Integer bulkUploadRolesFunctions(String uebkey) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               List<EPRole> roles = getAppRoles(app.getId());
+               final Map<String, Long> params = new HashMap<>();
+               Integer roleFunctions = 0;
+               try {
+                       for (EPRole role : roles) {
+                               params.put("roleId", role.getId());
+                               List<BulkUploadRoleFunction> appRoleFunc = dataAccessService.executeNamedQuery("uploadAllRoleFunctions",
+                                               params, null);
+                               if (!appRoleFunc.isEmpty()) {
+                                       for (BulkUploadRoleFunction addRoleFunc : appRoleFunc) {
+                                               addRoleFunctionsInExternalSystem(addRoleFunc, role, app);
+                                               roleFunctions++;
+                                       }
+                               }
+                       }
+               } catch(HttpClientErrorException e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to bulkUploadRolesFunctions", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRolesFunctions: failed", e);
+               }
+               return roleFunctions;
+       }
+       
+       /**
+        * Its adding a role function while doing bulk upload
+        * 
+        * @param addRoleFunc
+        * @param role
+        * @param app
+        */
+       private void addRoleFunctionsInExternalSystem(BulkUploadRoleFunction addRoleFunc, EPRole role, EPApp app) {
+               String checkType = addRoleFunc.getFunctionCd().contains("menu") ? "menu" : "url";
+               ExternalAccessRolePerms extRolePerms = null;
+               ExternalAccessPerms extPerms = null;
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+
+                       extPerms = new ExternalAccessPerms(app.getNameSpace() + "." + checkType, addRoleFunc.getFunctionCd(), "*",
+                                       addRoleFunc.getFunctionName());
+                       extRolePerms = new ExternalAccessRolePerms(extPerms,
+                                       app.getNameSpace() + "." + role.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                       String updateRolePerms = mapper.writeValueAsString(extRolePerms);
+                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
+                       template.exchange(
+                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/perm",
+                                       HttpMethod.POST, entity, String.class);
+               } catch (Exception e) {
+                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "addRoleFunctionsInExternalSystem: RoleFunction already exits but does not break functionality", e);
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionsInExternalSystem: Failed to addRoleFunctionsInExternalSystem",
+                                               e.getMessage());
+                       }
+               }
+       }
+
+       @Override
+       public void bulkUploadPartnerFunctions(String uebkey, List<RoleFunction> roleFunctionsList) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               CentralV2RoleFunction cenRoleFunc = null;
+               for (RoleFunction roleFunction : roleFunctionsList) {
+                       cenRoleFunc = new CentralV2RoleFunction(roleFunction.getCode(), roleFunction.getName());
+                       addRoleFunctionInExternalSystem(cenRoleFunc, app);
+               }
+       }
+
+       @Override
+       public void bulkUploadPartnerRoles(String uebkey, List<Role> roleList) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               for (Role role : roleList) {
+                       addRoleInExternalSystem(role, app);
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               for (Role role : roleList) {
+                       try {
+                               Set<RoleFunction> roleFunctionList = role.getRoleFunctions();
+                               List<RoleFunction> roleFunctionListNew = new ArrayList<>();
+                               ObjectMapper roleFunctionsMapper = new ObjectMapper();
+                               Iterator<RoleFunction> itetaror = roleFunctionList.iterator();
+                               while (itetaror.hasNext()) {
+                                       Object nextValue = itetaror.next();
+                                       RoleFunction roleFunction = roleFunctionsMapper.convertValue(nextValue, RoleFunction.class);
+                                       roleFunctionListNew.add(roleFunction);
+                               }
+                               List<RoleFunction> listWithoutDuplicates = roleFunctionListNew.stream().distinct()
+                                               .collect(Collectors.toList());
+                               for (RoleFunction roleFunction : listWithoutDuplicates) {
+                                       String checkType = roleFunction.getCode().contains("menu") ? "menu" : "url";
+                                       ExternalAccessRolePerms extRolePerms = null;
+                                       ExternalAccessPerms extPerms = null;
+                                       ObjectMapper mapper = new ObjectMapper();
+                                       extPerms = new ExternalAccessPerms(app.getNameSpace() + "." + checkType, roleFunction.getCode(),
+                                                       "*");
+                                       extRolePerms = new ExternalAccessRolePerms(extPerms,
+                                                       app.getNameSpace() + "." + role.getName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                                       String updateRolePerms = mapper.writeValueAsString(extRolePerms);
+                                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
+                                       template.exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                       + "role/perm", HttpMethod.PUT, entity, String.class);
+                               }
+                       } catch (Exception e) {
+                               if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "bulkUploadPartnerRoleFunctions: RoleFunction already exits but does not break functionality");
+                               } else {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadPartnerRoleFunctions: Failed to addRoleFunctionsInExternalSystem",
+                                                       e);
+                               }
+                       }
+
+               }
+       }
+
+       @Override
+       @Transactional
+       public void syncApplicationRolesWithEcompDB(EPApp app) {
+               try {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "syncRoleFunctionFromExternalAccessSystem: Started");
+                       //Sync functions and roles assigned to it which also creates new roles if does not exits in portal
+                       syncRoleFunctionFromExternalAccessSystem(app);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "syncRoleFunctionFromExternalAccessSystem: Finished");     
+                       
+                       ObjectMapper mapper = new ObjectMapper();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering to getAppRolesJSONFromExtAuthSystem");
+                       // Get Permissions from External Auth System
+                       JSONArray extRole = getAppRolesJSONFromExtAuthSystem(app);
+                       
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering into getExternalRoleDetailsList");
+                       List<ExternalRoleDetails> externalRoleDetailsList = getExternalRoleDetailsList(app,
+                                       mapper, extRole);
+                       
+                       List<EPRole> finalRoleList = new ArrayList<>();
+                       for (ExternalRoleDetails externalRole : externalRoleDetailsList) {
+                               EPRole ecompRole = convertExternalRoleDetailstoEpRole(externalRole);
+                               finalRoleList.add(ecompRole);
+                       }
+
+                       List<EPRole> applicationRolesList;
+                       applicationRolesList = getAppRoles(app.getId());
+                       List<String> applicationRoleIdList = new ArrayList<>();
+                       for (EPRole applicationRole : applicationRolesList) {
+                               applicationRoleIdList.add(applicationRole.getName());
+                       }
+
+                       List<EPRole> roleListToBeAddInEcompDB = new ArrayList<>();
+                       for (EPRole aafRole : finalRoleList) {
+                               if (!applicationRoleIdList.contains(aafRole.getName())) {
+                                       roleListToBeAddInEcompDB.add(aafRole);
+                               }
+                       }
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering into inactiveRolesNotInExternalAuthSystem");
+                       // Check if roles exits in external Access system and if not make inactive in DB
+                       inactiveRolesNotInExternalAuthSystem(app, finalRoleList, applicationRolesList);
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering into checkAndUpdateRoleInDB");
+                       // It checks properties in the external auth system app role description and updates role in local
+                       checkAndUpdateRoleInDB(app, finalRoleList);
+
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Entering into addNewRoleInEcompDBUpdateDescInExtAuthSystem");
+                       // Add new roles in DB and updates role description in External Auth System 
+                       addNewRoleInEcompDBUpdateDescInExtAuthSystem(app, roleListToBeAddInEcompDB);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "syncApplicationRolesWithEcompDB: Finished");
+               } catch (HttpClientErrorException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "syncApplicationRolesWithEcompDB: Failed due to the External Auth System", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "syncApplicationRolesWithEcompDB: Failed ", e);
+               }
+       }
+
+       /**
+        * 
+        * It adds new roles in DB and updates description in External Auth System
+        * 
+        * @param app
+        * @param roleListToBeAddInEcompDB
+        */
+       @SuppressWarnings("unchecked")
+       private void addNewRoleInEcompDBUpdateDescInExtAuthSystem(EPApp app, List<EPRole> roleListToBeAddInEcompDB) {
+               EPRole roleToBeAddedInEcompDB;
+               for (int i = 0; i < roleListToBeAddInEcompDB.size(); i++) {
+                       try {
+                               roleToBeAddedInEcompDB = roleListToBeAddInEcompDB.get(i);
+                               if (app.getId() == 1) {
+                                       roleToBeAddedInEcompDB.setAppRoleId(null);
+                               }
+                               dataAccessService.saveDomainObject(roleToBeAddedInEcompDB, null);
+                               List<EPRole> getRoleCreatedInSync = null;
+                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                       final Map<String, String> globalRoleParams = new HashMap<>();
+                                       globalRoleParams.put("appId", String.valueOf(app.getId()));
+                                       globalRoleParams.put("appRoleName", roleToBeAddedInEcompDB.getName());
+                                       getRoleCreatedInSync = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, globalRoleParams, null);
+                                       EPRole epUpdateRole = getRoleCreatedInSync.get(0);
+                                       epUpdateRole.setAppRoleId(epUpdateRole.getId());
+                                       dataAccessService.saveDomainObject(epUpdateRole, null);
+                               }
+                               List<EPRole> roleList = new ArrayList<>();
+                               final Map<String, String> params = new HashMap<>();
+
+                               params.put(APP_ROLE_NAME_PARAM, roleToBeAddedInEcompDB.getName());
+                               boolean isPortalRole = false;
+                               if (app.getId() == 1) {
+                                       isPortalRole = true;
+                                       roleList = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, params, null);
+                               } else {
+                                       isPortalRole = false;
+                                       params.put(APP_ID, app.getId().toString());
+                                       roleList = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, params, null);
+                               }
+                               EPRole role = roleList.get(0);
+                               Role aaFrole = new Role();
+                               aaFrole.setId(role.getId());
+                               aaFrole.setActive(role.getActive());
+                               aaFrole.setPriority(role.getPriority());
+                               aaFrole.setName(role.getName());
+                               updateRoleInExternalSystem(aaFrole, app, isPortalRole);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "SyncApplicationRolesWithEcompDB: Failed to add or update role in external auth system", e);
+                       }
+               }
+       }
+
+       /**
+        * 
+        * It checks description in External Auth System if found any changes updates in DB
+        * 
+        * @param app
+        * @param finalRoleList contains list of External Auth System roles list which is converted to EPRole
+        */
+       @SuppressWarnings("unchecked")
+       private void checkAndUpdateRoleInDB(EPApp app, List<EPRole> finalRoleList) {
+               for (EPRole roleItem : finalRoleList) {
+                       final Map<String, String> roleParams = new HashMap<>();
+                       List<EPRole> currentList = null;
+                       roleParams.put(APP_ROLE_NAME_PARAM, roleItem.getName());
+                       if (app.getId() == 1) {
+                               currentList = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, roleParams, null);
+                       } else {
+                               roleParams.put(APP_ID, app.getId().toString());
+                               currentList = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, roleParams, null);
+                       }
+
+                       if (!currentList.isEmpty()) {
+                               try {
+                                       Boolean aafRoleActive;
+                                       Boolean localRoleActive;
+                                       boolean result;
+                                       aafRoleActive = Boolean.valueOf(roleItem.getActive());
+                                       localRoleActive = Boolean.valueOf(currentList.get(0).getActive());
+                                       result = aafRoleActive.equals(localRoleActive);
+                                       EPRole updateRole = currentList.get(0);
+
+                                       if (!result) {
+                                               updateRole.setActive(roleItem.getActive());
+                                               dataAccessService.saveDomainObject(updateRole, null);
+                                       }
+                                       if (roleItem.getPriority() != null
+                                                       && !currentList.get(0).getPriority().equals(roleItem.getPriority())) {
+                                               updateRole.setPriority(roleItem.getPriority());
+                                               dataAccessService.saveDomainObject(updateRole, null);
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "syncApplicationRolesWithEcompDB: Failed to update role ", e);
+                               }
+                       }
+               }
+       }
+       /**
+        * 
+        * It de-activates application roles in DB if not present in External Auth system  
+        * 
+        * @param app
+        * @param finalRoleList contains list of current roles present in External Auth System
+        * @param applicationRolesList contains list of current roles present in DB
+        */
+       @SuppressWarnings("unchecked")
+       private void inactiveRolesNotInExternalAuthSystem(EPApp app, List<EPRole> finalRoleList,
+                       List<EPRole> applicationRolesList) {
+               final Map<String, EPRole> checkRolesInactive = new HashMap<>();
+               for (EPRole extrole : finalRoleList) {
+                       checkRolesInactive.put(extrole.getName(), extrole);
+               }
+               for (EPRole role : applicationRolesList) {
+                       try {
+                               final Map<String, String> extRoleParams = new HashMap<>();
+                               List<EPRole> roleList = null;
+                               extRoleParams.put(APP_ROLE_NAME_PARAM, role.getName());
+                               if (!checkRolesInactive.containsKey(role.getName())) {
+                                       if (app.getId() == 1) {
+                                               roleList = dataAccessService.executeNamedQuery(GET_PORTAL_APP_ROLES_QUERY, extRoleParams, null);
+                                       } else {
+                                               extRoleParams.put(APP_ID, app.getId().toString());
+                                               roleList = dataAccessService.executeNamedQuery(GET_ROLE_TO_UPDATE_IN_EXTERNAL_AUTH_SYSTEM, extRoleParams, null);
+                                       }
+                                       EPRole updateRoleInactive = roleList.get(0);
+                                       updateRoleInactive.setActive(false);
+                                       dataAccessService.saveDomainObject(updateRoleInactive, null);
+                               }
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "syncApplicationRolesWithEcompDB: Failed to de-activate role ", e);
+                       }
+               }
+       }
+       
+       @Override
+       @SuppressWarnings("unchecked")
+       public List<ExternalRoleDetails> getExternalRoleDetailsList(EPApp app,
+                       ObjectMapper mapper, JSONArray extRole)
+                       throws IOException {
+               List<ExternalRoleDetails> externalRoleDetailsList = new ArrayList<>();
+               ExternalRoleDescription ApplicationRole = new ExternalRoleDescription();
+               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms(); 
+               List<String> functionCodelist = new ArrayList<>();
+               for (int i = 0; i < extRole.length(); i++) {
+                       ExternalRoleDetails externalRoleDetail = new ExternalRoleDetails();
+                       EPAppRoleFunction ePAppRoleFunction = new EPAppRoleFunction();
+                       JSONObject Role = (JSONObject) extRole.get(i);
+                       if (!extRole.getJSONObject(i).has(EXTERNAL_AUTH_ROLE_DESCRIPTION)) {
+                               ApplicationRole.setActive("true");
+                               ApplicationRole.setAppId(IS_NULL_STRING);
+                               ApplicationRole.setPriority(IS_NULL_STRING);
+                               ApplicationRole.setAppRoleId(IS_NULL_STRING);
+                               String roleName = extRole.getJSONObject(i).getString(ROLE_NAME);
+                               ApplicationRole.setName(roleName.substring(app.getNameSpace().length() + 1));
+                       } else {
+                               String desc = extRole.getJSONObject(i).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
+                               ApplicationRole = mapper.readValue(desc, ExternalRoleDescription.class);
+                       }
+
+                       SortedSet<ExternalAccessPerms> externalAccessPermsOfRole = new TreeSet<>();
+                       if (extRole.getJSONObject(i).has(EXTERNAL_AUTH_PERMS)) {
+                               JSONArray extPerm = (JSONArray) Role.get(EXTERNAL_AUTH_PERMS);
+                               for (int j = 0; j < extPerm.length(); j++) {
+                                       JSONObject perms = extPerm.getJSONObject(j);
+                                       boolean isNamespaceMatching = EcompPortalUtils.checkNameSpaceMatching(perms.getString("type"), app.getNameSpace());
+                                       if (isNamespaceMatching) {
+                                               externalAccessPerms = new ExternalAccessPerms(perms.getString("type"),
+                                                               perms.getString("instance"), perms.getString("action"));
+                                               ePAppRoleFunction.setCode(externalAccessPerms.getInstance());
+                                               functionCodelist.add(ePAppRoleFunction.getCode());
+                                               externalAccessPermsOfRole.add(externalAccessPerms);
+                                       }
+
+                               }
+                       }
+
+                       if (ApplicationRole.getActive().equals(IS_NULL_STRING)) {
+                               externalRoleDetail.setActive(false);
+                       } else {
+                               externalRoleDetail.setActive(Boolean.parseBoolean(ApplicationRole.getActive()));
+                       }
+                       externalRoleDetail.setName(ApplicationRole.getName());
+
+                       if (ApplicationRole.getAppId().equals(IS_NULL_STRING) && app.getId() == 1) {
+                               externalRoleDetail.setAppId(null);
+                       } else if (ApplicationRole.getAppId().equals(IS_NULL_STRING)) {
+                               externalRoleDetail.setAppId(app.getId());
+                       } else {
+                               externalRoleDetail.setAppId(Long.parseLong(ApplicationRole.getAppId()));
+                       }
+
+                       if (ApplicationRole.getPriority().equals(IS_NULL_STRING)) {
+                               externalRoleDetail.setPriority(null);
+                       } else {
+                               externalRoleDetail.setPriority(Integer.parseInt(ApplicationRole.getPriority()));
+                       }
+
+                       if (ApplicationRole.getAppRoleId().equals(IS_NULL_STRING) && app.getId() == 1) {
+                               externalRoleDetail.setAppRoleId(null);
+                       }
+
+                       // get role functions from DB
+                       final Map<String, EPAppRoleFunction> roleFunctionsMap = new HashMap<>();
+                       if (!ApplicationRole.getId().equals(IS_NULL_STRING)) {
+                               final Map<String, Long> appRoleFuncsParams = new  HashMap<>();
+                               appRoleFuncsParams.put("appId", app.getId());
+                               appRoleFuncsParams.put("roleId", Long.valueOf(ApplicationRole.getId()));
+                               List<EPAppRoleFunction> appRoleFunctions = dataAccessService.executeNamedQuery("getAppRoleFunctionOnRoleIdandAppId", appRoleFuncsParams, null);
+                               if (!appRoleFunctions.isEmpty()) {
+                                       for (EPAppRoleFunction roleFunc : appRoleFunctions) {
+                                               roleFunctionsMap.put(roleFunc.getCode(), roleFunc);
+                                       }
+                               }
+                       }
+
+                       if (!externalAccessPermsOfRole.isEmpty()) {
+                               // Adding functions to role
+                               for (ExternalAccessPerms externalpermission : externalAccessPermsOfRole) {
+                                       EPAppRoleFunction checkRoleFunctionExits = roleFunctionsMap.get(externalpermission.getInstance());
+                                       if (checkRoleFunctionExits == null) {
+                                               String funcCode = externalpermission.getType().substring(app.getNameSpace().length() + 1)
+                                                               + FUNCTION_PIPE + externalAccessPerms.getInstance() + FUNCTION_PIPE
+                                                               + externalAccessPerms.getAction();
+                                               EPAppRoleFunction checkRoleFunctionPipeExits = roleFunctionsMap.get(funcCode);
+                                               if (checkRoleFunctionPipeExits == null) {
+                                                       try {
+                                                               final Map<String, String> appFuncsParams = new  HashMap<>();
+                                                               appFuncsParams.put("appId", String.valueOf(app.getId()));
+                                                               appFuncsParams.put("functionCd", externalpermission.getInstance());
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "SyncApplicationRolesWithEcompDB: Adding function to the role: {}",
+                                                                               externalpermission.getInstance());
+                                                               List<CentralV2RoleFunction> roleFunction = null;
+                                                               roleFunction = dataAccessService.executeNamedQuery("getAppFunctionOnCodeAndAppId", appFuncsParams, null);
+                                                               if (roleFunction.isEmpty()) {
+                                                                       appFuncsParams.put("functionCd", funcCode);
+                                                                       roleFunction = dataAccessService.executeNamedQuery("getAppFunctionOnCodeAndAppId", appFuncsParams, null);
+                                                               }
+                                                               if (!roleFunction.isEmpty()) {
+                                                                       EPAppRoleFunction apRoleFunction = new EPAppRoleFunction();
+                                                                       apRoleFunction.setAppId(app.getId());
+                                                                       apRoleFunction.setRoleId(Long.parseLong(ApplicationRole.getId()));
+                                                                       apRoleFunction.setCode(roleFunction.get(0).getCode());
+                                                                       dataAccessService.saveDomainObject(apRoleFunction, null);
+                                                               }
+                                                       } catch (Exception e) {
+                                                               logger.error(EELFLoggerDelegate.errorLogger,
+                                                                               "SyncApplicationRolesWithEcompDB: Failed to add role function", e);
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+                       externalRoleDetailsList.add(externalRoleDetail);
+               }
+               return externalRoleDetailsList;
+       }
+
+       @Override
+       public JSONArray getAppRolesJSONFromExtAuthSystem(EPApp app) throws Exception {
+               ResponseEntity<String> response = null;
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "syncApplicationRolesWithEcompDB: {} ",
+                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+               response = template
+                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                               + "roles/ns/" + app.getNameSpace(), HttpMethod.GET, entity, String.class);
+               String res = response.getBody();
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncApplicationRolesWithEcompDB: Finished GET roles from External Auth system and the result is :",
+                               res);
+               JSONObject jsonObj = new JSONObject(res);
+               JSONArray extRole = jsonObj.getJSONArray("role");
+               for (int i = 0; i < extRole.length(); i++) {
+                       if (extRole.getJSONObject(i).getString(ROLE_NAME).equals(app.getNameSpace() + ADMIN)
+                                       || extRole.getJSONObject(i).getString(ROLE_NAME).equals(app.getNameSpace() + OWNER)
+                                       || (extRole.getJSONObject(i).getString(ROLE_NAME).equals(app.getNameSpace() + ACCOUNT_ADMINISTRATOR)
+                                                       && !app.getId().equals(PortalConstants.PORTAL_APP_ID))) {
+                               extRole.remove(i);
+                               i--;
+                       }                       
+               }
+               return extRole;
+       }
+       
+       @Override
+       public JSONArray getAllUsersByRole(String roleName) throws Exception{
+               ResponseEntity<String> response = null;
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getAllUsersByRole: {} ",
+                               CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
+               response = template
+                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                               + "userRoles/role/" + roleName, HttpMethod.GET, entity, String.class);
+               String res = response.getBody();
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "syncApplicationRolesWithEcompDB: Finished GET roles from External Auth system and the result is :",
+                               res);
+               JSONObject jsonObj = new JSONObject(res);
+               JSONArray extRole = jsonObj.getJSONArray("userRole");
+               
+               return extRole;
+       }
+
+       /**
+        * 
+        * It converts from ExternalRoleDetails.class object to EPRole.class object
+        * 
+        * @param externalRoleDetails
+        * @return EPRole object
+        */
+       private EPRole convertExternalRoleDetailstoEpRole(ExternalRoleDetails externalRoleDetails) {
+               EPRole role = new EPRole();
+               role.setActive(externalRoleDetails.isActive());
+               role.setAppId(externalRoleDetails.getAppId());
+               role.setAppRoleId(externalRoleDetails.getAppRoleId());
+               role.setName(externalRoleDetails.getName());
+               role.setPriority(externalRoleDetails.getPriority());
+               return role;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public Integer bulkUploadUserRoles(String uebkey) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               final Map<String, String> params = new HashMap<>();
+               params.put("uebKey", app.getUebKey());
+               List<BulkUploadUserRoles> userRolesList = null;
+               Integer userRolesAdded = 0;
+               if (app.getCentralAuth()) {
+                       userRolesList = dataAccessService.executeNamedQuery("getBulkUserRoles", params, null);
+                       for (BulkUploadUserRoles userRolesUpload : userRolesList) {
+                               if(!userRolesUpload.getOrgUserId().equals("su1234")){
+                                       addUserRoleInExternalSystem(userRolesUpload);
+                                       userRolesAdded++;
+                               }
+                       }
+               }
+               return userRolesAdded;
+       }
+
+       /**
+        * Its adding a user role in external auth system while doing bulk upload 
+        * 
+        * @param userRolesUpload
+        */
+       private void addUserRoleInExternalSystem(BulkUploadUserRoles userRolesUpload) {
+               try {
+                       String name = "";
+                       ObjectMapper mapper = new ObjectMapper();
+                       if (EPCommonSystemProperties
+                                       .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
+                               name = userRolesUpload.getOrgUserId()
+                                               + SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
+                       }
+                       ExternalAccessUser extUser = new ExternalAccessUser(name,
+                                       userRolesUpload.getAppNameSpace() + "." + userRolesUpload.getRoleName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                       String userRole = mapper.writeValueAsString(extUser);
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                       HttpEntity<String> entity = new HttpEntity<>(userRole, headers);
+                       template.exchange(
+                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "userRole",
+                                       HttpMethod.POST, entity, String.class);
+               } catch(HttpClientErrorException e){
+                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to addUserRoleInExternalSystem", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+               } catch (Exception e) {
+                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addUserRoleInExternalSystem: UserRole already exits but does not break functionality");
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger, "addUserRoleInExternalSystem: Failed to addUserRoleInExternalSystem", e);
+                       }
+               }
+       }
+
+       @Override
+       public void deleteRoleDependencyRecords(Session localSession, Long roleId, Long appId, boolean isPortalRequest) throws Exception {
+               try {
+                       String sql = ""; 
+                       Query query = null;
+                       
+                       //It should delete only when it portal's roleId
+                       if(appId.equals(PortalConstants.PORTAL_APP_ID)){
+                       // Delete from fn_role_function
+                       sql = "DELETE FROM fn_role_function WHERE role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       
+                       // Delete from fn_role_composite
+                       sql = "DELETE FROM fn_role_composite WHERE parent_role_id=" + roleId + " OR child_role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       }
+                       
+                       // Delete from ep_app_role_function
+                       sql = "DELETE FROM ep_app_role_function WHERE role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Delete from ep_role_notification
+                       sql = "DELETE FROM ep_role_notification WHERE role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       
+                       // Delete from fn_user_pseudo_role
+                       sql = "DELETE FROM fn_user_pseudo_role WHERE pseudo_role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Delete form EP_WIDGET_CATALOG_ROLE
+                       sql = "DELETE FROM EP_WIDGET_CATALOG_ROLE WHERE role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       // Delete form EP_WIDGET_CATALOG_ROLE
+                       sql = "DELETE FROM ep_user_roles_request_det WHERE requested_role_id=" + roleId;
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+
+                       if(!isPortalRequest) {
+                               // Delete form fn_menu_functional_roles
+                               sql = "DELETE FROM fn_menu_functional_roles WHERE role_id=" + roleId;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+                               query = localSession.createSQLQuery(sql);
+                               query.executeUpdate();  
+                       }
+               } catch (Exception e) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleDependeciesRecord: failed ", e);
+                       throw new DeleteDomainObjectFailedException("delete Failed" + e.getMessage());
+               }
+
+       }
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<String> getMenuFunctionsList(String uebkey) throws Exception {
+               List<String> appMenuFunctionsList = null;
+               try {
+                       EPApp app = getApp(uebkey).get(0);
+                       final Map<String, Long> appParams = new HashMap<>();
+                       appParams.put(APP_ID, app.getId());
+                       appMenuFunctionsList = dataAccessService.executeNamedQuery("getMenuFunctions", appParams, null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuFunctionsList: Failed", e);
+                       return appMenuFunctionsList;
+               }
+               return appMenuFunctionsList;
+       }
+
+       @SuppressWarnings({ "unchecked"})
+       @Override
+       public List<EcompUser> getAllAppUsers(String uebkey) throws Exception {
+               List<String> usersList = new ArrayList<>();
+               List<EcompUser> usersfinalList = new ArrayList<>();
+               try {
+                       EPApp app = getApp(uebkey).get(0);
+                       final Map<String, Long> appParams = new HashMap<>();
+                       appParams.put("appId", app.getId());
+                       List<EcompUserRoles> userList = (List<EcompUserRoles>) dataAccessService
+                                       .executeNamedQuery("ApplicationUserRoles", appParams, null);
+                       for (EcompUserRoles ecompUserRole : userList) {
+                               boolean found = false;
+                               Set<EcompRole> roles = null;
+                               for (EcompUser user : usersfinalList) {
+                                       if (user.getOrgUserId().equals(ecompUserRole.getOrgUserId())) {
+                                               EcompRole ecompRole = new EcompRole();
+                                               ecompRole.setId(ecompUserRole.getRoleId());
+                                               ecompRole.setName(ecompUserRole.getRoleName());
+                                               roles = user.getRoles();
+                                               roles.add(ecompRole);
+                                               user.setRoles(roles);
+                                               found = true;
+                                               break;
+                                       }
+                               }
+
+                               if (!found) {
+                                       EcompUser epUser = new EcompUser();
+                                       epUser.setOrgId(ecompUserRole.getOrgId());
+                                       epUser.setManagerId(ecompUserRole.getManagerId());
+                                       epUser.setFirstName(ecompUserRole.getFirstName());
+                                       epUser.setLastName(ecompUserRole.getLastName());
+                                       epUser.setPhone(ecompUserRole.getPhone());
+                                       epUser.setEmail(ecompUserRole.getEmail());
+                                       epUser.setOrgUserId(ecompUserRole.getOrgUserId());
+                                       epUser.setOrgCode(ecompUserRole.getOrgCode());
+                                       epUser.setOrgManagerUserId(ecompUserRole.getOrgManagerUserId());
+                                       epUser.setJobTitle(ecompUserRole.getJobTitle());
+                                       epUser.setLoginId(ecompUserRole.getLoginId());
+                                       epUser.setActive(true);
+                                       roles = new HashSet<>();
+                                       EcompRole ecompRole = new EcompRole();
+                                       ecompRole.setId(ecompUserRole.getRoleId());
+                                       ecompRole.setName(ecompUserRole.getRoleName());
+                                       roles.add(ecompRole);
+                                       epUser.setRoles(roles);
+                                       usersfinalList.add(epUser);
+                               }
+                       }
+                       ObjectMapper mapper = new ObjectMapper();
+
+                       for (EcompUser u1 : usersfinalList) {
+                               String str = mapper.writeValueAsString(u1);
+                               usersList.add(str);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getAllUsers failed", e);
+                       throw e;
+               }
+               return usersfinalList;
+       }
+       
+
+       @Override
+       public Role ConvertCentralRoleToRole(String result) {
+               ObjectMapper mapper = new ObjectMapper();
+               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+               Role newRole = new Role();
+               try {
+                       newRole = mapper.readValue(result, Role.class);
+               } catch (IOException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to convert the result to Role Object", e);
+               }
+               if (newRole.getRoleFunctions() != null) {
+                       @SuppressWarnings("unchecked")
+                       Set<RoleFunction> roleFunctionList = newRole.getRoleFunctions();
+                       Set<RoleFunction> roleFunctionListNew = new HashSet<>();
+                       Iterator<RoleFunction> itetaror = roleFunctionList.iterator();
+                       while (itetaror.hasNext()) {
+                               Object nextValue = itetaror.next();
+                               RoleFunction roleFun = mapper.convertValue(nextValue, RoleFunction.class);
+                               roleFunctionListNew.add(roleFun);
+                       }
+                       newRole.setRoleFunctions(roleFunctionListNew);
+               }
+               return newRole;
+       }
+       
+       @Override
+       @SuppressWarnings("unchecked")
+       public List<CentralizedApp> getCentralizedAppsOfUser(String userId) {
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);
+               List<CentralizedApp> centralizedAppsList = new ArrayList<>();
+               try{
+                       centralizedAppsList =  dataAccessService
+                                       .executeNamedQuery("getCentralizedAppsOfUser", params, null);
+               }catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getCentralizedAppsOfUser failed", e);
+               }
+               return centralizedAppsList;
+       }
+
+       @SuppressWarnings("unchecked")
+       public List<CentralV2Role> getGlobalRolesOfApplication(Long appId) {
+               Map<String, Long> params = new HashMap<>();
+               params.put("appId", appId);
+               List<GlobalRoleWithApplicationRoleFunction> globalRoles = new ArrayList<>();
+               try {
+                       globalRoles = dataAccessService.executeNamedQuery("getGlobalRoleWithApplicationRoleFunctions", params,
+                                       null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getCentralizedAppsOfUser failed", e);
+               }
+               List<CentralV2Role> rolesfinalList = new ArrayList<>();
+               if (globalRoles.size() > 0)
+                       rolesfinalList = finalListOfCentralRoles(globalRoles);
+               return rolesfinalList;
+       }
+
+       @SuppressWarnings("unchecked")
+       private CentralV2Role getGlobalRoleForRequestedApp(long requestedAppId, long roleId) {
+               CentralV2Role finalGlobalrole = null;
+               List<GlobalRoleWithApplicationRoleFunction> roleWithApplicationRoleFucntions = new ArrayList<>();
+               Map<String, Long> params = new HashMap<>();
+               params.put("roleId", roleId);
+               params.put("requestedAppId", requestedAppId);
+               try {
+                       roleWithApplicationRoleFucntions = dataAccessService.executeNamedQuery("getGlobalRoleForRequestedApp",
+                                       params, null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getGlobalRoleForRequestedApp failed", e);
+               }
+               if (roleWithApplicationRoleFucntions.size() > 0) {
+                       List<CentralV2Role> rolesfinalList = finalListOfCentralRoles(roleWithApplicationRoleFucntions);
+                       finalGlobalrole = rolesfinalList.get(0);
+               } else {
+                       List<EPRole> roleList = getPortalAppRoleInfo(roleId);
+                       finalGlobalrole = convertRoleToCentralV2Role(roleList.get(0));
+               }
+               return finalGlobalrole;
+       }
+
+       private List<CentralV2Role> finalListOfCentralRoles(List<GlobalRoleWithApplicationRoleFunction> globalRoles) {
+               List<CentralV2Role> rolesfinalList = new ArrayList<>();
+               for (GlobalRoleWithApplicationRoleFunction role : globalRoles) {
+                       boolean found = false;
+                       for (CentralV2Role cenRole : rolesfinalList) {
+                               if (role.getRoleId().equals(cenRole.getId())) {
+                                       SortedSet<CentralV2RoleFunction> roleFunctions = cenRole.getRoleFunctions();
+                                       CentralV2RoleFunction cenRoleFun = createCentralRoleFunctionForGlobalRole(role);
+                                       roleFunctions.add(cenRoleFun);
+                                       cenRole.setRoleFunctions(roleFunctions);
+                                       found = true;
+                                       break;
+                               }
+                       }
+                       if (!found) {
+                               CentralV2Role cenrole = new CentralV2Role();
+                               cenrole.setName(role.getRoleName());
+                               cenrole.setId(role.getRoleId());
+                               cenrole.setActive(role.isActive());
+                               cenrole.setPriority(role.getPriority());
+                               SortedSet<CentralV2RoleFunction> roleFunctions = new TreeSet<>();
+                               CentralV2RoleFunction cenRoleFun = createCentralRoleFunctionForGlobalRole(role);
+                               roleFunctions.add(cenRoleFun);
+                               cenrole.setRoleFunctions(roleFunctions);
+                               rolesfinalList.add(cenrole);
+                       }
+               }
+               return rolesfinalList;
+       }
+
+       private CentralV2RoleFunction createCentralRoleFunctionForGlobalRole(GlobalRoleWithApplicationRoleFunction role) {
+               String instance;
+               String type;
+               String action;
+               CentralV2RoleFunction cenRoleFun;
+               if(role.getFunctionCd().contains(FUNCTION_PIPE)){
+                       instance = EcompPortalUtils.getFunctionCode(role.getFunctionCd());
+                       type = EcompPortalUtils.getFunctionType(role.getFunctionCd());
+                       action = EcompPortalUtils.getFunctionAction(role.getFunctionCd());
+                       cenRoleFun = new CentralV2RoleFunction(null, instance, role.getFunctionName(), null, type, action, null);
+               } else{
+                       type = getFunctionType(role.getFunctionCd());
+                       action = getFunctionAction(role.getFunctionCd());
+                       cenRoleFun = new CentralV2RoleFunction(null, role.getFunctionCd(), role.getFunctionName(), null, type, action, null);
+               }
+               return cenRoleFun;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPRole> getGlobalRolesOfPortal() {
+               List<EPRole> globalRoles = new ArrayList<>();
+               try {
+                       globalRoles = dataAccessService.executeNamedQuery("getGlobalRolesOfPortal", null, null);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getGlobalRolesOfPortal failed", e);
+               }
+               return globalRoles;
+       }
+
+       private CentralV2Role convertRoleToCentralV2Role(EPRole role) {
+        return new CentralV2Role(role.getId(), role.getCreated(), role.getModified(), role.getCreatedId(),
+                               role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(), role.getPriority(),
+                               new TreeSet<>(), new TreeSet<>(), new TreeSet<>());
+               
+       }
+       
+       @Override
+       public List<RoleFunction> convertCentralRoleFunctionToRoleFunctionObject(List<CentralV2RoleFunction> answer) {
+               List<RoleFunction> addRoleFuncList = new ArrayList<>();
+               for(CentralV2RoleFunction cenRoleFunc : answer){
+                       RoleFunction setRoleFunc = new RoleFunction();
+                       setRoleFunc.setCode(cenRoleFunc.getCode());
+                       setRoleFunc.setName(cenRoleFunc.getName());
+                       addRoleFuncList.add(setRoleFunc);
+               }               
+               return addRoleFuncList;
+       }
+
+       @Override
+       public CentralUser getUserRoles(String loginId, String uebkey) throws Exception {
+               CentralUser sendUserRoles = null;
+
+               try {
+                       CentralV2User cenV2User = getV2UserAppRoles(loginId, uebkey);
+                       sendUserRoles = convertV2UserRolesToOlderVersion(cenV2User);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserRoles: failed", e);
+               }
+               return sendUserRoles;
+       }
+
+       /**
+        * 
+        * It returns V2 CentralUser object if user has any roles and permissions
+        * 
+        * @param loginId
+        * @param uebkey
+        * @return CentralUser object
+        * @throws Exception
+        */
+       private CentralV2User getV2UserAppRoles(String loginId, String uebkey) throws Exception {
+               EPApp app;
+               List<EPUser> epUserList;
+               List<EPApp> appList = getApp(uebkey);
+               app = appList.get(0);
+               epUserList = getUser(loginId);
+               EPUser user = epUserList.get(0);
+               Set<EPUserApp> userAppSet = user.getEPUserApps();
+               return createEPUser(user, userAppSet, app);
+       }
+
+       /**
+        * It converts V2 CentralUser object to old version CentralUser object
+        * 
+        * @param cenV2User
+        * @return EPUser object
+        */
+       private CentralUser convertV2UserRolesToOlderVersion(CentralV2User cenV2User) {
+                       Set<CentralV2UserApp> userV2Apps = cenV2User.getUserApps();
+                       Set<CentralUserApp> userApps = new TreeSet<>();
+                       for(CentralV2UserApp userApp : userV2Apps){                             
+                               CentralApp app  = userApp.getApp();
+                               CentralUserApp cua = new CentralUserApp();
+                               cua.setUserId(null);
+                               cua.setApp(app);
+                               SortedSet<CentralRoleFunction> cenRoleFunction = new TreeSet<>();
+                               for(CentralV2RoleFunction  cenV2RoleFunc : userApp.getRole().getRoleFunctions() ){                                      
+                                       CentralRoleFunction cenRoleFunc = new CentralRoleFunction(cenV2RoleFunc.getCode(), cenV2RoleFunc.getName());                                                            
+                                       cenRoleFunction.add(cenRoleFunc);
+                               }
+                               CentralRole role = new CentralRole(userApp.getRole().getId(), userApp.getRole().getName(), userApp.getRole().isActive(), userApp.getRole().getPriority(),
+                                               cenRoleFunction);
+                               cua.setRole(role);
+                               userApps.add(cua);
+                       }
+                       return new CentralUser(cenV2User.getId(), cenV2User.getCreated(), cenV2User.getModified(), 
+                                       cenV2User.getCreatedId(),cenV2User.getModifiedId(), 
+                                       cenV2User.getRowNum(), cenV2User.getOrgId(), cenV2User.getManagerId(), cenV2User.getFirstName(), 
+                                       cenV2User.getMiddleInitial(), cenV2User.getLastName(), cenV2User.getPhone(), cenV2User.getFax(), 
+                                       cenV2User.getCellular(),cenV2User.getEmail(),cenV2User.getAddressId(),cenV2User.getAlertMethodCd(),
+                                       cenV2User.getHrid(),cenV2User.getOrgUserId(),cenV2User.getOrgCode(),cenV2User.getAddress1(), 
+                                       cenV2User.getAddress2(),cenV2User.getCity(),cenV2User.getState(),cenV2User.getZipCode(),cenV2User.getCountry(), 
+                                       cenV2User.getOrgManagerUserId(),cenV2User.getLocationClli(),cenV2User.getBusinessCountryCode(), 
+                                       cenV2User.getBusinessCountryName(),cenV2User.getBusinessUnit(),cenV2User.getBusinessUnitName(), 
+                                       cenV2User.getDepartment(),cenV2User.getDepartmentName(),cenV2User.getCompanyCode(), 
+                                       cenV2User.getCompany(),cenV2User.getZipCodeSuffix(),cenV2User.getJobTitle(), 
+                                       cenV2User.getCommandChain(),cenV2User.getSiloStatus(),cenV2User.getCostCenter(),
+                                       cenV2User.getFinancialLocCode(),cenV2User.getLoginId(),cenV2User.getLoginPwd(), 
+                                       cenV2User.getLastLoginDate(),cenV2User.isActive(),cenV2User.isInternal(),cenV2User.getSelectedProfileId(),cenV2User.getTimeZoneId(),
+                                       cenV2User.isOnline(),cenV2User.getChatId(), 
+                                       userApps);
+       }
+
+       @Override
+       public List<CentralRole> convertV2CentralRoleListToOldVerisonCentralRoleList(List<CentralV2Role> v2CenRoleList) {
+               List<CentralRole> cenRoleList = new ArrayList<>();
+               SortedSet<CentralRoleFunction> cenRoleFuncList = new TreeSet<>();
+                       for(CentralV2Role v2CenRole : v2CenRoleList){
+                               for(CentralV2RoleFunction v2CenRoleFunc: v2CenRole.getRoleFunctions()){
+                                       CentralRoleFunction roleFunc = new CentralRoleFunction(v2CenRoleFunc.getCode(), v2CenRoleFunc.getName());
+                                       cenRoleFuncList.add(roleFunc);
+                               }
+                               CentralRole role = new CentralRole(v2CenRole.getId(), v2CenRole.getName(), v2CenRole.isActive(), v2CenRole.getPriority(), cenRoleFuncList);
+                               cenRoleList.add(role);
+                       }               
+               return cenRoleList;
+       }
+       
+       @Override
+       public ResponseEntity<String> getNameSpaceIfExists(EPApp app) throws Exception {
+               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+               HttpEntity<String> entity = new HttpEntity<>(headers);
+               logger.debug(EELFLoggerDelegate.debugLogger, "checkIfNameSpaceExists: Connecting to External Auth system");
+               ResponseEntity<String> response = null;
+               try {
+                       response = template
+                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                       + "nss/" + app.getNameSpace(), HttpMethod.GET, entity, String.class);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "checkIfNameSpaceExists: Finished ",
+                                       response.getStatusCode().value());
+               } catch (HttpClientErrorException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "checkIfNameSpaceExists failed", e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
+                       if (e.getStatusCode() == HttpStatus.NOT_FOUND)
+                               throw new InvalidApplicationException("Invalid NameSpace");
+                       else
+                               throw e;
+               }
+               return response;
+       }
+       
+       @Override
+       public CentralRole convertV2CentralRoleToOldVerisonCentralRole(CentralV2Role v2CenRole) {
+               SortedSet<CentralRoleFunction> cenRoleFuncList = new TreeSet<>();
+               for (CentralV2RoleFunction v2CenRoleFunc : v2CenRole.getRoleFunctions()) {
+                       CentralRoleFunction roleFunc = new CentralRoleFunction(v2CenRoleFunc.getCode(), v2CenRoleFunc.getName());
+                       cenRoleFuncList.add(roleFunc);
+               }
+               return new CentralRole(v2CenRole.getId(), v2CenRole.getName(), v2CenRole.isActive(), v2CenRole.getPriority(),
+                               cenRoleFuncList);
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public Integer bulkUploadUsersSingleRole(String uebkey, Long roleId, String modifiedRoleName) throws Exception {
+               EPApp app = getApp(uebkey).get(0);
+               final Map<String, String> params = new HashMap<>();
+               params.put("uebKey", app.getUebKey());
+               params.put("roleId", String.valueOf(roleId));
+               List<BulkUploadUserRoles> userRolesList = null;
+               Integer userRolesAdded = 0;
+               if (app.getCentralAuth()) {
+                       userRolesList = dataAccessService.executeNamedQuery("getBulkUsersForSingleRole", params, null);
+                       for (BulkUploadUserRoles userRolesUpload : userRolesList) {
+                               userRolesUpload.setRoleName(modifiedRoleName);
+                               if(!userRolesUpload.getOrgUserId().equals("su1234")){
+                                       addUserRoleInExternalSystem(userRolesUpload);
+                                       userRolesAdded++;
+                               }
+                       }
+               }
+               return userRolesAdded;
+       }       
+       
+       @Override
+       public String encodeFunctionCode(String funCode){
+               String encodedString = funCode;
+               List<Pattern> encodingList = new ArrayList<>();
+               encodingList.add(Pattern.compile("/"));
+               encodingList.add(Pattern.compile("-"));
+               for (Pattern xssInputPattern : encodingList) {
+                       encodedString = xssInputPattern.matcher(encodedString)
+                                       .replaceAll("%" + Hex.encodeHexString(xssInputPattern.toString().getBytes()));
+               }               
+               encodedString = encodedString.replaceAll("\\*", "%"+ Hex.encodeHexString("*".getBytes()));
+               return encodedString;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/FunctionalMenuService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/FunctionalMenuService.java
new file mode 100644 (file)
index 0000000..fa703bd
--- /dev/null
@@ -0,0 +1,76 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.FunctionalMenuItemWithAppID;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRole;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuItemWithRoles;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+
+public interface FunctionalMenuService {
+       List<FunctionalMenuItem> getFunctionalMenuItems (EPUser user);
+       // return all active menu items
+       List<FunctionalMenuItem> getFunctionalMenuItems ();
+       // return all active menu items. If all is true, return all active and inactive menu items.
+       List<FunctionalMenuItem> getFunctionalMenuItems(Boolean all);
+       // return all active Functional menu items for Notification Tree in User Notification . If all is true, return all active menu items.
+       List<FunctionalMenuItem> getFunctionalMenuItemsForNotificationTree(Boolean all);
+       List<FunctionalMenuItem> getFunctionalMenuItemsForApp (Integer appId);
+       List<FunctionalMenuItem> getFunctionalMenuItemsForUser (String orgUserId);
+       FunctionalMenuItem getFunctionalMenuItemDetails (Long menuid);
+       FieldsValidator createFunctionalMenuItem (FunctionalMenuItemWithRoles menuItemJson);
+       FieldsValidator editFunctionalMenuItem (FunctionalMenuItemWithRoles menuItemJson);
+       FieldsValidator deleteFunctionalMenuItem (Long menuId);
+       FieldsValidator regenerateAncestorTable ();
+       //Methods relevant to favorites
+       FieldsValidator setFavoriteItem(FavoritesFunctionalMenuItem menuItemJson);
+       List<FavoritesFunctionalMenuItemJson> getFavoriteItems(Long userId);
+       FieldsValidator removeFavoriteItem (Long userId, Long menuId);
+       List<FunctionalMenuItem> transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(List<FunctionalMenuItemWithAppID> functionalMenuItemWithAppIDList);
+       List<FunctionalMenuRole> getFunctionalMenuRole();
+       //Assign URLs under Help Menu
+       void assignHelpURLs(List<FunctionalMenuItem> menuItems);
+       List<BusinessCardApplicationRole> getUserAppRolesList(String userId);
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/FunctionalMenuServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/FunctionalMenuServiceImpl.java
new file mode 100644 (file)
index 0000000..a6a4ca3
--- /dev/null
@@ -0,0 +1,1016 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang3.StringUtils;
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Projections;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.FunctionalMenuItemWithAppID;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRole;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuItemWithRoles;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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;
+
+@Service("functionalMenuService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class FunctionalMenuServiceImpl implements FunctionalMenuService {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuServiceImpl.class);
+
+       private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
+       private String RESTRICTED_APP_ROLE_ID = "900";
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       @Autowired
+       private SessionFactory sessionFactory;
+
+       @PostConstruct
+       private void init() {
+               try {
+                       ACCOUNT_ADMIN_ROLE_ID = Long
+                                       .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
+                       RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.RESTRICTED_APP_ROLE_ID);
+               } catch (Exception e) {
+               }
+       }
+
+       public List<FunctionalMenuItem> getFunctionalMenuItems(EPUser user) {
+               List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
+               return menuItems;
+       }
+
+       public List<FunctionalMenuItem> getFunctionalMenuItems() {
+               return getFunctionalMenuItems(false);
+       }
+
+       public List<FunctionalMenuItem> getFunctionalMenuItems(Boolean all) {
+               // Divide this into 2 queries: one which returns the bottom-level menu items
+               // associated with Restricted apps,
+               // and one that returns all the other menu items. Then we can easily add the
+               // boolean flag
+               // restrictedApp to each FunctionalMenuItem, to be used by the front end.
+               String activeWhereClause = "";
+               if (!all) {
+                       activeWhereClause = " AND UPPER(m.active_yn) = 'Y' ";
+               }
+               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
+                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+                               + activeWhereClause // " AND UPPER(m.active_yn) = 'Y' "
+                               + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID + "' " + " UNION "
+                               + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
+                               + " FROM fn_menu_functional m " + " WHERE m.url='' " + activeWhereClause; // " AND UPPER(m.active_yn) =
+                                                                                                                                                                                       // 'Y' ";
+               logQuery(sql);
+
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,
+                               FunctionalMenuItemWithAppID.class, null);
+               List<FunctionalMenuItem> menuItems = new ArrayList<>();
+               menuItems = transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(menuItemsWithAppIdList);
+               for (FunctionalMenuItem menuItem : menuItems) {
+                       menuItem.restrictedApp = false;
+               }
+
+               sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
+                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+                               + activeWhereClause // " AND UPPER(m.active_yn) = 'Y' "
+                               + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
+               logQuery(sql);
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
+               for (FunctionalMenuItem menuItem : menuItems2) {
+                       menuItem.restrictedApp = true;
+                       menuItems.add(menuItem);
+               }
+
+               return menuItems;
+       }
+
+       public List<FunctionalMenuItem> getFunctionalMenuItemsForNotificationTree(Boolean all) {
+               // Divide this into 2 queries: one which returns the bottom-level menu items
+               // associated with Restricted apps,
+               // and one that returns all the other menu items which are active. Then we can
+               // easily add the boolean flag
+               // restrictedApp to each FunctionalMenuItem, to be used by the front end.
+               String activeWhereClause = "";
+               if (!all) {
+                       activeWhereClause = " AND UPPER(m.active_yn) = 'Y' ";
+               }
+               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
+                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+                               + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID
+                               + "' " + " UNION "
+                               + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
+                               + " FROM fn_menu_functional m " + " WHERE m.url='' " + activeWhereClause
+                               + " AND UPPER(m.active_yn) = 'Y' ";
+               logQuery(sql);
+
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,
+                               FunctionalMenuItemWithAppID.class, null);
+               List<FunctionalMenuItem> menuItems = new ArrayList<>();
+               menuItems = transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(menuItemsWithAppIdList);
+               for (FunctionalMenuItem menuItem : menuItems) {
+                       menuItem.restrictedApp = false;
+               }
+
+               sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
+                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
+                               + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID
+                               + "' ";
+               logQuery(sql);
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
+               for (FunctionalMenuItem menuItem : menuItems2) {
+                       menuItem.restrictedApp = true;
+                       menuItems.add(menuItem);
+               }
+
+               return menuItems;
+       }
+
+       public List<FunctionalMenuItem> getFunctionalMenuItemsForApp(Integer appId) {
+               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
+                               + " FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr "
+                               + " WHERE " + " mr.app_id='" + appId + "' " + " AND mr.menu_id = m.menu_id "
+                               + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y'" + " AND a.menu_id = m.menu_id "
+                               + " AND a.ancestor_menu_id = m1.menu_id";
+               logQuery(sql);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuItemsForApp: logged the query");
+
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
+
+               return menuItems;
+       }
+
+       /**
+        * convert List of FunctionalMenuItemWithAppID into List of FunctionalMenuItem
+        * 
+        */
+       public List<FunctionalMenuItem> transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(
+                       List<FunctionalMenuItemWithAppID> functionalMenuItemWithAppIDList) {
+               List<FunctionalMenuItem> functionalMenuItemList = new ArrayList<FunctionalMenuItem>();
+               for (FunctionalMenuItemWithAppID functionalMenuItemWithAppID : functionalMenuItemWithAppIDList) {
+                       FunctionalMenuItem menuItem = new FunctionalMenuItem();
+                       menuItem.menuId = functionalMenuItemWithAppID.menuId;
+                       menuItem.column = functionalMenuItemWithAppID.column;
+                       menuItem.text = functionalMenuItemWithAppID.text;
+                       menuItem.parentMenuId = functionalMenuItemWithAppID.parentMenuId;
+                       menuItem.url = functionalMenuItemWithAppID.url;
+                       menuItem.active_yn = functionalMenuItemWithAppID.active_yn;
+                       menuItem.appid = functionalMenuItemWithAppID.appid;
+                       menuItem.setRoles(functionalMenuItemWithAppID.roles);
+                       menuItem.restrictedApp = functionalMenuItemWithAppID.restrictedApp;
+                       functionalMenuItemList.add(menuItem);
+               }
+               return functionalMenuItemList;
+       }
+
+       public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(String orgUserId) {
+               // m represents the functional menu items that are the leaf nodes
+               // m1 represents the functional menu items for all the nodes
+
+               // Divide this into 2 queries: one which returns the bottom-level menu items
+               // associated with Restricted apps,
+               // and one that returns all the other menu items. Then we can easily add the
+               // boolean flag
+               // restrictedApp to each FunctionalMenuItem, to be used by the front end.
+               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
+                               + " FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, "
+                               + " fn_menu_functional_roles mr, fn_user u , fn_user_role ur " + " WHERE " + " u.org_user_id='"
+                               + orgUserId + "' " + " AND u.user_id = ur.user_id " + " AND ur.app_id = mr.app_id " +
+                               // " AND ur.role_id = mr.role_id " +
+                               " AND (ur.role_id = mr.role_id " + "     OR ur.role_id = '" + ACCOUNT_ADMIN_ROLE_ID + "') "
+                               + " AND m.menu_id = mr.menu_id " + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y' "
+                               + " AND a.menu_id = m.menu_id " + " AND a.ancestor_menu_id = m1.menu_id " + " UNION "
+                               // the ancestors of the restricted app menu items
+                               + " select m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m1.active_yn "
+                               + " FROM fn_menu_functional m, fn_menu_functional_roles mr, fn_menu_functional m1, "
+                               + " fn_menu_functional_ancestors a " + " where a.menu_id = m.menu_id "
+                               + " AND a.ancestor_menu_id = m1.menu_id " + " AND m.menu_id != m1.menu_id "
+                               + " AND m.menu_id = mr.menu_id " + " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' "
+                               + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y' "
+                               // Add the Favorites menu item
+                               + " UNION " + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn "
+                               + " FROM fn_menu_functional m "
+                               + " WHERE m.text in ('Favorites','Get Access','Contact Us','Support','User Guide','Help')";
+
+               logQuery(sql);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuItemsForUser: logged the query");
+
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
+               for (FunctionalMenuItem menuItem : menuItems) {
+                       menuItem.restrictedApp = false;
+               }
+
+               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 UPPER(m.active_yn) = 'Y' " + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
+               logQuery(sql);
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
+               for (FunctionalMenuItem menuItem : menuItems2) {
+                       menuItem.restrictedApp = true;
+                       menuItems.add(menuItem);
+               }
+
+               return menuItems;
+       }
+
+       public FunctionalMenuItem getFunctionalMenuItemDetails(Long menuid) {
+               // First, fill in the fields that apply to all menu items
+               
+               List<FunctionalMenuItem> menuItems = getFunctionalMenuItem(menuid);
+               FunctionalMenuItem menuItem = (menuItems == null || menuItems.isEmpty() ? null : menuItems.get(0));
+               // If it is a bottom-level menu item, must fill in the appid and the
+               // roles
+               List<FunctionalMenuRole> roleItems = getFunctionalMenuRoleWithMenuId(menuid);
+               if (roleItems.size() > 0 && menuItem != null) {
+                       Integer appid = roleItems.get(0).appId;
+                       menuItem.appid = appid;
+                       List<Integer> roles = new ArrayList<Integer>();
+                       for (FunctionalMenuRole roleItem : roleItems) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "LR: app_id: " + roleItem.appId + "; role_id: " + roleItem.roleId + "\n");
+                               roles.add(roleItem.roleId);
+                       }
+                       menuItem.setRoles(roles);
+               }
+
+               return menuItem;
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<FunctionalMenuItem> getFunctionalMenuItem(Long menuid) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion textCriterion = Restrictions.eq("menuId",menuid);
+               restrictionsList.add(textCriterion);
+               return  (List<FunctionalMenuItem>) dataAccessService.getList(FunctionalMenuItem.class, null, restrictionsList, null);
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<FunctionalMenuRole> getFunctionalMenuRoleWithMenuId(Long menuid) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion textCriterion = Restrictions.eq("menuId",menuid);
+               restrictionsList.add(textCriterion);
+               return  (List<FunctionalMenuRole>) dataAccessService.getList(FunctionalMenuRole.class, null, restrictionsList, null);
+       }
+
+       private FieldsValidator menuItemFieldsChecker(FunctionalMenuItemWithRoles menuItemJson) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               try {
+                       // TODO: validate all the fields
+                       List<FunctionalMenuItem> functionalMenuItems  = getFunctionalMenuItemWithText(menuItemJson);
+                       boolean dublicatedName = false;
+                       for (FunctionalMenuItem fnMenuItem : functionalMenuItems) {
+                               if (menuItemJson.menuId != null && menuItemJson.menuId.equals(fnMenuItem.menuId)) {
+                                       // FunctionalMenuItem should not be compared with itself
+                                       continue;
+                               }
+
+                               if (!dublicatedName && fnMenuItem.text.equalsIgnoreCase(menuItemJson.text)) {
+                                       dublicatedName = true;
+                                       break;
+                               }
+                       }
+                       if (dublicatedName) {
+                               fieldsValidator.addProblematicFieldName("text");
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
+                               fieldsValidator.errorCode = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "In menuItemFieldsChecker, Error: we have an duplicate text field");
+                       } else if (StringUtils.isEmpty(menuItemJson.text) && menuItemJson.menuId == null) {
+                               // text must be non empty for a create. For an edit, can be empty, which means
+                               // it is a move request.
+                               // a null menuId indicates a create.
+                               fieldsValidator.addProblematicFieldName("text");
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "In menuItemFieldsChecker, Error: we have an empty text field");
+                       } else {
+                               // The url, appid, and roles must either be all filled or all empty.
+                               Boolean urlIsEmpty = StringUtils.isEmpty(menuItemJson.url);
+                               Boolean rolesIsEmpty = menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty();
+                               Boolean appidIsEmpty = menuItemJson.appid == null || menuItemJson.appid == 0;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "LR: menuItemfieldsChecker: urlIsEmpty: " + urlIsEmpty
+                                               + "; rolesIsEmpty: " + rolesIsEmpty + "; appidIsEmpty: " + appidIsEmpty + "\n");
+                               if (!((urlIsEmpty && rolesIsEmpty && appidIsEmpty)
+                                               || (!urlIsEmpty && !rolesIsEmpty && !appidIsEmpty))) {
+                                       fieldsValidator.addProblematicFieldName("url,roles,appid");
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "In menuItemFieldsChecker, Error: we don't have: either all 3 fields empty or all 3 fields nonempty");
+                               } else {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "In menuItemFieldsChecker, Success: either all 3 fields empty or all 3 fields nonempty");
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "menuItemFieldsChecker failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+
+               return fieldsValidator;
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<FunctionalMenuItem> getFunctionalMenuItemWithText(FunctionalMenuItemWithRoles menuItemJson) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion textCriterion = Restrictions.eq("text",menuItemJson.text);
+               restrictionsList.add(textCriterion);
+               return (List<FunctionalMenuItem>) dataAccessService.getList(FunctionalMenuItem.class, null, restrictionsList, null);
+       }
+
+       // Turn foreign key checks on or off
+       protected void setForeignKeys(Session localSession, Boolean on) {
+               String keyCheck = "0";
+               if (on) {
+                       keyCheck = "1";
+               }
+               String sql = "set FOREIGN_KEY_CHECKS=" + keyCheck;
+               logQuery(sql);
+               Query query = localSession.createSQLQuery(sql);
+               query.executeUpdate();
+       }
+
+       public FieldsValidator createFunctionalMenuItem(FunctionalMenuItemWithRoles menuItemJson) {
+               FieldsValidator fieldsValidator = menuItemFieldsChecker(menuItemJson);
+               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "LR: createFunctionalMenuItem: test 1");
+                       boolean result = false;
+                       Session localSession = null;
+                       Transaction transaction = null;
+                       try {
+                               FunctionalMenuItem menuItem = new FunctionalMenuItem();
+                               menuItem.appid = menuItemJson.appid;
+                               menuItem.setRoles(menuItemJson.getRoles());
+                               menuItem.url = menuItemJson.url;
+                               menuItem.text = menuItemJson.text;
+                               menuItem.parentMenuId = menuItemJson.parentMenuId;
+                               menuItem.active_yn = "Y";
+                               localSession = sessionFactory.openSession();
+
+                               // If the app is disabled, deactivate the menu item.
+                               if (menuItemJson.appid != null) {
+                                       Long appidLong = Long.valueOf(menuItemJson.appid);
+                                       EPApp app = (EPApp) localSession.get(EPApp.class, appidLong);
+                                       if (app != null && !app.getEnabled()) {
+                                               menuItem.active_yn = "N";
+                                       }
+                               }
+
+                               // Set the column number to 1 higher than the highest column
+                               // number under this parent.
+                               Criteria criteria = localSession.createCriteria(FunctionalMenuItem.class);
+                               criteria.setProjection(Projections.max("column"));
+                               criteria.add(Restrictions.eq("parentMenuId", menuItem.parentMenuId));
+                               Integer maxColumn = (Integer) criteria.uniqueResult();
+                               if (maxColumn == null) {
+                                       maxColumn = 0;
+                               }
+                               menuItem.column = maxColumn + 1;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "about to create menu item: " + menuItem.toString());
+
+                               transaction = localSession.beginTransaction();
+                               // localSession.saveOrUpdate(newMenuItem);
+                               localSession.save(menuItem);
+                               Long menuid = menuItem.menuId;
+                               menuItemJson.menuId = menuid;
+                               logger.debug(EELFLoggerDelegate.debugLogger, "after saving menu object, new id: " + menuid);
+
+                               // Next, save all the roles
+
+                               addRoles(menuItemJson, localSession);
+                               transaction.commit();
+                               result = true;
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "createFunctionalMenuItem failed", e);
+                               EcompPortalUtils.rollbackTransaction(transaction,
+                                               "createFunctionalMenuItem rollback, exception = " + e.toString());
+                       } finally {
+                               EcompPortalUtils.closeLocalSession(localSession, "createFunctionalMenuItem");
+                       }
+                       if (result) {
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
+                                                               + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "FunctionalMenuServiceImpl.createFunctionalMenuItem: bad request");
+               }
+               return fieldsValidator;
+       }
+
+       /* Add all the roles in the menu item to the database */
+       public void addRoles(FunctionalMenuItemWithRoles menuItemJson, Session localSession) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "entering addRoles.");
+               List<Integer> roles = menuItemJson.getRoles();
+               if (roles != null && roles.size() > 0) {
+                       Integer appid = menuItemJson.appid;
+                       Long menuid = menuItemJson.menuId;
+                       for (Integer roleid : roles) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "about to create record for role: " + roleid);
+                               FunctionalMenuRole role = new FunctionalMenuRole();
+                               role.appId = appid;
+                               role.menuId = menuid;
+                               role.roleId = roleid;
+                               localSession.save(role);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "after saving role menu object, new id: " + role.id);
+                       }
+               }
+       }
+
+       /* Delete all the roles associated with the menu item from the database */
+       public void deleteRoles(Long menuId) {
+               dataAccessService.deleteDomainObjects(FunctionalMenuRole.class, "menu_id='" + menuId + "'", null);
+       }
+
+       /* Delete all favorites associated with the menu item from the database */
+       public void deleteFavorites(Long menuId) {
+               dataAccessService.deleteDomainObjects(FavoritesFunctionalMenuItem.class, "menu_id='" + menuId + "'", null);
+       }
+
+       private Boolean parentMenuIdEqual(Integer menuId1, Integer menuId2) {
+               return ((menuId1 == null && menuId2 == null) || (menuId1 != null && menuId1.equals(menuId2)));
+       }
+
+       private void updateColumnForSiblings(Session localSession, Long menuId, Integer oldParentMenuId,
+                       Integer newParentMenuId, Integer oldColumn, Integer newColumn) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "entering updateColumnForSiblings");
+               Criteria criteria = localSession.createCriteria(FunctionalMenuItem.class);
+               criteria.add(Restrictions.ne("menuId", menuId));
+               if (parentMenuIdEqual(oldParentMenuId, newParentMenuId)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under the same parent");
+                       // We are moving to a new position under the same parent
+                       if (newParentMenuId == null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is null, so using isNull");
+                               criteria.add(Restrictions.isNull("parentMenuId"));
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is NOT null, so using eq");
+                               criteria.add(Restrictions.eq("parentMenuId", newParentMenuId));
+                       }
+                       if (oldColumn > newColumn) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "moving to a lower column under the same parent");
+                               // We are moving to a lower column under the same parent
+                               criteria.add(Restrictions.ge("column", newColumn));
+                               criteria.add(Restrictions.lt("column", oldColumn));
+                               @SuppressWarnings("unchecked")
+                               List<FunctionalMenuItem> menuItems = criteria.list();
+                               for (FunctionalMenuItem menuItem : menuItems) {
+                                       menuItem.column += 1;
+                                       localSession.save(menuItem);
+                               }
+                       } else if (oldColumn < newColumn) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "moving to a higher column under the same parent");
+                               // We are moving to a higher column under the same parent
+                               criteria.add(Restrictions.gt("column", oldColumn));
+                               criteria.add(Restrictions.le("column", newColumn));
+                               @SuppressWarnings("unchecked")
+                               List<FunctionalMenuItem> menuItems = criteria.list();
+                               for (FunctionalMenuItem menuItem : menuItems) {
+                                       menuItem.column -= 1;
+                                       localSession.save(menuItem);
+                               }
+                       } else {
+                               // No info has changed
+                               logger.debug(EELFLoggerDelegate.debugLogger, "no info has changed, so we are not moving");
+                       }
+               } else {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under a new parent");
+                       // We are moving under a new parent.
+
+                       // Adjust the children under the old parent
+                       logger.debug(EELFLoggerDelegate.debugLogger, "about to adjust the children under the old parent");
+
+                       // If the parentId is null, must check for its children differently
+                       if (oldParentMenuId == null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "oldParentMenuId is null, so using isNull");
+                               criteria.add(Restrictions.isNull("parentMenuId"));
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "oldParentMenuId is NOT null, so using eq");
+                               criteria.add(Restrictions.eq("parentMenuId", oldParentMenuId));
+                       }
+
+                       criteria.add(Restrictions.gt("column", oldColumn));
+                       @SuppressWarnings("unchecked")
+                       List<FunctionalMenuItem> menuItems1 = criteria.list();
+                       for (FunctionalMenuItem menuItem : menuItems1) {
+                               menuItem.column -= 1;
+                               localSession.save(menuItem);
+                       }
+                       // Adjust the children under the new parent.
+                       logger.debug(EELFLoggerDelegate.debugLogger, "about to adjust the children under the new parent");
+                       logger.debug(EELFLoggerDelegate.debugLogger, "get all menu items where menuId!=" + menuId
+                                       + "; parentMenuId==" + newParentMenuId + "; column>=" + newColumn);
+                       criteria = localSession.createCriteria(FunctionalMenuItem.class);
+                       criteria.add(Restrictions.ne("menuId", menuId));
+                       if (newParentMenuId == null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is null, so using isNull");
+                               criteria.add(Restrictions.isNull("parentMenuId"));
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is NOT null, so using eq");
+                               criteria.add(Restrictions.eq("parentMenuId", newParentMenuId));
+                       }
+
+                       criteria.add(Restrictions.ge("column", newColumn));
+                       @SuppressWarnings("unchecked")
+                       List<FunctionalMenuItem> menuItems2 = criteria.list();
+                       if (menuItems2 != null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "found " + menuItems2.size() + " menu items");
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "found null menu items");
+                       }
+                       for (FunctionalMenuItem menuItem : menuItems2) {
+                               menuItem.column += 1;
+                               localSession.save(menuItem);
+                       }
+               }
+               logger.debug(EELFLoggerDelegate.debugLogger, "done with updateColumnForSiblings");
+       }
+
+       public void removeAppInfo(Session localSession, Long menuId) {
+               // Remove the url, role, and app info from a menu item
+               FunctionalMenuItem menuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class, menuId);
+               menuItem.url = "";
+               deleteRoles(menuId);
+       }
+
+       public FieldsValidator editFunctionalMenuItem(FunctionalMenuItemWithRoles menuItemJson) {
+               boolean result = false;
+               Session localSession = null;
+               Transaction transaction = null;
+               Long menuId = menuItemJson.menuId;
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "LR: editFunctionalMenuItem: test 1");
+               FieldsValidator fieldsValidator = menuItemFieldsChecker(menuItemJson);
+               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                       // TODO: make sure menuId is here. And, it might not already exist
+                       // in db table.
+                       if (menuId == null) {
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "FunctionalMenuServiceImpl.editFunctionalMenuItem: bad request");
+                       } else {
+                               // To simplify the code, assume we will have a transaction
+                               try {
+                                       localSession = sessionFactory.openSession();
+                                       transaction = localSession.beginTransaction();
+
+                                       // Get the existing info associated with menuItem from the DB
+                                       FunctionalMenuItem menuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class,
+                                                       menuId);
+                                       Integer oldColumn = menuItem.column;
+                                       Integer oldParentMenuId = menuItem.parentMenuId;
+                                       Integer newColumn = menuItemJson.column;
+                                       Integer newParentMenuId = menuItemJson.parentMenuId;
+
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "prev info: column: " + oldColumn + "; parentMenuId: " + oldParentMenuId);
+
+                                       if (menuItemJson.appid != null && menuItemJson.getRoles() != null
+                                                       && !menuItemJson.getRoles().isEmpty() && menuItemJson.url != null
+                                                       && !menuItemJson.url.isEmpty() && menuItemJson.text != null
+                                                       && !menuItemJson.text.isEmpty()) {
+                                               // Scenario: appid, roles, url and text are all non-null.
+                                               // This menu item is associated with an app.
+                                               // (Note: this should only occur for a bottom-level menu
+                                               // item with no children.)
+                                               // 1) Remove all the records from fn_menu_functional_role
+                                               // for this menuId.
+                                               // 2) Add records to the fn_menu_function_role table for the
+                                               // appId and each roleId
+                                               // 3) Update the url and text for this menu item.
+
+                                               // Because of foreign key constraints, delete the roles,
+                                               // then update the menuItem then add the roles.
+                                               deleteRoles(menuId);
+                                               // Assumption: this is not a Move, so don't change the
+                                               // parentMenuId and column.
+                                               menuItem.appid = menuItemJson.appid;
+                                               menuItem.setRoles(menuItemJson.getRoles());
+                                               menuItem.url = menuItemJson.url;
+                                               menuItem.text = menuItemJson.text;
+
+                                               // If the app is disabled, deactivate the menu item.
+                                               Long appidLong = Long.valueOf(menuItemJson.appid);
+                                               EPApp app = (EPApp) localSession.get(EPApp.class, appidLong);
+                                               if (app != null && !app.getEnabled()) {
+                                                       menuItem.active_yn = "N";
+                                               } else {
+                                                       menuItem.active_yn = "Y";
+                                               }
+
+                                               localSession.update(menuItem);
+                                               addRoles(menuItemJson, localSession);
+
+                                       } else if (menuItemJson.appid == null
+                                                       && (menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty())
+                                                       && (menuItemJson.url == null || menuItemJson.url.isEmpty()) && menuItemJson.text != null
+                                                       && !menuItemJson.text.isEmpty()) {
+                                               // Scenario: appid, roles and url are all null; text is
+                                               // non-null.
+                                               // This menu item is NOT associated with an app.
+                                               // 1) Remove all the records from fn_menu_functional_role
+                                               // for this menuId
+                                               // (in case it was previously associated with an app).
+                                               // 2) Update the text for this menu item.
+                                               // 3) Set the url to ""
+                                               deleteRoles(menuId);
+                                               // Assumption: this is not a Move, so don't change the
+                                               // parentMenuId and column.
+                                               menuItem.text = menuItemJson.text;
+                                               menuItem.url = "";
+                                               menuItem.active_yn = "Y";
+                                               localSession.update(menuItem);
+
+                                       } else if (newColumn != null) {
+                                               // This is a "move" request.
+                                               // Menu item has been moved to a different position under
+                                               // the same parent, or under a new parent.
+                                               logger.debug(EELFLoggerDelegate.debugLogger, "Doing a move operation.");
+                                               if (parentMenuIdEqual(oldParentMenuId, newParentMenuId)) {
+                                                       // The parent is the same. We have just changed the
+                                                       // column
+                                                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under the same parent");
+                                                       menuItem.column = newColumn;
+                                                       localSession.update(menuItem);
+                                               } else {
+                                                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under a different parent");
+                                                       menuItem.parentMenuId = newParentMenuId;
+                                                       menuItem.column = newColumn;
+                                                       localSession.update(menuItem);
+                                                       // If we are moving under a new parent, must delete any
+                                                       // app/role info from
+                                                       // the new parent, since it is no longer a leaf menu
+                                                       // item and cannot have app info
+                                                       // associated with it. The front end will have warned
+                                                       // the user and gotten confirmation.
+                                                       if (menuItemJson.parentMenuId != null) {
+                                                               Long parentMenuIdLong = new Long(menuItemJson.parentMenuId);
+                                                               removeAppInfo(localSession, parentMenuIdLong);
+                                                               // deleteRoles(parentMenuIdLong);
+                                                       }
+                                               }
+                                               // must update the column for all old and new sibling menu
+                                               // items
+                                               updateColumnForSiblings(localSession, menuId, oldParentMenuId, newParentMenuId, oldColumn,
+                                                               newColumn);
+                                       }
+
+                                       transaction.commit();
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "LR: editFunctionalMenuItem: finished committing transaction");
+                                       result = true;
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "editFunctionalMenuItem failed", e);
+                                       EcompPortalUtils.rollbackTransaction(transaction,
+                                                       "createFunctionalMenuItem rollback, exception = " + e.toString());
+                               } finally {
+                                       EcompPortalUtils.closeLocalSession(localSession, "editFunctionalMenuItem");
+                               }
+
+                               if (result) {
+                               } else {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
+                                                                       + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                               }
+                       }
+               }
+
+               return fieldsValidator;
+       }
+
+       public FieldsValidator deleteFunctionalMenuItem(Long menuId) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               logger.debug(EELFLoggerDelegate.debugLogger, "LR: deleteFunctionalMenuItem: test 1");
+               boolean result = false;
+               Session localSession = null;
+               Transaction transaction = null;
+
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       // We must turn off foreign keys before deleting a menu item. Otherwise there
+                       // will be a
+                       // constraint violation from the ancestors table.
+                       setForeignKeys(localSession, false);
+                       deleteRoles(menuId);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteFunctionalMenuItem: after deleting roles");
+                       deleteFavorites(menuId);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteFunctionalMenuItem: after deleting favorites");
+                       localSession.delete(localSession.get(FunctionalMenuItem.class, menuId));
+                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteFunctionalMenuItem: about to commit");
+                       transaction.commit();
+                       result = true;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteFunctionalMenuItem failed", e);
+                       EcompPortalUtils.rollbackTransaction(transaction,
+                                       "deleteFunctionalMenuItem rollback, exception = " + e.toString());
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "deleteFunctionalMenuItem");
+               }
+               if (result) {
+               } else {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "LR: deleteFunctionalMenuItem: no result. setting httpStatusCode to "
+                                                       + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       // Regenerate the fn_menu_functional_ancestors table, which is used
+       // by the queries that return the functional menu items.
+       public FieldsValidator regenerateAncestorTable() {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               Session localSession = null;
+               Transaction transaction = null;
+
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       String sql = "DELETE FROM fn_menu_functional_ancestors";
+                       logQuery(sql);
+                       Query query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 1");
+
+                       sql = "ALTER TABLE fn_menu_functional_ancestors AUTO_INCREMENT=1";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: reset AUTO_INCREMENT to 1");
+
+                       int depth = 0;
+                       sql = "INSERT INTO fn_menu_functional_ancestors(menu_id, ancestor_menu_id, depth) "
+                                       + "SELECT m.menu_id, m.menu_id, " + depth + " FROM fn_menu_functional m";
+                       logQuery(sql);
+                       query = localSession.createSQLQuery(sql);
+                       query.executeUpdate();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 2");
+                       for (depth = 0; depth < 3; depth++) {
+                               int depthPlusOne = depth + 1;
+                               sql = "INSERT INTO fn_menu_functional_ancestors(menu_id, ancestor_menu_id, depth) "
+                                               + " SELECT a.menu_id, m.parent_menu_id, " + depthPlusOne
+                                               + " FROM fn_menu_functional m, fn_menu_functional_ancestors a " + " WHERE a.depth='" + depth
+                                               + "' AND " + " a.ancestor_menu_id = m.menu_id AND " + " m.parent_menu_id != '-1'";
+                               logQuery(sql);
+                               query = localSession.createSQLQuery(sql);
+                               query.executeUpdate();
+                       }
+                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 3");
+                       transaction.commit();
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "regenerateAncestorTable failed", e);
+                       EcompPortalUtils.rollbackTransaction(transaction,
+                                       "regenerateAncestorTable rollback, exception = " + e.toString());
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "regenerateAncestorTable");
+               }
+               return fieldsValidator;
+       }
+
+       private void logQuery(String sql) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+       }
+
+       public FieldsValidator setFavoriteItem(FavoritesFunctionalMenuItem menuItemJson) {
+               boolean result = false;
+               FieldsValidator fieldsValidator = new FieldsValidator();
+
+               Session localSession = null;
+               Transaction transaction = null;
+
+               try {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       String.format("Before adding favorite for user id:{0} and menu id:{1} ", menuItemJson.userId,
+                                                       menuItemJson.menuId));
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       localSession.save(menuItemJson);
+                       transaction.commit();
+                       result = true;
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       String.format("After adding favorite for user id:{0} and menu id:{1} ", menuItemJson.userId,
+                                                       menuItemJson.menuId));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "setFavoriteItem failed", e);
+                       EcompPortalUtils.rollbackTransaction(transaction, "setFavoriteItem rollback, exception = " + e.toString());
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "setFavoriteItem");
+               }
+
+               if (result) {
+               } else {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+
+               return fieldsValidator;
+       }
+
+       public List<FavoritesFunctionalMenuItemJson> getFavoriteItems(Long userId) {
+               try {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Before getting favorites for user id: " + userId);
+
+                       // Divide this into 2 queries: one which returns the favorites items associated
+                       // with Restricted apps,
+                       // and one that returns all the other favorites items. Then we can easily add
+                       // the boolean flag
+                       // restrictedApp to each FavoritesFunctionalMenuItemJson, to be used by the
+                       // front end.
+
+                       String sql = "SELECT f.user_id,f.menu_id,m.text,m.url "
+                                       + " FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
+                                       + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id " + " AND f.menu_id = mr.menu_id "
+                                       + " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
+
+                       @SuppressWarnings("unchecked")
+                       List<FavoritesFunctionalMenuItemJson> menuItems = dataAccessService.executeSQLQuery(sql,
+                                       FavoritesFunctionalMenuItemJson.class, null);
+                       for (FavoritesFunctionalMenuItemJson menuItem : menuItems) {
+                               menuItem.restrictedApp = true;
+                       }
+
+                       sql = "SELECT DISTINCT f.user_id,f.menu_id,m.text,m.url "
+                                       + " FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
+                                       + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id " + " AND f.menu_id = mr.menu_id "
+                                       + " AND mr.role_id != '" + RESTRICTED_APP_ROLE_ID + "' ";
+                       @SuppressWarnings("unchecked")
+                       List<FavoritesFunctionalMenuItemJson> menuItems2 = dataAccessService.executeSQLQuery(sql,
+                                       FavoritesFunctionalMenuItemJson.class, null);
+                       for (FavoritesFunctionalMenuItemJson menuItem : menuItems2) {
+                               menuItem.restrictedApp = false;
+                               menuItems.add(menuItem);
+                       }
+
+                       return menuItems;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getFavoriteItems failed", e);
+                       List<FavoritesFunctionalMenuItemJson> menuItems = new ArrayList<FavoritesFunctionalMenuItemJson>();
+                       return menuItems;
+               }
+       }
+
+       public FieldsValidator removeFavoriteItem(Long userId, Long menuId) {
+               boolean result = false;
+               FieldsValidator fieldsValidator = new FieldsValidator();
+
+               Session localSession = null;
+               Transaction transaction = null;
+
+               try {
+
+                       FavoritesFunctionalMenuItem menuItemJson = new FavoritesFunctionalMenuItem();
+                       menuItemJson.userId = userId;
+                       menuItemJson.menuId = menuId;
+
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       localSession.delete(menuItemJson);
+                       localSession.flush();
+                       transaction.commit();
+                       result = true;
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       String.format("After removing favorite for user id: " + userId + "; menu id: " + menuId));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "removeFavoriteItem failed", e);
+                       EcompPortalUtils.rollbackTransaction(transaction,
+                                       "removeFavoriteItem rollback, exception = " + e.toString());
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "removeFavoriteItem");
+               }
+
+               if (result) {
+               } else {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+
+               return fieldsValidator;
+       }
+
+       @Override
+       public void assignHelpURLs(List<FunctionalMenuItem> menuItems) {
+               try {
+                       String user_guide_link = SystemProperties.getProperty(EPCommonSystemProperties.USER_GUIDE_URL);
+
+                       for (FunctionalMenuItem menuItem : menuItems) {
+                               if (menuItem.text.equalsIgnoreCase("Contact Us")) {
+                                       menuItem.setUrl("contactUs");
+                                       // menuItem.setRestrictedApp(true);
+                               }
+                               if (menuItem.text.equalsIgnoreCase("Get Access")) {
+                                       menuItem.setUrl("getAccess");
+                               }
+                               if (menuItem.text.equalsIgnoreCase("User Guide")) {
+                                       menuItem.setUrl(user_guide_link);
+                                       menuItem.setRestrictedApp(true);
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "assignHelpURLs process failed", e);
+               }
+
+       }
+
+       public List<FunctionalMenuRole> getFunctionalMenuRole() {
+               String sql = "SELECT * from fn_menu_functional_roles";
+               logQuery(sql);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuRole: logged the query");
+
+               @SuppressWarnings("unchecked")
+               List<FunctionalMenuRole> functionalMenuRole = dataAccessService.executeSQLQuery(sql, FunctionalMenuRole.class,
+                               null);
+
+               return functionalMenuRole;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<BusinessCardApplicationRole> getUserAppRolesList(String userId) {
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);
+
+               List<BusinessCardApplicationRole> userAppRoles = null;
+               try {
+                       userAppRoles = dataAccessService.executeNamedQuery("getUserApproles", params, null);
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppRolesList failed", e);
+               }
+               return userAppRoles;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/GetAccessService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/GetAccessService.java
new file mode 100644 (file)
index 0000000..093fd25
--- /dev/null
@@ -0,0 +1,51 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.GetAccessResult;
+
+public interface GetAccessService {
+       /**
+        * @return One entry per application function AND role; i.e., each application
+        *         appears many times.
+        */
+       List<GetAccessResult> getAppAccessList(EPUser user);
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/GetAccessServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/GetAccessServiceImpl.java
new file mode 100644 (file)
index 0000000..fb0bf7f
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.GetAccessResult;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+@Service("getAccessService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class GetAccessServiceImpl implements GetAccessService{
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       /*
+        * (non-Javadoc)
+        * @see org.openecomp.portalapp.portal.service.GetAccessService#getAppAccessList()
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<GetAccessResult> getAppAccessList(EPUser user) {
+               final Map<String, Long> params = new HashMap<>();
+               List<GetAccessResult> appAccessList = null;
+               params.put("userId", user.getId());
+               appAccessList = dataAccessService
+                               .executeNamedQuery("getAppAccessFunctionRole", params, null);
+               return appAccessList;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ManifestService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ManifestService.java
new file mode 100644 (file)
index 0000000..ab15b18
--- /dev/null
@@ -0,0 +1,51 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.IOException;
+import java.util.jar.Attributes;
+
+public interface ManifestService {
+       /**
+        * Gets the content of the webapp manifest file META-INF/MANIFEST.MF.
+        *
+        * @return Attributes object with key-value pairs from the manifest
+        * @throws IOException
+        */
+       public Attributes getWebappManifest() throws IOException;
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ManifestServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ManifestServiceImpl.java
new file mode 100644 (file)
index 0000000..6ea66fe
--- /dev/null
@@ -0,0 +1,79 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.Attributes;
+import java.util.jar.Manifest;
+
+import javax.servlet.ServletContext;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+@Service("manifestService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class ManifestServiceImpl implements ManifestService {
+       @Autowired
+       ServletContext context;
+
+       /*
+        * (non-Javadoc)
+        * @see org.openecomp.portalapp.portal.service.ManifestService#getWebappManifest()
+        */
+       public Attributes getWebappManifest() throws IOException {
+               EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManifestServiceImpl.class);
+               // Path to resource on classpath
+               final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
+               // Manifest is formatted as Java-style properties
+               try {
+                       InputStream inputStream = context.getResourceAsStream(MANIFEST_RESOURCE_PATH);
+                       Manifest manifest = new Manifest(inputStream);
+                       inputStream.close();
+                       return manifest.getMainAttributes();
+               } catch (IOException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getWebappManifest: failed to read/find manifest");
+                       throw e;
+               }
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceProxyService.java
new file mode 100644 (file)
index 0000000..594e5ef
--- /dev/null
@@ -0,0 +1,77 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.springframework.web.client.RestClientException;
+
+public interface MicroserviceProxyService {
+
+       /**
+        * Gets the specific microservice from table ep_microservice, communicates
+        * to microservice with the specified security type. The microservice sends
+        * back the response.
+        * 
+        * Gets the data while testing the microservice with no widget associated with
+        * 
+        * @param serviceId
+        *            Id of microservice to be used
+        * @return response sent from microservice
+        * @throws Exception
+        */
+       String proxyToDestination(long serviceId, EPUser user, HttpServletRequest request) throws Exception;
+       
+       
+       
+       /**
+        * Gets the microservice data based on the user id and widget id. Different
+        * users have his/her own parameters for one widget. The method sends back
+        * the response.
+        * 
+        * @param widgetId
+        *                        Id of widget to be used
+        * @param user
+        *                        User information
+        * @param request
+        * @return response sent from microserivce 
+        * @throws Exception
+        */
+       String proxyToDestinationByWidgetId(long widgetId, EPUser user, HttpServletRequest request) throws Exception;
+}
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
new file mode 100644 (file)
index 0000000..d18ffbe
--- /dev/null
@@ -0,0 +1,242 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import org.apache.commons.codec.binary.Base64;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.MicroserviceData;
+import org.onap.portalapp.portal.domain.MicroserviceParameter;
+import org.onap.portalapp.portal.domain.WidgetCatalogParameter;
+import org.onap.portalapp.portal.domain.WidgetServiceHeaders;
+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.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+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.stereotype.Service;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestTemplate;
+
+@Service("microserviceProxyService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class MicroserviceProxyServiceImpl implements MicroserviceProxyService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyServiceImpl.class);
+
+       private static final String BASIC_AUTH = "Basic Authentication";
+       private static final String NO_AUTH = "No Authentication";
+       private static final String COOKIE_AUTH = "Cookie based Authentication";
+       private static final String QUESTION_MARK = "?";
+       private static final String ADD_MARK = "&";
+
+       @Autowired
+       private ConsulHealthService consulHealthService;
+       @Autowired
+       MicroserviceService microserviceService;
+       @Autowired
+       WidgetParameterService widgetParameterService;
+
+       private String whatService = "widgets-service";
+
+       private RestTemplate template = new RestTemplate();
+
+       @Override
+       public String proxyToDestination(long serviceId, EPUser user, HttpServletRequest request) throws Exception {
+               // get the microservice object by the id
+               MicroserviceData data = microserviceService.getMicroserviceDataById(serviceId);
+               // No such microservice available
+               if (data == null) {
+                       // can we return a better response than null?
+                       return null;
+               }
+               return authenticateAndRespond(data, request, composeParams(data, user));
+       }
+
+       @Override
+       public String proxyToDestinationByWidgetId(long widgetId, EPUser user, HttpServletRequest request)
+                       throws Exception {
+               @SuppressWarnings({ "rawtypes", "unchecked" })
+               ResponseEntity<Long> ans = (ResponseEntity<Long>) template.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://"
+                                               + consulHealthService.getServiceLocation(whatService,
+                                                               SystemProperties.getProperty("microservices.widget.local.port"))
+                                               + "/widget/microservices/widgetCatalog/parameters/" + widgetId,
+                               HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class);
+               Long serviceId = ans.getBody();
+               // get the microservice object by the id
+               MicroserviceData data = microserviceService.getMicroserviceDataById(serviceId);
+               // No such microservice available
+               if (data == null)
+                       return null;
+
+               List<MicroserviceParameter> params = composeParams(data, user);
+               for (MicroserviceParameter p : params) {
+                       WidgetCatalogParameter userValue = widgetParameterService.getUserParamById(widgetId, user.getId(),
+                                       p.getId());
+                       if (userValue != null)
+                               p.setPara_value(userValue.getUser_value());
+               }
+               return authenticateAndRespond(data, request, params);
+       }
+
+       private String authenticateAndRespond(MicroserviceData data, HttpServletRequest request,
+                       List<MicroserviceParameter> params) throws HttpClientErrorException, IllegalArgumentException {
+               String response = null;
+               if (data.getSecurityType().equals(NO_AUTH)) {
+                       HttpEntity<String> entity = new HttpEntity<String>(headersForNoAuth());
+                       String url = microserviceUrlConverter(data, params);
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "authenticateAndRespond: Before making no authentication call: {}", url);
+                       response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "authenticateAndRespond: No authentication call response: {}",
+                                       response);
+               } else if (data.getSecurityType().equals(BASIC_AUTH)) {
+                       // encoding the username and password
+                       String plainCreds = null;
+                       try {
+                               plainCreds = data.getUsername() + ":" + decryptedPassword(data.getPassword());
+                       } catch (Exception e) {
+                               logger.error("authenticateAndRespond failed to decrypt password", e);
+                               throw new IllegalArgumentException("Failed to decrypt password", e);
+                       }
+                       byte[] plainCredsBytes = plainCreds.getBytes();
+                       byte[] base64CredsBytes = Base64.encodeBase64(plainCredsBytes);
+                       String base64Creds = new String(base64CredsBytes);
+
+                       HttpEntity<String> entity = new HttpEntity<String>(headersForBasicAuth(request, base64Creds));
+
+                       String url = microserviceUrlConverter(data, params);
+                       try {
+                               response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
+                       } catch (HttpClientErrorException e) {
+                               logger.error("authenticateAndRespond failed for basic security url " + url, e);
+                               throw e;
+                       }
+               } else if (data.getSecurityType().equals(COOKIE_AUTH)) {
+                       HttpEntity<String> entity = new HttpEntity<String>(headersForCookieAuth(request));
+                       String url = microserviceUrlConverter(data, params);
+                       try {
+                               response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
+                       } catch (HttpClientErrorException e) {
+                               logger.error("authenticateAndRespond failed for cookie auth url " + url, e);
+                               throw e;
+                       }
+               }
+
+               return response;
+       }
+
+       private String decryptedPassword(String encryptedPwd) throws Exception {
+               String result = "";
+               if (encryptedPwd != null && encryptedPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.decryptPKC(encryptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
+                               throw e;
+                       }
+               }
+
+               return result;
+       }
+
+       private String microserviceUrlConverter(MicroserviceData data, List<MicroserviceParameter> params) {
+               String url = data.getUrl();
+               for (int i = 0; i < params.size(); i++) {
+                       if (i == 0) {
+                               url += QUESTION_MARK;
+                       }
+                       url += params.get(i).getPara_key() + "=" + params.get(i).getPara_value();
+                       if (i != (params.size() - 1)) {
+                               url += ADD_MARK;
+                       }
+               }
+
+               return url;
+       }
+
+       private HttpHeaders headersForNoAuth() {
+               HttpHeaders headers = new HttpHeaders();
+               headers.setContentType(MediaType.APPLICATION_JSON);
+
+               return headers;
+       }
+
+       // TODO: why is this generically named cookie used?
+       private final static String Cookie = "Cookie";
+       
+       private HttpHeaders headersForBasicAuth(HttpServletRequest request, String base64Creds) {
+               HttpHeaders headers = new HttpHeaders();
+               headers.add("Authorization", "Basic " + base64Creds);
+               headers.setContentType(MediaType.APPLICATION_JSON);
+               String rawCookie = request.getHeader(Cookie);
+               if (rawCookie != null)
+                       headers.add(Cookie, rawCookie);
+               return headers;
+       }
+
+       private HttpHeaders headersForCookieAuth(HttpServletRequest request) {
+               HttpHeaders headers = new HttpHeaders();
+               headers.setContentType(MediaType.APPLICATION_JSON);
+               String rawCookie = request.getHeader(Cookie);
+               if (rawCookie != null)
+                       headers.add(Cookie, rawCookie);
+               return headers;
+       }
+
+       private List<MicroserviceParameter> composeParams(MicroserviceData data, EPUser user) {
+               List<MicroserviceParameter> params = data.getParameterList();
+               MicroserviceParameter userIdParam = new MicroserviceParameter();
+               userIdParam.setPara_key("userId");
+               userIdParam.setPara_value(user.getOrgUserId());
+               params.add(userIdParam);
+               return params;
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/MicroserviceService.java
new file mode 100644 (file)
index 0000000..60553b3
--- /dev/null
@@ -0,0 +1,105 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.MicroserviceData;
+import org.onap.portalapp.portal.domain.MicroserviceParameter;
+
+public interface MicroserviceService {
+
+       /**
+        * Get all microservices from the ep_microservice
+        * 
+        * @return list of all microservices
+        * @throws Exception
+        */
+       List<MicroserviceData> getMicroserviceData() throws Exception;
+
+       /**
+        * Gets the specified microservice with id from ep_microservice
+        * 
+        * @param id
+        *            ID of microservice to be fetched
+        * @return the microservice with the specified id
+        */
+       MicroserviceData getMicroserviceDataById(long id);
+
+       /**
+        * Saves the specified microservice to the table ep_microservice
+        * 
+        * @param newService
+        *            Content of microservice to be saved
+        * @return new microservice id
+        * @throws Exception
+        */
+       Long saveMicroservice(MicroserviceData newService) throws Exception;
+
+       void saveServiceParameters(long serviceId, List<MicroserviceParameter> list) throws Exception;
+
+       /**
+        * Deletes the specified microservice from all tables where the serviceId is
+        * used
+        * 
+        * @param serviceId
+        * @throws Exception
+        */
+       void deleteMicroservice(long serviceId) throws Exception;
+
+       /**
+        * Updates the specified microservice from all tables where the serviceId is
+        * used
+        * 
+        * @param serviceId
+        *            Id of microservice to be updated
+        * @param newService
+        *            Content of microservice to be updated
+        * @throws Exception
+        */
+       void updateMicroservice(long serviceId, MicroserviceData newService) throws Exception;
+
+       /**
+        * Gets the Service parameters by the service Id
+        * 
+        * @param serviceId
+        * @return List<MicroserviceParameter>
+        */
+       List<MicroserviceParameter> getParametersById(long serviceId);
+
+}
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
new file mode 100644 (file)
index 0000000..d7f78d8
--- /dev/null
@@ -0,0 +1,227 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.crypto.BadPaddingException;
+
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.MicroserviceData;
+import org.onap.portalapp.portal.domain.MicroserviceParameter;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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;
+
+@Service("microserviceService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class MicroserviceServiceImpl implements MicroserviceService {
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       public Long saveMicroservice(MicroserviceData newService) throws Exception {
+               if (newService.getPassword() != null)
+                       newService.setPassword(encryptedPassword(newService.getPassword()));
+               getDataAccessService().saveDomainObject(newService, null);
+               return newService.getId();
+       }
+
+       public void saveServiceParameters(long serviceId, List<MicroserviceParameter> list) throws Exception {
+               for (int i = 0; i < list.size(); i++) {
+                       MicroserviceParameter para = list.get(i);
+                       para.setServiceId(serviceId);
+                       getDataAccessService().saveDomainObject(para, null);
+               }
+       }
+
+       @Override
+       public MicroserviceData getMicroserviceDataById(long id) {
+               MicroserviceData data = null;
+               try {
+                       List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                       Criterion idCriterion = Restrictions.eq("id", id);
+                       restrictionsList.add(idCriterion);
+                       data = (MicroserviceData) dataAccessService.getList(MicroserviceData.class, null, restrictionsList, null).get(0);
+                       
+                       data.setParameterList(getServiceParameters(id));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMicroserviceDataById failed", e);
+                       throw e;
+               }
+               return data;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<MicroserviceData> getMicroserviceData() throws Exception {
+               List<MicroserviceData> list = (List<MicroserviceData>) dataAccessService.getList(MicroserviceData.class, null);
+               for (int i = 0; i < list.size(); i++) {
+                       if (list.get(i).getPassword() != null)
+                               try{
+                                       list.get(i).setPassword(decryptedPassword(list.get(i).getPassword()));
+                               } catch(BadPaddingException bpe){
+                                       logger.error(EELFLoggerDelegate.errorLogger, "Couldn't decrypt - Check decryption key in system.properties - looks wrong. Still going ahead with list population though", bpe);
+                               }
+                       list.get(i).setParameterList(getServiceParameters(list.get(i).getId()));
+               }
+               return list;
+       }
+
+       private List<MicroserviceParameter> getServiceParameters(long serviceId) {
+               List<MicroserviceParameter> list = getMicroServiceParametersList(serviceId);
+               return list;
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<MicroserviceParameter> getMicroServiceParametersList(long serviceId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion serviceIdCriterion = Restrictions.eq("serviceId", serviceId);
+               restrictionsList.add(serviceIdCriterion);
+               return (List<MicroserviceParameter>) dataAccessService.getList(MicroserviceParameter.class, null, restrictionsList, null);
+       }
+
+       @Override
+       public void deleteMicroservice(long serviceId) throws Exception {
+
+               try {
+                       Map<String, String> params = new HashMap<String, String>();
+                       params.put("serviceId", Long.toString(serviceId));
+
+                       dataAccessService.executeNamedQuery("deleteMicroserviceParameter", params, null);
+                       dataAccessService.executeNamedQuery("deleteMicroservice", params, null);
+
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       logger.error(EELFLoggerDelegate.errorLogger, "deleteMicroservice failed", e);
+                       throw e;
+               }
+       }
+
+       @Override
+       public void updateMicroservice(long serviceId, MicroserviceData newService) throws Exception {
+               try {
+                       newService.setId(serviceId);
+                       if (newService.getPassword() != null)
+                               newService.setPassword(encryptedPassword(newService.getPassword()));
+                       getDataAccessService().saveDomainObject(newService, null);
+                       List<MicroserviceParameter> oldService = getServiceParameters(serviceId);
+                       boolean foundParam;
+                       for (int i = 0; i < oldService.size(); i++) {
+                               foundParam = false;
+                               for (int n = 0; n < newService.getParameterList().size(); n++) {
+                                       if (newService.getParameterList().get(n).getId().equals(oldService.get(i).getId())) {
+                                               foundParam = true;
+                                               break;
+                                       }
+                               }
+                               if (foundParam == false) {
+                                       MicroserviceParameter pd = oldService.get(i);
+                                       getDataAccessService().deleteDomainObject(pd, null);
+                               }
+                       }
+                       for (int i = 0; i < newService.getParameterList().size(); i++) {
+                               MicroserviceParameter param = newService.getParameterList().get(i);
+                               param.setServiceId(serviceId);
+                               getDataAccessService().saveDomainObject(param, null);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "updateMicroservice failed", e);
+                       throw e;
+               }
+               saveServiceParameters(serviceId, newService.getParameterList());
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       public List<MicroserviceParameter> getParametersById(long serviceId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion contextIdCrit = Restrictions.eq("serviceId", serviceId);
+               restrictionsList.add(contextIdCrit);
+               List<MicroserviceParameter> list = (List<MicroserviceParameter>) dataAccessService
+                               .getList(MicroserviceParameter.class, null, restrictionsList, null);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "getParametersById: microservice parameters list size: " + list.size());
+               return list;
+       }
+
+       private String decryptedPassword(String encryptedPwd) throws Exception {
+               String result = "";
+               if (encryptedPwd != null & encryptedPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.decryptPKC(encryptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+
+       private String encryptedPassword(String decryptedPwd) throws Exception {
+               String result = "";
+               if (decryptedPwd != null & decryptedPwd.length() > 0) {
+                       try {
+                               result = CipherUtil.encryptPKC(decryptedPwd,
+                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserAppService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserAppService.java
new file mode 100644 (file)
index 0000000..7838eb4
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+
+public interface PersUserAppService {
+
+       /**
+        * Sets the appropriate code in the user personalization table to indicate
+        * the application is (de)selected and/or pending.
+        * 
+        * @param user
+        *            EP User
+        * @param app
+        *            EP Application
+        * @param select
+        *            True or false
+        * @param pending
+        *            True or false
+        */
+       void setPersUserAppValue(EPUser user, EPApp app, boolean select, boolean pending);
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserAppServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserAppServiceImpl.java
new file mode 100644 (file)
index 0000000..39b88f6
--- /dev/null
@@ -0,0 +1,175 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+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.PersUserAppSelection;
+import org.onap.portalapp.portal.domain.PersUserWidgetSelection;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+@Service("persUserAppService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class PersUserAppServiceImpl implements PersUserAppService {
+
+       private static final String APP_ID = "appId";
+
+       private static final String USER_ID = "userId";
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PersUserAppServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       @Autowired
+       private AdminRolesService adminRolesService;
+       @Autowired
+       private UserRolesService userRolesService;
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserAppSelectService#
+        * setAppCatalogSelection(org.openecomp.portalapp.portal.domain.EPUser,
+        * org.openecomp.portalapp.portal.transport.AppCatalogSelection)
+        */
+       @Override
+       public void setPersUserAppValue(EPUser user, EPApp app, boolean select, boolean pending) {
+               if (user == null || app == null)
+                       throw new IllegalArgumentException("setPersUserAppValue: Null values");
+
+               // Find the record for this user-app combo, if any
+               List<PersUserAppSelection> persList = getUsersAppSelection(user, app);
+
+               // Key constraint limits to 1 row
+               PersUserAppSelection persRow = null;
+               if (persList.size() == 1)
+                       persRow = persList.get(0);
+               else
+                       persRow = new PersUserAppSelection(null, user.getId(), app.getId(), null);
+
+               if (app.getOpen()) {
+                       // Pending status is not meaningful for open apps.
+                       if (pending)
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "setPersUserAppValue: invalid request, ignoring set-pending for open app");
+
+                       // Open apps have same behavior for regular and admin users
+                       if (select) {
+                               // Selection of an open app requires a record
+                               persRow.setStatusCode("S"); // show
+                               dataAccessService.saveDomainObject(persRow, null);
+                       } else {
+                               // De-selection of an open app requires no record
+                               if (persRow.getId() != null)
+                                       dataAccessService.deleteDomainObject(persRow, null);
+                       }
+               } else {
+                       // Non-open app.
+
+                       // Pending overrides select.
+                       if (pending) {
+                               persRow.setStatusCode("P");
+                               dataAccessService.saveDomainObject(persRow, null);
+                       } else {
+                               // Behavior depends on Portal (super) admin status, bcos an
+                               // admin can force an app onto the dashboard.
+                               boolean isPortalAdmin = adminRolesService.isSuperAdmin(user);
+                               boolean adminUserHasAppRole = false;
+                               if (isPortalAdmin) {
+                                       List<EPUserApp> roles = userRolesService.getCachedAppRolesForUser(app.getId(), user.getId());
+                                       adminUserHasAppRole = (roles.size() > 0);
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "setPersUserAppValue: app {}, admin user {}, role count {}",
+                                                       app.getId(), user.getId(), roles.size());
+                               }
+
+                               if (select) {
+                                       if (isPortalAdmin) {
+                                               // The special case: portal admin
+                                               persRow.setStatusCode("S"); // show
+                                               dataAccessService.saveDomainObject(persRow, null);
+                                       } else {
+                                               // User has role-based access to the app.
+                                               // Showing an accessible app requires no record.
+                                               if (persRow.getId() != null)
+                                                       dataAccessService.deleteDomainObject(persRow, null);
+                                       }
+                               } // select
+                               else {
+                                       if (isPortalAdmin && !adminUserHasAppRole) {
+                                               // The special case: portal admin, no role
+                                               if (persRow.getId() != null)
+                                                       dataAccessService.deleteDomainObject(persRow, null);
+                                       } else {
+                                               // User has role-based access to the app.
+                                               // Hiding an accessible app requires a record
+                                               persRow.setStatusCode("H"); // hide
+                                               dataAccessService.saveDomainObject(persRow, null);
+                                       }
+                               } // deselect
+                       }
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<PersUserAppSelection> getUsersAppSelection(EPUser user, EPApp app) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion userIdCriterion = Restrictions.eq("userId", user.getId());
+               Criterion appIdCriterion = Restrictions.eq("appId", app.getId());
+               restrictionsList.add(Restrictions.and(userIdCriterion, appIdCriterion));
+               return (List<PersUserAppSelection>) dataAccessService.getList(PersUserAppSelection.class, null, restrictionsList, null);
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserWidgetService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserWidgetService.java
new file mode 100644 (file)
index 0000000..5070e4b
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalapp.portal.domain.EPUser;
+
+public interface PersUserWidgetService {
+
+       /**
+        * Sets the appropriate code in the user personalization table to indicate
+        * the application is (de)selected and/or pending.
+        * 
+        * @param user
+        *            EP User
+        * @param widgetId
+        *            widget
+        * @param select
+        *            True or false
+        */
+       void setPersUserAppValue(EPUser user, Long widgetId, boolean select);
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserWidgetServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PersUserWidgetServiceImpl.java
new file mode 100644 (file)
index 0000000..94c934d
--- /dev/null
@@ -0,0 +1,106 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.PersUserWidgetSelection;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+@Service("persUserWidgetService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class PersUserWidgetServiceImpl implements PersUserWidgetService{
+       
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PersUserAppServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       
+       @Override
+       public void setPersUserAppValue(EPUser user, Long widgetId, boolean select) {
+               if (user == null || widgetId == null)
+                       throw new IllegalArgumentException("setPersUserAppValue: Null values");
+               
+               List<PersUserWidgetSelection> persList = getUserWidgetSelction(user, widgetId);
+               // Key constraint limits to 1 row
+               PersUserWidgetSelection persRow = null;
+               if (persList.size() == 1){
+                       persRow = persList.get(0);
+               }
+               else {
+                       persRow = new PersUserWidgetSelection(null, user.getId(), widgetId, null);
+               }                       
+               if(select){
+                       if (persRow.getId() != null){
+                               dataAccessService.deleteDomainObject(persRow, null);                            
+                       }
+                       persRow.setStatusCode("S"); // show
+                       dataAccessService.saveDomainObject(persRow, null);                      
+               } else{
+                       if (persRow.getId() != null){
+                               dataAccessService.deleteDomainObject(persRow, null);
+                       } 
+                       persRow.setStatusCode("H"); // Hide
+                       dataAccessService.saveDomainObject(persRow, null);                      
+               }
+               
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<PersUserWidgetSelection> getUserWidgetSelction(EPUser user, Long widgetId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion userIdCriterion = Restrictions.eq("userId", user.getId());
+               Criterion widgetIdCriterion = Restrictions.eq("widgetId", widgetId);
+               restrictionsList.add(Restrictions.and(userIdCriterion, widgetIdCriterion));
+               return  (List<PersUserWidgetSelection>) dataAccessService.getList(PersUserWidgetSelection.class, null, restrictionsList, null);
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PortalAdminService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PortalAdminService.java
new file mode 100644 (file)
index 0000000..a881728
--- /dev/null
@@ -0,0 +1,49 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.PortalAdmin;
+
+public interface PortalAdminService {
+       List<PortalAdmin> getPortalAdmins ();
+       FieldsValidator createPortalAdmin(String orgUserId);
+       FieldsValidator deletePortalAdmin(Long userId);
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PortalAdminServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/PortalAdminServiceImpl.java
new file mode 100644 (file)
index 0000000..2704554
--- /dev/null
@@ -0,0 +1,305 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletResponse;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.transport.ExternalAccessUser;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.PortalAdmin;
+import org.onap.portalapp.portal.transport.PortalAdminUserRole;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Service("portalAdminService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class PortalAdminServiceImpl implements PortalAdminService {    
+
+       private String SYS_ADMIN_ROLE_ID = "1";
+       private String ECOMP_APP_ID = "1";
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalAdminServiceImpl.class);
+
+       @Autowired
+       private SessionFactory sessionFactory;
+       @Autowired
+       private DataAccessService dataAccessService;
+       @Autowired
+       SearchService searchService;
+       @Autowired
+       private EPAppService epAppService;
+       
+       RestTemplate template = new RestTemplate();
+       
+       @PostConstruct
+       private void init() {
+               SYS_ADMIN_ROLE_ID = SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID);
+               ECOMP_APP_ID = SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID);
+       }
+
+       public List<PortalAdmin> getPortalAdmins() {
+               try {
+                       Map<String, String> params = new HashMap<>();
+                       params.put("adminRoleId", SYS_ADMIN_ROLE_ID);
+                       @SuppressWarnings("unchecked")
+                       List<PortalAdmin> portalAdmins = (List<PortalAdmin>) dataAccessService.executeNamedQuery("getPortalAdmins",
+                                       params, null);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getPortalAdmins was successful");
+                       return portalAdmins;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getPortalAdmins failed", e);
+                       return null;
+               }
+       }
+
+       public FieldsValidator createPortalAdmin(String orgUserId) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               logger.debug(EELFLoggerDelegate.debugLogger, "LR: createPortalAdmin: orgUserId is {}", orgUserId);
+               EPUser user = null;
+               boolean createNewUser = false;
+               List<EPUser> localUserList = getUserListWithOrguseId(orgUserId);
+               if (!localUserList.isEmpty()) {
+                       user = localUserList.get(0);
+               } else {
+                       createNewUser = true;
+               }
+
+               if (user != null && isLoggedInUserPortalAdmin(user.getId())) {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "User '" + user.getOrgUserId() + "' already has PortalAdmin role assigned.");
+               } else if (user != null || createNewUser) {
+                       Session localSession = null;
+                       Transaction transaction = null;
+                       try {
+                               localSession = sessionFactory.openSession();
+
+                               transaction = localSession.beginTransaction();
+                               if (createNewUser) {
+                                       user = this.searchService.searchUserByUserId(orgUserId);
+                                       if (user != null) {
+                                               // insert the user with active true in order to
+                                               // pass login phase.
+                                               user.setActive(true);
+                                               localSession.save(EPUser.class.getName(), user);
+                                       }
+                               }
+                               if (user != null) {
+                                       Long userid = user.getId();
+                                       PortalAdminUserRole userRole = new PortalAdminUserRole();
+                                       userRole.userId = userid;
+                                       userRole.roleId = Long.valueOf(SYS_ADMIN_ROLE_ID);
+                                       userRole.appId = Long.valueOf(ECOMP_APP_ID);
+
+                                       localSession.save(PortalAdminUserRole.class.getName(), userRole);
+                               }
+
+                               transaction.commit();
+                               // Add role in the external central auth system
+                               if(user != null && EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                        addPortalAdminInExternalCentralAuth(user.getOrgUserId(), PortalConstants.PORTAL_ADMIN_ROLE);
+                               }
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "createPortalAdmin failed", e);
+                               EcompPortalUtils.rollbackTransaction(transaction, "createPortalAdmin rollback, exception = " + e.toString());
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       } finally {
+                               EcompPortalUtils.closeLocalSession(localSession, "createPortalAdmin");
+                       }
+               }
+               return fieldsValidator;
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<EPUser> getUserListWithOrguseId(String orgUserId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion orgUserIdCriterion = Restrictions.eq("orgUserId", orgUserId);
+               restrictionsList.add(orgUserIdCriterion);
+               return (List<EPUser>) dataAccessService.getList(EPUser.class, null, restrictionsList, null);
+       }
+       
+       private void addPortalAdminInExternalCentralAuth(String loginId, String portalAdminRole) throws Exception{
+               try{
+                       String name = "";
+                       if (EPCommonSystemProperties.containsProperty(
+                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
+                               name = loginId + SystemProperties
+                                               .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
+                       }
+                       EPApp app = epAppService.getApp(PortalConstants.PORTAL_APP_ID);
+                       String extRole = app.getNameSpace()+"."+portalAdminRole.replaceAll(" ", "_");
+                       ObjectMapper addUserRoleMapper = new ObjectMapper();
+                       ExternalAccessUser extUser = new ExternalAccessUser(name, extRole);
+                       String userRole = addUserRoleMapper.writeValueAsString(extUser);
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+
+                       HttpEntity<String> addUserRole = new HttpEntity<>(userRole, headers);
+                       template.exchange(
+                                       SystemProperties.getProperty(
+                                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                       + "userRole",
+                                       HttpMethod.POST, addUserRole, String.class);
+               } catch (Exception e) {
+                       // This happens only if role already exists in external central access system but not in local DB thats where we logging here
+                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Portal Admin role already exists", e.getMessage());
+                       } else{
+                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to add Portal Admin role ", e);
+                               throw e;
+                       }
+               }
+       }
+
+       public FieldsValidator deletePortalAdmin(Long userId) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               logger.debug(EELFLoggerDelegate.debugLogger, "deletePortalAdmin: test 1");
+               Session localSession = null;
+               Transaction transaction = null;
+
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       dataAccessService.deleteDomainObjects(PortalAdminUserRole.class,
+                                       "user_id='" + userId + "' AND role_id='" + SYS_ADMIN_ROLE_ID + "'", null);
+                       transaction.commit();
+                       if(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()){
+                               deletePortalAdminInExternalCentralAuth(userId, PortalConstants.PORTAL_ADMIN_ROLE);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin failed", e);
+                       EcompPortalUtils.rollbackTransaction(transaction, "deletePortalAdmin rollback, exception = " + e.toString());
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "deletePortalAdmin");
+               }
+               return fieldsValidator;
+       }
+
+       
+       private void deletePortalAdminInExternalCentralAuth(Long userId, String portalAdminRole) throws Exception{
+               try{                                                                    
+                       String name = "";
+                       List<EPUser> localUserList = getUserListWithUserid(userId);
+                       if (EPCommonSystemProperties.containsProperty(
+                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
+                               name = localUserList.get(0).getOrgUserId() + SystemProperties
+                                               .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
+                       }
+                       EPApp app = epAppService.getApp(PortalConstants.PORTAL_APP_ID);
+                       String extRole = app.getNameSpace()+"."+portalAdminRole.replaceAll(" ", "_");
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                       HttpEntity<String> addUserRole = new HttpEntity<>(headers);
+                       template.exchange(
+                                       SystemProperties.getProperty(
+                                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                       + "userRole/"+name+"/"+extRole,
+                                       HttpMethod.DELETE, addUserRole, String.class);
+               } catch (Exception e) {
+                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Portal Admin role already deleted or may not be found", e.getMessage());
+                       } else{
+                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to add Portal Admin role ", e);
+                               throw e;
+                       }
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<EPUser> getUserListWithUserid(Long userId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion orgUserIdCriterion = Restrictions.eq("id", userId);
+               restrictionsList.add(orgUserIdCriterion);
+               return (List<EPUser>) dataAccessService.getList(EPUser.class, null, restrictionsList, null);
+       }
+       
+       private void logQuery(String sql) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
+       }
+
+       private boolean isLoggedInUserPortalAdmin(Long userId) {
+               try {
+                       String sql = "SELECT u.user_id, u.first_name, u.last_name, u.login_id "
+                                       + " FROM fn_user u, fn_user_role ur " + " WHERE u.user_id = ur.user_id " + " AND ur.user_id="
+                                       + userId + " AND ur.role_id=" + SYS_ADMIN_ROLE_ID;
+
+                       logQuery(sql);
+
+                       @SuppressWarnings("unchecked")
+                       List<PortalAdmin> portalAdmins = dataAccessService.executeSQLQuery(sql, PortalAdmin.class, null);
+                       logger.debug(EELFLoggerDelegate.debugLogger, portalAdmins.toString());
+                       if (portalAdmins == null || portalAdmins.size() <= 0) {
+                               return false;
+                       }
+                       return true;
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "isLoggedInUserPortalAdmin failed", e);
+                       return false;
+               }
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SearchService.java
new file mode 100644 (file)
index 0000000..9cbc52e
--- /dev/null
@@ -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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalapp.portal.domain.EPUser;
+
+public interface SearchService {
+
+       public String searchUsersInPhoneBook(String searchString);
+
+       public EPUser searchUserByUserId(String orgUserId);
+
+}
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
new file mode 100644 (file)
index 0000000..30ff598
--- /dev/null
@@ -0,0 +1,195 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Service("searchService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class SearchServiceImpl implements SearchService {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SearchServiceImpl.class);
+       
+       // TODO: the values below should be defined in other place
+       private static final int maxSizeOfSearchResult = 100;
+
+
+       @Autowired
+       EPLdapService ldapService;
+
+       @Override
+       public String searchUsersInPhoneBook(String searchString) {
+               String orgUserId = null;
+               List<String> tokens = EcompPortalUtils.parsingByRegularExpression(searchString, " ");
+               for (int i = 0; i < tokens.size(); i++) { // find orgUserId if possible and remove it from tokens
+                       if (tokens.get(i).matches(".*\\d+.*")) {
+                               orgUserId = tokens.get(i);
+                               tokens.remove(i);
+                       }
+               }
+               while (tokens.size() > 2) { // we use no more then first 2 tokens (orgUserId is removed, see above)
+                       tokens.remove(tokens.size() - 1);
+               }
+               EPUser attrUser = new EPUser();
+               attrUser.setOrgUserId(orgUserId);
+               List<UserWithNameSurnameTitle> resultOfSearch = new ArrayList<UserWithNameSurnameTitle>(), resultOfAdditionalSearch = null;
+               if (tokens.size() == 2) {
+                       attrUser.setFirstName(tokens.get(0));
+                       attrUser.setLastName(tokens.get(1));
+                       resultOfSearch = this.searchUsersByAttrs(attrUser);
+                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
+                       resultOfSearch = this.removeWrongLastNames(resultOfSearch, tokens.get(1));
+                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
+                               attrUser.setFirstName(tokens.get(1));
+                               attrUser.setLastName(tokens.get(0));
+                               resultOfAdditionalSearch = this.searchUsersByAttrs(attrUser);
+                               resultOfAdditionalSearch = this.removeWrongFirstNames(resultOfAdditionalSearch, tokens.get(1));
+                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
+                       }
+               } else if (tokens.size() == 1) {
+                       attrUser.setFirstName(tokens.get(0));
+                       resultOfSearch = this.searchUsersByAttrs(attrUser);
+                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
+                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
+                               attrUser.setFirstName(null);
+                               attrUser.setLastName(tokens.get(0));
+                               resultOfAdditionalSearch = this.searchUsersByAttrs(attrUser);
+                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
+                       }
+               } else if (orgUserId != null) {
+                       resultOfSearch = this.searchUsersByAttrs(attrUser);
+               }
+               if (resultOfAdditionalSearch != null) {
+                       resultOfSearch.addAll(resultOfAdditionalSearch);
+               }
+               resultOfSearch = this.cutSearchResultToMaximumSize(resultOfSearch);
+               ObjectMapper mapper = new ObjectMapper();
+               String result = "[]";
+               try {
+                       result = mapper.writeValueAsString(resultOfSearch);
+               } catch (JsonProcessingException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInPhoneBook failed", e);
+               }
+               return result;
+       }
+
+       private List<UserWithNameSurnameTitle> searchUsersByAttrs(EPUser attrUser) {
+               List<UserWithNameSurnameTitle> foundUsers = new ArrayList<UserWithNameSurnameTitle>();
+               try {
+                       org.onap.portalsdk.core.command.support.SearchResult searchResult = this.ldapService.searchPost(attrUser, null, null, null, 0, 0, -1);
+                       for (Object obj : searchResult) {
+                               EPUser user = (EPUser) obj;
+                               UserWithNameSurnameTitle foundUser = new UserWithNameSurnameTitle(user.getOrgUserId(), user.getFirstName(), user.getLastName(), user.getJobTitle());
+                               foundUsers.add(foundUser);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByAttrs failed", e);
+               }
+               return foundUsers;
+       }
+
+       private List<UserWithNameSurnameTitle> removeWrongFirstNames(List<UserWithNameSurnameTitle> resultOfSearch, String firstName) {
+               firstName = firstName.toUpperCase();
+               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
+                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
+                       if ((user.firstName == null) || !user.firstName.toUpperCase().startsWith(firstName)) {
+                               resultOfSearch.remove(i);
+                       }
+               }
+               return resultOfSearch;
+       }
+
+       private List<UserWithNameSurnameTitle> removeWrongLastNames(List<UserWithNameSurnameTitle> resultOfSearch, String lastName) {
+               lastName = lastName.toUpperCase();
+               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
+                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
+                       if ((user.lastName == null) || !user.lastName.toUpperCase().startsWith(lastName)) {
+                               resultOfSearch.remove(i);
+                       }
+               }
+               return resultOfSearch;
+       }
+
+       private List<UserWithNameSurnameTitle> cutSearchResultToMaximumSize(List<UserWithNameSurnameTitle> resultOfSearch) {
+               for (int i = resultOfSearch.size() - 1; i >= maxSizeOfSearchResult; i--) {
+                       resultOfSearch.remove(i);
+               }
+               return resultOfSearch;
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       public EPUser searchUserByUserId(String orgUserId) {
+               EPUser user = null;
+               EPUser searchedUser = new EPUser();
+               searchedUser.setOrgUserId(orgUserId);
+               try {
+                       List<Object> searchResult = ldapService.searchPost(searchedUser, "", null, null, 0, -1, 1);
+                       for (Object obj : searchResult) {
+                               if (obj instanceof EPUser) {
+                                       user = (EPUser) obj;
+                                       // This assignment should be checked later!
+                                       user.setLoginId(orgUserId);
+                                       break;
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId failed", e);
+               }
+               return user;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SharedContextService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SharedContextService.java
new file mode 100644 (file)
index 0000000..37321e5
--- /dev/null
@@ -0,0 +1,118 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.SharedContext;
+
+/**
+ * Defines the methods exposed by the service that manages shared context
+ * objects in the database.
+ */
+public interface SharedContextService {
+
+       /**
+        * Gets all shared context objects for the specified context ID.
+        * 
+        * @param contextId
+        *            SharedContext ID
+        * @return List of SharedContext objects
+        */
+       List<SharedContext> getSharedContexts(String contextId);
+
+       /**
+        * Gets the shared context with the specified context ID and key.
+        * 
+        * @param contextId
+        *            Context ID; usually a session ID
+        * @param key
+        *            Key for the key-value pair
+        * @return Value found in the database, null if any parameter is null or no
+        *         shared context exists with that context ID - key pair.
+        */
+       SharedContext getSharedContext(String contextId, String key);
+
+       /**
+        * Creates a new shared context entry with the specified context ID, key and
+        * value.
+        * 
+        * @param contextId
+        *            SharedContext ID
+        * @param key
+        *            Key for the key-value pair.
+        * @param value
+        *            Value for the key-value pair.
+        */
+       void addSharedContext(String contextId, String key, String value);
+
+       /**
+        * Saves the specified shared context.
+        * 
+        * @param context
+        *            SharedContext object to save.
+        */
+       void saveSharedContext(SharedContext context);
+
+       /**
+        * Deletes the specified shared context.
+        * 
+        * @param context
+        *            SharedContext object to delete.
+        */
+       void deleteSharedContext(SharedContext context);
+
+       /**
+        * Deletes all shared contexts with the specified context ID.
+        * 
+        * @param contextId
+        *            Context ID; usually a session ID
+        * @return number of shared-context objects deleted
+        */
+       int deleteSharedContexts(String contextId);
+
+       /**
+        * Deletes all shared contexts with a creation time that is older than the
+        * specified value.
+        * 
+        * @param ageInSeconds
+        *            Expiration threshold in seconds
+        */
+       void expireSharedContexts(int ageInSeconds);
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SharedContextServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/SharedContextServiceImpl.java
new file mode 100644 (file)
index 0000000..a950c5f
--- /dev/null
@@ -0,0 +1,194 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.onap.portalapp.portal.domain.SharedContext;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+/**
+ * Implementation of the shared-context service that talks to the database.
+ */
+@Service("sharedContextService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class SharedContextServiceImpl implements SharedContextService {
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SharedContextServiceImpl.class);
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalsdk.core.service.SharedContextService#
+        * getSharedContexts()
+        */
+       @Override
+       @SuppressWarnings("unchecked")
+       public List<SharedContext> getSharedContexts(String contextId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion contextIdCrit = Restrictions.eq("context_id", contextId);
+               restrictionsList.add(contextIdCrit);
+               List<SharedContext> contexts = (List<SharedContext>) getDataAccessService().getList(SharedContext.class, null,
+                               restrictionsList, null);
+
+               return contexts;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalsdk.core.service.SharedContextService#
+        * getSharedContext(java. lang.String, java.lang.String)
+        */
+       @Override
+       public SharedContext getSharedContext(String contextId, String key) {
+               SharedContext context = null;
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion contextIdCrit = Restrictions.eq("context_id", contextId);
+               Criterion keyCrit = Restrictions.eq("ckey", key);
+               restrictionsList.add(contextIdCrit);
+               restrictionsList.add(keyCrit);
+               @SuppressWarnings("unchecked")
+               List<SharedContext> contexts = (List<SharedContext>) getDataAccessService().getList(SharedContext.class, null,
+                               restrictionsList, null);
+               if (contexts != null && contexts.size() == 1)
+                       context = contexts.get(0);
+
+               return context;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.SharedContextService#
+        * addSharedContext(java.lang.String, java.lang.String, java.lang.String)
+        */
+       @Override
+       public void addSharedContext(String contextId, String key, String value) {
+               SharedContext context = new SharedContext(contextId, key, value);
+               saveSharedContext(context);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalsdk.core.service.SharedContextService#
+        * saveSharedContext(org.openecomp.portalapp.portal.domain.SharedContext)
+        */
+       @Override
+       public void saveSharedContext(SharedContext context) {
+               getDataAccessService().saveDomainObject(context, null);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalsdk.core.service.SharedContextService#
+        * deleteSharedContext(org.openecomp.portalapp.portal.domain.SharedContext)
+        */
+       @Override
+       public void deleteSharedContext(SharedContext context) {
+               getDataAccessService().deleteDomainObject(context, null);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.SharedContextService#
+        * deleteSharedContexts(java.lang.String)
+        */
+       @Override
+       public int deleteSharedContexts(String contextId) {
+               // Uses an inefficient method to avoid a where clause
+               // that could be used to mount a SQL injection attack.
+               List<SharedContext> contexts = getSharedContexts(contextId);
+               if (contexts == null)
+                       return 0;
+
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteSharedContexts: count is " + contexts.size());
+               for (SharedContext sc : contexts)
+                       deleteSharedContext(sc);
+
+               return contexts.size();
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.SharedContextService#
+        * expireSharedContexts(int)
+        */
+       @Override
+       public void expireSharedContexts(int ageInSeconds) {
+               // Specific to the MySQL database.
+               // final String whereClause = " where create_time < ADDDATE(NOW(),
+               // INTERVAL - " + ageInSeconds + " SECOND)";
+               final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+               Date expiredDateTime = new Date(System.currentTimeMillis() - ageInSeconds * 1000);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "expireSharedContexts: expire time is " + expiredDateTime.toString());
+               final String whereClause = " create_time < '" + dateFormat.format(expiredDateTime) + "'";
+               getDataAccessService().deleteDomainObjects(SharedContext.class, whereClause, null);
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/TicketEventService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/TicketEventService.java
new file mode 100644 (file)
index 0000000..ad0dbc5
--- /dev/null
@@ -0,0 +1,46 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service; 
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+public interface TicketEventService {
+
+       public String getNotificationHyperLink(JsonNode application, String ticket, String eventSource);
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserNotificationService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserNotificationService.java
new file mode 100644 (file)
index 0000000..f327c84
--- /dev/null
@@ -0,0 +1,158 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EcompAppRole;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+import org.onap.portalapp.portal.transport.EpNotificationItemVO;
+import org.onap.portalapp.portal.transport.EpRoleNotificationItem;
+
+public interface UserNotificationService {
+
+       /**
+        * Gets the specified notifications with userId from ep_notification
+        * 
+        * @param userId
+        * 
+        * @return the notifications with the specified userId
+        */
+
+       List<EpNotificationItem> getNotifications(Long userId);
+
+       /**
+        * Gets the specified roles from ep_role_notification
+        * 
+        * @param notificationId
+        * 
+        * @return the roles for a specified notification
+        */
+
+       List<EpRoleNotificationItem> getNotificationRoles(Long notificationId);
+
+       /**
+        * Get all app role list from the fn_app and fn_role table
+        * 
+        * @return list of all roles associated with the applications
+        */
+       List<EcompAppRole> getAppRoleList();
+
+       /**
+        * Marks the notification as viewed by the specified user.
+        * 
+        * @param notificationId
+        * @param userId
+        */
+       void setNotificationRead(Long notificationId, int userId);
+
+       /**
+        * Saves the specified notification to the table ep_notification
+        * 
+        * @param notificationItem
+        * @throws Exception
+        */
+
+       String saveNotification(EpNotificationItem notificationItem) throws Exception;
+
+       /**
+        * Gets the specified notification with the userId for view all recent
+        * notifications
+        * 
+        * @param userId
+        * 
+        * @return the notification list
+        */
+
+       List<EpNotificationItemVO> getNotificationHistoryVO(Long userId);
+
+       /**
+        * Gets the notifications with the userId for user notifications
+        * 
+        * @param userId
+        * 
+        * @return the notification list
+        */
+
+       List<EpNotificationItemVO> getAdminNotificationVOS(Long userId);
+
+       /**
+        * Gets the user list from fn_user
+        * 
+        * @param OrgIds
+        * 
+        * @return the users list
+        */
+
+       List<EPUser> getUsersByOrgIds(List<String> OrgIds);
+
+       /**
+        * Gets the received recipient to whom the notification is delivered from
+        * external system
+        * 
+        * @param notificationId
+        * 
+        * @return the active users
+        */
+
+       List<String> getMessageRecipients(Long notificationId);
+
+       /**
+        * delete the records from ep_notification table when the endtime is more
+        * than 3 months
+        * 
+        */
+
+       void deleteNotificationsFromEpNotificationTable();
+
+       /**
+        * delete the records from ep_user_notification table when the endtime is
+        * more than 3 months
+        * 
+        */
+       void deleteNotificationsFromEpUserNotificationTable();
+
+       /**
+        * delete the records from ep_role_notification table when the endtime is
+        * more than 3 months
+        * 
+        */
+       void deleteNotificationsFromEpRoleNotificationTable();
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserNotificationServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserNotificationServiceImpl.java
new file mode 100644 (file)
index 0000000..130c99e
--- /dev/null
@@ -0,0 +1,262 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.hibernate.SessionFactory;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EPUserNotification;
+import org.onap.portalapp.portal.domain.EcompAppRole;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+import org.onap.portalapp.portal.transport.EpNotificationItemVO;
+import org.onap.portalapp.portal.transport.EpRoleNotificationItem;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+@Service("userNotificationService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class UserNotificationServiceImpl implements UserNotificationService {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       @Autowired
+       private SessionFactory sessionFactory;
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * getNotifications(java.lang.Long)
+        */
+       @Override
+       public List<EpNotificationItem> getNotifications(Long userId) {
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("user_id", userId.toString());
+               @SuppressWarnings("unchecked")
+               List<EpNotificationItem> notificationList = dataAccessService.executeNamedQuery("getNotifications", params,
+                               null);
+               // set the roles to null for pure retrieval of all notifications
+               for (EpNotificationItem item : notificationList) {
+                       item.setRoles(null);
+               }
+               return notificationList;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * getNotificationHistoryVO(java.lang.Long)
+        */
+       @Override
+       public List<EpNotificationItemVO> getNotificationHistoryVO(Long userId) {
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("user_id", userId.toString());
+               @SuppressWarnings("unchecked")
+               List<EpNotificationItemVO> notificationList = dataAccessService.executeNamedQuery("getNotificationHistoryVO",
+                               params, null);
+               return notificationList;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * getAdminNotificationVOS()
+        */
+       @Override
+       public List<EpNotificationItemVO> getAdminNotificationVOS(Long userId) {
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("user_id", userId.toString());
+               @SuppressWarnings("unchecked")
+               List<EpNotificationItemVO> notificationList = dataAccessService
+                               .executeNamedQuery("getAdminNotificationHistoryVO", params, null);
+               return notificationList;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * getNotificationRoles(java.lang.Long)
+        */
+       @Override
+       public List<EpRoleNotificationItem> getNotificationRoles(Long notificationId) {
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("notificationId", Long.toString(notificationId));
+               @SuppressWarnings("unchecked")
+               List<EpRoleNotificationItem> roleNotifList = dataAccessService.executeNamedQuery("getNotificationRoles", params,
+                               null);
+               return roleNotifList;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * getAppRoleList()
+        */
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EcompAppRole> getAppRoleList() {
+               List<EcompAppRole> appRoleList = (List<EcompAppRole>) dataAccessService
+                               .executeNamedQuery("getEpNotificationAppRoles", null, null);
+               return appRoleList;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * setNotificationsRead(java.lang.Long, int)
+        */
+       @Override
+       public void setNotificationRead(Long notificationId, int userId) {
+               EPUserNotification userNotification = new EPUserNotification();
+               userNotification.setNotificationId(notificationId);
+               userNotification.setUpdateTime(new Date());
+               userNotification.setViewed("Y");
+               userNotification.setUserId((long) userId);
+               getDataAccessService().saveDomainObject(userNotification, null);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
+        * saveNotification(org.openecomp.portalapp.portal.transport.
+        * EpNotificationItem)
+        */
+       @Override
+       public String saveNotification(EpNotificationItem notificationItem) throws Exception {
+
+               // gather the roles
+               if (notificationItem.getRoleIds() != null && !notificationItem.getIsForAllRoles().equals("Y")) {
+                       if (notificationItem.getRoles() == null) {
+                               Set<EpRoleNotificationItem> roleSet = new HashSet<EpRoleNotificationItem>();
+                               notificationItem.setRoles(roleSet);
+                       }
+                       for (Long roleId : notificationItem.getRoleIds()) {
+                               EpRoleNotificationItem roleItem = new EpRoleNotificationItem();
+                               roleItem.setNotificationId(notificationItem.getNotificationId());
+                               roleItem.setRoleId(roleId.intValue());
+                               notificationItem.getRoles().add(roleItem);
+                       }
+               }
+
+               // for updates fetch roles and then save
+               if (notificationItem.getNotificationId() != null) {
+                       EpNotificationItem updateNotificationItem = (EpNotificationItem) getDataAccessService()
+                                       .getDomainObject(EpNotificationItem.class, notificationItem.getNotificationId(), null);
+                       notificationItem.setRoles(updateNotificationItem.getRoles());
+               }
+               if (notificationItem.msgSource == null) {
+                       notificationItem.setMsgSource("EP");
+               }
+               getDataAccessService().saveDomainObject(notificationItem, null);
+               return "";
+
+       }
+
+       @Override
+       public List<EPUser> getUsersByOrgIds(List<String> OrgIds) {
+               Map<String, Object> params = new HashMap<String, Object>();
+               params.put("OrgIds", OrgIds);
+               @SuppressWarnings("unchecked")
+               List<EPUser> userList = dataAccessService.executeNamedQuery("getUsersByOrgIdsNotifications", params, null);
+               return userList;
+       }
+
+       @Override
+       public List<String> getMessageRecipients(Long notificationId) {
+               Map<String, String> params = new HashMap<>();
+               params.put("notificationId", Long.toString(notificationId));
+               @SuppressWarnings("unchecked")
+               List<String> activeUsers = dataAccessService.executeNamedQuery("messageRecipients", params, null);
+               return activeUsers;
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+       public SessionFactory getSessionFactory() {
+               return sessionFactory;
+       }
+
+       public void setSessionFactory(SessionFactory sessionFactory) {
+               this.sessionFactory = sessionFactory;
+       }
+
+       @Override
+       public void deleteNotificationsFromEpNotificationTable() {
+               Map<String, String> params = new HashMap<String, String>();
+               dataAccessService.executeNamedQuery("deleteNotificationsFromEpNotificationTable", params, null);
+       }
+
+       @Override
+       public void deleteNotificationsFromEpUserNotificationTable() {
+               Map<String, String> params = new HashMap<String, String>();
+               dataAccessService.executeNamedQuery("deleteNotificationsFromEpUserNotificationTable", params, null);
+
+       }
+
+       @Override
+       public void deleteNotificationsFromEpRoleNotificationTable() {
+               Map<String, String> params = new HashMap<String, String>();
+               dataAccessService.executeNamedQuery("deleteNotificationsFromEpRoleNotificationTable", params, null);
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..3535f75
--- /dev/null
@@ -0,0 +1,1950 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.service;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.stream.Collectors;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.cxf.transport.http.HTTPException;
+import org.hibernate.SQLQuery;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemUser;
+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.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.ExternalSystemAccess;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.transport.AppWithRolesForUser;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.EPUserAppCurrentRoles;
+import org.onap.portalapp.portal.transport.EcompUserAppRoles;
+import org.onap.portalapp.portal.transport.ExternalAccessUser;
+import org.onap.portalapp.portal.transport.ExternalAccessUserRoleDetail;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalapp.portal.transport.ExternalRoleDescription;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+import org.onap.portalapp.portal.transport.RemoteRole;
+import org.onap.portalapp.portal.transport.RemoteUserWithRoles;
+import org.onap.portalapp.portal.transport.RoleInAppForUser;
+import org.onap.portalapp.portal.transport.RolesInAppForUser;
+import org.onap.portalapp.portal.transport.UserApplicationRoles;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.RoleService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@EPMetricsLog
+public class UserRolesCommonServiceImpl  {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesCommonServiceImpl.class);
+
+       private static final Object syncRests = new Object();
+               
+       @Autowired
+       private DataAccessService dataAccessService;                            
+       @Autowired
+       private SessionFactory sessionFactory;
+       @Autowired
+       private SearchService searchService;
+       @Autowired
+       private EPAppService appsService;
+       @Autowired
+       private ApplicationsRestClientService applicationsRestClientService;
+       @Autowired
+       private EPRoleService epRoleService;
+       @Autowired
+       private RoleService roleService;        
+       
+       @Autowired
+       private ExternalAccessRolesService externalAccessRolesService;
+       
+       RestTemplate template = new RestTemplate();
+       
+       /**
+        * 
+        * @param ecompRoles
+        * @return  HashMap<Long, EcompRole>
+        */
+       private static HashMap<Long, EcompRole> hashMapFromEcompRoles(EcompRole[] ecompRoles) {
+               HashMap<Long, EcompRole> result = new HashMap<Long, EcompRole>();
+               if (ecompRoles != null) {
+                       for (int i = 0; i < ecompRoles.length; i++) {
+                               if (ecompRoles[i].getId() != null) {
+                                       result.put(ecompRoles[i].getId(), ecompRoles[i]);
+                               }
+                       }
+               }
+               return result;
+       }
+       
+       /**
+        * 
+        * @param userId
+        */
+       protected void createLocalUserIfNecessary(String userId) {
+               if (StringUtils.isEmpty(userId)) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "createLocalUserIfNecessary : empty userId!");
+                       return;
+               }
+               Session localSession = null;
+               Transaction transaction = null;
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       @SuppressWarnings("unchecked")
+                       List<EPUser> userList = localSession
+                                       .createQuery("from " + EPUser.class.getName() + " where orgUserId='" + userId + "'").list();
+                       if (userList.size() == 0) {
+                               EPUser client = searchService.searchUserByUserId(userId);
+                               if (client == null) {
+                                       String msg = "createLocalUserIfNecessary: cannot create user " + userId
+                                                       + ", because not found in phonebook";
+                                       logger.error(EELFLoggerDelegate.errorLogger, msg);
+                               } else {
+                                       client.setLoginId(userId);
+                                       client.setActive(true);
+                                       localSession.save(client);
+                               }
+                       }
+                       transaction.commit();
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       EcompPortalUtils.rollbackTransaction(transaction, "searchOrCreateUser rollback, exception = " + e);
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "searchOrCreateUser");
+               }
+       }
+       
+       /**
+        * This method return nothing and remove roles before adding any roles for an app
+        * @param userRole
+        * @param appId
+        * @param localSession
+        * @param userAppRoles
+        * @param newUserAppRolesMap
+        */
+       private static void syncUserRolesExtension(EPUserApp userRole, Long appId, Session localSession, EcompRole[] userAppRoles, HashMap<Long, EcompRole> newUserAppRolesMap) {
+
+               Long userAppRoleId = 0L;
+               if (appId == PortalConstants.PORTAL_APP_ID) { // local app
+                       userAppRoleId = userRole.getRoleId();
+               } else { // remote app
+                       userAppRoleId = userRole.getAppRoleId();
+               }
+
+               if (!newUserAppRolesMap.containsKey(userAppRoleId)) {
+                       localSession.delete(userRole);
+               } else {
+                       newUserAppRolesMap.remove(userAppRoleId);
+               }
+       }
+       
+       /**
+        * Checks whether the role is inactive
+        *  
+        * @param epRole
+        * @throws Exception
+        *                      if role is inactive, throws exception
+        */
+       private void checkIfRoleInactive(EPRole epRole) throws Exception{       
+               if(!epRole.getActive()){
+                       throw new Exception(epRole.getName()+ " role is unavailable");
+               }
+       }
+       
+       /**
+        * 
+        * @param sessionFactory
+        * @param userId
+        * @param appId
+        * @param userAppRoles
+        * @param extRequestValue 
+        *                      set to false if request is from users page otherwise true
+        * @throws Exception
+        */
+       protected void syncUserRoles(SessionFactory sessionFactory, String userId, Long appId,
+                       EcompRole[] userAppRoles, Boolean extRequestValue, String reqType) throws Exception {
+               boolean result = false;
+               Session localSession = null;
+               Transaction transaction = null;
+               String roleActive = null;
+               final Map<String, String> userAppParams = new HashMap<>();
+               final Map<String, String> appParams = new HashMap<>();
+               HashMap<Long, EcompRole> newUserAppRolesMap = hashMapFromEcompRoles(userAppRoles);
+
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       @SuppressWarnings("unchecked")
+                       List<EPUser> userList = localSession
+                                       .createQuery("from " + EPUser.class.getName() + " where orgUserId='" + userId + "'").list();
+                       if (userList.size() > 0) {
+                               EPUser client = userList.get(0);
+                               roleActive = ("DELETE".equals(reqType)) ? "" : " and role.active = 'Y'";
+                               @SuppressWarnings("unchecked")
+                               List<EPUserApp> userRoles = localSession.createQuery("from " + EPUserApp.class.getName()
+                                               + " where app.id=" + appId + roleActive + " and userId=" + client.getId()).list();
+                               
+                               if ("DELETE".equals(reqType)) {
+                                       for (EPUserApp userAppRoleList : userRoles) {
+                                               userAppParams.put("roleName", String.valueOf(userAppRoleList.getRole().getName()));
+                                               userAppParams.put("appId",  String.valueOf(appId));
+                                               appParams.put("appRoleName", userAppRoleList.getRole().getName());
+                                               @SuppressWarnings("unchecked")
+                                               List<EPRole>  rolesList = (!userAppRoleList.getRole().getName().equals(PortalConstants.ADMIN_ROLE)) ? (List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles", userAppParams, null) : (List<EPRole>) dataAccessService.executeNamedQuery("getPortalAppRoles", appParams, null);        
+                                               if(rolesList.size() > 0 || !rolesList.isEmpty()){
+                                               checkIfRoleInactive(rolesList.get(0));
+                                               }
+                                       }
+                               }
+
+                               for (EPUserApp userRole : userRoles) {
+                                       if (!userRole.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID) && userRole.getRoleId() != PortalConstants.SYS_ADMIN_ROLE_ID && !extRequestValue){
+                                               syncUserRolesExtension(userRole, appId, localSession, userAppRoles, newUserAppRolesMap);
+                                               }
+                                       else if (extRequestValue && ("PUT".equals(reqType) || "POST".equals(reqType) || "DELETE".equals(reqType))){
+                                               syncUserRolesExtension(userRole, appId, localSession, userAppRoles, newUserAppRolesMap);
+                                       }
+                                       else if (extRequestValue && !userRole.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)){
+                                               syncUserRolesExtension(userRole, appId, localSession, userAppRoles, newUserAppRolesMap);
+                                       }
+                               }
+                               Collection<EcompRole> newRolesToAdd = newUserAppRolesMap.values();
+                               if (newRolesToAdd.size() > 0) {
+                                       EPApp app = (EPApp) localSession.get(EPApp.class, appId);
+
+                                       HashMap<Long, EPRole> rolesMap = new HashMap<Long, EPRole>();
+                                       if (appId.equals(PortalConstants.PORTAL_APP_ID)) { // local app
+                                               String appIdValue = "";
+                                               if(!extRequestValue){
+                                                       appIdValue = "and id != " +  PortalConstants.SYS_ADMIN_ROLE_ID; 
+                                               }
+                                               @SuppressWarnings("unchecked")
+                                               List<EPRole> roles = localSession
+                                                               .createQuery("from " + EPRole.class.getName() + " where appId is null " + appIdValue).list();
+                                               for (EPRole role : roles) {
+                                                       role.setAppId(1L);
+                                                       rolesMap.put(role.getId(), role);
+                                               }
+                                       } else { // remote app
+                                               @SuppressWarnings("unchecked")
+                                               List<EPRole> roles = localSession
+                                                               .createQuery("from " + EPRole.class.getName() + " where appId=" + appId).list();
+                                               for (EPRole role : roles) {
+                                                       if (!extRequestValue && app.getCentralAuth()) {
+                                                               rolesMap.put(role.getId(), role);
+                                                       } else {
+                                                               rolesMap.put(role.getAppRoleId(), role);
+                                                       }
+                                               }
+                                       }
+
+                                       EPRole role = null;
+                                       for (EcompRole userRole : newRolesToAdd) {
+                                               EPUserApp userApp = new EPUserApp();
+                                               if (("PUT".equals(reqType) || "POST".equals(reqType)) && userRole.getName().equals(PortalConstants.ADMIN_ROLE)) {
+                                                       role = (EPRole) localSession.get(EPRole.class, new Long(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
+                                                       userApp.setRole(role);
+                                               } else if ((userRole.getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)) && !extRequestValue){
+                                                               continue;
+                                               }else if((userRole.getId().equals(PortalConstants.SYS_ADMIN_ROLE_ID)) && app.getId().equals(PortalConstants.PORTAL_APP_ID) && !extRequestValue){
+                                                       continue;
+                                               }                                               
+                                               else {
+                                                       userApp.setRole(rolesMap.get(userRole.getId()));
+                                               }
+
+                                               userApp.setUserId(client.getId());
+                                               userApp.setApp(app);
+                                               localSession.save(userApp);
+                                               localSession.flush();
+                                       }
+
+                                       if (appId == PortalConstants.PORTAL_APP_ID) {
+                                               /*
+                                                * for local app -- hack - always make sure fn_role
+                                                * table's app_id is null and not 1 for primary app in
+                                                * this case being ecomp portal app; reason: hibernate
+                                                * is rightly setting this to 1 while persisting to
+                                                * fn_role as per the mapping but SDK role management
+                                                * code expects the app_id to be null as there is no
+                                                * concept of App_id in SDK
+                                                */
+                                               localSession.flush();
+                                               SQLQuery sqlQuery = localSession
+                                                               .createSQLQuery("update fn_role set app_id = null where app_id = 1 ");
+                                               sqlQuery.executeUpdate();
+                                               
+                                       }
+                               }
+                       }
+                       transaction.commit();
+                       result = true;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "syncUserRoles failed", e);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       EcompPortalUtils.rollbackTransaction(transaction,
+                                       "Exception occurred in syncUserRoles, Details: " + e.toString());
+                       if("DELETE".equals(reqType)){
+                               throw new Exception(e.getMessage());
+                       }
+               } finally {
+                       localSession.close();
+                       if (!result && !"DELETE".equals(reqType)) {
+                               throw new Exception(
+                                               "Exception occurred in syncUserRoles while closing database session for app: '" + appId + "'.");
+                       }
+               }
+       }
+       
+       /**
+        * Called when getting the list of roles for the user
+        * 
+        * @param appRoles
+        * @param userAppRoles
+        * @return List<RoleInAppForUser> 
+        */
+       protected List<RoleInAppForUser> constructRolesInAppForUserGet(EcompRole[] appRoles, EcompRole[] userAppRoles) {
+               List<RoleInAppForUser> rolesInAppForUser = new ArrayList<RoleInAppForUser>();
+
+               Set<Long> userAppRolesMap = new HashSet<Long>();
+               if (userAppRoles != null) {
+                       for (EcompRole ecompRole : userAppRoles) {
+                               userAppRolesMap.add(ecompRole.getId());
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "constructRolesInAppForUserGet has received userAppRoles list empty");
+               }
+
+               if (appRoles != null) {
+                       for (EcompRole ecompRole : appRoles) {
+                               RoleInAppForUser roleForUser = new RoleInAppForUser(ecompRole.getId(), ecompRole.getName());
+                               roleForUser.isApplied = userAppRolesMap.contains(ecompRole.getId());
+                               rolesInAppForUser.add(roleForUser);
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger, "constructRolesInAppForUser has received appRoles list empty");
+               }
+               return rolesInAppForUser;
+       }
+
+       /**
+        * Called when getting the list of roles for the user
+        * 
+        * @param appRoles
+        * @param userAppRoles
+        * @param extRequestValue 
+        *                      set to false if request is from users page otherwise true
+        * @return List<RoleInAppForUser>
+        */
+       protected List<RoleInAppForUser> constructRolesInAppForUserGet(List<Role> appRoles, EPRole[] userAppRoles, Boolean extRequestValue) {
+               List<RoleInAppForUser> rolesInAppForUser = new ArrayList<RoleInAppForUser>();
+
+               Set<Long> userAppRolesMap = new HashSet<Long>();
+               if (userAppRoles != null) {
+                       for (EPRole ecompRole : userAppRoles) {
+                               userAppRolesMap.add(ecompRole.getId());
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "constructRolesInAppForUserGet has received userAppRoles list empty.");
+               }
+
+               if (appRoles != null) {
+                       for (Role ecompRole : appRoles) {
+                               if (ecompRole.getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID) && !extRequestValue)
+                                       continue;
+                               RoleInAppForUser roleForUser = new RoleInAppForUser(ecompRole.getId(), ecompRole.getName());
+                               roleForUser.isApplied = userAppRolesMap.contains(ecompRole.getId());
+                               rolesInAppForUser.add(roleForUser);
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "constructRolesInAppForUser has received appRoles list empty.");
+               }
+               return rolesInAppForUser;
+       }
+
+       
+       /**
+        * copies of methods in GetAppsWithUserRoleState
+        * 
+        * @param sessionFactory
+        * @param appId
+        * @param appRoles
+        * @throws Exception
+        */
+       protected void syncAppRoles(SessionFactory sessionFactory, Long appId, EcompRole[] appRoles) throws Exception {
+               logger.debug(EELFLoggerDelegate.debugLogger, "entering syncAppRoles for appId: " + appId);
+               HashMap<Long, EcompRole> newRolesMap = hashMapFromEcompRoles(appRoles);
+               Session localSession = null;
+               Transaction transaction = null;
+
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       // Attention! All roles from remote application supposed to be
+                       // active!
+                       @SuppressWarnings("unchecked")
+                       List<EPRole> currentAppRoles = localSession
+                                       .createQuery("from " + EPRole.class.getName() + " where appId=" + appId).list();
+                       List<EPRole> obsoleteRoles = new ArrayList<EPRole>();
+                       for (int i = 0; i < currentAppRoles.size(); i++) {
+                               EPRole oldAppRole = currentAppRoles.get(i);
+                               if (oldAppRole.getAppRoleId() != null) {
+                                       EcompRole role = null;
+                                       role = newRolesMap.get(oldAppRole.getAppRoleId());
+                                       if (role != null) {
+                                               if (!(role.getName() == null || oldAppRole.getName().equals(role.getName()))) {
+                                                       oldAppRole.setName(role.getName());
+                                                       localSession.update(oldAppRole);
+                                               }
+                                               newRolesMap.remove(oldAppRole.getAppRoleId());
+                                       } else {
+                                               obsoleteRoles.add(oldAppRole);
+                                       }
+                               } else {
+                                       obsoleteRoles.add(oldAppRole);
+                               }
+                       }
+                       Collection<EcompRole> newRolesToAdd = newRolesMap.values();
+                       if (obsoleteRoles.size() > 0) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: we have obsolete roles to delete");
+                               for (EPRole role : obsoleteRoles) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: obsolete role: " + role.toString());
+                                       Long roleId = role.getId();
+                                       // delete obsolete roles here
+                                       // Must delete all records with foreign key constraints on
+                                       // fn_role:
+                                       // fn_user_role, fn_role_composite, fn_role_function,
+                                       // fn_user_pseudo_role, fn_menu_functional_roles.
+                                       // And for fn_menu_functional, if no other roles for that
+                                       // menu item, remove the url.
+
+                                       // Delete from fn_user_role
+                                       @SuppressWarnings("unchecked")
+                                       List<EPUserApp> userRoles = localSession.createQuery(
+                                                       "from " + EPUserApp.class.getName() + " where app.id=" + appId + " and role_id=" + roleId)
+                                                       .list();
+
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: number of userRoles to delete: " + userRoles.size());
+                                       for (EPUserApp userRole : userRoles) {
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "syncAppRoles: about to delete userRole: " + userRole.toString());
+                                               localSession.delete(userRole);
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "syncAppRoles: finished deleting userRole: " + userRole.toString());
+                                       }
+
+                                       // Delete from fn_menu_functional_roles
+                                       @SuppressWarnings("unchecked")
+                                       List<FunctionalMenuRole> funcMenuRoles = localSession
+                                                       .createQuery("from " + FunctionalMenuRole.class.getName() + " where roleId=" + roleId)
+                                                       .list();
+                                       int numMenuRoles = funcMenuRoles.size();
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "syncAppRoles: number of funcMenuRoles for roleId: " + roleId + ": " + numMenuRoles);
+                                       for (FunctionalMenuRole funcMenuRole : funcMenuRoles) {
+                                               Long menuId = funcMenuRole.menuId;
+                                               // If this is the only role for this menu item, then the
+                                               // app and roles will be gone,
+                                               // so must null out the url too, to be consistent
+                                               @SuppressWarnings("unchecked")
+                                               List<FunctionalMenuRole> funcMenuRoles2 = localSession
+                                                               .createQuery("from " + FunctionalMenuRole.class.getName() + " where menuId=" + menuId)
+                                                               .list();
+                                               int numMenuRoles2 = funcMenuRoles2.size();
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "syncAppRoles: number of funcMenuRoles for menuId: " + menuId + ": " + numMenuRoles2);
+                                               localSession.delete(funcMenuRole);
+                                               if (numMenuRoles2 == 1) {
+                                                       // If this is the only role for this menu item, then
+                                                       // the app and roles will be gone,
+                                                       // so must null out the url too, to be consistent
+                                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                       "syncAppRoles: There is exactly 1 menu item for this role, so emptying the url");
+                                                       @SuppressWarnings("unchecked")
+                                                       List<FunctionalMenuItem> funcMenuItems = localSession
+                                                                       .createQuery(
+                                                                                       "from " + FunctionalMenuItem.class.getName() + " where menuId=" + menuId)
+                                                                       .list();
+                                                       if (funcMenuItems.size() > 0) {
+                                                               logger.debug(EELFLoggerDelegate.debugLogger, "got the menu item");
+                                                               FunctionalMenuItem funcMenuItem = funcMenuItems.get(0);
+                                                               funcMenuItem.url = "";
+                                                               localSession.update(funcMenuItem);
+                                                       }
+                                               }
+                                       }
+                                       boolean isPortalRequest = true;
+                                       externalAccessRolesService.deleteRoleDependencyRecords(localSession, roleId, appId, isPortalRequest);
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: about to delete the role: " + role.toString());
+                                       localSession.delete(role);
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: deleted the role");
+                               }
+                       }
+                       for (EcompRole role : newRolesToAdd) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: about to add missing role: " + role.toString());
+                               EPRole newRole = new EPRole();
+                               // Attention! All roles from remote application supposed to be
+                               // active!
+                               newRole.setActive(true);
+                               newRole.setName(role.getName());
+                               newRole.setAppId(appId);
+                               newRole.setAppRoleId(role.getId());
+                               localSession.save(newRole);
+                       }
+                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: about to commit the transaction");
+                       transaction.commit();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: committed the transaction");
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "syncAppRoles failed", e);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       EcompPortalUtils.rollbackTransaction(transaction,
+                                       "Exception occurred in syncAppRoles, Details: " + e.toString());
+                       throw new Exception(e);
+               } finally {
+                       localSession.close();
+               }
+       }
+       
+       
+       
+       
+       
+       /**
+        * Called when updating the list of roles for the user
+        * 
+        * @param userId
+        * @param appId
+        * @param userRolesInRemoteApp
+        * @return RolesInAppForUser
+        */
+       protected RolesInAppForUser constructRolesInAppForUserUpdate(String userId, Long appId,
+                       Set<EcompRole> userRolesInRemoteApp) {
+               RolesInAppForUser result;
+               result = new RolesInAppForUser();
+               result.appId = appId;
+               result.orgUserId = userId;
+               for (EcompRole role : userRolesInRemoteApp) {
+                       RoleInAppForUser roleInAppForUser = new RoleInAppForUser();
+                       roleInAppForUser.roleId = role.getId();
+                       roleInAppForUser.roleName = role.getName();
+                       roleInAppForUser.isApplied = new Boolean(true);
+                       result.roles.add(roleInAppForUser);
+               }
+               return result;
+       }
+       
+       /**
+        * 
+        * @param roleInAppForUserList
+        * @return boolean
+        */
+       protected boolean remoteUserShouldBeCreated(List<RoleInAppForUser> roleInAppForUserList) {
+               for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) {
+                       if (roleInAppForUser.isApplied.booleanValue()) {
+                               return true;
+                       }
+               }
+               return false;
+       }
+       
+       /**
+        * Builds JSON and posts it to a remote application to update user roles.
+        * 
+        * @param roleInAppForUserList
+        * @param mapper
+        * @param applicationsRestClientService
+        * @param appId
+        * @param userId
+        * @return Set of roles as sent; NOT the response from the app.
+        * @throws JsonProcessingException
+        * @throws HTTPException
+        */
+       protected Set<EcompRole> postUsersRolesToRemoteApp(List<RoleInAppForUser> roleInAppForUserList, ObjectMapper mapper,
+                       ApplicationsRestClientService applicationsRestClientService, Long appId, String userId)
+                       throws JsonProcessingException, HTTPException {
+               Set<EcompRole> updatedUserRolesinRemote = constructUsersRemoteAppRoles(roleInAppForUserList);
+               Set<EcompRole> updateUserRolesInEcomp = constructUsersEcompRoles(roleInAppForUserList);
+               String userRolesAsString = mapper.writeValueAsString(updatedUserRolesinRemote);
+               applicationsRestClientService.post(EcompRole.class, appId, userRolesAsString,
+                               String.format("/user/%s/roles", userId));
+               // TODO: We should add code that verifies that the post operation did
+               // succeed. Because the SDK may still return 200 OK with an html page
+               // even when it fails!
+               return updateUserRolesInEcomp;
+       }
+       
+       /**
+        * 
+        * @param roleInAppForUserList
+        * @return Set<EcompRole> 
+        */
+       protected Set<EcompRole> constructUsersEcompRoles(List<RoleInAppForUser> roleInAppForUserList) {
+               Set<EcompRole> existingUserRoles = new TreeSet<EcompRole>();
+               for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) {
+                       if (roleInAppForUser.isApplied) {
+                               EcompRole ecompRole = new EcompRole();
+                               ecompRole.setId(roleInAppForUser.roleId);
+                               ecompRole.setName(roleInAppForUser.roleName);
+                               existingUserRoles.add(ecompRole);
+                       }
+               }
+               return existingUserRoles;
+       }
+       
+       /**
+        * Constructs user app roles excluding Account Administrator role
+        * 
+        * @param roleInAppForUserList
+        * @return
+        *            List of roles with Role name, Role Id
+        */
+       protected Set<EcompRole> constructUsersRemoteAppRoles(List<RoleInAppForUser> roleInAppForUserList) {
+               Set<EcompRole> existingUserRoles = new TreeSet<EcompRole>();
+               for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) {
+                       if (roleInAppForUser.isApplied && !roleInAppForUser.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)) {
+                               EcompRole ecompRole = new EcompRole();
+                               ecompRole.setId(roleInAppForUser.roleId);
+                               ecompRole.setName(roleInAppForUser.roleName);
+                               existingUserRoles.add(ecompRole);
+                       }
+               }
+               return existingUserRoles;
+       }
+       
+       /**
+        * This is for a single app
+        * 
+        * @param rolesInAppForUser
+        * @param externalSystemRequest  
+        *                      set to false if requests from Users page otherwise true
+        * @return true on success, false otherwise
+        */
+       protected boolean applyChangesInUserRolesForAppToEcompDB(RolesInAppForUser rolesInAppForUser, boolean externalSystemRequest, String reqType) throws Exception {
+               boolean result = false;
+               String userId = rolesInAppForUser.orgUserId;
+               Long appId = rolesInAppForUser.appId;
+               synchronized (syncRests) {
+                       if (rolesInAppForUser != null) {
+                               createLocalUserIfNecessary(userId);
+                       }
+
+                       if (rolesInAppForUser != null) {
+                               EcompRole[] userAppRoles = new EcompRole[rolesInAppForUser.roles.stream().distinct().collect(Collectors.toList()).size()];
+                               for (int i = 0; i < rolesInAppForUser.roles.stream().distinct().collect(Collectors.toList()).size(); i++) {
+                                       RoleInAppForUser roleInAppForUser = rolesInAppForUser.roles.get(i);
+                                       EcompRole role = new EcompRole();
+                                       role.setId(roleInAppForUser.roleId);
+                                       role.setName(roleInAppForUser.roleName);
+                                       userAppRoles[i] = role;
+                               }
+                               try {
+                                       syncUserRoles(sessionFactory, userId, appId, userAppRoles, externalSystemRequest, reqType);
+                                       result = true;
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger,
+                                                       "applyChangesInUserRolesForAppToEcompDB: failed to syncUserRoles for orgUserId " + userId, e);
+                                       if("DELETE".equals(reqType)){
+                                               throw new Exception(e.getMessage());
+                                       }
+                               }
+                       }
+               }
+               return result;
+       }
+       
+       /**
+        * 
+        * @param appId
+        * @param remoteUser
+        * @return UserApplicationRoles
+        */
+       protected UserApplicationRoles convertToUserApplicationRoles(Long appId, RemoteUserWithRoles remoteUser) {
+               UserApplicationRoles userWithRemoteAppRoles = new UserApplicationRoles();
+               userWithRemoteAppRoles.setAppId(appId);
+               userWithRemoteAppRoles.setOrgUserId(remoteUser.getOrgUserId());
+               userWithRemoteAppRoles.setFirstName(remoteUser.getFirstName());
+               userWithRemoteAppRoles.setLastName(remoteUser.getLastName());
+               userWithRemoteAppRoles.setRoles(remoteUser.getRoles());
+               return userWithRemoteAppRoles;
+       }
+       
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserRolesService#
+        * importRolesFromRemoteApplication(java.lang.Long)
+        */
+       public List<EPRole> importRolesFromRemoteApplication(Long appId) throws HTTPException {
+               EPRole[] appRolesFull = applicationsRestClientService.get(EPRole[].class, appId, "/rolesFull");
+               List<EPRole> rolesList = Arrays.asList(appRolesFull);
+               for (EPRole externalAppRole : rolesList) {
+
+                       // Try to find an existing extern role for the app in the local
+                       // ecomp DB. If so, then use its id to update the existing external
+                       // application role record.
+                       Long externAppId = externalAppRole.getId();
+                       EPRole existingAppRole = epRoleService.getRole(appId, externAppId);
+                       if (existingAppRole != null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               String.format("ecomp role already exists for app=%s; appRoleId=%s. No need to import this one.",
+                                                               appId, externAppId));
+                               continue;
+                       }
+                       // persistExternalRoleInEcompDb(externalAppRole, appId,
+                       // roleService);
+               }
+
+               return rolesList;
+       }
+       
+       /**
+        * It adds new user for remote application
+        * 
+        * @param roleInAppForUserList
+        * @param remoteAppUser
+        * @param userId
+        * @param app
+        * @param mapper
+        * @param searchService
+        * @param applicationsRestClientService
+        * @return 
+        * @throws Exception
+        */
+       private EPUser addRemoteUser(List<RoleInAppForUser> roleInAppForUserList, String userId, EPApp app, ObjectMapper mapper, SearchService searchService, ApplicationsRestClientService applicationsRestClientService) throws Exception{
+               EPUser addRemoteUser = null;
+               if (remoteUserShouldBeCreated(roleInAppForUserList)) {
+                       
+                       createNewUserOnRemoteApp(userId, app, applicationsRestClientService, searchService, mapper, isAppUpgradeVersion(app));
+                       // If we succeed, we know that the new user was
+                       // persisted on remote app.
+                       addRemoteUser = getUserFromApp(userId, app, applicationsRestClientService);
+                       if (addRemoteUser == null) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "Failed to persist new user: " + userId + " in remote app. appId = " + app.getId());
+                               // return null;
+                       }
+               }
+               return addRemoteUser;
+       }
+       
+       /**
+        * It checks whether the remote user exists or not
+        * if exits returns user object else null
+        * 
+        * @param userId
+        * @param app
+        * @param applicationsRestClientService
+        * @return
+        * @throws HTTPException
+        */
+       private EPUser checkIfRemoteUserExits(String userId, EPApp app, ApplicationsRestClientService applicationsRestClientService) throws HTTPException{
+               EPUser checkRemoteUser = null;
+               try {
+                       checkRemoteUser = getUserFromApp(userId, app, applicationsRestClientService);
+               } catch (HTTPException e) {
+                       // Some apps are returning 400 if user is not found.
+                       if (e.getResponseCode() == 400) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "setAppWithUserRoleStateForUser: getuserFromApp threw exception with response code 400; continuing",
+                                               e);
+                       } else if(e.getResponseCode() == 404) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "setAppWithUserRoleStateForUser: getuserFromApp threw exception with response code 404; continuing",
+                                               e);
+                       } else {
+                               // Other response code, let it come thru.
+                               throw e;
+                       }
+               }
+               return checkRemoteUser;
+       }
+       
+       
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserRolesService#
+        * setAppWithUserRoleStateForUser(org.openecomp.portalapp.portal.domain.
+        * EPUser, org.openecomp.portalapp.portal.transport.AppWithRolesForUser)
+        */
+       public boolean setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser) {
+               boolean result = false;
+               boolean epRequestValue = false;
+               String userId = "";
+               if (newAppRolesForUser != null && newAppRolesForUser.orgUserId != null) {
+                       userId = newAppRolesForUser.orgUserId.trim();
+               }
+               Long appId = newAppRolesForUser.appId;
+               List<RoleInAppForUser> roleInAppForUserList = newAppRolesForUser.appRoles;
+               if (userId.length() > 0) {
+                       ObjectMapper mapper = new ObjectMapper();
+                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+
+                       try {
+                               EPApp app = appsService.getApp(appId);
+                               applyChangesToUserAppRolesForMyLoginsRequest(user, appId);
+
+                               // if centralized app
+                               if (app.getCentralAuth()) {
+                                       // We should add If user does not exist in remote application
+                                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                                               EPUser remoteAppUser = null;
+                                               remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService);
+
+                                               if (remoteAppUser == null) {
+                                                       addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService,
+                                                                       applicationsRestClientService);
+                                               }
+                                       }
+                                       
+                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
+                                                       applicationsRestClientService, appId, userId);
+                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
+                                                       userRolesInLocalApp);
+                                       List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
+                                       if (EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                               // Apply changes in external Access system
+                                               updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList,
+                                                               epRequestValue);
+                                       }
+                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal");
+                               } 
+                               // In case if portal is not centralized then follow existing approach
+                               else if(!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
+                                                       applicationsRestClientService, appId, userId);  
+                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
+                                                       userRolesInLocalApp);
+                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal");
+                               } else{// remote app
+                                       EPUser remoteAppUser = null;
+                                       if(!app.getCentralAuth() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+                                               
+                                               remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService);
+               
+                                               if (remoteAppUser == null) {
+                                                       remoteAppUser = addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService, applicationsRestClientService);
+                                               }
+                                               if (remoteAppUser != null) {
+                                                       Set<EcompRole> userRolesInRemoteApp = postUsersRolesToRemoteApp(roleInAppForUserList, mapper,
+                                                                       applicationsRestClientService, appId, userId);
+                                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
+                                                                       userRolesInRemoteApp);
+                                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, null);
+
+                                                       // If no roles remain, request app to set user inactive.
+                                                       if (userRolesInRemoteApp.size() == 0) {
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "setAppWithUserRoleStateForUser: no roles in app {}, set user {} to inactive", app,
+                                                                               userId);
+                                                               remoteAppUser.setActive(false);
+                                                               postUserToRemoteApp(userId, user, app, applicationsRestClientService);
+                                                       }
+                                               }
+                                       }
+                               }
+                       } catch (Exception e) {
+                               String message = String.format(
+                                               "Failed to create user or update user roles for User %s, AppId %s",
+                                               userId, Long.toString(appId));
+                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                               result = false;
+                       }
+
+               }
+               return result;
+       }
+       /**
+        * It adds user roles in External system and also make data consistent in both local and in External System 
+        * 
+        * @param app details
+        * @param orgUserId
+        * @param roleInAppUser Contains list of active roles 
+        */
+       @SuppressWarnings("unchecked")
+       private void updateUserRolesInExternalSystem(EPApp app, String orgUserId, List<RoleInAppForUser> roleInAppUser, boolean isPortalRequest) throws Exception
+       {
+               try {
+                       // check if user exists
+                       final Map<String, String> userParams = new HashMap<>();
+                       userParams.put("orgUserIdValue", orgUserId);
+                       List<EPUser> userInfo = checkIfUserExists(userParams);
+                       if (userInfo.isEmpty()) {
+                               createLocalUserIfNecessary(orgUserId);
+                       }
+                       String name = "";
+                       if (EPCommonSystemProperties
+                                       .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
+                               name = orgUserId
+                                               + SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
+                       }
+                       ObjectMapper mapper = new ObjectMapper();
+                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
+                       HttpEntity<String> getUserRolesEntity = new HttpEntity<>(headers);
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Connecting to external system to get current user roles");
+                       ResponseEntity<String> getResponse = template
+                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                       + "roles/user/" + name, HttpMethod.GET, getUserRolesEntity, String.class);
+                       if (getResponse.getStatusCode().value() == 200) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "updateUserRolesInExternalSystem: Finished GET user roles from external system and received user roles {}",
+                                               getResponse.getBody());
+
+                       }else{
+                               logger.error(EELFLoggerDelegate.errorLogger, "updateUserRolesInExternalSystem: Failed GET user roles from external system and received user roles {}",getResponse.getBody() );
+                               EPLogUtil.logExternalAuthAccessAlarm(logger, getResponse.getStatusCode());
+                       }
+                       List<ExternalAccessUserRoleDetail> userRoleDetailList = new ArrayList<>();
+                       String res = getResponse.getBody();
+                       JSONObject jsonObj = null;
+                       JSONArray extRoles = null;
+                       if (!res.equals("{}")) {
+                               jsonObj = new JSONObject(res);
+                               extRoles = jsonObj.getJSONArray("role");
+                       }
+                       ExternalAccessUserRoleDetail userRoleDetail = null;
+                       if (extRoles != null) {
+                               for (int i = 0; i < extRoles.length(); i++) {
+                                       if (extRoles.getJSONObject(i).getString("name").startsWith(app.getNameSpace() + ".")
+                                                       && !extRoles.getJSONObject(i).getString("name").equals(app.getNameSpace() + ".admin")
+                                                       && !extRoles.getJSONObject(i).getString("name").equals(app.getNameSpace() + ".owner")) {
+                                               ObjectMapper descMapper = new ObjectMapper();
+                                               if (extRoles.getJSONObject(i).has("description") && EcompPortalUtils.isJSONValid(extRoles.getJSONObject(i).getString("description"))) {
+                                                       ExternalRoleDescription desc = descMapper.readValue(
+                                                                       extRoles.getJSONObject(i).getString("description"), ExternalRoleDescription.class);
+                                                       userRoleDetail = new ExternalAccessUserRoleDetail(
+                                                                       extRoles.getJSONObject(i).getString("name"), desc);
+                                                       userRoleDetailList.add(userRoleDetail);
+                                               } else {
+                                                       userRoleDetail = new ExternalAccessUserRoleDetail(
+                                                                       extRoles.getJSONObject(i).getString("name"), null);
+                                                       userRoleDetailList.add(userRoleDetail);
+                                               }
+
+                                       }
+                               }
+                       }
+                       
+                       List<ExternalAccessUserRoleDetail>  userRoleListMatchingInExtAuthAndLocal = CheckIfRoleAreMatchingInUserRoleDetailList(userRoleDetailList,app);
+                       
+                       // If request coming from portal not from external role approval system then we have to check if user already 
+                       // have account admin or system admin as GUI will not send these roles 
+                       if (!isPortalRequest) {
+                               final Map<String, String> loginIdParams = new HashMap<>();
+                               loginIdParams.put("orgUserIdValue", orgUserId);
+                               EPUser user = (EPUser) dataAccessService.executeNamedQuery("epUserAppId", loginIdParams, null).get(0);
+                               final Map<String, Long> params = new HashMap<>();
+                               params.put("appId", app.getId());
+                               params.put("userId", user.getId());
+                               List<EcompUserAppRoles> userAppList = dataAccessService.executeNamedQuery("getUserAppExistingRoles",
+                                               params, null);
+                               if (!roleInAppUser.isEmpty()) {
+                                       for (EcompUserAppRoles userApp : userAppList) {
+                                               if (userApp.getRoleId().equals(PortalConstants.SYS_ADMIN_ROLE_ID)
+                                                               || userApp.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)) {
+                                                       RoleInAppForUser addSpecialRole = new RoleInAppForUser();
+                                                       addSpecialRole.setIsApplied(true);
+                                                       addSpecialRole.setRoleId(userApp.getRoleId());
+                                                       addSpecialRole.setRoleName(userApp.getRoleName());
+                                                       roleInAppUser.add(addSpecialRole);
+                                               }
+                                       }
+                               }
+                       }
+                       List<RoleInAppForUser> roleInAppUserNonDupls = roleInAppUser.stream().distinct()
+                                       .collect(Collectors.toList());
+                       final Map<String, RoleInAppForUser> currentUserRolesToUpdate = new HashMap<>();
+                       for (RoleInAppForUser roleInAppUserNew : roleInAppUserNonDupls) {
+                               currentUserRolesToUpdate.put(roleInAppUserNew.getRoleName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"), roleInAppUserNew);
+                       }
+                       final Map<String, ExternalAccessUserRoleDetail> currentUserRolesInExternalSystem = new HashMap<>();
+                       for (ExternalAccessUserRoleDetail extAccessUserRole : userRoleListMatchingInExtAuthAndLocal) {
+                               currentUserRolesInExternalSystem.put(extAccessUserRole.getName(), extAccessUserRole);
+                       }
+                       // Check if user roles does not exists in local but still there in External Central Auth System delete them all
+                       for (ExternalAccessUserRoleDetail userRole : userRoleListMatchingInExtAuthAndLocal) {
+                               if (!(currentUserRolesToUpdate
+                                               .containsKey(userRole.getName().substring(app.getNameSpace().length() + 1)))) {
+                                       HttpEntity<String> entity = new HttpEntity<>(headers);
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "updateUserRolesInExternalSystem: Connecting to external system to DELETE user role {}",
+                                                       userRole.getName());
+                                       ResponseEntity<String> deleteResponse = template.exchange(
+                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                       + "userRole/" + name + "/" + userRole.getName(),
+                                                       HttpMethod.DELETE, entity, String.class);
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "updateUserRolesInExternalSystem: Finished DELETE operation in external system for user role {} and the response is {}",
+                                                       userRole.getName(), deleteResponse.getBody());
+                               }
+                       }
+                       // Check if user roles does not exists in External Central Auth System add them all
+                       for (RoleInAppForUser addUserRole : roleInAppUserNonDupls) {
+                               if (!(currentUserRolesInExternalSystem
+                                               .containsKey(app.getNameSpace() + "." + addUserRole.getRoleName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_")))) {
+                                       ExternalAccessUser extUser = new ExternalAccessUser(name,
+                                                       app.getNameSpace() + "." + addUserRole.getRoleName().replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+                                       String formattedUserRole = mapper.writeValueAsString(extUser);
+                                       HttpEntity<String> entity = new HttpEntity<>(formattedUserRole, headers);
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "updateUserRolesInExternalSystem: Connecting to external system for user {} and POST {}",
+                                                       name , addUserRole.getRoleName());
+                                       ResponseEntity<String> addResponse = template
+                                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
+                                                                       + "userRole", HttpMethod.POST, entity, String.class);
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "updateUserRolesInExternalSystem: Finished adding user role in external system {} and added user role {}",
+                                                       addResponse.getBody(), addUserRole.getRoleName());
+                                       if (addResponse.getStatusCode().value() != 201 && addResponse.getStatusCode().value() != 404) {
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "Finished POST operation in external system but unable to save user role", addResponse.getBody(),
+                                                               addUserRole.getRoleName());
+                                               throw new Exception(addResponse.getBody());
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "updateUserRolesInExternalSystem: Failed to add user role for application {} due to {}", app.getId(), e);
+                       EPLogUtil.logExternalAuthAccessAlarm(logger, HttpStatus.BAD_REQUEST);
+                       throw e;
+               }
+
+       }
+
+       private List<ExternalAccessUserRoleDetail> CheckIfRoleAreMatchingInUserRoleDetailList(
+                       List<ExternalAccessUserRoleDetail> userRoleDetailList, EPApp app) {             
+               Map<String, EPRole> epRoleList  = externalAccessRolesService.getCurrentRolesInDB(app);  
+               //Add Account Admin role for partner app to prevent conflict
+               if(!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+               EPRole role =  new EPRole();
+               role.setName(PortalConstants.ADMIN_ROLE.replaceAll(EcompPortalUtils.EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS, "_"));
+               epRoleList.put(role.getName(), role);
+               }
+               userRoleDetailList.removeIf(userRoleDetail -> !epRoleList.containsKey(userRoleDetail.getName().substring(app.getNameSpace().length()+1)));              
+               return userRoleDetailList;
+       }
+
+       /**
+        * 
+        * @param userId
+        * @param app
+        * @param applicationsRestClientService
+        * @param searchService
+        * @param mapper
+        * @throws Exception
+        */
+       protected void createNewUserOnRemoteApp(String userId, EPApp app,
+                       ApplicationsRestClientService applicationsRestClientService, SearchService searchService,
+                       ObjectMapper mapper, boolean postOpenSource) throws Exception {
+
+                       
+                       EPUser client = searchService.searchUserByUserId(userId);
+                       
+                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                       
+                       if (client == null) {
+                               String msg = "cannot create user " + userId + ", because he/she cannot be found in phonebook.";
+                               logger.error(EELFLoggerDelegate.errorLogger, msg);
+                               throw new Exception(msg);
+                       }
+
+                       client.setLoginId(userId);
+                       client.setActive(true);
+
+                       String userInString = null;
+                       userInString = mapper.writerFor(EPUser.class).writeValueAsString(client);
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "about to post new client to remote application, users json = " + userInString);
+                       applicationsRestClientService.post(EPUser.class, app.getId(), userInString, String.format("/user", userId));
+
+       }
+       
+       @SuppressWarnings("unchecked")
+       protected void applyChangesToAppRolesRequest(Long appId, Long userId, String updateStatus, EPUserAppRolesRequest epUserAppRolesRequest) {
+               final Map<String, Long> epRequestParams = new HashMap<>();
+               try {
+                       EPUserAppRolesRequest epAppRolesRequestData = epUserAppRolesRequest;
+                       epAppRolesRequestData.setUpdatedDate(new Date());
+                       epAppRolesRequestData.setRequestStatus(updateStatus);
+                       HashMap<String, Long> addiotonalUpdateParam = new HashMap<String, Long>();
+                       addiotonalUpdateParam.put("userId", userId);
+                       dataAccessService.saveDomainObject(epAppRolesRequestData, addiotonalUpdateParam);
+                       epRequestParams.put("reqId", epUserAppRolesRequest.getId());
+                       List<EPUserAppRolesRequestDetail> epUserAppRolessDetailList = new ArrayList<EPUserAppRolesRequestDetail>();
+                       epUserAppRolessDetailList = dataAccessService.executeNamedQuery("userAppRolesRequestDetailList",
+                                       epRequestParams, null);
+                       if (epUserAppRolessDetailList.size() > 0) {
+                               for (EPUserAppRolesRequestDetail epRequestUpdateData : epUserAppRolessDetailList) {
+                                       EPUserAppRolesRequestDetail epAppRoleDetailData = epRequestUpdateData;
+                                       epAppRoleDetailData.setReqType(updateStatus);
+                                       epAppRoleDetailData.setEpRequestIdData(epAppRolesRequestData);
+                                       HashMap<String, Long> updateDetailsParam = new HashMap<String, Long>();
+                                       addiotonalUpdateParam.put("reqId", epUserAppRolesRequest.getId());
+                                       dataAccessService.saveDomainObject(epAppRoleDetailData, updateDetailsParam);
+                               }
+                       }
+                       logger.debug(EELFLoggerDelegate.debugLogger, "The request is set to complete");
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "applyChangesToAppRolesRequest failed", e);
+               }
+       }
+       
+       @SuppressWarnings("unchecked")
+       public void applyChangesToUserAppRolesForMyLoginsRequest(EPUser user, Long appId) {
+               final Map<String, Long> params = new HashMap<>();
+               final Map<String, Long> epDetailParams = new HashMap<>();
+               List<EPUserAppRolesRequest> epRequestIdVal = new ArrayList<EPUserAppRolesRequest>();
+               params.put("appId", appId);
+               params.put("userId", user.getId());
+               try {
+                       epRequestIdVal = (List<EPUserAppRolesRequest>) dataAccessService
+                                       .executeNamedQuery("userAppRolesRequestList", params, null);
+                       if (epRequestIdVal.size() > 0) {
+                               EPUserAppRolesRequest epAppRolesRequestData = epRequestIdVal.get(0);
+                               epAppRolesRequestData.setUpdatedDate(new Date());
+                               epAppRolesRequestData.setRequestStatus("O");
+                               HashMap<String, Long> addiotonalUpdateParam = new HashMap<String, Long>();
+                               addiotonalUpdateParam.put("userId", user.getId());
+                               dataAccessService.saveDomainObject(epAppRolesRequestData, addiotonalUpdateParam);
+                               epDetailParams.put("reqId", epAppRolesRequestData.getId());
+                               List<EPUserAppRolesRequestDetail> epUserAppRolesDetailList = new ArrayList<EPUserAppRolesRequestDetail>();
+                               epUserAppRolesDetailList = dataAccessService.executeNamedQuery("userAppRolesRequestDetailList",
+                                               epDetailParams, null);
+                               if (epUserAppRolesDetailList.size() > 0) {
+                                       for (EPUserAppRolesRequestDetail epRequestUpdateList : epUserAppRolesDetailList) {
+                                               EPUserAppRolesRequestDetail epAppRoleDetailData = epRequestUpdateList;
+                                               epAppRoleDetailData.setReqType("O");
+                                               epAppRoleDetailData.setEpRequestIdData(epAppRolesRequestData);
+                                               HashMap<String, Long> updateDetailsParams = new HashMap<String, Long>();
+                                               addiotonalUpdateParam.put("reqId", epAppRolesRequestData.getId());
+                                               dataAccessService.saveDomainObject(epAppRoleDetailData, updateDetailsParams);
+                                       }
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "User App roles request from User Page is overridden");
+                               }
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "applyChangesToUserAppRolesRequest failed", e);
+               }
+       }
+       
+       /**
+        * Pushes specified user details to the specified remote app.
+        * 
+        * @param userId
+        *            OrgUserId identifying user at remote app in REST endpoint path
+        * @param user
+        *            User details to be pushed
+        * @param app
+        *            Remote app
+        * @param applicationsRestClientService
+        * @throws HTTPException
+        */
+       protected void postUserToRemoteApp(String userId, EPUser user, EPApp app,
+                       ApplicationsRestClientService applicationsRestClientService) throws HTTPException {
+       
+                getUser(userId, app, applicationsRestClientService);
+                                       
+       }
+       
+       /**
+        * It returns user details for single org user id
+        * 
+        * @param userParams
+        * @return
+        *              if user exists it returns list of user details otherwise empty value
+        */
+       @SuppressWarnings("unchecked")
+       private List<EPUser> checkIfUserExists(Map<String, String> userParams){ 
+               return (List<EPUser>)dataAccessService.executeNamedQuery("epUserAppId", userParams, null);
+       }
+       
+       /**
+        * It checks whether the new user is valid or not otherwise throws exception
+        * 
+        * @param orgUserId
+        * @param app
+        * @return 
+        *                      Checks if user is valid and returns message otherwise throws exception
+        * @throws Exception
+        */
+       private String validateNewUser(String orgUserId, EPApp app) throws Exception {
+               EPUser epUser = searchService.searchUserByUserId(orgUserId);
+               if (epUser == null) {
+                       throw new Exception("User does not exist");
+               } else if (!epUser.getOrgUserId().equals(orgUserId)) {
+                       throw new Exception("User does not exist");
+               } else if (app == null) {
+                       throw new Exception("Application does not exist");
+               }
+               return "Saved Successfully";
+       }
+       
+       /**
+        *   Checks if the fields exists or not
+        *   
+        * @param userList
+        *                      contains user information
+        * @param app
+        *                      contains app name
+        * @throws Exception
+        *                      throws exception if the field is not valid
+        */
+       private void validateExternalRequestFields(List<EPUser> userList, EPApp app) throws Exception{
+               if (userList.size() == 0 || userList.isEmpty() ) {
+                       throw new Exception("User does not exist");
+               } else if(app == null) {
+                       throw new Exception("Application does not exist");
+               } else if(!app.getEnabled() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
+                       throw new Exception(app.getMlAppName()+" application is unavailable");
+               }
+       }
+       
+       @SuppressWarnings("unchecked")
+       public ExternalRequestFieldsValidator setExternalRequestUserAppRole(ExternalSystemUser newAppRolesForUser, String reqType) {
+               boolean result = false;
+               boolean externalSystemRequest = true;
+               final Map<String, Long> params = new HashMap<>();
+               final Map<String, String> userParams = new HashMap<>();
+               List<EPUser> userInfo = null;
+               EPUser userId = null;
+               List<EPUserAppRolesRequest> epRequestId = null;
+               String orgUserId = "";
+               String updateStatus = "";
+               String reqMessage = "";
+               EPApp app = null;
+               if (newAppRolesForUser != null && newAppRolesForUser.getLoginId() != null) {
+                       orgUserId = newAppRolesForUser.getLoginId().trim();
+               }
+               String appName = newAppRolesForUser.getApplicationName();
+               String logMessage = ("DELETE").equals(reqType) ? "Deleting": "Assigning/Updating" ;
+               if (orgUserId.length() > 0) {
+                       ObjectMapper mapper = new ObjectMapper();
+                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+                       int epRequestIdSize = 0;
+                       try {
+                               app = appsService.getAppDetail(appName);
+                               userParams.put("orgUserIdValue", orgUserId);
+                               userInfo = checkIfUserExists(userParams);
+                               reqMessage = "Updated Successfully";
+                               if (!reqType.equals("DELETE") && (userInfo.size() == 0 || userInfo.isEmpty())) {
+                                       reqMessage = validateNewUser(orgUserId, app);
+                               }
+                               if (userInfo.size() != 0 || !userInfo.isEmpty()) {
+                                       validateExternalRequestFields(userInfo, app);
+                                       userId = userInfo.get(0);
+                                       params.put("appId", app.getId());
+                                       params.put("userId", userId.getId());
+                                       epRequestId = (List<EPUserAppRolesRequest>) dataAccessService
+                                                       .executeNamedQuery("userAppRolesRequestList", params, null);
+                                       epRequestIdSize = epRequestId.size();
+                               }
+                               
+                               //If Non-Centralized app make sure you sync app roles before assigning to user
+                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !app.getCentralAuth()) {
+                                       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);
+                                       if (appRoles.length > 0) {
+                                               syncAppRoles(sessionFactory, app.getId(), appRoles);
+                                       }
+                               }
+                               List<RoleInAppForUser> roleInAppForUserList = roleInAppForUserList(newAppRolesForUser.getRoles(),
+                                               app.getId(), app.getMlAppName());
+                               List<EcompUserAppRoles> userRoleList = null;
+                               if(!userInfo.isEmpty()){
+                               final Map<String, Long> appParams = new HashMap<>();
+                               appParams.put("userId", userId.getId());
+                               appParams.put("appId", app.getId());
+                               userRoleList = dataAccessService.executeNamedQuery("getUserAppExistingRoles", appParams, null);
+                               }
+                               // Check if list contains just account admin role
+                               boolean checkIfAdminRoleExists = false;
+                               if (reqType.equals("DELETE") && userRoleList!=null) {
+                                       checkIfAdminRoleExists = userRoleList.stream()
+                                                       .anyMatch(userRole -> userRole.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
+                               } else {
+                                       checkIfAdminRoleExists = roleInAppForUserList.stream()
+                                                       .anyMatch(roleList -> roleList.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
+                               }
+                               // if Centralized app
+                               if (app.getCentralAuth()) {
+                                       // We should add If user does not exist in remote application
+                                       try {
+                                               // If adding just account admin role dont make remote application user call
+                                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !(checkIfAdminRoleExists
+                                                               && reqType.equals("DELETE")) && roleInAppForUserList.size() > 1) {
+                                                       EPUser remoteAppUser = null;
+                                                       remoteAppUser = checkIfRemoteUserExits(orgUserId, app,
+                                                                       applicationsRestClientService);
+                                                       if (remoteAppUser == null) {
+                                                               addRemoteUser(roleInAppForUserList, orgUserId, app, mapper, searchService,
+                                                                               applicationsRestClientService);
+                                                               reqMessage = "Saved Successfully";
+                                                       }
+                                               }
+                                       } catch (Exception e) {
+                                               reqMessage = e.getMessage();
+                                               logger.error(EELFLoggerDelegate.errorLogger, "setExternalRequestUserAppRole: Failed to added remote user", e);
+                                               throw new Exception(reqMessage);
+                                       }
+                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
+                                                       applicationsRestClientService, app.getId(), orgUserId);
+                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
+                                                       userRolesInLocalApp);
+                                       List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
+                                       if(EcompPortalUtils.checkIfRemoteCentralAccessAllowed()) {
+                                       // Apply changes in external Access system
+                                       updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList, externalSystemRequest);
+                                       }
+                                       logger.info(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: {} user app roles: for app {}, user {}", logMessage,
+                                                       newAppRolesForUser.getApplicationName(), newAppRolesForUser.getLoginId());
+                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest, reqType);
+                               } 
+                               // If local application is not centralized 
+                               else if(!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)){
+                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
+                                                       applicationsRestClientService, app.getId(), orgUserId); 
+                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
+                                                       userRolesInLocalApp);
+                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest, reqType);
+                               } else {// remote app
+                                       // If adding just account admin role don't do remote application user call
+                                       if(!((roleInAppForUserList.size() == 1 || reqType.equals("DELETE")) && checkIfAdminRoleExists)){
+                                       EPUser remoteAppUser = null;
+                                               remoteAppUser = checkIfRemoteUserExits(orgUserId, app, applicationsRestClientService);
+                                       if (remoteAppUser == null) {
+                                               remoteAppUser = addRemoteUser(roleInAppForUserList, orgUserId, app, mapper, searchService, applicationsRestClientService);
+                                               reqMessage = "Saved Successfully";
+                                       }
+                                               if (remoteAppUser != null) {
+                                                       Set<EcompRole> userRolesInRemoteApp = postUsersRolesToRemoteApp(roleInAppForUserList,
+                                                                       mapper, applicationsRestClientService, app.getId(), orgUserId);
+
+                                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId,
+                                                                       app.getId(), userRolesInRemoteApp);
+                                                       logger.info(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: {} user app roles: for app {}, user {}",
+                                                                       logMessage, newAppRolesForUser.getApplicationName(),
+                                                                       newAppRolesForUser.getLoginId());
+                                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest,
+                                                                       reqType);
+                                                       // If no roles remain, request app to set user inactive.
+                                                       /*if (userRolesInRemoteApp.size() == 0) {
+                                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                               "setAppWithUserRoleStateForUser: no roles in app {}, set user {} to inactive", app,
+                                                                               orgUserId);
+                                                               //TODO Need  to fix the logged in user is not set to inactive
+                                                               remoteAppUser.setActive(false);
+                                                               postUserToRemoteApp(orgUserId, user, app, applicationsRestClientService);
+                                                       }*/
+                                               }
+                                       } else {
+                                               // Here we are adding only we have single account admin in roleInAppForUserList and this should not add in remote 
+                                               if(!(reqType.equals("DELETE")) && userInfo.isEmpty()){
+                                                       reqMessage = "Saved Successfully";
+                                               }
+                                               Set<EcompRole> userRolesInRemoteApp = constructUsersEcompRoles(roleInAppForUserList);
+
+                                               RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
+                                                               userRolesInRemoteApp);
+                                               logger.info(EELFLoggerDelegate.debugLogger, "setExternalRequestUserAppRole: {} user app roles: for app {}, user {}",
+                                                               logMessage, newAppRolesForUser.getApplicationName(), newAppRolesForUser.getLoginId());
+                                               result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest,
+                                                               reqType);
+                                       }
+                                       if(!result){
+                                               reqMessage = "Failed to save the user app role(s)";
+                                       }
+                                       if (epRequestIdSize > 0 && !userInfo.isEmpty()) {
+                                               updateStatus = "C";
+                                               applyChangesToAppRolesRequest(app.getId(), userId.getId(), updateStatus, epRequestId.get(0));
+                                       }
+                               }
+                       } catch (Exception e) {
+                               String message = String.format("setExternalRequestUserAppRole: Failed to create user or update user roles for User %s, AppId %s",
+                                               orgUserId, appName);
+                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                               result = false;
+                               reqMessage = e.getMessage();
+                                if(epRequestIdSize > 0 && userInfo!=null && !userInfo.isEmpty()){
+                                updateStatus = "F";
+                                applyChangesToAppRolesRequest(app.getId(), userId.getId(),
+                                updateStatus, epRequestId.get(0));
+                                }
+                       }
+
+               }
+               return new ExternalRequestFieldsValidator(result, reqMessage);
+       }
+       
+       /**
+        * 
+        * @param roleInAppForUserList
+        * @param mapper
+        * @param applicationsRestClientService
+        * @param appId
+        * @param userId
+        * @return  Set<EcompRole>
+        * @throws JsonProcessingException
+        * @throws HTTPException
+        */
+       private Set<EcompRole> postUsersRolesToLocalApp(List<RoleInAppForUser> roleInAppForUserList, ObjectMapper mapper,
+                       ApplicationsRestClientService applicationsRestClientService, Long appId, String userId)
+                       throws JsonProcessingException, HTTPException {
+               Set<EcompRole> updatedUserRoles = constructUsersEcompRoles(roleInAppForUserList);
+               return updatedUserRoles;
+       }
+       
+       /**
+        * It constructs and returns list of user app roles when the external API role approval system calls
+        * this method
+        * 
+        * @param roleInAppForUserList
+        * @param appId
+        * @return list of user app roles
+        * @throws Exception
+        *                 throws exceptions if role id does not exits 
+        */
+       private List<RoleInAppForUser> roleInAppForUserList(List<ExternalSystemRoleApproval> roleInAppForUserList,
+                       Long appId, String appName) throws Exception {
+               List<RoleInAppForUser> existingUserRoles = new ArrayList<RoleInAppForUser>();
+               EPRole existingAppRole = null;
+               for (ExternalSystemRoleApproval roleInAppForUser : roleInAppForUserList) {
+                       RoleInAppForUser ecompRole = new RoleInAppForUser();
+                       existingAppRole = epRoleService.getAppRole(roleInAppForUser.getRoleName(), appId);
+                       if (existingAppRole == null) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "roleInAppForUserList failed for the roles {}",
+                                               roleInAppForUserList);
+                               throw new Exception("'" +roleInAppForUser.getRoleName() + "'" +" role does not exist for " + appName + " application");
+                       }
+                       if (!existingAppRole.getActive()) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "roleInAppForUserList failed for the roles {}",
+                                               roleInAppForUserList);
+                               throw new Exception(roleInAppForUser.getRoleName() + " role is unavailable for "+ appName + " application");
+                       } else {
+                               ecompRole.roleId = (appId == 1 || roleInAppForUser.getRoleName().equals(PortalConstants.ADMIN_ROLE)) ? existingAppRole.getId() : existingAppRole.getAppRoleId();
+                               ecompRole.roleName = roleInAppForUser.getRoleName();
+                               ecompRole.isApplied = true;
+                               existingUserRoles.add(ecompRole);
+                       }
+               }
+               return existingUserRoles;
+       }
+       
+       
+
+       /**
+        * 
+        * @param userId
+        * @param app
+        * @param applicationsRestClientService
+        * @return EPUser
+        * @throws HTTPException
+        */
+       protected EPUser getUserFromApp(String userId, EPApp app, ApplicationsRestClientService applicationsRestClientService)
+                       throws HTTPException {
+               // local app
+               if (app.getId() == PortalConstants.PORTAL_APP_ID) {
+                       // Map<String,String> params = new HashMap<String,String>();
+                       // params.put("sbcid",userId);
+                       @SuppressWarnings("unchecked")
+                       List<EPUser> userList = (List<EPUser>) dataAccessService
+                                       .executeQuery("from EPUser where orgUserId='" + userId + "'", null);
+                       if (userList != null && !userList.isEmpty())
+                               return userList.get(0);
+                       else
+                               return null;
+               }
+               // remote app
+               
+               return getUser(userId, app, applicationsRestClientService);
+       }
+       
+       protected EPUser getUser(String userId, EPApp app, ApplicationsRestClientService applicationsRestClientService)
+                       throws HTTPException {
+               return applicationsRestClientService.get(EPUser.class, app.getId(), String.format("/user/%s", userId), true);
+
+       }
+       
+       protected boolean isAppUpgradeVersion(EPApp app){
+               return true;
+       }
+       
+       
+       public ExternalSystemAccess getExternalRequestAccess(){
+               ExternalSystemAccess res = null; 
+               try {
+                       res = new ExternalSystemAccess(EPCommonSystemProperties.EXTERNAL_ACCESS_ENABLE,
+                                       Boolean.parseBoolean(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_ACCESS_ENABLE)));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getExternalRequestAccess failed" + e.getMessage());
+               }
+               return res;             
+       }
+       
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserRolesService#
+        * getAppRolesForUser(java.lang.Long, java.lang.String)
+        */
+       @SuppressWarnings("unchecked")
+       public List<RoleInAppForUser> getAppRolesForUser(Long appId, String userId, Boolean extRequestValue) {
+
+               List<RoleInAppForUser> rolesInAppForUser = null;
+               EPApp app = appsService.getApp(appId);
+               try {
+                       // for ecomp portal app, no need to make a remote call
+                       List<Role> roleList = new ArrayList<>();
+                       if (appId == PortalConstants.PORTAL_APP_ID) {           
+                               if(app.getCentralAuth()){
+                                       List<CentralV2Role> cenRoleList = externalAccessRolesService.getRolesForApp(app.getUebKey());
+                                       for(CentralV2Role cenRole : cenRoleList){
+                                               Role role = new Role();
+                                               role.setActive(cenRole.isActive());
+                                               role.setId(cenRole.getId());
+                                               role.setName(cenRole.getName());
+                                               role.setPriority(cenRole.getPriority());
+                                               roleList.add(role);
+                                       }
+                               }else{
+                                       roleList = roleService.getAvailableRoles(userId);
+                               }
+                               List<Role> activeRoleList = new ArrayList<Role>();
+                               for(Role role: roleList) {
+                                       if(role.getActive()) {
+                                               if(role.getId() != 1){ // prevent portal admin from being added
+                                                       activeRoleList.add(role);
+                                               } else if(extRequestValue){
+                                                       activeRoleList.add(role);
+                                               }
+                                       }
+                                               
+                               }
+                               EPUser localUser  = getUserFromApp(userId, app, applicationsRestClientService);
+                               // If localUser does not exists return roles
+                               Set<EPRole> roleSet = null;
+                               EPRole[] roleSetList = null;
+                               if(localUser != null){
+                                       roleSet = localUser.getAppEPRoles(app);
+                                       roleSetList = roleSet.toArray(new EPRole[0]);
+                               }
+                               rolesInAppForUser = constructRolesInAppForUserGet(activeRoleList, roleSetList, extRequestValue);
+                               return rolesInAppForUser;
+                       }
+                       
+                       EcompRole[] appRoles = null;
+                       List<EcompRole> roles = new ArrayList<>();
+                       if(app.getCentralAuth()){
+                               List<EPRole> applicationRoles = dataAccessService.getList(EPRole.class, " where app_id = "+app.getId()+ " and active_yn = 'Y'", null, null);;
+                               for(EPRole role : applicationRoles){
+                                       EcompRole ecompRole = new EcompRole();
+                                       ecompRole.setId(role.getId());
+                                       ecompRole.setName(role.getName());
+                                       roles.add(ecompRole);
+                               }
+                               appRoles = roles.toArray(new EcompRole[roles.size()]);
+                       } else{
+                               appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
+                       }
+                       // Test this error case, for generating an internal Ecomp Portal
+                       // error
+                       // EcompRole[] appRoles = null;
+                       // If there is an exception in the rest client api, then null will
+                       // be returned.
+                       if (appRoles != null) {
+                               if(!app.getCentralAuth()) {
+                               syncAppRoles(sessionFactory, appId, appRoles);
+                               }
+                               EcompRole[] userAppRoles = null;
+                               try {
+                                       try {
+                                               if(app.getCentralAuth()){
+                                                       final Map<String, String> params = new HashMap<>();
+                                                       final Map<String, Long> userParams = new HashMap<>();
+                                                       params.put("orgUserIdValue", userId);
+                                                       List<EPUser> user = dataAccessService.executeNamedQuery("epUserAppId", params, null);
+                                                       userParams.put("appId", app.getId());
+                                                       userParams.put("userId", user.get(0).getId());  
+                                                       List<EPUserAppCurrentRoles> userAppsRolesList = dataAccessService.executeNamedQuery("getUserAppCurrentRoles", userParams, null);
+                                                               List<EcompRole> setUserRoles = new ArrayList<>();
+                                                               for(EPUserAppCurrentRoles role : userAppsRolesList){
+                                                                       EcompRole ecompRole = new EcompRole();
+                                                                       ecompRole.setId(role.getRoleId());
+                                                                       ecompRole.setName(role.getRoleName());
+                                                                       setUserRoles.add(ecompRole);
+                                                               }
+                                                               userAppRoles = setUserRoles.toArray(new EcompRole[setUserRoles.size()]);
+                                                               rolesInAppForUser = constructRolesInAppForUserGet(appRoles, userAppRoles);
+                                                               return rolesInAppForUser;
+                                               }else{
+                                                       userAppRoles = applicationsRestClientService.get(EcompRole[].class, appId,
+                                                                       String.format("/user/%s/roles", userId));
+                                               }
+                                       } catch (HTTPException e) {
+                                               // Some apps are returning 400 if user is not found.
+                                               if (e.getResponseCode() == 400) {
+                                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                                       "getAppRolesForUser caught exception with response code 400; continuing", e);
+                                               } else {
+                                                       // Other response code, let it come thru.
+                                                       throw e;
+                                               }
+                                       }
+                                       if (userAppRoles == null) {
+                                               if (EcompPortalUtils.getExternalAppResponseCode() == 400) {
+                                                       EcompPortalUtils.setExternalAppResponseCode(200);
+                                                       String message = String.format(
+                                                                       "getAppRolesForUser: App %s, User %, endpoint /user/{userid}/roles returned 400, "
+                                                                                       + "assuming user doesn't exist, app is framework SDK based, and things are ok. "
+                                                                                       + "Overriding to 200 until framework SDK returns a useful response.",
+                                                                       Long.toString(appId), userId);
+                                                       logger.warn(EELFLoggerDelegate.applicationLogger, message);
+                                               }
+                                       }
+                                       
+                                        HashMap<Long, EcompRole> appRolesActiveMap =hashMapFromEcompRoles(appRoles);
+                                               ArrayList<EcompRole> activeRoles = new ArrayList<EcompRole>();
+                                               if(userAppRoles != null){
+                                                       for (int i = 0; i < userAppRoles.length; i++) {
+                                                               if (appRolesActiveMap.containsKey(userAppRoles[i].getId())) {
+                                                                       EcompRole role = new EcompRole();
+                                                                       role.setId(userAppRoles[i].getId());
+                                                                       role.setName(userAppRoles[i].getName());
+                                                                       activeRoles.add(role);
+                                                               }
+                                                       }
+                                               }
+                                               EcompRole[]     userAppRolesActive = activeRoles.toArray(new EcompRole[activeRoles.size()]);
+                                       
+                                       // If the remote application isn't down we MUST sync user
+                                       // roles here in case we have this user here!
+                                       syncUserRoles(sessionFactory, userId, appId, userAppRolesActive, extRequestValue, null);
+                               } catch (Exception e) {
+                                       // TODO: we may need to check if user exists, maybe remote
+                                       // app is down.
+                                       String message = String.format(
+                                                       "getAppRolesForUser: user %s does not exist in remote application %s", userId,
+                                                       Long.toString(appId));
+                                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                                       userAppRoles = new EcompRole[0];
+                               }
+                               rolesInAppForUser = constructRolesInAppForUserGet(appRoles, userAppRoles);
+                       }
+               } catch (Exception e) {
+                       String message = String.format("getAppRolesForUser: failed for User %s, AppId %s", userId,
+                                       Long.toString(appId));
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+               }
+               return rolesInAppForUser;
+
+       }
+       
+       private boolean postUserRolesToMylogins(AppWithRolesForUser userAppRolesData,
+                       ApplicationsRestClientService applicationsRestClientService, Long appId, Long userId)
+                       throws JsonProcessingException, HTTPException {
+               boolean result = false;
+               ObjectMapper mapper = new ObjectMapper();
+               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+               String userRolesAsString = mapper.writeValueAsString(userAppRolesData);
+               logger.error(EELFLoggerDelegate.errorLogger,"Should not be reached here, as the endpoint is not defined yet from the Mylogins");
+               applicationsRestClientService.post(AppWithRolesForUser.class, appId, userRolesAsString, String.format("/user/%s/myLoginroles", userId));
+               return result;
+       }
+
+       public FieldsValidator putUserAppRolesRequest(AppWithRolesForUser userAppRolesData, EPUser user) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               final Map<String, Long> params = new HashMap<>();
+               EPUserAppRoles  appRole= new EPUserAppRoles();
+               try {
+                       logger.error(EELFLoggerDelegate.errorLogger,"Should not be reached here, still the endpoint is yet to be defined");
+                       boolean result = postUserRolesToMylogins(userAppRolesData, applicationsRestClientService, userAppRolesData.appId, user.getId());
+                       logger.debug(EELFLoggerDelegate.debugLogger,"putUserAppRolesRequest: result {}", result);
+                                               
+                       params.put("appId", userAppRolesData.appId);
+                       EPUserAppRolesRequest epAppRolesRequestData = new EPUserAppRolesRequest();
+                       epAppRolesRequestData.setCreatedDate(new Date());
+                       epAppRolesRequestData.setUpdatedDate(new Date());
+                       epAppRolesRequestData.setUserId(user.getId());
+                       epAppRolesRequestData.setAppId(userAppRolesData.appId);
+                       epAppRolesRequestData.setRequestStatus("P");
+                       List<RoleInAppForUser> appRoleIdList = userAppRolesData.appRoles;
+                       Set<EPUserAppRolesRequestDetail> appRoleDetails = new LinkedHashSet<EPUserAppRolesRequestDetail>();
+                       dataAccessService.saveDomainObject(epAppRolesRequestData, null);
+                       for (RoleInAppForUser userAppRoles : appRoleIdList) {
+                               Boolean isAppliedVal = userAppRoles.isApplied;
+                               params.put("appRoleId", userAppRoles.roleId);                           
+                               if (isAppliedVal) {
+                                       appRole = (EPUserAppRoles) dataAccessService.executeNamedQuery("appRoles", params, null).get(0);
+                                       EPUserAppRolesRequestDetail epAppRoleDetail = new EPUserAppRolesRequestDetail();
+                                       epAppRoleDetail.setReqRoleId(appRole.getRoleId());
+                                       epAppRoleDetail.setReqType("P");
+                                       epAppRoleDetail.setEpRequestIdData(epAppRolesRequestData);
+                                       dataAccessService.saveDomainObject(epAppRoleDetail, null);
+                                       }                       
+                       }
+                       epAppRolesRequestData.setEpRequestIdDetail(appRoleDetails);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "putUserAppRolesRequest failed", e);
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+               return fieldsValidator;
+       }
+
+       public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(EPUser userid, String appName) {      
+               Map<String, String> params = new HashMap<>();
+               params.put("userid", userid.getId().toString());
+               //params.put("appid", appid);
+               params.put("appName", appName);
+                       
+               @SuppressWarnings("unchecked")
+               List<EPUserAppCatalogRoles> userAppRoles = (List<EPUserAppCatalogRoles>) dataAccessService
+                               .executeNamedQuery("userAppCatalogRoles", params, null);
+               return userAppRoles;    
+       }
+       
+       public String updateRemoteUserProfile(String orgUserId, Long appId) {
+               ObjectMapper mapper = new ObjectMapper();
+               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+               EPUser client = searchService.searchUserByUserId(orgUserId);
+               EPUser newUser = new EPUser();
+               newUser.setActive(client.getActive());
+               newUser.setFirstName(client.getFirstName());
+               newUser.setLastName(client.getLastName());
+               newUser.setLoginId(client.getLoginId());
+               newUser.setLoginPwd(client.getLoginPwd());
+               newUser.setMiddleInitial(client.getMiddleInitial());
+               newUser.setEmail(client.getEmail());
+               newUser.setOrgUserId(client.getLoginId());
+               try {
+                       String userAsString = mapper.writeValueAsString(newUser);
+                       List<EPApp> appList = appsService.getUserRemoteApps(client.getId().toString());
+                       // applicationsRestClientService.post(EPUser.class, appId,
+                       // userAsString, String.format("/user", orgUserId));
+                       for (EPApp eachApp : appList) {
+                               try {
+                                       applicationsRestClientService.post(EPUser.class, eachApp.getId(), userAsString,
+                                                       String.format("/user/%s", orgUserId));
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to update user: " + client.getOrgUserId()
+                                                       + " in remote app. appId = " + eachApp.getId());
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "updateRemoteUserProfile failed", e);
+                       return "failure";
+               }
+
+               return "success";
+       }
+
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see org.openecomp.portalapp.portal.service.UserRolesService#
+        * getCachedAppRolesForUser(java.lang.Long, java.lang.Long)
+        */
+       public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId) {
+               // Find the records for this user-app combo, if any
+               String filter = " where user_id = " + Long.toString(userId) + " and app_id = " + Long.toString(appId);
+               @SuppressWarnings("unchecked")
+               List<EPUserApp> roleList = dataAccessService.getList(EPUserApp.class, filter, null, null);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getCachedAppRolesForUser: list size is {}", roleList.size());
+               return roleList;
+       }
+       
+       /**
+        * It retrieves and returns list of user app roles for local and remote applications based app id
+        * 
+        * @param appId
+        * @return list of user app roles
+        * @throws HTTPException 
+        */
+       public List<UserApplicationRoles> getUsersFromAppEndpoint(Long appId) throws HTTPException {
+               ArrayList<UserApplicationRoles> userApplicationRoles = new ArrayList<UserApplicationRoles>();
+               
+               EPApp app = appsService.getApp(appId);
+               //If local or centralized application
+               if (appId == PortalConstants.PORTAL_APP_ID || app.getCentralAuth()) {
+                       @SuppressWarnings("unchecked")
+                       List<EPUser> userList = (List<EPUser>) dataAccessService.executeNamedQuery("getActiveUsers", null, null);
+                       for (EPUser user : userList) {
+                               UserApplicationRoles userWithAppRoles = convertToUserApplicationRoles(appId, user, app);
+                               if (userWithAppRoles.getRoles() != null && userWithAppRoles.getRoles().size() > 0)
+                                       userApplicationRoles.add(userWithAppRoles);
+                       }
+
+               } 
+               // remote app
+               else {  
+                       RemoteUserWithRoles[] remoteUsers = null;
+                       String remoteUsersString = applicationsRestClientService.getIncomingJsonString(appId, "/users");
+                       
+                       remoteUsers = doGetUsers(isAppUpgradeVersion(app), remoteUsersString);
+                       
+                       userApplicationRoles = new ArrayList<UserApplicationRoles>();
+                       for (RemoteUserWithRoles remoteUser : remoteUsers) {
+                               UserApplicationRoles userWithRemoteAppRoles = convertToUserApplicationRoles(appId, remoteUser);
+                               if (userWithRemoteAppRoles.getRoles() != null && userWithRemoteAppRoles.getRoles().size() > 0) {
+                                       userApplicationRoles.add(userWithRemoteAppRoles);
+                               } else {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "User " + userWithRemoteAppRoles.getOrgUserId() + " doesn't have any roles assigned to any app.");
+                               }
+                       }
+               }
+               
+               return userApplicationRoles;
+       }
+       
+       /**
+        * 
+        * @param appId
+        * @param user
+        * @param appgetUsersFromAppEndpoint
+        * @return
+        */
+       private UserApplicationRoles convertToUserApplicationRoles(Long appId, EPUser user, EPApp app) {
+               UserApplicationRoles userWithRemoteAppRoles = new UserApplicationRoles();
+               userWithRemoteAppRoles.setAppId(appId);
+               userWithRemoteAppRoles.setOrgUserId(user.getOrgUserId());
+               userWithRemoteAppRoles.setFirstName(user.getFirstName());
+               userWithRemoteAppRoles.setLastName(user.getLastName());
+               userWithRemoteAppRoles.setRoles(convertToRemoteRoleList(user, app));
+               return userWithRemoteAppRoles;
+       }
+
+       /**
+        * 
+        * @param user
+        * @param app
+        * @return
+        */
+       private List<RemoteRole> convertToRemoteRoleList(EPUser user, EPApp app) {
+               List<RemoteRole> roleList = new ArrayList<RemoteRole>();
+               SortedSet<EPRole> roleSet = user.getAppEPRoles(app);
+               for (EPRole role : roleSet) {
+                       RemoteRole rRole = new RemoteRole();
+                       rRole.setId(role.getId());
+                       rRole.setName(role.getName());
+                       roleList.add(rRole);
+               }
+               return roleList;
+       }
+
+       public RemoteUserWithRoles[] doGetUsers(boolean postOpenSource, String remoteUsersString) {
+
+               ObjectMapper mapper = new ObjectMapper();
+               try {
+                       return mapper.readValue(remoteUsersString, RemoteUserWithRoles[].class);
+               } catch (IOException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "doGetUsers : Failed : Unexpected property in incoming JSON",
+                                       e);
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "doGetUsers : Incoming JSON that caused it --> " + remoteUsersString);
+               }
+
+               return new RemoteUserWithRoles[0];
+       }
+
+       @SuppressWarnings("unchecked")
+       public List<EPUserApp> getEPUserAppList(Long appId, Long userId, Long roleId) {
+               List<EPUserApp> userRoleList = new ArrayList<EPUserApp>();
+               final Map<String, Long> params = new HashMap<>();
+               params.put("appId", appId);
+               params.put("userId", userId);
+               params.put("roleId", roleId);
+               userRoleList = dataAccessService.executeNamedQuery("getUserRoleOnUserIdAndRoleIdAndAppId", params, null);
+               return userRoleList;
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserRolesService.java
new file mode 100644 (file)
index 0000000..1b63862
--- /dev/null
@@ -0,0 +1,111 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.apache.cxf.transport.http.HTTPException;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemUser;
+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.EPUserAppCatalogRoles;
+import org.onap.portalapp.portal.domain.ExternalSystemAccess;
+import org.onap.portalapp.portal.transport.AppWithRolesForUser;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.RoleInAppForUser;
+import org.onap.portalapp.portal.transport.UserApplicationRoles;
+
+public interface UserRolesService {
+
+       /**
+        * Returns list of app roles of a single app
+        * 
+        * @param appId
+        *            ID of row in fn_app
+        * @param userId
+        *            ID of row in fn_user
+        * @param extRequestValue
+        *            set to false if request is from users page otherwise true
+        * @return List<RoleInAppForUser>
+        */
+       public List<RoleInAppForUser> getAppRolesForUser(Long appId, String userId, Boolean extRequestValue);
+
+       public boolean setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser);
+
+       public List<UserApplicationRoles> getUsersFromAppEndpoint(Long appId) throws HTTPException;
+
+       public List<EPRole> importRolesFromRemoteApplication(Long appId) throws HTTPException;
+
+       /**
+        * Gets entries from the local fn_user_role table for the specified user and
+        * app.
+        * 
+        * @param appId
+        *            ID of row in fn_app
+        * @param userId
+        *            ID of row in fn_user
+        * @return List of EPRole; empty if none found.
+        */
+       public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId);
+
+       public FieldsValidator putUserAppRolesRequest(AppWithRolesForUser userAppRolesData, EPUser user);
+
+       /**
+        * Save user app roles in the database from the external request
+        * 
+        * @param newAppRolesForUser
+        * 
+        *            contains login id, app name, request id, and list of role
+        *            names
+        * @param reqType
+        * @return if any exceptions, returns detail message and true or false
+        */
+       ExternalRequestFieldsValidator setExternalRequestUserAppRole(ExternalSystemUser newAppRolesForUser, String reqType);
+
+       public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(EPUser user, String appName);
+
+       public String updateRemoteUserProfile(String orgUserId, Long appId);
+
+       public ExternalSystemAccess getExternalRequestAccess();
+       
+       public List<EPUserApp> getEPUserAppList(Long appId, Long userId, Long roleId);
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserService.java
new file mode 100644 (file)
index 0000000..cfc3230
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+
+public interface UserService {
+
+       List<EPUser> getUserByUserId(String orgUserId);
+
+       List<EPUser> getUserByFirstLastName(String firstName, String lastName);
+
+       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception;
+
+       public void saveUser(EPUser user) throws Exception;
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java
new file mode 100644 (file)
index 0000000..860712b
--- /dev/null
@@ -0,0 +1,288 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.portal.service.UserServiceImpl;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalsdk.core.FusionObject.Utilities;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service("userService")
+@Transactional
+public class UserServiceImpl implements UserService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPUser> getUserByUserId(String userId) {
+
+               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
+                       List<EPUser> users = new ArrayList<EPUser>();
+                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
+                       BufferedReader in = null;
+                       HttpURLConnection con = null;
+                       try {
+                               String url = EPCommonSystemProperties.getProperty(EPCommonSystemProperties.AUTH_USER_SERVER);
+                               URL obj = new URL(url);
+
+                               con = (HttpURLConnection) obj.openConnection();
+
+                               // optional default is GET
+                               con.setRequestMethod("GET");
+                               con.setConnectTimeout(3000);
+                               con.setReadTimeout(8000);
+
+                               StringBuffer response = new StringBuffer();
+
+                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+                               String inputLine;
+                               while ((inputLine = in.readLine()) != null)
+                                       response.append(inputLine);
+                               JSONObject jObject = new JSONObject(response.toString()); // json
+                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get
+                                                                                                                                               // data
+                                                                                                                                               // object
+                               for (int i = 0; i < jsonUsers.length(); i++) {
+                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
+                                       EPUser eachUser = new EPUser();
+                                       eachUser.setOrgUserId(eachObject.get("id").toString());
+                                       eachUser.setFirstName(eachObject.get("givenName").toString());
+                                       eachUser.setLastName(eachObject.get("familyName").toString());
+                                       eachUser.setEmail(eachObject.get("email").toString());
+                                       users.add(eachUser);
+                               }
+
+                               for (int i = 0; i < users.size(); i++) {
+                                       if (Utilities.nvl(userId).length() > 0) {
+                                               if (!userId.equalsIgnoreCase(users.get(i).getOrgUserId())) {
+                                                       continue;
+                                               }
+                                       }
+                                       filterdUsers.add(users.get(i));
+                               }
+
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed", e);
+                       } finally {
+                               try {
+                                       in.close();
+                                       con.disconnect();
+                               } catch (IOException e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed to close", e);
+                               }
+                       }
+
+                       return filterdUsers;
+
+               } else {
+
+                       List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                       Criterion orgUserIdCriterion = Restrictions.eq("orgUserId",userId);
+                       restrictionsList.add(orgUserIdCriterion);
+                       
+                       List<EPUser> list = (List<EPUser>) dataAccessService.getList(EPUser.class, null, restrictionsList, null);
+
+                       return (list == null || list.size() == 0) ? null : list;
+
+               }
+
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<EPUser> getUserByFirstLastName(String firstName, String lastName) {
+
+               if (!SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
+                       List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                       Criterion firstNameCriterion = Restrictions.eq("firstName", firstName);
+                       Criterion lastNameCriterion = Restrictions.eq("lastName", lastName);
+                       restrictionsList.add(Restrictions.or(firstNameCriterion, lastNameCriterion));
+
+                       List<EPUser> list = (List<EPUser>) dataAccessService.getList(EPUser.class, null, restrictionsList, null);
+                       return (list == null || list.size() == 0) ? null : list;
+
+               } else {
+
+                       List<EPUser> users = new ArrayList<EPUser>();
+                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
+                       BufferedReader in = null;
+                       HttpURLConnection con = null;
+                       try {
+                               String url = EPCommonSystemProperties.getProperty(EPCommonSystemProperties.AUTH_USER_SERVER);
+                               URL obj = new URL(url);
+
+                               con = (HttpURLConnection) obj.openConnection();
+
+                               // optional default is GET
+                               con.setRequestMethod("GET");
+                               con.setConnectTimeout(3000);
+                               con.setReadTimeout(8000);
+
+                               StringBuffer response = new StringBuffer();
+
+                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+                               String inputLine;
+                               while ((inputLine = in.readLine()) != null)
+                                       response.append(inputLine);
+                               JSONObject jObject = new JSONObject(response.toString()); // json
+                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get
+                                                                                                                                               // data
+                                                                                                                                               // object
+                               for (int i = 0; i < jsonUsers.length(); i++) {
+                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
+                                       EPUser eachUser = new EPUser();
+                                       eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
+                                       eachUser.setFirstName(eachObject.get("givenName").toString());
+                                       eachUser.setLastName(eachObject.get("familyName").toString());
+                                       eachUser.setEmail(eachObject.get("email").toString());
+                                       users.add(eachUser);
+                               }
+
+                               for (int i = 0; i < users.size(); i++) {
+
+                                       if (Utilities.nvl(firstName).length() > 0) {
+                                               if (!firstName.equalsIgnoreCase(users.get(i).getFirstName())) {
+                                                       continue;
+                                               }
+                                       }
+                                       if (Utilities.nvl(lastName).length() > 0) {
+                                               if (!lastName.equalsIgnoreCase(users.get(i).getLastName())) {
+                                                       continue;
+                                               }
+                                       }
+
+                                       filterdUsers.add(users.get(i));
+
+                               }
+
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed", e);
+                       } finally {
+                               try {
+                                       in.close();
+                                       con.disconnect();
+                               } catch (IOException e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed to close", e);
+                               }
+                       }
+
+                       return filterdUsers;
+               }
+
+       }
+
+       @SuppressWarnings("unchecked")
+       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception {
+
+               try {
+
+                       List<Criterion> restrictionsList = new ArrayList<Criterion>();
+                       Criterion orgUserIdCriterion = Restrictions.eq("orgUserId",newUser.getLoginId());
+                       restrictionsList.add(orgUserIdCriterion);
+                       List<EPUser> list = (List<EPUser>) dataAccessService.getList(EPUser.class, null, restrictionsList, null);
+                       
+                       if (list == null || list.size() == 0) {
+                               newUser.setActive(true);
+                               newUser.setOrgUserId(newUser.getLoginId());
+                               newUser.setLoginPwd(CipherUtil.encryptPKC(newUser.getLoginPwd()));
+                               getDataAccessService().saveDomainObject(newUser, null);
+                       } else {
+                               if (checkDuplicate.equals("Yes")) {
+                                       // userId already exist in database
+                                       return "Record already exist";
+                               } else {
+
+                                       EPUser oldUser = (EPUser) list.get(0);
+                                       oldUser.setFirstName(newUser.getFirstName());
+                                       oldUser.setLastName(newUser.getLastName());
+                                       oldUser.setMiddleInitial(newUser.getMiddleInitial());
+                                       if (!oldUser.getLoginPwd().equals(newUser.getLoginPwd()))
+                                               oldUser.setLoginPwd(CipherUtil.encryptPKC(newUser.getLoginPwd()));
+                                       else
+                                               oldUser.setLoginPwd(newUser.getLoginPwd());
+                                       getDataAccessService().saveDomainObject(oldUser, null);
+
+                               }
+
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveNewUser failed", e);
+                       throw new Exception(e);
+               }
+               return "success";
+       };
+
+       @Override
+       public void saveUser(EPUser user) throws Exception {
+               getDataAccessService().saveDomainObject(user, null);
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetParameterService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetParameterService.java
new file mode 100644 (file)
index 0000000..782f54b
--- /dev/null
@@ -0,0 +1,82 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.WidgetCatalogParameter;
+
+public interface WidgetParameterService {
+       
+       /**
+        * Saves the specified user-defined widget parameters to the table ep_widget_parameters
+        * 
+        * @param newParameter
+        */
+       void saveUserParameter(WidgetCatalogParameter newParameter);
+       
+       /**
+        * Gets the specified user-defined widget parameter where paramId is used from all users 
+        * 
+        * @param paramId
+        * @return
+        * List of widget parameters
+        */
+       List<WidgetCatalogParameter> getUserParameterById(Long paramId);
+       
+       
+       /**
+        * Deletes the specified user-defined widget parameters from ep_widget_parameters table 
+        * where paramId is used
+        * 
+        * @param paramId
+        */
+       void deleteUserParameterById(Long paramId);
+
+       
+       /**
+        * Gets the specified user-defined widget parameter where paramId is used from the specified
+        * user with userId 
+        * @param widgetId
+        * @param userId
+        * @param paramId
+        * @return WidgetCatalogParameter
+        */
+       WidgetCatalogParameter getUserParamById(Long widgetId, Long userId, Long paramId);
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetParameterServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetParameterServiceImpl.java
new file mode 100644 (file)
index 0000000..e01e2cb
--- /dev/null
@@ -0,0 +1,109 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.portal.domain.WidgetCatalogParameter;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+@Service("widgetParameterService")
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class WidgetParameterServiceImpl implements WidgetParameterService{
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetParameterServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public WidgetCatalogParameter getUserParamById(Long widgetId, Long userId, Long paramId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion widgetIdCrit = Restrictions.eq("widgetId", widgetId);
+               restrictionsList.add(widgetIdCrit);
+               Criterion userIdCrit = Restrictions.eq("userId", userId);
+               restrictionsList.add(userIdCrit);
+               Criterion paramIdCrit = Restrictions.eq("paramId", paramId);
+               restrictionsList.add(paramIdCrit);
+               
+               
+               WidgetCatalogParameter widgetParam = null;
+               List<WidgetCatalogParameter> list = (List<WidgetCatalogParameter>) dataAccessService
+                               .getList(WidgetCatalogParameter.class, null, restrictionsList, null);
+               if(list.size() != 0)
+                       widgetParam = list.get(0);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "getUserParamById: widget parameters: " + widgetParam);
+               return widgetParam;
+       }
+
+       @Override
+       public void saveUserParameter(WidgetCatalogParameter newParameter) {
+               dataAccessService.saveDomainObject(newParameter, null);
+       }
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<WidgetCatalogParameter> getUserParameterById(Long paramId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion paramIdCrit = Restrictions.eq("paramId", paramId);
+               restrictionsList.add(paramIdCrit);
+               List<WidgetCatalogParameter> list = (List<WidgetCatalogParameter>) dataAccessService
+                               .getList(WidgetCatalogParameter.class, null, restrictionsList, null);
+               return list;
+       }
+
+       @Override
+       public void deleteUserParameterById(Long paramId) {
+               Map<String, String> params = new HashMap<String, String>();
+               params.put("paramId", Long.toString(paramId));
+               dataAccessService.executeNamedQuery("deleteWidgetCatalogParameter", params, null);
+               dataAccessService.executeNamedQuery("deleteMicroserviceParameterById", params, null);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetService.java
new file mode 100644 (file)
index 0000000..a529ba8
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.OnboardingWidget;
+
+public interface WidgetService {
+
+       List<OnboardingWidget> getOnboardingWidgets(EPUser user, boolean managed);
+
+       FieldsValidator setOnboardingWidget(EPUser user, OnboardingWidget onboardingWidget);
+
+       FieldsValidator deleteOnboardingWidget(EPUser user, Long onboardingWidgetId);
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/WidgetServiceImpl.java
new file mode 100644 (file)
index 0000000..062e9cb
--- /dev/null
@@ -0,0 +1,310 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletResponse;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Restrictions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EPUserApp;
+import org.onap.portalapp.portal.domain.Widget;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.OnboardingWidget;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+
+@Service("widgetService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class WidgetServiceImpl implements WidgetService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetServiceImpl.class);
+
+       private static final String baseSqlToken = " widget.WIDGET_ID, widget.WDG_NAME, widget.APP_ID, app.APP_NAME, widget.WDG_WIDTH, widget.WDG_HEIGHT, widget.WDG_URL"
+                       + " from FN_WIDGET widget join FN_APP app ON widget.APP_ID = app.APP_ID";
+
+       private String validAppsFilter = "";
+
+       private Long LONG_ECOMP_APP_ID = 1L;
+       private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
+       private static final Long DUBLICATED_FIELD_VALUE_ECOMP_ERROR = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
+
+       private static final String urlField = "url";
+
+       private static final String nameField = "name";
+       @Autowired
+       AdminRolesService adminRolesService;
+       @Autowired
+       private SessionFactory sessionFactory;
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @PostConstruct
+       private void init() {
+               try {
+                       validAppsFilter = " AND app.ENABLED = 'Y' AND app.APP_ID != " + SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID);
+                       ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
+                       LONG_ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID));
+               } catch(Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
+               }
+       }
+       
+       private String sqlWidgetsForAllApps() {
+               return "SELECT" + baseSqlToken + validAppsFilter;
+       }
+
+       private String sqlWidgetsForAllAppsWhereUserIsAdmin(Long userId) {
+               return "SELECT" + baseSqlToken + " join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = app.APP_ID where FN_USER_ROLE.USER_ID = " + userId
+                               + " AND FN_USER_ROLE.ROLE_ID = " + ACCOUNT_ADMIN_ROLE_ID + validAppsFilter;
+       }
+
+       private String sqlWidgetsForAllAppsWhereUserHasAnyRole(Long userId) {
+               return "SELECT DISTINCT" + baseSqlToken + " join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = app.APP_ID where FN_USER_ROLE.USER_ID = "
+                               + userId + validAppsFilter;
+       }
+
+       @SuppressWarnings("unchecked")
+       @Override
+       public List<OnboardingWidget> getOnboardingWidgets(EPUser user, boolean managed) {
+               List<OnboardingWidget> onboardingWidgets = new ArrayList<OnboardingWidget>();
+               String sql = null;
+               if (adminRolesService.isSuperAdmin(user)) {
+                       sql = this.sqlWidgetsForAllApps();
+               } else if (managed) {
+                       if (adminRolesService.isAccountAdmin(user)) {
+                               sql = this.sqlWidgetsForAllAppsWhereUserIsAdmin(user.getId());
+                       }
+               } else if (adminRolesService.isAccountAdmin(user) || adminRolesService.isUser(user)) {
+                       sql = this.sqlWidgetsForAllAppsWhereUserHasAnyRole(user.getId());
+               }
+               if (sql != null) {
+                       onboardingWidgets = dataAccessService.executeSQLQuery(sql, OnboardingWidget.class, null);
+               }
+               return onboardingWidgets;
+       }
+
+       private static final Object syncRests = new Object();
+
+       private boolean isUserAdminOfAppForWidget(boolean superAdmin, Long userId, Long appId) {
+               if (!superAdmin) {
+                       List<EPUserApp> userRoles = getAdminUserRoles(userId, appId);
+                       return (userRoles.size() > 0);
+               }
+               return true;
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<EPUserApp> getAdminUserRoles(Long userId, Long appId) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion userIdCriterion = Restrictions.eq("userId",userId);
+               Criterion roleIDCriterion = Restrictions.eq("role.id",  ACCOUNT_ADMIN_ROLE_ID);
+               Criterion appIDCriterion  = Restrictions.eq("app.id",  appId);
+               restrictionsList.add(Restrictions.and(userIdCriterion, roleIDCriterion,appIDCriterion));
+               return (List<EPUserApp>) dataAccessService.getList(EPUserApp.class, null, restrictionsList, null);
+       }
+
+       private void validateOnboardingWidget(OnboardingWidget onboardingWidget, FieldsValidator fieldsValidator) {
+               
+               List<Widget> widgets = getWidgets(onboardingWidget);
+               boolean dublicatedUrl = false;
+               boolean dublicatedName = false;
+               for (Widget widget : widgets) {
+                       if (onboardingWidget.id != null && onboardingWidget.id.equals(widget.getId())) {
+                               // widget should not be compared with itself
+                               continue;
+                       }
+                       if (!dublicatedUrl && widget.getUrl().equals(onboardingWidget.url)) {
+                               dublicatedUrl = true;
+                               if (dublicatedName) {
+                                       break;
+                               }
+                       }
+                       if (!dublicatedName && widget.getName().equalsIgnoreCase(onboardingWidget.name) && widget.getAppId().equals(onboardingWidget.appId)) {
+                               dublicatedName = true;
+                               if (dublicatedUrl) {
+                                       break;
+                               }
+                       }
+               }
+               if (dublicatedUrl || dublicatedName) {
+                       if (dublicatedUrl) {
+                               fieldsValidator.addProblematicFieldName(urlField);
+                       }
+                       if (dublicatedName) {
+                               fieldsValidator.addProblematicFieldName(nameField);
+                       }
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
+                       fieldsValidator.errorCode = DUBLICATED_FIELD_VALUE_ECOMP_ERROR;
+               }
+       }
+
+       @SuppressWarnings("unchecked")
+       private List<Widget> getWidgets(OnboardingWidget onboardingWidget) {
+               List<Criterion> restrictionsList = new ArrayList<Criterion>();
+               Criterion urlCriterion = Restrictions.eq("url", onboardingWidget.url);
+               Criterion nameCriterion = Restrictions.eq("name", onboardingWidget.name);
+               restrictionsList.add(Restrictions.or(urlCriterion, nameCriterion));
+               return (List<Widget>) dataAccessService.getList(Widget.class, null, restrictionsList, null);
+       }
+
+       private void applyOnboardingWidget(OnboardingWidget onboardingWidget, FieldsValidator fieldsValidator) {
+               boolean result = false;
+               Session localSession = null;
+               Transaction transaction = null;
+               try {
+                       localSession = sessionFactory.openSession();
+                       transaction = localSession.beginTransaction();
+                       Widget widget;
+                       if (onboardingWidget.id == null) {
+                               widget = new Widget();
+                       } else {
+                               widget = (Widget) localSession.get(Widget.class, onboardingWidget.id);
+                       }
+                       widget.setAppId(onboardingWidget.appId);
+                       widget.setName(onboardingWidget.name);
+                       widget.setWidth(onboardingWidget.width);
+                       widget.setHeight(onboardingWidget.height);
+                       widget.setUrl(onboardingWidget.url);
+                       localSession.saveOrUpdate(widget);
+                       transaction.commit();
+                       result = true;
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                       EcompPortalUtils.rollbackTransaction(transaction, "applyOnboardingWidget rollback, exception = " + e);
+               } finally {
+                       EcompPortalUtils.closeLocalSession(localSession, "applyOnboardingWidget");
+               }
+               if (!result) {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+               }
+       }
+
+       private FieldsValidator updateOrSaveWidget(boolean superAdmin, Long userId, OnboardingWidget onboardingWidget) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               if (!this.isUserAdminOfAppForWidget(superAdmin, userId, onboardingWidget.appId)) {
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_FORBIDDEN);
+                       return fieldsValidator;
+               }
+               synchronized (syncRests) {
+                       // onboardingWidget.id is null for POST and not null for PUT
+                       if (onboardingWidget.id == null) {
+                               this.validateOnboardingWidget(onboardingWidget, fieldsValidator);
+                       } else {
+                               Widget widget = (Widget) dataAccessService.getDomainObject(Widget.class, onboardingWidget.id, null);
+                               if (widget == null || widget.getId() == null) {
+                                       // Widget not found
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
+                                       return fieldsValidator;
+                               }
+                               this.validateOnboardingWidget(onboardingWidget, fieldsValidator);
+                       }
+                       if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
+                               this.applyOnboardingWidget(onboardingWidget, fieldsValidator);
+                       }
+               }
+               return fieldsValidator;
+       }
+
+       @Override
+       public FieldsValidator setOnboardingWidget(EPUser user, OnboardingWidget onboardingWidget) {
+               if (onboardingWidget.name.length() == 0 || onboardingWidget.url.length() == 0 || onboardingWidget.appId == null
+                               || onboardingWidget.appId.equals(LONG_ECOMP_APP_ID) || onboardingWidget.width.intValue() <= 0 || onboardingWidget.height.intValue() <= 0) {
+                       if (onboardingWidget.appId.equals(LONG_ECOMP_APP_ID)) {
+                       }
+                       FieldsValidator fieldsValidator = new FieldsValidator();
+                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
+                       return fieldsValidator;
+               }
+               return this.updateOrSaveWidget(adminRolesService.isSuperAdmin(user), user.getId(), onboardingWidget);
+       }
+
+       @Override
+       public FieldsValidator deleteOnboardingWidget(EPUser user, Long onboardingWidgetId) {
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               synchronized (syncRests) {
+                       Widget widget = (Widget) dataAccessService.getDomainObject(Widget.class, onboardingWidgetId, null);
+                       if (widget != null && widget.getId() != null) { // widget exists
+                               if (!this.isUserAdminOfAppForWidget(adminRolesService.isSuperAdmin(user), user.getId(), widget.getAppId())) {
+                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_FORBIDDEN);
+                               } else {
+                                       boolean result = false;
+                                       Session localSession = null;
+                                       Transaction transaction = null;
+                                       try {
+                                               localSession = sessionFactory.openSession();
+                                               transaction = localSession.beginTransaction();
+                                               localSession.delete(localSession.get(Widget.class, onboardingWidgetId));
+                                               transaction.commit();
+                                               result = true;
+                                       } catch (Exception e) {
+                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                                               EcompPortalUtils.rollbackTransaction(transaction, "deleteOnboardingWidget rollback, exception = " + e);
+                                       } finally {
+                                               EcompPortalUtils.closeLocalSession(localSession, "deleteOnboardingWidget");
+                                       }
+                                       if (!result) {
+                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                                       }
+                               }
+                       }
+               }
+               return fieldsValidator;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AllAppsWithRolesForUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AllAppsWithRolesForUser.java
new file mode 100644 (file)
index 0000000..2d2374e
--- /dev/null
@@ -0,0 +1,58 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.List;
+
+public class AllAppsWithRolesForUser {
+
+       public String orgUserId;
+
+       public List<AppWithUserRoles> apps;
+
+       public static class AppWithUserRoles {
+
+               public Long appId;
+
+               public String appName;
+               
+               public List<RoleInAppForUser> appRoles;
+
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/Analytics.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/Analytics.java
new file mode 100644 (file)
index 0000000..deb3629
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Analytics {
+       
+       private String action;
+       private String page;
+       private String function;
+       private String userid;
+       private String type;
+       
+       public String getType() {
+               return type;
+       }
+       public void setType(String type) {
+               this.type = type;
+       }
+       public String getAction() {
+               return action;
+       }
+       public void setAction(String action) {
+               this.action = action;
+       }
+       public String getPage() {
+               return page;
+       }
+       public void setPage(String page) {
+               this.page = page;
+       }
+       public String getFunction() {
+               return function;
+       }
+       public void setFunction(String function) {
+               this.function = function;
+       }
+       public String getUserid() {
+               return userid;
+       }
+       public void setUserid(String userId) {
+               this.userid = userId;
+       }
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppCatalogPersonalization.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppCatalogPersonalization.java
new file mode 100644 (file)
index 0000000..29bba67
--- /dev/null
@@ -0,0 +1,112 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+/**
+ * Model for the object PUT to the controller when the user takes an action on
+ * an application in the catalog.
+ */
+public class AppCatalogPersonalization {
+
+       public Long appId;
+       public Boolean select;
+       public Boolean pending;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public Boolean getSelect() {
+               return select;
+       }
+
+       public void setSelect(Boolean select) {
+               this.select = select;
+       }
+
+       public Boolean getPending() {
+               return pending;
+       }
+
+       public void setPending(Boolean pending) {
+               this.pending = pending;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((pending == null) ? 0 : pending.hashCode());
+               result = prime * result + ((select == null) ? 0 : select.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AppCatalogPersonalization other = (AppCatalogPersonalization) obj;
+               if (appId == null) {
+                       if (other.appId != null)
+                               return false;
+               } else if (!appId.equals(other.appId))
+                       return false;
+               if (pending == null) {
+                       if (other.pending != null)
+                               return false;
+               } else if (!pending.equals(other.pending))
+                       return false;
+               if (select == null) {
+                       if (other.select != null)
+                               return false;
+               } else if (!select.equals(other.select))
+                       return false;
+               return true;
+       }
+
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppNameIdIsAdmin.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppNameIdIsAdmin.java
new file mode 100644 (file)
index 0000000..a554197
--- /dev/null
@@ -0,0 +1,132 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class AppNameIdIsAdmin {
+
+       public Long id;
+
+       public String appName;
+
+       public Boolean isAdmin;
+
+       public Boolean restrictedApp;
+
+       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 Boolean getIsAdmin() {
+               return isAdmin;
+       }
+
+       public void setIsAdmin(Boolean isAdmin) {
+               this.isAdmin = isAdmin;
+       }
+
+       public Boolean getRestrictedApp() {
+               return restrictedApp;
+       }
+
+       public void setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + ((isAdmin == null) ? 0 : isAdmin.hashCode());
+               result = prime * result + ((restrictedApp == null) ? 0 : restrictedApp.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AppNameIdIsAdmin other = (AppNameIdIsAdmin) obj;
+               if (appName == null) {
+                       if (other.appName != null)
+                               return false;
+               } else if (!appName.equals(other.appName))
+                       return false;
+               if (id == null) {
+                       if (other.id != null)
+                               return false;
+               } else if (!id.equals(other.id))
+                       return false;
+               if (isAdmin == null) {
+                       if (other.isAdmin != null)
+                               return false;
+               } else if (!isAdmin.equals(other.isAdmin))
+                       return false;
+               if (restrictedApp == null) {
+                       if (other.restrictedApp != null)
+                               return false;
+               } else if (!restrictedApp.equals(other.restrictedApp))
+                       return false;
+               return true;
+       }
+
+       @Override
+       public String toString() {
+               return "AppNameIdIsAdmin [id=" + id + ", appName=" + appName + ", isAdmin=" + isAdmin + ", restrictedApp="
+                               + restrictedApp + "]";
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppWithRolesForUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppWithRolesForUser.java
new file mode 100644 (file)
index 0000000..b6b1031
--- /dev/null
@@ -0,0 +1,90 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.List;
+
+public class AppWithRolesForUser {
+
+       public String orgUserId;
+
+       public Long appId;
+
+       public String appName;
+
+       public List<RoleInAppForUser> appRoles;
+
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+
+       public List<RoleInAppForUser> getAppRoles() {
+               return appRoles;
+       }
+
+       public void setAppRoles(List<RoleInAppForUser> appRoles) {
+               this.appRoles = appRoles;
+       }
+
+       @Override
+       public String toString() {
+               return "AppWithRolesForUser [orgUserId=" + orgUserId + ", appId=" + appId + ", appName=" + appName
+                               + ", appRoles=" + appRoles + "]";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppsListWithAdminRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/AppsListWithAdminRole.java
new file mode 100644 (file)
index 0000000..67189fa
--- /dev/null
@@ -0,0 +1,104 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.ArrayList;
+
+public class AppsListWithAdminRole {
+
+       public String orgUserId;
+
+       public ArrayList<AppNameIdIsAdmin> appsRoles;
+
+       public AppsListWithAdminRole() {
+               appsRoles = new ArrayList<AppNameIdIsAdmin>();
+       }
+
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+
+       public ArrayList<AppNameIdIsAdmin> getAppsRoles() {
+               return appsRoles;
+       }
+
+       public void setAppsRoles(ArrayList<AppNameIdIsAdmin> appsRoles) {
+               this.appsRoles = appsRoles;
+       }
+
+       @Override
+       public String toString() {
+               return "AppsListWithAdminRole [orgUserId=" + orgUserId + ", appsRoles=" + appsRoles + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appsRoles == null) ? 0 : appsRoles.hashCode());
+               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               AppsListWithAdminRole other = (AppsListWithAdminRole) obj;
+               if (appsRoles == null) {
+                       if (other.appsRoles != null)
+                               return false;
+               } else if (!appsRoles.equals(other.appsRoles))
+                       return false;
+               if (orgUserId == null) {
+                       if (other.orgUserId != null)
+                               return false;
+               } else if (!orgUserId.equals(other.orgUserId))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BulkUploadRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BulkUploadRoleFunction.java
new file mode 100644 (file)
index 0000000..9457242
--- /dev/null
@@ -0,0 +1,105 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BulkUploadRoleFunction implements Serializable{
+       
+
+       private static final long serialVersionUID = -1880947347092068841L;
+       
+       @Id
+       @Column(name="function_name")
+       private String functionName;
+       @Id
+       @Column(name="function_cd")
+       private String functionCd;
+       
+       public String getFunctionName() {
+               return functionName;
+       }
+       public void setFunctionName(String functionName) {
+               this.functionName = functionName;
+       }
+       public String getFunctionCd() {
+               return functionCd;
+       }
+       public void setFunctionCd(String functionCd) {
+               this.functionCd = functionCd;
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((functionCd == null) ? 0 : functionCd.hashCode());
+               result = prime * result + ((functionName == null) ? 0 : functionName.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               BulkUploadRoleFunction other = (BulkUploadRoleFunction) obj;
+               if (functionCd == null) {
+                       if (other.functionCd != null)
+                               return false;
+               } else if (!functionCd.equals(other.functionCd))
+                       return false;
+               if (functionName == null) {
+                       if (other.functionName != null)
+                               return false;
+               } else if (!functionName.equals(other.functionName))
+                       return false;
+               return true;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BulkUploadUserRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BulkUploadUserRoles.java
new file mode 100644 (file)
index 0000000..67260af
--- /dev/null
@@ -0,0 +1,120 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BulkUploadUserRoles implements Serializable{
+
+       private static final long serialVersionUID = -7478654947593502185L;
+       
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+       @Id
+       @Column(name="org_user_id")
+       private String orgUserId;
+       @Id
+       @Column(name="auth_namespace")
+       private String appNameSpace;
+       
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+       public String getAppNameSpace() {
+               return appNameSpace;
+       }
+       public void setAppNameSpace(String appNameSpace) {
+               this.appNameSpace = appNameSpace;
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appNameSpace == null) ? 0 : appNameSpace.hashCode());
+               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
+               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               BulkUploadUserRoles other = (BulkUploadUserRoles) obj;
+               if (appNameSpace == null) {
+                       if (other.appNameSpace != null)
+                               return false;
+               } else if (!appNameSpace.equals(other.appNameSpace))
+                       return false;
+               if (orgUserId == null) {
+                       if (other.orgUserId != null)
+                               return false;
+               } else if (!orgUserId.equals(other.orgUserId))
+                       return false;
+               if (roleName == null) {
+                       if (other.roleName != null)
+                               return false;
+               } else if (!roleName.equals(other.roleName))
+                       return false;
+               return true;
+       }
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRole.java
new file mode 100644 (file)
index 0000000..a913236
--- /dev/null
@@ -0,0 +1,126 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BusinessCardApplicationRole implements Serializable{
+       
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
+
+
+       public BusinessCardApplicationRole() {
+       }
+
+       
+    @Id
+       @Column(name="app_name")
+       private String appName;
+       
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+
+
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+
+       @Override
+       public String toString() {
+               return "BusinessCardUserApplicationRoles [appName=" + appName + ", roleName=" + roleName + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
+               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               BusinessCardApplicationRole other = (BusinessCardApplicationRole) obj;
+               if (appName == null) {
+                       if (other.appName != null)
+                               return false;
+               } else if (!appName.equals(other.appName))
+                       return false;
+               if (roleName == null) {
+                       if (other.roleName != null)
+                               return false;
+               } else if (!roleName.equals(other.roleName))
+                       return false;
+               return true;
+       }       
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRolesList.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRolesList.java
new file mode 100644 (file)
index 0000000..e17e53e
--- /dev/null
@@ -0,0 +1,104 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BusinessCardApplicationRolesList {
+
+       public BusinessCardApplicationRolesList(){}
+
+    private String appName;
+       private List<String> roleNames;
+
+
+       public String getAppName() {
+               return appName;
+       }
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+       public List<String> getRoleNames() {
+               return roleNames;
+       }
+       public void setRoleNames(List<String> roleNames) {
+               this.roleNames = roleNames;
+       }
+       public BusinessCardApplicationRolesList(String appName, List<String> roleNames) {
+               super();
+               this.appName = appName;
+               this.roleNames = roleNames;
+       }
+       @Override
+       public String toString() {
+               return "BusinessCardUserAppRoles [appName=" + appName + ", roleNames=" + roleNames + "]";
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
+               result = prime * result + ((roleNames == null) ? 0 : roleNames.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               BusinessCardApplicationRolesList other = (BusinessCardApplicationRolesList) obj;
+               if (appName == null) {
+                       if (other.appName != null)
+                               return false;
+               } else if (!appName.equals(other.appName))
+                       return false;
+               if (roleNames == null) {
+                       if (other.roleNames != null)
+                               return false;
+               } else if (!roleNames.equals(other.roleNames))
+                       return false;
+               return true;
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralApp.java
new file mode 100644 (file)
index 0000000..6fcc0dc
--- /dev/null
@@ -0,0 +1,400 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class CentralApp implements Serializable{
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -3325965646585871632L;
+       private Long id;
+       private Date created;
+       private Date modified;
+       private Long createdId;
+       private Long modifiedId;
+       private Long rowNum;
+       private String name; // app_name
+       private String imageUrl; // app_image_url
+       private String description; // app_description
+       private String notes; // app_notes
+       private String url; // app_url
+       private String alternateUrl; // app_alternate_url
+       private String restEndpoint; // app_rest_endpoint
+       private String mlAppName; // ml_app_name
+       private String mlAppAdminId; // ml_app_admin_id;
+       private String motsId; // mots_id
+       private String appPassword; // app_password
+       private String open;
+       private String enabled;
+       private byte[] thumbnail;
+       private String username; // app_username
+       private String uebKey; // ueb_key
+       private String uebSecret; // ueb_secret
+       private String uebTopicName; // ueb_topic_name
+       
+       public CentralApp(){
+               
+       }
+
+       public CentralApp(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
+                       String imageUrl, String description, String notes, String url, String alternateUrl, String restEndpoint,
+                       String mlAppName, String mlAppAdminId, String motsId, String appPassword, String open, String enabled,
+                       byte[] thumbnail, String username, String uebKey, String uebSecret, String uebTopicName) {
+               super();
+               this.id = id;
+               this.created = created;
+               this.modified = modified;
+               this.createdId = createdId;
+               this.modifiedId = modifiedId;
+               this.rowNum = rowNum;
+               this.name = name;
+               this.imageUrl = imageUrl;
+               this.description = description;
+               this.notes = notes;
+               this.url = url;
+               this.alternateUrl = alternateUrl;
+               this.restEndpoint = restEndpoint;
+               this.mlAppName = mlAppName;
+               this.mlAppAdminId = mlAppAdminId;
+               this.motsId = motsId;
+               this.appPassword = appPassword;
+               this.open = open;
+               this.enabled = enabled;
+               this.thumbnail = thumbnail;
+               this.username = username;
+               this.uebKey = uebKey;
+               this.uebSecret = uebSecret;
+               this.uebTopicName = uebTopicName;
+       }
+       
+       public Long getId() {
+               return id;
+       }
+       public void setId(Long id) {
+               this.id = id;
+       }
+       
+       public Date getCreated() {
+               return created;
+       }
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+       public Date getModified() {
+               return modified;
+       }
+       public void setModified(Date modified) {
+               this.modified = modified;
+       }
+       public Long getCreatedId() {
+               return createdId;
+       }
+       public void setCreatedId(Long createdId) {
+               this.createdId = createdId;
+       }
+       public Long getModifiedId() {
+               return modifiedId;
+       }
+       public void setModifiedId(Long modifiedId) {
+               this.modifiedId = modifiedId;
+       }
+       public Long getRowNum() {
+               return rowNum;
+       }
+       public void setRowNum(Long rowNum) {
+               this.rowNum = rowNum;
+       }
+       public String getName() {
+               return name;
+       }
+       public void setName(String name) {
+               this.name = name;
+       }
+       public String getImageUrl() {
+               return imageUrl;
+       }
+       public void setImageUrl(String imageUrl) {
+               this.imageUrl = imageUrl;
+       }
+       public String getDescription() {
+               return description;
+       }
+       public void setDescription(String description) {
+               this.description = description;
+       }
+       public String getNotes() {
+               return notes;
+       }
+       public void setNotes(String notes) {
+               this.notes = notes;
+       }
+       public String getUrl() {
+               return url;
+       }
+       public void setUrl(String url) {
+               this.url = url;
+       }
+       public String getAlternateUrl() {
+               return alternateUrl;
+       }
+       public void setAlternateUrl(String alternateUrl) {
+               this.alternateUrl = alternateUrl;
+       }
+       public String getRestEndpoint() {
+               return restEndpoint;
+       }
+       public void setRestEndpoint(String restEndpoint) {
+               this.restEndpoint = restEndpoint;
+       }
+       public String getMlAppName() {
+               return mlAppName;
+       }
+       public void setMlAppName(String mlAppName) {
+               this.mlAppName = mlAppName;
+       }
+       public String getMlAppAdminId() {
+               return mlAppAdminId;
+       }
+       public void setMlAppAdminId(String mlAppAdminId) {
+               this.mlAppAdminId = mlAppAdminId;
+       }
+       public String getMotsId() {
+               return motsId;
+       }
+       public void setMotsId(String motsId) {
+               this.motsId = motsId;
+       }
+       public String getAppPassword() {
+               return appPassword;
+       }
+       public void setAppPassword(String appPassword) {
+               this.appPassword = appPassword;
+       }
+       public String getOpen() {
+               return open;
+       }
+       public void setOpen(String open) {
+               this.open = open;
+       }
+       public String getEnabled() {
+               return enabled;
+       }
+       public void setEnabled(String enabled) {
+               this.enabled = enabled;
+       }
+       public byte[] getThumbnail() {
+               return thumbnail;
+       }
+       public void setThumbnail(byte[] thumbnail) {
+               this.thumbnail = thumbnail;
+       }
+       public String getUsername() {
+               return username;
+       }
+       public void setUsername(String username) {
+               this.username = username;
+       }
+       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 String getUebTopicName() {
+               return uebTopicName;
+       }
+       public void setUebTopicName(String uebTopicName) {
+               this.uebTopicName = uebTopicName;
+       }
+
+       @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 + ((createdId == null) ? 0 : createdId.hashCode());
+               result = prime * result + ((description == null) ? 0 : description.hashCode());
+               result = prime * result + ((enabled == null) ? 0 : enabled.hashCode());
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
+               result = prime * result + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode());
+               result = prime * result + ((mlAppName == null) ? 0 : mlAppName.hashCode());
+               result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
+               result = prime * result + ((motsId == null) ? 0 : motsId.hashCode());
+               result = prime * result + ((name == null) ? 0 : name.hashCode());
+               result = prime * result + ((notes == null) ? 0 : notes.hashCode());
+               result = prime * result + ((open == null) ? 0 : open.hashCode());
+               result = prime * result + ((restEndpoint == null) ? 0 : restEndpoint.hashCode());
+               result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
+               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());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               CentralApp other = (CentralApp) obj;
+               if (alternateUrl == null) {
+                       if (other.alternateUrl != null)
+                               return false;
+               } else if (!alternateUrl.equals(other.alternateUrl))
+                       return false;
+               if (appPassword == null) {
+                       if (other.appPassword != null)
+                               return false;
+               } else if (!appPassword.equals(other.appPassword))
+                       return false;
+               if (createdId == null) {
+                       if (other.createdId != null)
+                               return false;
+               } else if (!createdId.equals(other.createdId))
+                       return false;
+               if (description == null) {
+                       if (other.description != null)
+                               return false;
+               } else if (!description.equals(other.description))
+                       return false;
+               if (enabled == null) {
+                       if (other.enabled != null)
+                               return false;
+               } else if (!enabled.equals(other.enabled))
+                       return false;
+               if (id == null) {
+                       if (other.id != null)
+                               return false;
+               } else if (!id.equals(other.id))
+                       return false;
+               if (imageUrl == null) {
+                       if (other.imageUrl != null)
+                               return false;
+               } else if (!imageUrl.equals(other.imageUrl))
+                       return false;
+               if (mlAppAdminId == null) {
+                       if (other.mlAppAdminId != null)
+                               return false;
+               } else if (!mlAppAdminId.equals(other.mlAppAdminId))
+                       return false;
+               if (mlAppName == null) {
+                       if (other.mlAppName != null)
+                               return false;
+               } else if (!mlAppName.equals(other.mlAppName))
+                       return false;
+               if (modifiedId == null) {
+                       if (other.modifiedId != null)
+                               return false;
+               } else if (!modifiedId.equals(other.modifiedId))
+                       return false;
+               if (motsId == null) {
+                       if (other.motsId != null)
+                               return false;
+               } else if (!motsId.equals(other.motsId))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       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 (restEndpoint == null) {
+                       if (other.restEndpoint != null)
+                               return false;
+               } else if (!restEndpoint.equals(other.restEndpoint))
+                       return false;
+               if (rowNum == null) {
+                       if (other.rowNum != null)
+                               return false;
+               } else if (!rowNum.equals(other.rowNum))
+                       return false;
+               if (uebKey == null) {
+                       if (other.uebKey != null)
+                               return false;
+               } else if (!uebKey.equals(other.uebKey))
+                       return false;
+               if (uebSecret == null) {
+                       if (other.uebSecret != null)
+                               return false;
+               } else if (!uebSecret.equals(other.uebSecret))
+                       return false;
+               if (uebTopicName == null) {
+                       if (other.uebTopicName != null)
+                               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)
+                               return false;
+               } else if (!username.equals(other.username))
+                       return false;
+               return true;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java
new file mode 100644 (file)
index 0000000..dc1a78f
--- /dev/null
@@ -0,0 +1,279 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+public class CentralRole implements Serializable {
+
+       private static final long serialVersionUID = -9210905386086213882L;
+       private Long id;
+       private Date created;
+       private Date modified;
+       private Long createdId;
+       private Long modifiedId;
+       private Long rowNum;
+
+       private String name;
+       private boolean active;
+       private Integer priority;
+
+       private SortedSet<CentralRoleFunction> roleFunctions = new TreeSet<>();
+
+       private SortedSet<CentralRole> childRoles = new TreeSet<>();
+
+       private SortedSet<CentralRole> parentRoles = new TreeSet<>();
+
+       public CentralRole(){
+               
+       }
+       
+       public CentralRole(Long id, String name, boolean active, Integer priority,
+                       SortedSet<CentralRoleFunction> roleFunctions) {
+               super();
+               this.id = id;
+               this.name = name;
+               this.active = active;
+               this.priority = priority;
+               this.roleFunctions = roleFunctions;
+       }
+       
+       
+
+       public CentralRole(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
+                       boolean active, Integer priority, SortedSet<CentralRoleFunction> roleFunctions,
+                       SortedSet<CentralRole> childRoles, SortedSet<CentralRole> parentRoles) {
+               super();
+               this.id = id;
+               this.created = created;
+               this.modified = modified;
+               this.createdId = createdId;
+               this.modifiedId = modifiedId;
+               this.rowNum = rowNum;
+               this.name = name;
+               this.active = active;
+               this.priority = priority;
+               this.roleFunctions = roleFunctions;
+               this.childRoles = childRoles;
+               this.parentRoles = parentRoles;
+       }
+
+       /**
+        * @return the id
+        */
+       public Long getId() {
+               return id;
+       }
+
+       /**
+        * @param id
+        *            the id to set
+        */
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       /**
+        * @return the created
+        */
+       public Date getCreated() {
+               return created;
+       }
+
+       /**
+        * @param created
+        *            the created to set
+        */
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+
+       /**
+        * @return the modified
+        */
+       public Date getModified() {
+               return modified;
+       }
+
+       /**
+        * @param modified
+        *            the modified to set
+        */
+       public void setModified(Date modified) {
+               this.modified = modified;
+       }
+
+       /**
+        * @return the createdId
+        */
+       public Long getCreatedId() {
+               return createdId;
+       }
+
+       /**
+        * @param createdId
+        *            the createdId to set
+        */
+       public void setCreatedId(Long createdId) {
+               this.createdId = createdId;
+       }
+
+       /**
+        * @return the modifiedId
+        */
+       public Long getModifiedId() {
+               return modifiedId;
+       }
+
+       /**
+        * @param modifiedId
+        *            the modifiedId to set
+        */
+       public void setModifiedId(Long modifiedId) {
+               this.modifiedId = modifiedId;
+       }
+
+       /**
+        * @return the rowNum
+        */
+       public Long getRowNum() {
+               return rowNum;
+       }
+
+       /**
+        * @param rowNum
+        *            the rowNum to set
+        */
+       public void setRowNum(Long rowNum) {
+               this.rowNum = rowNum;
+       }
+
+       /**
+        * @return the name
+        */
+       public String getName() {
+               return name;
+       }
+
+       /**
+        * @param name
+        *            the name to set
+        */
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       /**
+        * @return the active
+        */
+       public boolean isActive() {
+               return active;
+       }
+
+       /**
+        * @param active
+        *            the active to set
+        */
+       public void setActive(boolean active) {
+               this.active = active;
+       }
+
+       /**
+        * @return the priority
+        */
+       public Integer getPriority() {
+               return priority;
+       }
+
+       /**
+        * @param priority
+        *            the priority to set
+        */
+       public void setPriority(Integer priority) {
+               this.priority = priority;
+       }
+
+       /**
+        * @return the roleFunctions
+        */
+       public SortedSet<CentralRoleFunction> getRoleFunctions() {
+               return roleFunctions;
+       }
+
+       /**
+        * @param roleFunctions
+        *            the roleFunctions to set
+        */
+       public void setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
+               this.roleFunctions = roleFunctions;
+       }
+
+       /**
+        * @return the childRoles
+        */
+       public SortedSet<CentralRole> getChildRoles() {
+               return childRoles;
+       }
+
+       /**
+        * @param childRoles
+        *            the childRoles to set
+        */
+       public void setChildRoles(SortedSet<CentralRole> childRoles) {
+               this.childRoles = childRoles;
+       }
+
+       /**
+        * @return the parentRoles
+        */
+       public SortedSet<CentralRole> getParentRoles() {
+               return parentRoles;
+       }
+
+       /**
+        * @param parentRoles
+        *            the parentRoles to set
+        */
+       public void setParentRoles(SortedSet<CentralRole> parentRoles) {
+               this.parentRoles = parentRoles;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRoleFunction.java
new file mode 100644 (file)
index 0000000..6cc474a
--- /dev/null
@@ -0,0 +1,251 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@SuppressWarnings("rawtypes")
+public class CentralRoleFunction implements Serializable, Comparable {
+       private static final long serialVersionUID = 1990254299529285610L;
+       private Long id;
+       private Date created;
+       private Date modified;
+       private Long createdId;
+       private Long modifiedId;
+       private Serializable auditUserId;
+       private Set auditTrail;
+       private Long rowNum;
+       private String code;
+       private String name;
+       private String editUrl;
+
+       public CentralRoleFunction(String code, String name) {
+               super();
+               this.code = code;
+               this.name = name;
+       }
+
+       public CentralRoleFunction() {
+       }
+
+       /**
+        * @return the id
+        */
+       public Long getId() {
+               return id;
+       }
+
+       /**
+        * @param id
+        *            the id to set
+        */
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       /**
+        * @return the created
+        */
+       public Date getCreated() {
+               return created;
+       }
+
+       /**
+        * @param created
+        *            the created to set
+        */
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+
+       /**
+        * @return the modified
+        */
+       public Date getModified() {
+               return modified;
+       }
+
+       /**
+        * @param modified
+        *            the modified to set
+        */
+       public void setModified(Date modified) {
+               this.modified = modified;
+       }
+
+       /**
+        * @return the createdId
+        */
+       public Long getCreatedId() {
+               return createdId;
+       }
+
+       /**
+        * @param createdId
+        *            the createdId to set
+        */
+       public void setCreatedId(Long createdId) {
+               this.createdId = createdId;
+       }
+
+       /**
+        * @return the modifiedId
+        */
+       public Long getModifiedId() {
+               return modifiedId;
+       }
+
+       /**
+        * @param modifiedId
+        *            the modifiedId to set
+        */
+       public void setModifiedId(Long modifiedId) {
+               this.modifiedId = modifiedId;
+       }
+
+       /**
+        * @return the rowNum
+        */
+       public Long getRowNum() {
+               return rowNum;
+       }
+
+       /**
+        * @param rowNum
+        *            the rowNum to set
+        */
+       public void setRowNum(Long rowNum) {
+               this.rowNum = rowNum;
+       }
+
+       /**
+        * @return the code
+        */
+       public String getCode() {
+               return code;
+       }
+
+       /**
+        * @param code
+        *            the code to set
+        */
+       public void setCode(String code) {
+               this.code = code;
+       }
+
+       /**
+        * @return the name
+        */
+       public String getName() {
+               return name;
+       }
+
+       /**
+        * @param name
+        *            the name to set
+        */
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public Serializable getAuditUserId() {
+               return auditUserId;
+       }
+
+       public void setAuditUserId(Serializable auditUserId) {
+               this.auditUserId = auditUserId;
+       }
+
+       public Set getAuditTrail() {
+               return auditTrail;
+       }
+
+       public void setAuditTrail(Set auditTrail) {
+               this.auditTrail = auditTrail;
+       }
+
+       public String getEditUrl() {
+               return editUrl;
+       }
+
+       public void setEditUrl(String editUrl) {
+               this.editUrl = editUrl;
+       }
+
+       @Override
+       public int compareTo(Object obj) {
+               String c1 = getName();
+               String c2 = ((CentralRoleFunction) obj).getName();
+
+               return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((code == null) ? 0 : code.hashCode());
+               result = prime * result + ((name == null) ? 0 : name.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               CentralRoleFunction other = (CentralRoleFunction) obj;
+               if (code == null) {
+                       if (other.code != null)
+                               return false;
+               } else if (!code.equals(other.code))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralUser.java
new file mode 100644 (file)
index 0000000..3b94d11
--- /dev/null
@@ -0,0 +1,965 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+import java.util.TreeSet;
+
+public class CentralUser implements Serializable {
+
+       private static final long serialVersionUID = 7060454665330579923L;
+       private Long id;
+       private Date created;
+       private Date modified;
+       private Long createdId;
+       private Long modifiedId;
+       private Long rowNum;
+
+       private Long orgId;
+       private Long managerId;
+       private String firstName;
+       private String middleInitial;
+       private String lastName;
+       private String phone;
+       private String fax;
+       private String cellular;
+       private String email;
+       private Long addressId;
+       private String alertMethodCd;
+       private String hrid;
+       private String orgUserId;
+       private String orgCode;
+       private String address1;
+       private String address2;
+       private String city;
+       private String state;
+       private String zipCode;
+       private String country;
+       private String orgManagerUserId;
+       private String locationClli;
+       private String businessCountryCode;
+       private String businessCountryName;
+       private String businessUnit;
+       private String businessUnitName;
+       private String department;
+       private String departmentName;
+       private String companyCode;
+       private String company;
+       private String zipCodeSuffix;
+       private String jobTitle;
+       private String commandChain;
+       private String siloStatus;
+       private String costCenter;
+       private String financialLocCode;
+
+       private String loginId;
+       private String loginPwd;
+       private Date lastLoginDate;
+       private boolean active;
+       private boolean internal;
+       private Long selectedProfileId;
+       private Long timeZoneId;
+       private boolean online;
+       private String chatId;
+
+       private Set<CentralUserApp> userApps = new TreeSet<>();
+       private Set<CentralRole> pseudoRoles = new TreeSet<>();
+
+       public CentralUser(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, Long orgId,
+                       Long managerId, String firstName, String middleInitial, String lastName, String phone, String fax,
+                       String cellular, String email, Long addressId, String alertMethodCd, String hrid, String orgUserId,
+                       String orgCode, String address1, String address2, String city, String state, String zipCode, String country,
+                       String orgManagerUserId, String locationClli, String businessCountryCode, String businessCountryName,
+                       String businessUnit, String businessUnitName, String department, String departmentName, String companyCode,
+                       String company, String zipCodeSuffix, String jobTitle, String commandChain, String siloStatus,
+                       String costCenter, String financialLocCode, String loginId, String loginPwd, Date lastLoginDate,
+                       boolean active, boolean internal, Long selectedProfileId, Long timeZoneId, boolean online, String chatId,
+                       Set<CentralUserApp> userApps) {
+               super();
+               this.id = id;
+               this.created = created;
+               this.modified = modified;
+               this.createdId = createdId;
+               this.modifiedId = modifiedId;
+               this.rowNum = rowNum;
+               this.orgId = orgId;
+               this.managerId = managerId;
+               this.firstName = firstName;
+               this.middleInitial = middleInitial;
+               this.lastName = lastName;
+               this.phone = phone;
+               this.fax = fax;
+               this.cellular = cellular;
+               this.email = email;
+               this.addressId = addressId;
+               this.alertMethodCd = alertMethodCd;
+               this.hrid = hrid;
+               this.orgUserId = orgUserId;
+               this.orgCode = orgCode;
+               this.address1 = address1;
+               this.address2 = address2;
+               this.city = city;
+               this.state = state;
+               this.zipCode = zipCode;
+               this.country = country;
+               this.orgManagerUserId = orgManagerUserId;
+               this.locationClli = locationClli;
+               this.businessCountryCode = businessCountryCode;
+               this.businessCountryName = businessCountryName;
+               this.businessUnit = businessUnit;
+               this.businessUnitName = businessUnitName;
+               this.department = department;
+               this.departmentName = departmentName;
+               this.companyCode = companyCode;
+               this.company = company;
+               this.zipCodeSuffix = zipCodeSuffix;
+               this.jobTitle = jobTitle;
+               this.commandChain = commandChain;
+               this.siloStatus = siloStatus;
+               this.costCenter = costCenter;
+               this.financialLocCode = financialLocCode;
+               this.loginId = loginId;
+               this.loginPwd = loginPwd;
+               this.lastLoginDate = lastLoginDate;
+               this.active = active;
+               this.internal = internal;
+               this.selectedProfileId = selectedProfileId;
+               this.timeZoneId = timeZoneId;
+               this.online = online;
+               this.chatId = chatId;
+               this.userApps = userApps;
+       }
+
+       /**
+        * @return the id
+        */
+       public Long getId() {
+               return id;
+       }
+
+       /**
+        * @param id
+        *            the id to set
+        */
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       /**
+        * @return the created
+        */
+       public Date getCreated() {
+               return created;
+       }
+
+       /**
+        * @param created
+        *            the created to set
+        */
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+
+       /**
+        * @return the modified
+        */
+       public Date getModified() {
+               return modified;
+       }
+
+       /**
+        * @param modified
+        *            the modified to set
+        */
+       public void setModified(Date modified) {
+               this.modified = modified;
+       }
+
+       /**
+        * @return the createdId
+        */
+       public Long getCreatedId() {
+               return createdId;
+       }
+
+       /**
+        * @param createdId
+        *            the createdId to set
+        */
+       public void setCreatedId(Long createdId) {
+               this.createdId = createdId;
+       }
+
+       /**
+        * @return the modifiedId
+        */
+       public Long getModifiedId() {
+               return modifiedId;
+       }
+
+       /**
+        * @param modifiedId
+        *            the modifiedId to set
+        */
+       public void setModifiedId(Long modifiedId) {
+               this.modifiedId = modifiedId;
+       }
+
+       /**
+        * @return the rowNum
+        */
+       public Long getRowNum() {
+               return rowNum;
+       }
+
+       /**
+        * @param rowNum
+        *            the rowNum to set
+        */
+       public void setRowNum(Long rowNum) {
+               this.rowNum = rowNum;
+       }
+
+       /**
+        * @return the orgId
+        */
+       public Long getOrgId() {
+               return orgId;
+       }
+
+       /**
+        * @param orgId
+        *            the orgId to set
+        */
+       public void setOrgId(Long orgId) {
+               this.orgId = orgId;
+       }
+
+       /**
+        * @return the managerId
+        */
+       public Long getManagerId() {
+               return managerId;
+       }
+
+       /**
+        * @param managerId
+        *            the managerId to set
+        */
+       public void setManagerId(Long managerId) {
+               this.managerId = managerId;
+       }
+
+       /**
+        * @return the firstName
+        */
+       public String getFirstName() {
+               return firstName;
+       }
+
+       /**
+        * @param firstName
+        *            the firstName to set
+        */
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       /**
+        * @return the middleInitial
+        */
+       public String getMiddleInitial() {
+               return middleInitial;
+       }
+
+       /**
+        * @param middleInitial
+        *            the middleInitial to set
+        */
+       public void setMiddleInitial(String middleInitial) {
+               this.middleInitial = middleInitial;
+       }
+
+       /**
+        * @return the lastName
+        */
+       public String getLastName() {
+               return lastName;
+       }
+
+       /**
+        * @param lastName
+        *            the lastName to set
+        */
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+
+       /**
+        * @return the phone
+        */
+       public String getPhone() {
+               return phone;
+       }
+
+       /**
+        * @param phone
+        *            the phone to set
+        */
+       public void setPhone(String phone) {
+               this.phone = phone;
+       }
+
+       /**
+        * @return the fax
+        */
+       public String getFax() {
+               return fax;
+       }
+
+       /**
+        * @param fax
+        *            the fax to set
+        */
+       public void setFax(String fax) {
+               this.fax = fax;
+       }
+
+       /**
+        * @return the cellular
+        */
+       public String getCellular() {
+               return cellular;
+       }
+
+       /**
+        * @param cellular
+        *            the cellular to set
+        */
+       public void setCellular(String cellular) {
+               this.cellular = cellular;
+       }
+
+       /**
+        * @return the email
+        */
+       public String getEmail() {
+               return email;
+       }
+
+       /**
+        * @param email
+        *            the email to set
+        */
+       public void setEmail(String email) {
+               this.email = email;
+       }
+
+       /**
+        * @return the addressId
+        */
+       public Long getAddressId() {
+               return addressId;
+       }
+
+       /**
+        * @param addressId
+        *            the addressId to set
+        */
+       public void setAddressId(Long addressId) {
+               this.addressId = addressId;
+       }
+
+       /**
+        * @return the alertMethodCd
+        */
+       public String getAlertMethodCd() {
+               return alertMethodCd;
+       }
+
+       /**
+        * @param alertMethodCd
+        *            the alertMethodCd to set
+        */
+       public void setAlertMethodCd(String alertMethodCd) {
+               this.alertMethodCd = alertMethodCd;
+       }
+
+       /**
+        * @return the hrid
+        */
+       public String getHrid() {
+               return hrid;
+       }
+
+       /**
+        * @param hrid
+        *            the hrid to set
+        */
+       public void setHrid(String hrid) {
+               this.hrid = hrid;
+       }
+
+       /**
+        * @return the orgUserId
+        */
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       /**
+        * @param orgUserId
+        *            the orgUserId to set
+        */
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+
+       /**
+        * @return the orgCode
+        */
+       public String getOrgCode() {
+               return orgCode;
+       }
+
+       /**
+        * @param orgCode
+        *            the orgCode to set
+        */
+       public void setOrgCode(String orgCode) {
+               this.orgCode = orgCode;
+       }
+
+       /**
+        * @return the address1
+        */
+       public String getAddress1() {
+               return address1;
+       }
+
+       /**
+        * @param address1
+        *            the address1 to set
+        */
+       public void setAddress1(String address1) {
+               this.address1 = address1;
+       }
+
+       /**
+        * @return the address2
+        */
+       public String getAddress2() {
+               return address2;
+       }
+
+       /**
+        * @param address2
+        *            the address2 to set
+        */
+       public void setAddress2(String address2) {
+               this.address2 = address2;
+       }
+
+       /**
+        * @return the city
+        */
+       public String getCity() {
+               return city;
+       }
+
+       /**
+        * @param city
+        *            the city to set
+        */
+       public void setCity(String city) {
+               this.city = city;
+       }
+
+       /**
+        * @return the state
+        */
+       public String getState() {
+               return state;
+       }
+
+       /**
+        * @param state
+        *            the state to set
+        */
+       public void setState(String state) {
+               this.state = state;
+       }
+
+       /**
+        * @return the zipCode
+        */
+       public String getZipCode() {
+               return zipCode;
+       }
+
+       /**
+        * @param zipCode
+        *            the zipCode to set
+        */
+       public void setZipCode(String zipCode) {
+               this.zipCode = zipCode;
+       }
+
+       /**
+        * @return the country
+        */
+       public String getCountry() {
+               return country;
+       }
+
+       /**
+        * @param country
+        *            the country to set
+        */
+       public void setCountry(String country) {
+               this.country = country;
+       }
+
+       /**
+        * @return the orgManagerUserId
+        */
+       public String getOrgManagerUserId() {
+               return orgManagerUserId;
+       }
+
+       /**
+        * @param orgManagerUserId
+        *            the orgManagerUserId to set
+        */
+       public void setOrgManagerUserId(String orgManagerUserId) {
+               this.orgManagerUserId = orgManagerUserId;
+       }
+
+       /**
+        * @return the locationClli
+        */
+       public String getLocationClli() {
+               return locationClli;
+       }
+
+       /**
+        * @param locationClli
+        *            the locationClli to set
+        */
+       public void setLocationClli(String locationClli) {
+               this.locationClli = locationClli;
+       }
+
+       /**
+        * @return the businessCountryCode
+        */
+       public String getBusinessCountryCode() {
+               return businessCountryCode;
+       }
+
+       /**
+        * @param businessCountryCode
+        *            the businessCountryCode to set
+        */
+       public void setBusinessCountryCode(String businessCountryCode) {
+               this.businessCountryCode = businessCountryCode;
+       }
+
+       /**
+        * @return the businessCountryName
+        */
+       public String getBusinessCountryName() {
+               return businessCountryName;
+       }
+
+       /**
+        * @param businessCountryName
+        *            the businessCountryName to set
+        */
+       public void setBusinessCountryName(String businessCountryName) {
+               this.businessCountryName = businessCountryName;
+       }
+
+       /**
+        * @return the businessUnit
+        */
+       public String getBusinessUnit() {
+               return businessUnit;
+       }
+
+       /**
+        * @param businessUnit
+        *            the businessUnit to set
+        */
+       public void setBusinessUnit(String businessUnit) {
+               this.businessUnit = businessUnit;
+       }
+
+       /**
+        * @return the businessUnitName
+        */
+       public String getBusinessUnitName() {
+               return businessUnitName;
+       }
+
+       /**
+        * @param businessUnitName
+        *            the businessUnitName to set
+        */
+       public void setBusinessUnitName(String businessUnitName) {
+               this.businessUnitName = businessUnitName;
+       }
+
+       /**
+        * @return the department
+        */
+       public String getDepartment() {
+               return department;
+       }
+
+       /**
+        * @param department
+        *            the department to set
+        */
+       public void setDepartment(String department) {
+               this.department = department;
+       }
+
+       /**
+        * @return the departmentName
+        */
+       public String getDepartmentName() {
+               return departmentName;
+       }
+
+       /**
+        * @param departmentName
+        *            the departmentName to set
+        */
+       public void setDepartmentName(String departmentName) {
+               this.departmentName = departmentName;
+       }
+
+       /**
+        * @return the companyCode
+        */
+       public String getCompanyCode() {
+               return companyCode;
+       }
+
+       /**
+        * @param companyCode
+        *            the companyCode to set
+        */
+       public void setCompanyCode(String companyCode) {
+               this.companyCode = companyCode;
+       }
+
+       /**
+        * @return the company
+        */
+       public String getCompany() {
+               return company;
+       }
+
+       /**
+        * @param company
+        *            the company to set
+        */
+       public void setCompany(String company) {
+               this.company = company;
+       }
+
+       /**
+        * @return the zipCodeSuffix
+        */
+       public String getZipCodeSuffix() {
+               return zipCodeSuffix;
+       }
+
+       /**
+        * @param zipCodeSuffix
+        *            the zipCodeSuffix to set
+        */
+       public void setZipCodeSuffix(String zipCodeSuffix) {
+               this.zipCodeSuffix = zipCodeSuffix;
+       }
+
+       /**
+        * @return the jobTitle
+        */
+       public String getJobTitle() {
+               return jobTitle;
+       }
+
+       /**
+        * @param jobTitle
+        *            the jobTitle to set
+        */
+       public void setJobTitle(String jobTitle) {
+               this.jobTitle = jobTitle;
+       }
+
+       /**
+        * @return the commandChain
+        */
+       public String getCommandChain() {
+               return commandChain;
+       }
+
+       /**
+        * @param commandChain
+        *            the commandChain to set
+        */
+       public void setCommandChain(String commandChain) {
+               this.commandChain = commandChain;
+       }
+
+       /**
+        * @return the siloStatus
+        */
+       public String getSiloStatus() {
+               return siloStatus;
+       }
+
+       /**
+        * @param siloStatus
+        *            the siloStatus to set
+        */
+       public void setSiloStatus(String siloStatus) {
+               this.siloStatus = siloStatus;
+       }
+
+       /**
+        * @return the costCenter
+        */
+       public String getCostCenter() {
+               return costCenter;
+       }
+
+       /**
+        * @param costCenter
+        *            the costCenter to set
+        */
+       public void setCostCenter(String costCenter) {
+               this.costCenter = costCenter;
+       }
+
+       /**
+        * @return the financialLocCode
+        */
+       public String getFinancialLocCode() {
+               return financialLocCode;
+       }
+
+       /**
+        * @param financialLocCode
+        *            the financialLocCode to set
+        */
+       public void setFinancialLocCode(String financialLocCode) {
+               this.financialLocCode = financialLocCode;
+       }
+
+       /**
+        * @return the loginId
+        */
+       public String getLoginId() {
+               return loginId;
+       }
+
+       /**
+        * @param loginId
+        *            the loginId to set
+        */
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+
+       /**
+        * @return the loginPwd
+        */
+       public String getLoginPwd() {
+               return loginPwd;
+       }
+
+       /**
+        * @param loginPwd
+        *            the loginPwd to set
+        */
+       public void setLoginPwd(String loginPwd) {
+               this.loginPwd = loginPwd;
+       }
+
+       /**
+        * @return the lastLoginDate
+        */
+       public Date getLastLoginDate() {
+               return lastLoginDate;
+       }
+
+       /**
+        * @param lastLoginDate
+        *            the lastLoginDate to set
+        */
+       public void setLastLoginDate(Date lastLoginDate) {
+               this.lastLoginDate = lastLoginDate;
+       }
+
+       /**
+        * @return the active
+        */
+       public boolean isActive() {
+               return active;
+       }
+
+       /**
+        * @param active
+        *            the active to set
+        */
+       public void setActive(boolean active) {
+               this.active = active;
+       }
+
+       /**
+        * @return the internal
+        */
+       public boolean isInternal() {
+               return internal;
+       }
+
+       /**
+        * @param internal
+        *            the internal to set
+        */
+       public void setInternal(boolean internal) {
+               this.internal = internal;
+       }
+
+       /**
+        * @return the selectedProfileId
+        */
+       public Long getSelectedProfileId() {
+               return selectedProfileId;
+       }
+
+       /**
+        * @param selectedProfileId
+        *            the selectedProfileId to set
+        */
+       public void setSelectedProfileId(Long selectedProfileId) {
+               this.selectedProfileId = selectedProfileId;
+       }
+
+       /**
+        * @return the timeZoneId
+        */
+       public Long getTimeZoneId() {
+               return timeZoneId;
+       }
+
+       /**
+        * @param timeZoneId
+        *            the timeZoneId to set
+        */
+       public void setTimeZoneId(Long timeZoneId) {
+               this.timeZoneId = timeZoneId;
+       }
+
+       /**
+        * @return the online
+        */
+       public boolean isOnline() {
+               return online;
+       }
+
+       /**
+        * @param online
+        *            the online to set
+        */
+       public void setOnline(boolean online) {
+               this.online = online;
+       }
+
+       /**
+        * @return the chatId
+        */
+       public String getChatId() {
+               return chatId;
+       }
+
+       /**
+        * @param chatId
+        *            the chatId to set
+        */
+       public void setChatId(String chatId) {
+               this.chatId = chatId;
+       }
+
+       /**
+        * @return the userApps
+        */
+       public Set<CentralUserApp> getUserApps() {
+               return userApps;
+       }
+
+       /**
+        * @param userApps
+        *            the userApps to set
+        */
+       public void setUserApps(Set<CentralUserApp> userApps) {
+               this.userApps = userApps;
+       }
+
+       /**
+        * @return the pseudoRoles
+        */
+       public Set<CentralRole> getPseudoRoles() {
+               return pseudoRoles;
+       }
+
+       /**
+        * @param pseudoRoles
+        *            the pseudoRoles to set
+        */
+       public void setPseudoRoles(Set<CentralRole> pseudoRoles) {
+               this.pseudoRoles = pseudoRoles;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralUserApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralUserApp.java
new file mode 100644 (file)
index 0000000..59ce5fb
--- /dev/null
@@ -0,0 +1,144 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+@SuppressWarnings("rawtypes")
+public class CentralUserApp implements Serializable, Comparable {
+
+       private static final long serialVersionUID = -1140858385803822099L;
+       private Long userId;
+       private CentralApp app;
+       private CentralRole role;
+       private Short priority;
+
+       /**
+        * @return the userId
+        */
+       public Long getUserId() {
+               return userId;
+       }
+
+       /**
+        * @param userId
+        *            the userId to set
+        */
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+       /**
+        * @return the app
+        */
+       public CentralApp getApp() {
+               return app;
+       }
+
+       /**
+        * @param app
+        *            the app to set
+        */
+       public void setApp(CentralApp app) {
+               this.app = app;
+       }
+
+       /**
+        * @return the role
+        */
+       public CentralRole getRole() {
+               return role;
+       }
+
+       /**
+        * @param role
+        *            the role to set
+        */
+       public void setRole(CentralRole role) {
+               this.role = role;
+       }
+
+       /**
+        * @return the priority
+        */
+       public Short getPriority() {
+               return priority;
+       }
+
+       /**
+        * @param priority
+        *            the priority to set
+        */
+       public void setPriority(Short priority) {
+               this.priority = priority;
+       }
+
+       @Override
+       public int compareTo(Object obj) {
+               String c1 = getRole().getName();
+               String c2 = ((CentralUserApp) obj).getRole().getName();
+
+               return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((role == null) ? 0 : role.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               CentralUserApp other = (CentralUserApp) obj;
+               if (role == null) {
+                       if (other.role != null)
+                               return false;
+               } else if (!role.equals(other.role))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2Role.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2Role.java
new file mode 100644 (file)
index 0000000..8c87acb
--- /dev/null
@@ -0,0 +1,246 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.onap.portalapp.portal.domain.CentralV2RoleFunction;
+
+@SuppressWarnings("rawtypes")
+public class CentralV2Role implements Serializable, Comparable{
+               /**
+        * 
+        */
+       private static final long serialVersionUID = -4332644961113063714L;
+               private Long id;
+               private Date created;
+               private Date modified;
+               private Long createdId;
+               private Long modifiedId;
+               private Long rowNum;
+               
+           private String  name;
+           private boolean active;
+           private Integer priority;
+           
+        private SortedSet<CentralV2RoleFunction> roleFunctions = new TreeSet<>();
+           
+           private SortedSet<CentralV2Role> childRoles = new TreeSet<>();
+
+           private SortedSet<CentralV2Role> parentRoles = new TreeSet<>();
+
+               public CentralV2Role(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum,
+                               String name, boolean active, Integer priority, SortedSet<CentralV2RoleFunction> roleFunctions,
+                               SortedSet<CentralV2Role> childRoles, SortedSet<CentralV2Role> parentRoles) {
+                       super();
+                       this.id = id;
+                       this.created = created;
+                       this.modified = modified;
+                       this.createdId = createdId;
+                       this.modifiedId = modifiedId;
+                       this.rowNum = rowNum;
+                       this.name = name;
+                       this.active = active;
+                       this.priority = priority;
+                       this.roleFunctions = roleFunctions;
+                       this.childRoles = childRoles;
+                       this.parentRoles = parentRoles;
+               }
+               
+               public CentralV2Role(){
+                       
+               }
+               
+               public CentralV2Role(Long id, String name){
+                       this.id = id;
+                       this.name = name;
+               }
+
+               public Long getId() {
+                       return id;
+               }
+
+               public void setId(Long id) {
+                       this.id = id;
+               }
+
+               public Date getCreated() {
+                       return created;
+               }
+
+               public void setCreated(Date created) {
+                       this.created = created;
+               }
+
+               public Date getModified() {
+                       return modified;
+               }
+
+               public void setModified(Date modified) {
+                       this.modified = modified;
+               }
+
+               public Long getCreatedId() {
+                       return createdId;
+               }
+
+               public void setCreatedId(Long createdId) {
+                       this.createdId = createdId;
+               }
+
+               public Long getModifiedId() {
+                       return modifiedId;
+               }
+
+               public void setModifiedId(Long modifiedId) {
+                       this.modifiedId = modifiedId;
+               }
+
+               public Long getRowNum() {
+                       return rowNum;
+               }
+
+               public void setRowNum(Long rowNum) {
+                       this.rowNum = rowNum;
+               }
+
+               public String getName() {
+                       return name;
+               }
+
+               public void setName(String name) {
+                       this.name = name;
+               }
+
+               public boolean isActive() {
+                       return active;
+               }
+
+               public void setActive(boolean active) {
+                       this.active = active;
+               }
+
+               public Integer getPriority() {
+                       return priority;
+               }
+
+               public void setPriority(Integer priority) {
+                       this.priority = priority;
+               }
+
+               public SortedSet<CentralV2RoleFunction> getRoleFunctions() {
+                       return roleFunctions;
+               }
+
+               public void setRoleFunctions(SortedSet<CentralV2RoleFunction> roleFunctions) {
+                       this.roleFunctions = roleFunctions;
+               }
+
+               public SortedSet<CentralV2Role> getChildRoles() {
+                       return childRoles;
+               }
+
+               public void setChildRoles(SortedSet<CentralV2Role> childRoles) {
+                       this.childRoles = childRoles;
+               }
+
+               public SortedSet<CentralV2Role> getParentRoles() {
+                       return parentRoles;
+               }
+
+               public void setParentRoles(SortedSet<CentralV2Role> parentRoles) {
+                       this.parentRoles = parentRoles;
+               }
+               public void addRoleFunction(CentralV2RoleFunction roleFunction) {
+                       this.roleFunctions.add(roleFunction);
+               }
+
+               public void addChildRole(CentralV2Role role) {
+                       this.childRoles.add(role);
+               }
+
+               public void addParentRole(CentralV2Role role) {
+                       this.parentRoles.add(role);
+               }
+               
+               public int compareTo(Object obj){
+               CentralV2Role other = (CentralV2Role)obj;
+
+               String c1 = getName();
+               String c2 = other.getName();
+
+               return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+           }
+
+               @Override
+               public int hashCode() {
+                       final int prime = 31;
+                       int result = 1;
+                       result = prime * result + ((id == null) ? 0 : id.hashCode());
+                       result = prime * result + ((name == null) ? 0 : name.hashCode());
+                       return result;
+               }
+
+               @Override
+               public boolean equals(Object obj) {
+                       if (this == obj)
+                               return true;
+                       if (obj == null)
+                               return false;
+                       if (getClass() != obj.getClass())
+                               return false;
+                       CentralV2Role other = (CentralV2Role) obj;
+                       if (id == null) {
+                               if (other.id != null)
+                                       return false;
+                       } else if (!id.equals(other.id))
+                               return false;
+                       if (name == null) {
+                               if (other.name != null)
+                                       return false;
+                       } else if (!name.equals(other.name))
+                               return false;
+                       return true;
+               }
+               
+               
+               
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2User.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2User.java
new file mode 100644 (file)
index 0000000..bdbf392
--- /dev/null
@@ -0,0 +1,1250 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+public class CentralV2User implements Serializable {
+
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -2673289523184880563L;
+       private Long id;
+       private Date created;
+       private Date modified;
+       private Long createdId;
+       private Long modifiedId;
+       private Long rowNum;
+       
+       private Long   orgId;
+    private Long   managerId;
+    private String firstName;
+    private String middleInitial;
+    private String lastName;
+    private String phone;
+    private String fax;
+    private String cellular;
+    private String email;
+    private Long   addressId;
+    private String alertMethodCd;
+    private String hrid;
+    private String orgUserId;
+    private String orgCode;
+    private String address1;
+    private String address2;
+    private String city;
+    private String state;
+    private String zipCode;
+    private String country;
+    private String orgManagerUserId;
+    private String locationClli;
+    private String businessCountryCode;
+    private String businessCountryName;
+    private String businessUnit;
+    private String businessUnitName;
+    private String department;
+    private String departmentName;
+    private String companyCode;
+    private String company;
+    private String zipCodeSuffix;
+    private String jobTitle;
+    private String commandChain;
+    private String siloStatus;
+    private String costCenter;
+    private String financialLocCode;
+
+    private String loginId;
+    private String loginPwd;
+    private Date   lastLoginDate;
+    private boolean active;
+    private boolean internal;
+    private Long    selectedProfileId;
+    private Long timeZoneId;
+    private boolean online;
+    private String chatId;
+    
+    private Set<CentralV2UserApp> userApps = null;
+       private Set<CentralV2Role> pseudoRoles = null;
+       
+       public CentralV2User(){
+               
+       }
+       
+       public CentralV2User(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, Long orgId,
+                       Long managerId, String firstName, String middleInitial, String lastName, String phone, String fax,
+                       String cellular, String email, Long addressId, String alertMethodCd, String hrid, String orgUserId,
+                       String orgCode, String address1, String address2, String city, String state, String zipCode, String country,
+                       String orgManagerUserId, String locationClli, String businessCountryCode, String businessCountryName,
+                       String businessUnit, String businessUnitName, String department, String departmentName, String companyCode,
+                       String company, String zipCodeSuffix, String jobTitle, String commandChain, String siloStatus,
+                       String costCenter, String financialLocCode, String loginId, String loginPwd, Date lastLoginDate,
+                       boolean active, boolean internal, Long selectedProfileId, Long timeZoneId, boolean online, String chatId,
+                       Set<CentralV2UserApp> userApps, Set<CentralV2Role> pseudoRoles) {
+               super();
+               this.id = id;
+               this.created = created;
+               this.modified = modified;
+               this.createdId = createdId;
+               this.modifiedId = modifiedId;
+               this.rowNum = rowNum;
+               this.orgId = orgId;
+               this.managerId = managerId;
+               this.firstName = firstName;
+               this.middleInitial = middleInitial;
+               this.lastName = lastName;
+               this.phone = phone;
+               this.fax = fax;
+               this.cellular = cellular;
+               this.email = email;
+               this.addressId = addressId;
+               this.alertMethodCd = alertMethodCd;
+               this.hrid = hrid;
+               this.orgUserId = orgUserId;
+               this.orgCode = orgCode;
+               this.address1 = address1;
+               this.address2 = address2;
+               this.city = city;
+               this.state = state;
+               this.zipCode = zipCode;
+               this.country = country;
+               this.orgManagerUserId = orgManagerUserId;
+               this.locationClli = locationClli;
+               this.businessCountryCode = businessCountryCode;
+               this.businessCountryName = businessCountryName;
+               this.businessUnit = businessUnit;
+               this.businessUnitName = businessUnitName;
+               this.department = department;
+               this.departmentName = departmentName;
+               this.companyCode = companyCode;
+               this.company = company;
+               this.zipCodeSuffix = zipCodeSuffix;
+               this.jobTitle = jobTitle;
+               this.commandChain = commandChain;
+               this.siloStatus = siloStatus;
+               this.costCenter = costCenter;
+               this.financialLocCode = financialLocCode;
+               this.loginId = loginId;
+               this.loginPwd = loginPwd;
+               this.lastLoginDate = lastLoginDate;
+               this.active = active;
+               this.internal = internal;
+               this.selectedProfileId = selectedProfileId;
+               this.timeZoneId = timeZoneId;
+               this.online = online;
+               this.chatId = chatId;
+               this.userApps = userApps;
+               this.pseudoRoles = pseudoRoles;
+       }
+
+       /**
+        * @return the id
+        */
+       public Long getId() {
+               return id;
+       }
+
+       /**
+        * @param id the id to set
+        */
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       /**
+        * @return the created
+        */
+       public Date getCreated() {
+               return created;
+       }
+
+       /**
+        * @param created the created to set
+        */
+       public void setCreated(Date created) {
+               this.created = created;
+       }
+
+       /**
+        * @return the modified
+        */
+       public Date getModified() {
+               return modified;
+       }
+
+       /**
+        * @param modified the modified to set
+        */
+       public void setModified(Date modified) {
+               this.modified = modified;
+       }
+
+       /**
+        * @return the createdId
+        */
+       public Long getCreatedId() {
+               return createdId;
+       }
+
+       /**
+        * @param createdId the createdId to set
+        */
+       public void setCreatedId(Long createdId) {
+               this.createdId = createdId;
+       }
+
+       /**
+        * @return the modifiedId
+        */
+       public Long getModifiedId() {
+               return modifiedId;
+       }
+
+       /**
+        * @param modifiedId the modifiedId to set
+        */
+       public void setModifiedId(Long modifiedId) {
+               this.modifiedId = modifiedId;
+       }
+
+       /**
+        * @return the rowNum
+        */
+       public Long getRowNum() {
+               return rowNum;
+       }
+
+       /**
+        * @param rowNum the rowNum to set
+        */
+       public void setRowNum(Long rowNum) {
+               this.rowNum = rowNum;
+       }
+
+       /**
+        * @return the orgId
+        */
+       public Long getOrgId() {
+               return orgId;
+       }
+
+       /**
+        * @param orgId the orgId to set
+        */
+       public void setOrgId(Long orgId) {
+               this.orgId = orgId;
+       }
+
+       /**
+        * @return the managerId
+        */
+       public Long getManagerId() {
+               return managerId;
+       }
+
+       /**
+        * @param managerId the managerId to set
+        */
+       public void setManagerId(Long managerId) {
+               this.managerId = managerId;
+       }
+
+       /**
+        * @return the firstName
+        */
+       public String getFirstName() {
+               return firstName;
+       }
+
+       /**
+        * @param firstName the firstName to set
+        */
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       /**
+        * @return the middleInitial
+        */
+       public String getMiddleInitial() {
+               return middleInitial;
+       }
+
+       /**
+        * @param middleInitial the middleInitial to set
+        */
+       public void setMiddleInitial(String middleInitial) {
+               this.middleInitial = middleInitial;
+       }
+
+       /**
+        * @return the lastName
+        */
+       public String getLastName() {
+               return lastName;
+       }
+
+       /**
+        * @param lastName the lastName to set
+        */
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+
+       /**
+        * @return the phone
+        */
+       public String getPhone() {
+               return phone;
+       }
+
+       /**
+        * @param phone the phone to set
+        */
+       public void setPhone(String phone) {
+               this.phone = phone;
+       }
+
+       /**
+        * @return the fax
+        */
+       public String getFax() {
+               return fax;
+       }
+
+       /**
+        * @param fax the fax to set
+        */
+       public void setFax(String fax) {
+               this.fax = fax;
+       }
+
+       /**
+        * @return the cellular
+        */
+       public String getCellular() {
+               return cellular;
+       }
+
+       /**
+        * @param cellular the cellular to set
+        */
+       public void setCellular(String cellular) {
+               this.cellular = cellular;
+       }
+
+       /**
+        * @return the email
+        */
+       public String getEmail() {
+               return email;
+       }
+
+       /**
+        * @param email the email to set
+        */
+       public void setEmail(String email) {
+               this.email = email;
+       }
+
+       /**
+        * @return the addressId
+        */
+       public Long getAddressId() {
+               return addressId;
+       }
+
+       /**
+        * @param addressId the addressId to set
+        */
+       public void setAddressId(Long addressId) {
+               this.addressId = addressId;
+       }
+
+       /**
+        * @return the alertMethodCd
+        */
+       public String getAlertMethodCd() {
+               return alertMethodCd;
+       }
+
+       /**
+        * @param alertMethodCd the alertMethodCd to set
+        */
+       public void setAlertMethodCd(String alertMethodCd) {
+               this.alertMethodCd = alertMethodCd;
+       }
+
+       /**
+        * @return the hrid
+        */
+       public String getHrid() {
+               return hrid;
+       }
+
+       /**
+        * @param hrid the hrid to set
+        */
+       public void setHrid(String hrid) {
+               this.hrid = hrid;
+       }
+
+       /**
+        * @return the orgUserId
+        */
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       /**
+        * @param orgUserId the orgUserId to set
+        */
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+
+       /**
+        * @return the orgCode
+        */
+       public String getOrgCode() {
+               return orgCode;
+       }
+
+       /**
+        * @param orgCode the orgCode to set
+        */
+       public void setOrgCode(String orgCode) {
+               this.orgCode = orgCode;
+       }
+
+       /**
+        * @return the address1
+        */
+       public String getAddress1() {
+               return address1;
+       }
+
+       /**
+        * @param address1 the address1 to set
+        */
+       public void setAddress1(String address1) {
+               this.address1 = address1;
+       }
+
+       /**
+        * @return the address2
+        */
+       public String getAddress2() {
+               return address2;
+       }
+
+       /**
+        * @param address2 the address2 to set
+        */
+       public void setAddress2(String address2) {
+               this.address2 = address2;
+       }
+
+       /**
+        * @return the city
+        */
+       public String getCity() {
+               return city;
+       }
+
+       /**
+        * @param city the city to set
+        */
+       public void setCity(String city) {
+               this.city = city;
+       }
+
+       /**
+        * @return the state
+        */
+       public String getState() {
+               return state;
+       }
+
+       /**
+        * @param state the state to set
+        */
+       public void setState(String state) {
+               this.state = state;
+       }
+
+       /**
+        * @return the zipCode
+        */
+       public String getZipCode() {
+               return zipCode;
+       }
+
+       /**
+        * @param zipCode the zipCode to set
+        */
+       public void setZipCode(String zipCode) {
+               this.zipCode = zipCode;
+       }
+
+       /**
+        * @return the country
+        */
+       public String getCountry() {
+               return country;
+       }
+
+       /**
+        * @param country the country to set
+        */
+       public void setCountry(String country) {
+               this.country = country;
+       }
+
+       /**
+        * @return the orgManagerUserId
+        */
+       public String getOrgManagerUserId() {
+               return orgManagerUserId;
+       }
+
+       /**
+        * @param orgManagerUserId the orgManagerUserId to set
+        */
+       public void setOrgManagerUserId(String orgManagerUserId) {
+               this.orgManagerUserId = orgManagerUserId;
+       }
+
+       /**
+        * @return the locationClli
+        */
+       public String getLocationClli() {
+               return locationClli;
+       }
+
+       /**
+        * @param locationClli the locationClli to set
+        */
+       public void setLocationClli(String locationClli) {
+               this.locationClli = locationClli;
+       }
+
+       /**
+        * @return the businessCountryCode
+        */
+       public String getBusinessCountryCode() {
+               return businessCountryCode;
+       }
+
+       /**
+        * @param businessCountryCode the businessCountryCode to set
+        */
+       public void setBusinessCountryCode(String businessCountryCode) {
+               this.businessCountryCode = businessCountryCode;
+       }
+
+       /**
+        * @return the businessCountryName
+        */
+       public String getBusinessCountryName() {
+               return businessCountryName;
+       }
+
+       /**
+        * @param businessCountryName the businessCountryName to set
+        */
+       public void setBusinessCountryName(String businessCountryName) {
+               this.businessCountryName = businessCountryName;
+       }
+
+       /**
+        * @return the businessUnit
+        */
+       public String getBusinessUnit() {
+               return businessUnit;
+       }
+
+       /**
+        * @param businessUnit the businessUnit to set
+        */
+       public void setBusinessUnit(String businessUnit) {
+               this.businessUnit = businessUnit;
+       }
+
+       /**
+        * @return the businessUnitName
+        */
+       public String getBusinessUnitName() {
+               return businessUnitName;
+       }
+
+       /**
+        * @param businessUnitName the businessUnitName to set
+        */
+       public void setBusinessUnitName(String businessUnitName) {
+               this.businessUnitName = businessUnitName;
+       }
+
+       /**
+        * @return the department
+        */
+       public String getDepartment() {
+               return department;
+       }
+
+       /**
+        * @param department the department to set
+        */
+       public void setDepartment(String department) {
+               this.department = department;
+       }
+
+       /**
+        * @return the departmentName
+        */
+       public String getDepartmentName() {
+               return departmentName;
+       }
+
+       /**
+        * @param departmentName the departmentName to set
+        */
+       public void setDepartmentName(String departmentName) {
+               this.departmentName = departmentName;
+       }
+
+       /**
+        * @return the companyCode
+        */
+       public String getCompanyCode() {
+               return companyCode;
+       }
+
+       /**
+        * @param companyCode the companyCode to set
+        */
+       public void setCompanyCode(String companyCode) {
+               this.companyCode = companyCode;
+       }
+
+       /**
+        * @return the company
+        */
+       public String getCompany() {
+               return company;
+       }
+
+       /**
+        * @param company the company to set
+        */
+       public void setCompany(String company) {
+               this.company = company;
+       }
+
+       /**
+        * @return the zipCodeSuffix
+        */
+       public String getZipCodeSuffix() {
+               return zipCodeSuffix;
+       }
+
+       /**
+        * @param zipCodeSuffix the zipCodeSuffix to set
+        */
+       public void setZipCodeSuffix(String zipCodeSuffix) {
+               this.zipCodeSuffix = zipCodeSuffix;
+       }
+
+       /**
+        * @return the jobTitle
+        */
+       public String getJobTitle() {
+               return jobTitle;
+       }
+
+       /**
+        * @param jobTitle the jobTitle to set
+        */
+       public void setJobTitle(String jobTitle) {
+               this.jobTitle = jobTitle;
+       }
+
+       /**
+        * @return the commandChain
+        */
+       public String getCommandChain() {
+               return commandChain;
+       }
+
+       /**
+        * @param commandChain the commandChain to set
+        */
+       public void setCommandChain(String commandChain) {
+               this.commandChain = commandChain;
+       }
+
+       /**
+        * @return the siloStatus
+        */
+       public String getSiloStatus() {
+               return siloStatus;
+       }
+
+       /**
+        * @param siloStatus the siloStatus to set
+        */
+       public void setSiloStatus(String siloStatus) {
+               this.siloStatus = siloStatus;
+       }
+
+       /**
+        * @return the costCenter
+        */
+       public String getCostCenter() {
+               return costCenter;
+       }
+
+       /**
+        * @param costCenter the costCenter to set
+        */
+       public void setCostCenter(String costCenter) {
+               this.costCenter = costCenter;
+       }
+
+       /**
+        * @return the financialLocCode
+        */
+       public String getFinancialLocCode() {
+               return financialLocCode;
+       }
+
+       /**
+        * @param financialLocCode the financialLocCode to set
+        */
+       public void setFinancialLocCode(String financialLocCode) {
+               this.financialLocCode = financialLocCode;
+       }
+
+       /**
+        * @return the loginId
+        */
+       public String getLoginId() {
+               return loginId;
+       }
+
+       /**
+        * @param loginId the loginId to set
+        */
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+
+       /**
+        * @return the loginPwd
+        */
+       public String getLoginPwd() {
+               return loginPwd;
+       }
+
+       /**
+        * @param loginPwd the loginPwd to set
+        */
+       public void setLoginPwd(String loginPwd) {
+               this.loginPwd = loginPwd;
+       }
+
+       /**
+        * @return the lastLoginDate
+        */
+       public Date getLastLoginDate() {
+               return lastLoginDate;
+       }
+
+       /**
+        * @param lastLoginDate the lastLoginDate to set
+        */
+       public void setLastLoginDate(Date lastLoginDate) {
+               this.lastLoginDate = lastLoginDate;
+       }
+
+       /**
+        * @return the active
+        */
+       public boolean isActive() {
+               return active;
+       }
+
+       /**
+        * @param active the active to set
+        */
+       public void setActive(boolean active) {
+               this.active = active;
+       }
+
+       /**
+        * @return the internal
+        */
+       public boolean isInternal() {
+               return internal;
+       }
+
+       /**
+        * @param internal the internal to set
+        */
+       public void setInternal(boolean internal) {
+               this.internal = internal;
+       }
+
+       /**
+        * @return the selectedProfileId
+        */
+       public Long getSelectedProfileId() {
+               return selectedProfileId;
+       }
+
+       /**
+        * @param selectedProfileId the selectedProfileId to set
+        */
+       public void setSelectedProfileId(Long selectedProfileId) {
+               this.selectedProfileId = selectedProfileId;
+       }
+
+       /**
+        * @return the timeZoneId
+        */
+       public Long getTimeZoneId() {
+               return timeZoneId;
+       }
+
+       /**
+        * @param timeZoneId the timeZoneId to set
+        */
+       public void setTimeZoneId(Long timeZoneId) {
+               this.timeZoneId = timeZoneId;
+       }
+
+       /**
+        * @return the online
+        */
+       public boolean isOnline() {
+               return online;
+       }
+
+       /**
+        * @param online the online to set
+        */
+       public void setOnline(boolean online) {
+               this.online = online;
+       }
+
+       /**
+        * @return the chatId
+        */
+       public String getChatId() {
+               return chatId;
+       }
+
+       /**
+        * @param chatId the chatId to set
+        */
+       public void setChatId(String chatId) {
+               this.chatId = chatId;
+       }
+
+       /**
+        * @return the userApps
+        */
+       public Set<CentralV2UserApp> getUserApps() {
+               return userApps;
+       }
+
+       /**
+        * @param userApps the userApps to set
+        */
+       public void setUserApps(Set<CentralV2UserApp> userApps) {
+               this.userApps = userApps;
+       }
+
+       /**
+        * @return the pseudoRoles
+        */
+       public Set<CentralV2Role> getPseudoRoles() {
+               return pseudoRoles;
+       }
+
+       /**
+        * @param pseudoRoles the pseudoRoles to set
+        */
+       public void setPseudoRoles(Set<CentralV2Role> pseudoRoles) {
+               this.pseudoRoles = pseudoRoles;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + (active ? 1231 : 1237);
+               result = prime * result + ((address1 == null) ? 0 : address1.hashCode());
+               result = prime * result + ((address2 == null) ? 0 : address2.hashCode());
+               result = prime * result + ((addressId == null) ? 0 : addressId.hashCode());
+               result = prime * result + ((alertMethodCd == null) ? 0 : alertMethodCd.hashCode());
+               result = prime * result + ((businessCountryCode == null) ? 0 : businessCountryCode.hashCode());
+               result = prime * result + ((businessCountryName == null) ? 0 : businessCountryName.hashCode());
+               result = prime * result + ((businessUnit == null) ? 0 : businessUnit.hashCode());
+               result = prime * result + ((businessUnitName == null) ? 0 : businessUnitName.hashCode());
+               result = prime * result + ((cellular == null) ? 0 : cellular.hashCode());
+               result = prime * result + ((chatId == null) ? 0 : chatId.hashCode());
+               result = prime * result + ((city == null) ? 0 : city.hashCode());
+               result = prime * result + ((commandChain == null) ? 0 : commandChain.hashCode());
+               result = prime * result + ((company == null) ? 0 : company.hashCode());
+               result = prime * result + ((companyCode == null) ? 0 : companyCode.hashCode());
+               result = prime * result + ((costCenter == null) ? 0 : costCenter.hashCode());
+               result = prime * result + ((country == null) ? 0 : country.hashCode());
+               result = prime * result + ((created == null) ? 0 : created.hashCode());
+               result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
+               result = prime * result + ((department == null) ? 0 : department.hashCode());
+               result = prime * result + ((departmentName == null) ? 0 : departmentName.hashCode());
+               result = prime * result + ((email == null) ? 0 : email.hashCode());
+               result = prime * result + ((fax == null) ? 0 : fax.hashCode());
+               result = prime * result + ((financialLocCode == null) ? 0 : financialLocCode.hashCode());
+               result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
+               result = prime * result + ((hrid == null) ? 0 : hrid.hashCode());
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + (internal ? 1231 : 1237);
+               result = prime * result + ((jobTitle == null) ? 0 : jobTitle.hashCode());
+               result = prime * result + ((lastLoginDate == null) ? 0 : lastLoginDate.hashCode());
+               result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
+               result = prime * result + ((locationClli == null) ? 0 : locationClli.hashCode());
+               result = prime * result + ((loginId == null) ? 0 : loginId.hashCode());
+               result = prime * result + ((loginPwd == null) ? 0 : loginPwd.hashCode());
+               result = prime * result + ((managerId == null) ? 0 : managerId.hashCode());
+               result = prime * result + ((middleInitial == null) ? 0 : middleInitial.hashCode());
+               result = prime * result + ((modified == null) ? 0 : modified.hashCode());
+               result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
+               result = prime * result + (online ? 1231 : 1237);
+               result = prime * result + ((orgCode == null) ? 0 : orgCode.hashCode());
+               result = prime * result + ((orgId == null) ? 0 : orgId.hashCode());
+               result = prime * result + ((orgManagerUserId == null) ? 0 : orgManagerUserId.hashCode());
+               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
+               result = prime * result + ((phone == null) ? 0 : phone.hashCode());
+               result = prime * result + ((pseudoRoles == null) ? 0 : pseudoRoles.hashCode());
+               result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
+               result = prime * result + ((selectedProfileId == null) ? 0 : selectedProfileId.hashCode());
+               result = prime * result + ((siloStatus == null) ? 0 : siloStatus.hashCode());
+               result = prime * result + ((state == null) ? 0 : state.hashCode());
+               result = prime * result + ((timeZoneId == null) ? 0 : timeZoneId.hashCode());
+               result = prime * result + ((userApps == null) ? 0 : userApps.hashCode());
+               result = prime * result + ((zipCode == null) ? 0 : zipCode.hashCode());
+               result = prime * result + ((zipCodeSuffix == null) ? 0 : zipCodeSuffix.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               CentralV2User other = (CentralV2User) obj;
+               if (active != other.active)
+                       return false;
+               if (address1 == null) {
+                       if (other.address1 != null)
+                               return false;
+               } else if (!address1.equals(other.address1))
+                       return false;
+               if (address2 == null) {
+                       if (other.address2 != null)
+                               return false;
+               } else if (!address2.equals(other.address2))
+                       return false;
+               if (addressId == null) {
+                       if (other.addressId != null)
+                               return false;
+               } else if (!addressId.equals(other.addressId))
+                       return false;
+               if (alertMethodCd == null) {
+                       if (other.alertMethodCd != null)
+                               return false;
+               } else if (!alertMethodCd.equals(other.alertMethodCd))
+                       return false;
+               if (businessCountryCode == null) {
+                       if (other.businessCountryCode != null)
+                               return false;
+               } else if (!businessCountryCode.equals(other.businessCountryCode))
+                       return false;
+               if (businessCountryName == null) {
+                       if (other.businessCountryName != null)
+                               return false;
+               } else if (!businessCountryName.equals(other.businessCountryName))
+                       return false;
+               if (businessUnit == null) {
+                       if (other.businessUnit != null)
+                               return false;
+               } else if (!businessUnit.equals(other.businessUnit))
+                       return false;
+               if (businessUnitName == null) {
+                       if (other.businessUnitName != null)
+                               return false;
+               } else if (!businessUnitName.equals(other.businessUnitName))
+                       return false;
+               if (cellular == null) {
+                       if (other.cellular != null)
+                               return false;
+               } else if (!cellular.equals(other.cellular))
+                       return false;
+               if (chatId == null) {
+                       if (other.chatId != null)
+                               return false;
+               } else if (!chatId.equals(other.chatId))
+                       return false;
+               if (city == null) {
+                       if (other.city != null)
+                               return false;
+               } else if (!city.equals(other.city))
+                       return false;
+               if (commandChain == null) {
+                       if (other.commandChain != null)
+                               return false;
+               } else if (!commandChain.equals(other.commandChain))
+                       return false;
+               if (company == null) {
+                       if (other.company != null)
+                               return false;
+               } else if (!company.equals(other.company))
+                       return false;
+               if (companyCode == null) {
+                       if (other.companyCode != null)
+                               return false;
+               } else if (!companyCode.equals(other.companyCode))
+                       return false;
+               if (costCenter == null) {
+                       if (other.costCenter != null)
+                               return false;
+               } else if (!costCenter.equals(other.costCenter))
+                       return false;
+               if (country == null) {
+                       if (other.country != null)
+                               return false;
+               } else if (!country.equals(other.country))
+                       return false;
+               if (created == null) {
+                       if (other.created != null)
+                               return false;
+               } else if (!created.equals(other.created))
+                       return false;
+               if (createdId == null) {
+                       if (other.createdId != null)
+                               return false;
+               } else if (!createdId.equals(other.createdId))
+                       return false;
+               if (department == null) {
+                       if (other.department != null)
+                               return false;
+               } else if (!department.equals(other.department))
+                       return false;
+               if (departmentName == null) {
+                       if (other.departmentName != null)
+                               return false;
+               } else if (!departmentName.equals(other.departmentName))
+                       return false;
+               if (email == null) {
+                       if (other.email != null)
+                               return false;
+               } else if (!email.equals(other.email))
+                       return false;
+               if (fax == null) {
+                       if (other.fax != null)
+                               return false;
+               } else if (!fax.equals(other.fax))
+                       return false;
+               if (financialLocCode == null) {
+                       if (other.financialLocCode != null)
+                               return false;
+               } else if (!financialLocCode.equals(other.financialLocCode))
+                       return false;
+               if (firstName == null) {
+                       if (other.firstName != null)
+                               return false;
+               } else if (!firstName.equals(other.firstName))
+                       return false;
+               if (hrid == null) {
+                       if (other.hrid != null)
+                               return false;
+               } else if (!hrid.equals(other.hrid))
+                       return false;
+               if (id == null) {
+                       if (other.id != null)
+                               return false;
+               } else if (!id.equals(other.id))
+                       return false;
+               if (internal != other.internal)
+                       return false;
+               if (jobTitle == null) {
+                       if (other.jobTitle != null)
+                               return false;
+               } else if (!jobTitle.equals(other.jobTitle))
+                       return false;
+               if (lastLoginDate == null) {
+                       if (other.lastLoginDate != null)
+                               return false;
+               } else if (!lastLoginDate.equals(other.lastLoginDate))
+                       return false;
+               if (lastName == null) {
+                       if (other.lastName != null)
+                               return false;
+               } else if (!lastName.equals(other.lastName))
+                       return false;
+               if (locationClli == null) {
+                       if (other.locationClli != null)
+                               return false;
+               } else if (!locationClli.equals(other.locationClli))
+                       return false;
+               if (loginId == null) {
+                       if (other.loginId != null)
+                               return false;
+               } else if (!loginId.equals(other.loginId))
+                       return false;
+               if (loginPwd == null) {
+                       if (other.loginPwd != null)
+                               return false;
+               } else if (!loginPwd.equals(other.loginPwd))
+                       return false;
+               if (managerId == null) {
+                       if (other.managerId != null)
+                               return false;
+               } else if (!managerId.equals(other.managerId))
+                       return false;
+               if (middleInitial == null) {
+                       if (other.middleInitial != null)
+                               return false;
+               } else if (!middleInitial.equals(other.middleInitial))
+                       return false;
+               if (modified == null) {
+                       if (other.modified != null)
+                               return false;
+               } else if (!modified.equals(other.modified))
+                       return false;
+               if (modifiedId == null) {
+                       if (other.modifiedId != null)
+                               return false;
+               } else if (!modifiedId.equals(other.modifiedId))
+                       return false;
+               if (online != other.online)
+                       return false;
+               if (orgCode == null) {
+                       if (other.orgCode != null)
+                               return false;
+               } else if (!orgCode.equals(other.orgCode))
+                       return false;
+               if (orgId == null) {
+                       if (other.orgId != null)
+                               return false;
+               } else if (!orgId.equals(other.orgId))
+                       return false;
+               if (orgManagerUserId == null) {
+                       if (other.orgManagerUserId != null)
+                               return false;
+               } else if (!orgManagerUserId.equals(other.orgManagerUserId))
+                       return false;
+               if (orgUserId == null) {
+                       if (other.orgUserId != null)
+                               return false;
+               } else if (!orgUserId.equals(other.orgUserId))
+                       return false;
+               if (phone == null) {
+                       if (other.phone != null)
+                               return false;
+               } else if (!phone.equals(other.phone))
+                       return false;
+               if (pseudoRoles == null) {
+                       if (other.pseudoRoles != null)
+                               return false;
+               } else if (!pseudoRoles.equals(other.pseudoRoles))
+                       return false;
+               if (rowNum == null) {
+                       if (other.rowNum != null)
+                               return false;
+               } else if (!rowNum.equals(other.rowNum))
+                       return false;
+               if (selectedProfileId == null) {
+                       if (other.selectedProfileId != null)
+                               return false;
+               } else if (!selectedProfileId.equals(other.selectedProfileId))
+                       return false;
+               if (siloStatus == null) {
+                       if (other.siloStatus != null)
+                               return false;
+               } else if (!siloStatus.equals(other.siloStatus))
+                       return false;
+               if (state == null) {
+                       if (other.state != null)
+                               return false;
+               } else if (!state.equals(other.state))
+                       return false;
+               if (timeZoneId == null) {
+                       if (other.timeZoneId != null)
+                               return false;
+               } else if (!timeZoneId.equals(other.timeZoneId))
+                       return false;
+               if (userApps == null) {
+                       if (other.userApps != null)
+                               return false;
+               } else if (!userApps.equals(other.userApps))
+                       return false;
+               if (zipCode == null) {
+                       if (other.zipCode != null)
+                               return false;
+               } else if (!zipCode.equals(other.zipCode))
+                       return false;
+               if (zipCodeSuffix == null) {
+                       if (other.zipCodeSuffix != null)
+                               return false;
+               } else if (!zipCodeSuffix.equals(other.zipCodeSuffix))
+                       return false;
+               return true;
+       }
+
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2UserApp.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2UserApp.java
new file mode 100644 (file)
index 0000000..a871857
--- /dev/null
@@ -0,0 +1,113 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+@SuppressWarnings("rawtypes")
+public class CentralV2UserApp implements Serializable, Comparable{
+       
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 4954830080839125389L;
+       private Long userId;
+       private CentralApp app;
+       private CentralV2Role role;
+       private Short priority;
+       
+       
+       
+       public Long getUserId() {
+               return userId;
+       }
+
+
+
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+
+
+       public CentralApp getApp() {
+               return app;
+       }
+
+
+
+       public void setApp(CentralApp app) {
+               this.app = app;
+       }
+
+
+
+       public CentralV2Role getRole() {
+               return role;
+       }
+
+
+
+       public void setRole(CentralV2Role role) {
+               this.role = role;
+       }
+
+
+
+       public Short getPriority() {
+               return priority;
+       }
+
+
+
+       public void setPriority(Short priority) {
+               this.priority = priority;
+       }
+
+
+
+       public int compareTo(Object other){
+           CentralV2UserApp castOther = (CentralV2UserApp) other;
+
+           Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.priority==null ? 0 : this.priority);
+           Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.priority==null ? 0 : castOther.priority);
+
+           return c1.compareTo(c2);
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CommonWidget.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CommonWidget.java
new file mode 100644 (file)
index 0000000..18110e1
--- /dev/null
@@ -0,0 +1,156 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * This is to handle portal admins
+ */
+@Entity 
+@Table(name="fn_common_widget_data")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CommonWidget extends DomainVo{
+
+       private static final long serialVersionUID = 7897021982887364557L;
+       
+       @Id
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       @Column(name = "id")
+       private Long id;
+
+       @Column(name = "category")
+       public String category;
+       
+       @Column(name = "href")
+       public String href;
+
+       @Column(name = "title")
+       public String title;
+       
+       @Column(name = "content")
+       public String content;
+
+       @Column(name = "event_date")
+       public String eventDate;
+       
+       @Column(name = "sort_order")
+       public Integer sortOrder;
+
+       
+       public CommonWidget(){
+               
+       }
+       
+       public CommonWidget(String category, String href, String title, String content, String eventDate, Integer sortOrder){
+               this.category = category;
+               this.href = href;
+               this.title = title;
+               this.content = content;
+               this.eventDate = eventDate;
+               this.sortOrder = sortOrder;
+       }
+
+       public String getCategory() {
+               return category;
+       }
+
+       public void setCategory(String category) {
+               this.category = category;
+       }
+
+       public String getHref() {
+               return href;
+       }
+
+       public void setHref(String href) {
+               this.href = href;
+       }
+
+       public String getTitle() {
+               return title;
+       }
+
+       public void setTitle(String title) {
+               this.title = title;
+       }
+
+       public Integer getSortOrder() {
+               return sortOrder;
+       }
+
+       public void setSortOrder(Integer sortOrder) {
+               this.sortOrder = sortOrder;
+       }
+
+       public static long getSerialversionuid() {
+               return serialVersionUID;
+       }
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {            
+               this.id = id;
+       }
+
+       public String getContent() {
+               return content;
+       }
+
+       public void setContent(String content) {
+               this.content = content;
+       }
+
+       public String getEventDate() {
+               return eventDate;
+       }
+
+       public void setEventDate(String eventDate) {
+               this.eventDate = eventDate;
+       }       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CommonWidgetMeta.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CommonWidgetMeta.java
new file mode 100644 (file)
index 0000000..173718a
--- /dev/null
@@ -0,0 +1,68 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.List;
+
+public class CommonWidgetMeta {
+       
+       private String category;
+       private List<CommonWidget> items;
+       
+       public CommonWidgetMeta(){      
+               
+       }
+
+       public CommonWidgetMeta(String category, List<CommonWidget> items){
+               this.category = category;
+               this.items = items;
+       }
+       
+       public String getCategory() {
+               return category;
+       }
+       public void setCategory(String category) {
+               this.category = category;
+       }
+       public List<CommonWidget> getItems() {
+               return items;
+       }
+       public void setItems(List<CommonWidget> items) {
+               this.items = items;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPAppsManualPreference.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPAppsManualPreference.java
new file mode 100644 (file)
index 0000000..e547206
--- /dev/null
@@ -0,0 +1,132 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class EPAppsManualPreference {
+       
+       private Long appid;
+       private int col;
+       private String headerText;
+       private String imageLink;
+       private int order;
+       private boolean restrictedApp;
+       private int row;
+       private int sizeX;
+       private int sizeY;
+       private String subHeaderText;
+       private String url;
+       private boolean addRemoveApps;
+       
+       
+       public boolean isAddRemoveApps() {
+               return addRemoveApps;
+       }
+       public void setAddRemoveApps(boolean addRemoveApps) {
+               this.addRemoveApps = addRemoveApps;
+       }
+       public Long getAppid() {
+               return appid;
+       }
+       public void setAppid(Long appid) {
+               this.appid = appid;
+       }
+       public int getCol() {
+               return col;
+       }
+       public void setCol(int col) {
+               this.col = col;
+       }
+       public String getHeaderText() {
+               return headerText;
+       }
+       public void setHeaderText(String headerText) {
+               this.headerText = headerText;
+       }
+       public String getImageLink() {
+               return imageLink;
+       }
+       public void setImageLink(String imageLink) {
+               this.imageLink = imageLink;
+       }
+       public int getOrder() {
+               return order;
+       }
+       public void setOrder(int order) {
+               this.order = order;
+       }
+       public boolean isRestrictedApp() {
+               return restrictedApp;
+       }
+       public void setRestrictedApp(boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+       public int getRow() {
+               return row;
+       }
+       public void setRow(int row) {
+               this.row = row;
+       }
+       public int getSizeX() {
+               return sizeX;
+       }
+       public void setSizeX(int sizeX) {
+               this.sizeX = sizeX;
+       }
+       public int getSizeY() {
+               return sizeY;
+       }
+       public void setSizeY(int sizeY) {
+               this.sizeY = sizeY;
+       }
+       public String getSubHeaderText() {
+               return subHeaderText;
+       }
+       public void setSubHeaderText(String subHeaderText) {
+               this.subHeaderText = subHeaderText;
+       }
+       public String getUrl() {
+               return url;
+       }
+       public void setUrl(String url) {
+               this.url = url;
+       }
+       
+       public boolean isValid(){
+               return appid != null;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPAppsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPAppsSortPreference.java
new file mode 100644 (file)
index 0000000..367d1d3
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class EPAppsSortPreference {
+       
+       private int index;
+       private String value;
+       private String title;
+       
+       public int getIndex() {
+               return index;
+       }
+       public void setIndex(int index) {
+               this.index = index;
+       }
+       public String getValue() {
+               return value;
+       }
+       public void setValue(String value) {
+               this.value = value;
+       }
+       public String getTitle() {
+               return title;
+       }
+       public void setTitle(String title) {
+               this.title = title;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPDeleteAppsManualSortPref.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPDeleteAppsManualSortPref.java
new file mode 100644 (file)
index 0000000..1278641
--- /dev/null
@@ -0,0 +1,69 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class EPDeleteAppsManualSortPref {
+       private Long appId;
+       private boolean select;
+       private boolean pending;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public boolean isSelect() {
+               return select;
+       }
+
+       public void setSelect(boolean select) {
+               this.select = select;
+       }
+
+       public boolean isPending() {
+               return pending;
+       }
+
+       public void setPending(boolean pending) {
+               this.pending = pending;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPUserAppCurrentRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPUserAppCurrentRoles.java
new file mode 100644 (file)
index 0000000..ee88bd4
--- /dev/null
@@ -0,0 +1,135 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class EPUserAppCurrentRoles implements Serializable{
+
+       private static final long serialVersionUID = -8145807875293949759L;
+       
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+       @Id
+       @Column(name="user_id")
+       private Long userId;
+       @Id
+       @Column(name="priority")
+       private String priority ;
+       @Id
+       @Column(name="role_id")
+       private Long roleId;
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       public Long getUserId() {
+               return userId;
+       }
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+       public String getPriority() {
+               return priority;
+       }
+       public void setPriority(String priority) {
+               this.priority = priority;
+       }
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
+               result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
+               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
+               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               EPUserAppCurrentRoles other = (EPUserAppCurrentRoles) obj;
+               if (priority == null) {
+                       if (other.priority != null)
+                               return false;
+               } else if (!priority.equals(other.priority))
+                       return false;
+               if (roleId == null) {
+                       if (other.roleId != null)
+                               return false;
+               } else if (!roleId.equals(other.roleId))
+                       return false;
+               if (roleName == null) {
+                       if (other.roleName != null)
+                               return false;
+               } else if (!roleName.equals(other.roleName))
+                       return false;
+               if (userId == null) {
+                       if (other.userId != null)
+                               return false;
+               } else if (!userId.equals(other.userId))
+                       return false;
+               return true;
+       }
+       
+       
+
+}
+       
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPWidgetsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EPWidgetsSortPreference.java
new file mode 100644 (file)
index 0000000..072abe7
--- /dev/null
@@ -0,0 +1,110 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.List;
+
+public class EPWidgetsSortPreference {
+       
+       private int SizeX;
+       private int SizeY;
+       private String headerText;
+       private String url;
+       private Long widgetid;
+       private List<Object> attrb;
+       private String widgetIdentifier;
+       private int row;
+       private int col;
+       
+       public String getWidgetIdentifier() {
+               return widgetIdentifier;
+       }
+       public List<Object> getAttrb() {
+               return attrb;
+       }
+       public void setAttrb(List<Object> attrb) {
+               this.attrb = attrb;
+       }
+       public void setWidgetIdentifier(String widgetIdentifier) {
+               this.widgetIdentifier = widgetIdentifier;
+       }
+       public int getSizeX() {
+               return SizeX;
+       }
+       public void setSizeX(int sizeX) {
+               SizeX = sizeX;
+       }
+       public int getSizeY() {
+               return SizeY;
+       }
+       public void setSizeY(int sizeY) {
+               SizeY = sizeY;
+       }
+       public String getHeaderText() {
+               return headerText;
+       }
+       public void setHeaderText(String headerText) {
+               this.headerText = headerText;
+       }
+       public String getUrl() {
+               return url;
+       }
+       public void setUrl(String url) {
+               this.url = url;
+       }
+       public Long getWidgetid() {
+               return widgetid;
+       }
+       public void setWidgetid(Long widgetid) {
+               this.widgetid = widgetid;
+       }
+       public int getRow() {
+               return row;
+       }
+       public void setRow(int row) {
+               this.row = row;
+       }
+       public int getCol() {
+               return col;
+       }
+       public void setCol(int col) {
+               this.col = col;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EcompUserAppRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EcompUserAppRoles.java
new file mode 100644 (file)
index 0000000..b6caccb
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@Entity
+@JsonInclude(JsonInclude.Include.NON_NULL)     
+public class EcompUserAppRoles implements Serializable {
+
+       private static final long serialVersionUID = -3394219387296578741L;
+       
+       @Id
+       @Column(name="app_id")
+       private String appId;
+       @Id
+       @Column(name="user_id")
+       private Long userId;
+       @Id
+       @Column(name="priority")
+       private String priority ;
+       @Id
+       @Column(name="role_id")
+       private Long roleId;
+       @Id
+       @Column(name="role_name")
+       private String roleName;
+       public String getAppId() {
+               return appId;
+       }
+       public void setAppId(String appId) {
+               this.appId = appId;
+       }
+       public Long getUserId() {
+               return userId;
+       }
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+       public String getPriority() {
+               return priority;
+       }
+       public void setPriority(String priority) {
+               this.priority = priority;
+       }
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EcompUserRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EcompUserRoles.java
new file mode 100644 (file)
index 0000000..73409ed
--- /dev/null
@@ -0,0 +1,209 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class EcompUserRoles implements Serializable{
+       
+       private static final long serialVersionUID = 1L;
+       
+       @Id
+       @Column(name = "org_id")
+       private Long orgId;
+       @Id
+       @Column(name = "manager_id")
+       private String managerId;
+       @Id
+       @Column(name = "first_name")
+       private String firstName;
+       @Id
+       @Column(name = "middle_name")
+       private String middleInitial;
+       @Id
+       @Column(name = "last_name")
+       private String lastName;
+       @Id
+       @Column(name = "phone")
+       private String phone;
+       @Id
+       @Column(name = "email")
+       private String email;
+       @Id
+       @Column(name = "hrid")
+       private String hrid;
+       @Id
+       @Column(name = "org_user_id")
+       private String orgUserId;
+       @Id
+       @Column(name = "org_code")
+       private String orgCode;
+       @Id
+       @Column(name = "org_manager_userid")
+       private String orgManagerUserId;
+       @Id
+       @Column(name = "job_title")
+       private String jobTitle;
+       @Id
+       @Column(name = "login_id")
+       private String loginId;
+
+       @Id
+       @Column(name = "app_role_id")
+       private Long roleId;
+       @Id
+       @Column(name = "role_name")
+       private String roleName;
+       @Id
+       @Column(name = "active_yn")
+       private boolean active;
+       public Long getOrgId() {
+               return orgId;
+       }
+       public void setOrgId(Long orgId) {
+               this.orgId = orgId;
+       }
+       public String getManagerId() {
+               return managerId;
+       }
+       public void setManagerId(String managerId) {
+               this.managerId = managerId;
+       }
+       public String getFirstName() {
+               return firstName;
+       }
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+       public String getMiddleInitial() {
+               return middleInitial;
+       }
+       public void setMiddleInitial(String middleInitial) {
+               this.middleInitial = middleInitial;
+       }
+       public String getLastName() {
+               return lastName;
+       }
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+       public String getPhone() {
+               return phone;
+       }
+       public void setPhone(String phone) {
+               this.phone = phone;
+       }
+       public String getEmail() {
+               return email;
+       }
+       public void setEmail(String email) {
+               this.email = email;
+       }
+       public String getHrid() {
+               return hrid;
+       }
+       public void setHrid(String hrid) {
+               this.hrid = hrid;
+       }
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+       public String getOrgCode() {
+               return orgCode;
+       }
+       public void setOrgCode(String orgCode) {
+               this.orgCode = orgCode;
+       }
+       public String getOrgManagerUserId() {
+               return orgManagerUserId;
+       }
+       public void setOrgManagerUserId(String orgManagerUserId) {
+               this.orgManagerUserId = orgManagerUserId;
+       }
+       public String getJobTitle() {
+               return jobTitle;
+       }
+       public void setJobTitle(String jobTitle) {
+               this.jobTitle = jobTitle;
+       }
+       public String getLoginId() {
+               return loginId;
+       }
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+       
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       
+       public boolean isActive() {
+               return active;
+       }
+       public void setActive(boolean active) {
+               this.active = active;
+       }
+       @Override
+       public String toString() {
+               return "EcompUserRoles [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName
+                               + ", middleInitial=" + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", email="
+                               + email + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", orgManagerUserId="
+                               + orgManagerUserId + ", jobTitle=" + jobTitle + ", loginId=" + loginId + ", active=" + active
+                               + ", roleId=" + roleId + ", roleName=" + roleName + "]";
+       }
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItem.java
new file mode 100644 (file)
index 0000000..ea3e6a7
--- /dev/null
@@ -0,0 +1,357 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+
+/**
+ * This is to handle notifications in notification PopUp
+ */
+
+
+@Entity
+@Table(name = "ep_notification")
+public class EpNotificationItem extends DomainVo {
+       public EpNotificationItem() {
+       };
+
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.IDENTITY)
+       @Column(name = "notification_ID")
+       public Long notificationId;
+
+       @Column(name = "is_for_online_users")
+       public String isForOnlineUsers;
+
+       @Column(name = "is_for_all_roles")
+       public String isForAllRoles;
+
+       @Column(name = "active_YN")
+       public String activeYn;
+       
+       @Column(name = "msg_header")
+       public String msgHeader;
+
+       @Column(name = "msg_description")
+       public String msgDescription;
+       
+       @Column(name = "msg_source")
+       public String msgSource;
+
+       @Column(name = "start_time")
+       public Date startTime;
+       
+       @Column(name = "end_time")
+       public Date endTime;
+
+       @Column(name = "priority")
+       public Long priority;
+       
+       @Column(name = "creator_ID")
+       public Long creatorId;
+       
+       @Column(name = "created_date")
+       public Date createdDate;
+       
+       @Column(name = "notification_hyperlink")
+       public String notificationHyperlink;
+               
+       
+       @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, orphanRemoval = true)
+       @JoinColumn(name="notification_ID")
+       private Set<EpRoleNotificationItem> roles;
+       
+       @Transient
+       private List<Long> roleIds;
+       
+       public Long getNotificationId() {
+               return notificationId;
+       }
+
+       public void setNotificationId(Long notificationId) {
+               this.notificationId = notificationId;
+       }
+
+       public String getIsForOnlineUsers() {
+               return isForOnlineUsers;
+       }
+
+       public void setIsForOnlineUsers(String isForOnlineUsers) {
+               this.isForOnlineUsers = isForOnlineUsers;
+       }
+
+       public String getIsForAllRoles() {
+               return isForAllRoles;
+       }
+
+       public void setIsForAllRoles(String isForAllRoles) {
+               this.isForAllRoles = isForAllRoles;
+       }
+       
+       public String getActiveYn() {
+               return activeYn;
+       }
+
+       public void setActiveYn(String activeYn) {
+               this.activeYn = activeYn;
+       }
+
+       public String getMsgHeader() {
+               return msgHeader;
+       }
+
+       public void setMsgHeader(String msgHeader) {
+               this.msgHeader = msgHeader;
+       }
+
+       public String getMsgDescription() {
+               return msgDescription;
+       }
+
+       public void setMsgDescription(String msgDescription) {
+               this.msgDescription = msgDescription;
+       }
+
+       public Date getStartTime() {
+               return startTime;
+       }
+
+       public void setStartTime(Date startTime) {
+               this.startTime = startTime;
+       }
+
+       public Date getEndTime() {
+               return endTime;
+       }
+
+       public void setEndTime(Date endTime) {
+               this.endTime = endTime;
+       }
+
+       public Long getPriority() {
+               return priority;
+       }
+
+       public void setPriority(Long priority) {
+               this.priority = priority;
+       }
+
+       public Long getCreatorId() {
+               return creatorId;
+       }
+
+       public void setCreatorId(Long creatorId) {
+               this.creatorId = creatorId;
+       }
+
+       public Date getCreatedDate() {
+               return createdDate;
+       }
+
+       public void setCreatedDate(Date createdDate) {
+               this.createdDate = createdDate;
+       }
+
+       public static long getSerialversionuid() {
+               return serialVersionUID;
+       }
+
+       public Set<EpRoleNotificationItem> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(Set<EpRoleNotificationItem> roles) {
+               this.roles = roles;
+       }
+
+       public List<Long> getRoleIds() {
+               return roleIds;
+       }
+
+       public void setRoleIds(List<Long> roleIds) {
+               this.roleIds = roleIds;
+       }
+       
+       public String getMsgSource() {
+               return msgSource;
+       }
+
+       public void setMsgSource(String msgSource) {
+               this.msgSource = msgSource;
+       }
+       
+       public String getNotificationHyperlink() {
+               return notificationHyperlink;
+       }
+
+       public void setNotificationHyperlink(String notificationHyperlink) {
+               this.notificationHyperlink = notificationHyperlink;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((activeYn == null) ? 0 : activeYn.hashCode());
+               result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
+               result = prime * result + ((creatorId == null) ? 0 : creatorId.hashCode());
+               result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
+               result = prime * result + ((isForAllRoles == null) ? 0 : isForAllRoles.hashCode());
+               result = prime * result + ((isForOnlineUsers == null) ? 0 : isForOnlineUsers.hashCode());
+               result = prime * result + ((msgDescription == null) ? 0 : msgDescription.hashCode());
+               result = prime * result + ((msgHeader == null) ? 0 : msgHeader.hashCode());
+               result = prime * result + ((msgSource == null) ? 0 : msgSource.hashCode());
+               result = prime * result + ((notificationId == null) ? 0 : notificationId.hashCode());
+               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
+               result = prime * result + ((roleIds == null) ? 0 : roleIds.hashCode());
+               result = prime * result + ((roles == null) ? 0 : roles.hashCode());
+               result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               EpNotificationItem other = (EpNotificationItem) obj;
+               if (activeYn == null) {
+                       if (other.activeYn != null)
+                               return false;
+               } else if (!activeYn.equals(other.activeYn))
+                       return false;
+               if (createdDate == null) {
+                       if (other.createdDate != null)
+                               return false;
+               } else if (!createdDate.equals(other.createdDate))
+                       return false;
+               if (creatorId == null) {
+                       if (other.creatorId != null)
+                               return false;
+               } else if (!creatorId.equals(other.creatorId))
+                       return false;
+               if (endTime == null) {
+                       if (other.endTime != null)
+                               return false;
+               } else if (!endTime.equals(other.endTime))
+                       return false;
+               if (isForAllRoles == null) {
+                       if (other.isForAllRoles != null)
+                               return false;
+               } else if (!isForAllRoles.equals(other.isForAllRoles))
+                       return false;
+               if (isForOnlineUsers == null) {
+                       if (other.isForOnlineUsers != null)
+                               return false;
+               } else if (!isForOnlineUsers.equals(other.isForOnlineUsers))
+                       return false;
+               if (msgDescription == null) {
+                       if (other.msgDescription != null)
+                               return false;
+               } else if (!msgDescription.equals(other.msgDescription))
+                       return false;
+               if (msgHeader == null) {
+                       if (other.msgHeader != null)
+                               return false;
+               } else if (!msgHeader.equals(other.msgHeader))
+                       return false;
+               if (msgSource == null) {
+                       if (other.msgSource != null)
+                               return false;
+               } else if (!msgSource.equals(other.msgSource))
+                       return false;
+               if (notificationId == null) {
+                       if (other.notificationId != null)
+                               return false;
+               } else if (!notificationId.equals(other.notificationId))
+                       return false;
+               if (priority == null) {
+                       if (other.priority != null)
+                               return false;
+               } else if (!priority.equals(other.priority))
+                       return false;
+               if (roleIds == null) {
+                       if (other.roleIds != null)
+                               return false;
+               } else if (!roleIds.equals(other.roleIds))
+                       return false;
+               if (roles == null) {
+                       if (other.roles != null)
+                               return false;
+               } else if (!roles.equals(other.roles))
+                       return false;
+               if (startTime == null) {
+                       if (other.startTime != null)
+                               return false;
+               } else if (!startTime.equals(other.startTime))
+                       return false;
+               return true;
+       }
+
+       @Override
+       public String toString() {
+               return "EpNotificationItem [notificationId=" + notificationId + ", isForOnlineUsers=" + isForOnlineUsers
+                               + ", isForAllRoles=" + isForAllRoles + ", activeYn=" + activeYn + ", msgHeader=" + msgHeader
+                               + ", msgDescription=" + msgDescription + ", msgSource=" + msgSource + ", startTime=" + startTime
+                               + ", endTime=" + endTime + ", priority=" + priority + ", creatorId=" + creatorId + ", createdDate="
+                               + createdDate + ", roles=" + roles + ", roleIds=" + roleIds + "]";
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItemExtVO.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItemExtVO.java
new file mode 100644 (file)
index 0000000..9a6a58b
--- /dev/null
@@ -0,0 +1,137 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class EpNotificationItemExtVO {
+       
+       private Character activeYn;
+
+       private String msgHeader;
+
+       private String msgDescription;
+
+       private Date startTime;
+
+       private Date endTime;
+
+       private Integer priority;
+
+       private Integer creatorId;
+
+       private Date createdDate;
+       
+       private String loginId;
+
+       public Character getActiveYn() {
+               return activeYn;
+       }
+
+       public void setActiveYn(Character activeYn) {
+               this.activeYn = activeYn;
+       }
+
+       public String getMsgHeader() {
+               return msgHeader;
+       }
+
+       public void setMsgHeader(String msgHeader) {
+               this.msgHeader = msgHeader;
+       }
+
+       public String getMsgDescription() {
+               return msgDescription;
+       }
+
+       public void setMsgDescription(String msgDescription) {
+               this.msgDescription = msgDescription;
+       }
+
+       public Date getStartTime() {
+               return startTime;
+       }
+
+       public void setStartTime(Date startTime) {
+               this.startTime = startTime;
+       }
+
+       public Date getEndTime() {
+               return endTime;
+       }
+
+       public void setEndTime(Date endTime) {
+               this.endTime = endTime;
+       }
+
+       public Integer getPriority() {
+               return priority;
+       }
+
+       public void setPriority(Integer priority) {
+               this.priority = priority;
+       }
+
+       public Integer getCreatorId() {
+               return creatorId;
+       }
+
+       public void setCreatorId(Integer creatorId) {
+               this.creatorId = creatorId;
+       }
+
+       public Date getCreatedDate() {
+               return createdDate;
+       }
+
+       public void setCreatedDate(Date createdDate) {
+               this.createdDate = createdDate;
+       }
+
+       public String getLoginId() {
+               return loginId;
+       }
+
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       } 
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItemVO.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpNotificationItemVO.java
new file mode 100644 (file)
index 0000000..7c2da30
--- /dev/null
@@ -0,0 +1,221 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.Date;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+/**
+ * This is to handle notifications in user notifications and in notification history
+ */
+
+/**
+ * POJO that models a single notification with the org user ID (not integer
+ * user_id).
+ */
+@Entity
+public class EpNotificationItemVO extends DomainVo {
+
+       private static final long serialVersionUID = 9095479701352339201L;
+
+       @Id
+       private Integer notificationId;
+
+       private Character isForOnlineUsers;
+
+       private Character isForAllRoles;
+
+       private Character activeYn;
+
+       private String msgHeader;
+
+       private String msgDescription;
+       
+       private String msgSource;
+
+       private Date startTime;
+
+       private Date endTime;
+
+       private Integer priority;
+
+       private Integer creatorId;
+
+       private Date createdDate;
+
+       private String loginId;
+       
+       private String notificationHyperlink;
+
+       
+       /**
+        * Answers whether the notification is expired.
+        * 
+        * @return true if the end time is past the current time, else false.
+        */
+       public boolean isExpired() {
+               boolean result = false;
+               if (endTime != null) {
+                       int expired = endTime.compareTo(new Date());
+                       result = (expired == -1) ? true : false;
+               }
+               return result;
+       }
+
+       public String getLoginId() {
+               return loginId;
+       }
+
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+
+       public Integer getNotificationId() {
+               return notificationId;
+       }
+
+       public void setNotificationId(Integer notificationId) {
+               this.notificationId = notificationId;
+       }
+
+       public Character getIsForOnlineUsers() {
+               return isForOnlineUsers;
+       }
+
+       public void setIsForOnlineUsers(Character isForOnlineUsers) {
+               this.isForOnlineUsers = isForOnlineUsers;
+       }
+
+       public Character getIsForAllRoles() {
+               return isForAllRoles;
+       }
+
+       public void setIsForAllRoles(Character isForAllRoles) {
+               this.isForAllRoles = isForAllRoles;
+       }
+
+       public Character getActiveYn() {
+               return activeYn;
+       }
+
+       public void setActiveYn(Character activeYn) {
+               this.activeYn = activeYn;
+       }
+
+       public String getMsgHeader() {
+               return msgHeader;
+       }
+
+       public void setMsgHeader(String msgHeader) {
+               this.msgHeader = msgHeader;
+       }
+
+       public String getMsgDescription() {
+               return msgDescription;
+       }
+
+       public void setMsgDescription(String msgDescription) {
+               this.msgDescription = msgDescription;
+       }
+
+       public Date getStartTime() {
+               return startTime;
+       }
+
+       public void setStartTime(Date startTime) {
+               this.startTime = startTime;
+       }
+
+       public Date getEndTime() {
+               return endTime;
+       }
+
+       public void setEndTime(Date endTime) {
+               this.endTime = endTime;
+       }
+
+       public Integer getPriority() {
+               return priority;
+       }
+
+       public void setPriority(Integer priority) {
+               this.priority = priority;
+       }
+
+       public Integer getCreatorId() {
+               return creatorId;
+       }
+
+       public void setCreatorId(Integer creatorId) {
+               this.creatorId = creatorId;
+       }
+
+       public Date getCreatedDate() {
+               return createdDate;
+       }
+
+       public void setCreatedDate(Date createdDate) {
+               this.createdDate = createdDate;
+       }
+
+       public static long getSerialversionuid() {
+               return serialVersionUID;
+       }
+
+       
+       public String getMsgSource() {
+               return msgSource;
+       }
+
+       public void setMsgSource(String msgSource) {
+               this.msgSource = msgSource;
+       }
+       
+       public String getNotificationHyperlink() {
+               return notificationHyperlink;
+       }
+
+       public void setNotificationHyperlink(String notificationHyperlink) {
+               this.notificationHyperlink = notificationHyperlink;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpRoleNotificationItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EpRoleNotificationItem.java
new file mode 100644 (file)
index 0000000..a1b4377
--- /dev/null
@@ -0,0 +1,108 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+@Entity
+@Table(name="ep_role_notification")
+public class EpRoleNotificationItem extends DomainVo  {
+       public EpRoleNotificationItem(){};
+       
+       private static final long serialVersionUID = 1L;
+
+       @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+       @Column(name = "ID")
+       public Long id;
+       
+       @Column(name = "notification_ID")
+       public Long notificationId;
+               
+       @Column(name = "role_ID")
+       public Integer roleId;
+       
+       @Column(name = "recv_user_id")
+       public Integer RecvUserId;
+
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public Long getNotificationId() {
+               return notificationId;
+       }
+
+       public void setNotificationId(Long notificationId) {
+               this.notificationId = notificationId;
+       }
+
+       public Integer getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Integer roleId) {
+               this.roleId = roleId;
+       }
+
+       public static long getSerialversionuid() {
+               return serialVersionUID;
+       }
+       
+       public Integer getRecvUserId() {
+               return RecvUserId;
+       }
+
+       public void setRecvUserId(Integer recvUserId) {
+               RecvUserId = recvUserId;
+       }
+
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EventWidget.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EventWidget.java
new file mode 100644 (file)
index 0000000..9656239
--- /dev/null
@@ -0,0 +1,156 @@
+package org.onap.portalapp.portal.transport;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+/*package org.openecomp.portalapp.portal.transport;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+*//**
+ * This is to handle portal admins
+ *//*
+@Entity 
+@Table(name="fn_event_widget_data")
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class EventWidget extends DomainVo{
+
+       *//**
+        * 
+        *//*
+       private static final long serialVersionUID = -2784849102886421352L;
+
+       
+       @Id
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       @Column(name = "id")
+       private Long id;
+
+       @Column(name = "category")
+       private String category;
+
+       @Column(name = "title")
+       private String title;
+       
+       @Column(name = "href")
+       private String href;
+
+       @Column(name = "content")
+       private String content;
+       
+       @Column(name = "month_val")
+       private String mon;
+
+       @Column(name = "day_val")
+       private Integer  day;
+
+       @Column(name = "year_val")
+       private Integer year;
+
+       @Column(name = "sort_order")
+       private Integer sortOrder;
+
+       public String getTitle() {
+               return title;
+       }
+
+       public void setTitle(String title) {
+               this.title = title;
+       }
+
+       public String getHref() {
+               return href;
+       }
+
+       public void setHref(String href) {
+               this.href = href;
+       }
+
+       public String getContent() {
+               return content;
+       }
+
+       public void setContent(String content) {
+               this.content = content;
+       }
+
+       public String getMon() {
+               return mon;
+       }
+
+       public void setMonth(String mon) {
+               this.mon = mon;
+       }
+
+       public Integer getDay() {
+               return day;
+       }
+
+       public void setDay(Integer day) {
+               this.day = day;
+       }
+
+       public Integer getYear() {
+               return year;
+       }
+
+       public void setYear(Integer year) {
+               this.year = year;
+       }
+
+       public Integer getSortOrder() {
+               return sortOrder;
+       }
+
+       public String getCategory() {
+               return category;
+       }
+
+       public void setCategory(String category) {
+               this.category = category;
+       }
+       
+       
+}
+*/
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EventWidgetMeta.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/EventWidgetMeta.java
new file mode 100644 (file)
index 0000000..a27aa65
--- /dev/null
@@ -0,0 +1,70 @@
+package org.onap.portalapp.portal.transport;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+/*package org.openecomp.portalapp.portal.transport;
+
+import java.util.List;
+
+public class EventWidgetMeta {
+       
+       private String category;
+       private List<EventWidget> items;
+       
+       public EventWidgetMeta(){       
+               
+       }
+
+       public EventWidgetMeta(String category, List<EventWidget> items){
+               this.category = category;
+               this.items = items;
+       }
+       
+       public String getCategory() {
+               return category;
+       }
+       public void setCategory(String category) {
+               this.category = category;
+       }
+       public List<EventWidget> getItems() {
+               return items;
+       }
+       public void setItems(List<EventWidget> items) {
+               this.items = items;
+       }
+}
+*/
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessPerms.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessPerms.java
new file mode 100644 (file)
index 0000000..db9107f
--- /dev/null
@@ -0,0 +1,180 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+public class ExternalAccessPerms implements Serializable, Comparable{
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = -200964838466882602L;
+       public String type;
+       public String instance;
+       public String action;
+       public String description;
+       
+       
+       public ExternalAccessPerms() {
+               super();
+       }
+       
+       
+       
+       public ExternalAccessPerms(String type, String instance, String action, String description) {
+               super();
+               this.type = type;
+               this.instance = instance;
+               this.action = action;
+               this.description = description;
+       }
+
+       public ExternalAccessPerms(String type, String instance, String action) {
+               super();
+               this.type = type;
+               this.instance = instance;
+               this.action = action;
+       }
+
+
+       /**
+        * @return the type
+        */
+       public String getType() {
+               return type;
+       }
+       /**
+        * @param type the type to set
+        */
+       public void setType(String type) {
+               this.type = type;
+       }
+       /**
+        * @return the instance
+        */
+       public String getInstance() {
+               return instance;
+       }
+       /**
+        * @param instance the instance to set
+        */
+       public void setInstance(String instance) {
+               this.instance = instance;
+       }
+       /**
+        * @return the action
+        */
+       public String getAction() {
+               return action;
+       }
+       /**
+        * @param action the action to set
+        */
+       public void setAction(String action) {
+               this.action = action;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+
+       public void setDescription(String description) {
+               this.description = description;
+       }
+
+
+       @Override
+       public int compareTo(Object obj){
+       ExternalAccessPerms other = (ExternalAccessPerms)obj;
+
+       String c1 = getInstance();
+       String c2 = other.getInstance();
+
+       return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
+       }
+
+
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((action == null) ? 0 : action.hashCode());
+               result = prime * result + ((description == null) ? 0 : description.hashCode());
+               result = prime * result + ((instance == null) ? 0 : instance.hashCode());
+               result = prime * result + ((type == null) ? 0 : type.hashCode());
+               return result;
+       }
+
+
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               ExternalAccessPerms other = (ExternalAccessPerms) obj;
+               if (action == null) {
+                       if (other.action != null)
+                               return false;
+               } else if (!action.equals(other.action))
+                       return false;
+               if (description == null) {
+                       if (other.description != null)
+                               return false;
+               } else if (!description.equals(other.description))
+                       return false;
+               if (instance == null) {
+                       if (other.instance != null)
+                               return false;
+               } else if (!instance.equals(other.instance))
+                       return false;
+               if (type == null) {
+                       if (other.type != null)
+                               return false;
+               } else if (!type.equals(other.type))
+                       return false;
+               return true;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessPermsDetail.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessPermsDetail.java
new file mode 100644 (file)
index 0000000..49167c8
--- /dev/null
@@ -0,0 +1,127 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonRootName(value="perm")
+public class ExternalAccessPermsDetail {
+
+       private String type;
+       private String instance;
+       private String action;
+       private List<String> roles;
+       private String description;
+       
+       
+       
+       public ExternalAccessPermsDetail() {
+               super();
+       }
+
+       /**
+        * @param type
+        * @param instance
+        * @param action
+        * @param roles
+        * @param description
+        */
+       public ExternalAccessPermsDetail(String type, String instance, String action, List<String> roles,
+                       String description) {
+               super();
+               this.type = type;
+               this.instance = instance;
+               this.action = action;
+               this.roles = roles;
+               this.description = description;
+       }
+       
+       /**
+        * @param type
+        * @param instance
+        * @param action
+        * @param description
+        */
+       public ExternalAccessPermsDetail(String type, String instance, String action,
+                       String description) {
+               super();
+               this.type = type;
+               this.instance = instance;
+               this.action = action;
+               this.description = description;
+       }
+       
+       public String getType() {
+               return type;
+       }
+       public void setType(String type) {
+               this.type = type;
+       }
+       public String getInstance() {
+               return instance;
+       }
+       public void setInstance(String instance) {
+               this.instance = instance;
+       }
+       public String getAction() {
+               return action;
+       }
+       public void setAction(String action) {
+               this.action = action;
+       }
+       public List<String> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<String> roles) {
+               this.roles = roles;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+       public void setDescription(String description) {
+               this.description = description;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessRole.java
new file mode 100644 (file)
index 0000000..3a377f3
--- /dev/null
@@ -0,0 +1,76 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+public class ExternalAccessRole implements Serializable {
+
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 3439986826362436339L;
+       public String name;
+       public String description;
+       
+       public ExternalAccessRole() {
+       
+       }
+       
+       public ExternalAccessRole(String name, String description) {
+               super();
+               this.name = name;
+               this.description = description;
+       }
+       
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public String getDescription() {
+               return description;
+       }
+       public void setDescription(String description) {
+               this.description = description;
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessRolePerms.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessRolePerms.java
new file mode 100644 (file)
index 0000000..1235f62
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class ExternalAccessRolePerms {
+       
+       private ExternalAccessPerms perm;       
+       private String role;
+       
+       
+       public ExternalAccessRolePerms(ExternalAccessPerms perm, String role) {
+               super();
+               this.perm = perm;
+               this.role = role;
+       }
+       
+       public ExternalAccessPerms getPerm() {
+               return perm;
+       }
+       public void setPerm(ExternalAccessPerms perm) {
+               this.perm = perm;
+       }
+       public String getRole() {
+               return role;
+       }
+       public void setRole(String role) {
+               this.role = role;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessUser.java
new file mode 100644 (file)
index 0000000..63d1144
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class ExternalAccessUser {
+
+       private String user;
+       private String role;
+
+       public ExternalAccessUser(String user, String role) {
+               super();
+               this.user = user;
+               this.role = role;
+       }
+       
+       public String getUser() {
+               return user;
+       }
+       public void setUser(String user) {
+               this.user = user;
+       }
+       public String getRole() {
+               return role;
+       }
+       public void setRole(String role) {
+               this.role = role;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessUserRoleDetail.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAccessUserRoleDetail.java
new file mode 100644 (file)
index 0000000..fe92fb4
--- /dev/null
@@ -0,0 +1,104 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class ExternalAccessUserRoleDetail {
+               
+       private String name;
+       private ExternalRoleDescription description;
+       
+       
+       /**
+        * 
+        */
+       public ExternalAccessUserRoleDetail() {
+               super();
+       }
+
+       public ExternalAccessUserRoleDetail(String name, ExternalRoleDescription description) {
+               super();
+               this.name = name;
+               this.description = description;
+       }
+       
+       public String getName() {
+               return name;
+       }
+       public void setName(String name) {
+               this.name = name;
+       }
+       public ExternalRoleDescription getDescription() {
+               return description;
+       }
+       public void setDescription(ExternalRoleDescription description) {
+               this.description = description;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((description == null) ? 0 : description.hashCode());
+               result = prime * result + ((name == null) ? 0 : name.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               ExternalAccessUserRoleDetail other = (ExternalAccessUserRoleDetail) obj;
+               if (description == null) {
+                       if (other.description != null)
+                               return false;
+               } else if (!description.equals(other.description))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       return false;
+               return true;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAuthUserRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalAuthUserRole.java
new file mode 100644 (file)
index 0000000..0b143bd
--- /dev/null
@@ -0,0 +1,74 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+public class ExternalAuthUserRole implements Serializable{
+       
+       /**
+        * 
+        */ 
+       private static final long serialVersionUID = 5066251837431287376L;
+       
+       private String role;
+       private String user;
+       private String expiryDate;
+       
+       public String getRole() {
+               return role;
+       }
+       public void setRole(String role) {
+               this.role = role;
+       }
+       public String getUser() {
+               return user;
+       }
+       public void setUser(String user) {
+               this.user = user;
+       }
+       public String getExpiryDate() {
+               return expiryDate;
+       }
+       public void setExpiryDate(String expiryDate) {
+               this.expiryDate = expiryDate;
+       }
+       
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalRequestFieldsValidator.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalRequestFieldsValidator.java
new file mode 100644 (file)
index 0000000..75418df
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class ExternalRequestFieldsValidator {
+
+       private boolean result;
+       private String detailMessage;
+       
+       public ExternalRequestFieldsValidator(boolean result, String detailMessage) {
+               super();
+               this.result = result;
+               this.detailMessage = detailMessage;
+       }
+       public boolean isResult() {
+               return result;
+       }
+       public void setResult(boolean result) {
+               this.result = result;
+       }
+       public String getDetailMessage() {
+               return detailMessage;
+       }
+       public void setDetailMessage(String detailMessage) {
+               this.detailMessage = detailMessage;
+       }
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalRoleDescription.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ExternalRoleDescription.java
new file mode 100644 (file)
index 0000000..262cc8f
--- /dev/null
@@ -0,0 +1,140 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class ExternalRoleDescription {
+
+       private String id;
+       private String  name;
+    private String active;
+    private String priority;
+    private String appId;
+    private String appRoleId;
+    
+       public String getId() {
+               return id;
+       }
+       public void setId(String id) {
+               this.id = id;
+       }
+       public String getName() {
+               return name;
+       }
+       public void setName(String name) {
+               this.name = name;
+       }
+       public String getActive() {
+               return active;
+       }
+       public void setActive(String active) {
+               this.active = active;
+       }
+       public String getPriority() {
+               return priority;
+       }
+       public void setPriority(String priority) {
+               this.priority = priority;
+       }
+       public String getAppId() {
+               return appId;
+       }
+       public void setAppId(String appId) {
+               this.appId = appId;
+       }
+       public String getAppRoleId() {
+               return appRoleId;
+       }
+       public void setAppRoleId(String appRoleId) {
+               this.appRoleId = appRoleId;
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((active == null) ? 0 : active.hashCode());
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((appRoleId == null) ? 0 : appRoleId.hashCode());
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + ((name == null) ? 0 : name.hashCode());
+               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               ExternalRoleDescription other = (ExternalRoleDescription) obj;
+               if (active == null) {
+                       if (other.active != null)
+                               return false;
+               } else if (!active.equals(other.active))
+                       return false;
+               if (appId == null) {
+                       if (other.appId != null)
+                               return false;
+               } else if (!appId.equals(other.appId))
+                       return false;
+               if (appRoleId == null) {
+                       if (other.appRoleId != null)
+                               return false;
+               } else if (!appRoleId.equals(other.appRoleId))
+                       return false;
+               if (id == null) {
+                       if (other.id != null)
+                               return false;
+               } else if (!id.equals(other.id))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       return false;
+               if (priority == null) {
+                       if (other.priority != null)
+                               return false;
+               } else if (!priority.equals(other.priority))
+                       return false;
+               return true;
+       }
+    
+    
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FavoritesFunctionalMenuItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FavoritesFunctionalMenuItem.java
new file mode 100644 (file)
index 0000000..aff15cd
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+
+/**
+ * This is to handle functional menu favorites
+ */
+@Entity
+@Table(name="fn_menu_favorites")
+public class FavoritesFunctionalMenuItem implements Serializable {
+       private static final long serialVersionUID = 1L;
+       
+       @Id
+       @Column(name = "user_id")
+       public Long userId;
+       
+       @Id
+       @Column(name = "menu_id")
+       public Long menuId;     
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java
new file mode 100644 (file)
index 0000000..73b01e2
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+
+
+/**
+ * This is to handle functional menu favorites
+ */
+@Entity
+@Table(name="fn_menu_favorites")
+public class FavoritesFunctionalMenuItemJson implements Serializable {
+
+       private static final long serialVersionUID = 1L;
+       
+       @Id
+       @Column(name = "user_id")
+       public Long userId;
+       
+       @Id
+       @Column(name = "menu_id")
+       public Long menuId;
+       
+       @Column(name = "text")
+       public String text;
+       
+       @Column(name = "url")
+       public String url;
+       
+       @Transient
+       public Boolean restrictedApp;
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FieldsValidator.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FieldsValidator.java
new file mode 100644 (file)
index 0000000..7c9b696
--- /dev/null
@@ -0,0 +1,143 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+public class FieldsValidator {
+
+       public Long httpStatusCode = new Long(HttpServletResponse.SC_OK);
+
+       public Long errorCode;
+
+       public class FieldName {
+
+               public String name;
+
+               public FieldName(String name) {
+                       this.name = name;
+               }
+
+               public String getName() {
+                       return name;
+               }
+
+               public void setName(String name) {
+                       this.name = name;
+               }
+
+       }
+       
+
+       public List<FieldName> fields = new ArrayList<FieldName>();
+
+       public void addProblematicFieldName(String name) {
+               fields.add(new FieldName(name));
+       }
+
+       public Long getHttpStatusCode() {
+               return httpStatusCode;
+       }
+
+       public void setHttpStatusCode(Long httpStatusCode) {
+               this.httpStatusCode = httpStatusCode;
+       }
+
+       public Long getErrorCode() {
+               return errorCode;
+       }
+
+       public void setErrorCode(Long errorCode) {
+               this.errorCode = errorCode;
+       }
+
+       public List<FieldName> getFields() {
+               return fields;
+       }
+
+       public void setFields(List<FieldName> fields) {
+               this.fields = fields;
+       }
+
+       @Override
+       public String toString() {
+               return "FieldsValidator [httpStatusCode=" + httpStatusCode + ", errorCode=" + errorCode + ", fields=" + fields
+                               + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode());
+               result = prime * result + ((fields == null) ? 0 : fields.hashCode());
+               result = prime * result + ((httpStatusCode == null) ? 0 : httpStatusCode.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               FieldsValidator other = (FieldsValidator) obj;
+               if (errorCode == null) {
+                       if (other.errorCode != null)
+                               return false;
+               } else if (!errorCode.equals(other.errorCode))
+                       return false;
+               if (fields == null) {
+                       if (other.fields != null)
+                               return false;
+               } else if (!fields.equals(other.fields))
+                       return false;
+               if (httpStatusCode == null) {
+                       if (other.httpStatusCode != null)
+                               return false;
+               } else if (!httpStatusCode.equals(other.httpStatusCode))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItem.java
new file mode 100644 (file)
index 0000000..fcee620
--- /dev/null
@@ -0,0 +1,118 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+@Entity
+@Table(name="fn_menu_functional")
+public class FunctionalMenuItem implements Serializable {
+       public FunctionalMenuItem(){};
+       
+       private static final long serialVersionUID = 1L;
+
+       @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+       @Column(name = "MENU_ID")
+       public Long menuId;
+       
+       @Column(name = "COLUMN_NUM")
+       public Integer column;
+       
+       @Column(name = "TEXT")
+       public String text;
+       
+       @Column(name = "PARENT_MENU_ID")
+       public Integer parentMenuId;
+       
+       @Column(name = "URL")
+       public String url;
+       
+       @Column(name="ACTIVE_YN")
+       public String active_yn;
+
+       @Transient
+       public Integer appid;
+       
+       public List<Integer> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<Integer> roles) {
+               this.roles = roles;
+       }
+
+       @Transient
+       private List<Integer> roles;
+       
+       @Transient
+       public Boolean restrictedApp;
+       
+       public void normalize() {
+               if (this.column == null)
+                       this.column = new Integer(1);
+               this.text = (this.text == null) ? "" : this.text.trim();
+               if (this.parentMenuId == null)
+                       this.parentMenuId = new Integer(-1);
+               this.url = (this.url == null) ? "" : this.url.trim();
+       }
+
+       @Override
+       public String toString() {
+               return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
+                               + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
+                               + ", restrictedApp=" + restrictedApp + "]";
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public void setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItemWithRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuItemWithRoles.java
new file mode 100644 (file)
index 0000000..f1a48ac
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+import java.util.List;
+
+// This type is used to read the Json in from the API call from the Front End
+public class FunctionalMenuItemWithRoles implements Serializable {
+       private static final long serialVersionUID = 1L;
+
+       public Long menuId;
+       
+       public Integer column;
+       
+       public String text;
+       
+       public Integer parentMenuId;
+       
+       public String url;
+
+       public Integer appid;
+       
+       private List<Integer> roles;
+
+       public List<Integer> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<Integer> roles) {
+               this.roles = roles;
+       }
+
+       public void normalize() {
+               if (this.column == null)
+                       this.column = new Integer(1);
+               this.text = (this.text == null) ? "" : this.text.trim();
+               if (this.parentMenuId == null)
+                       this.parentMenuId = new Integer(-1);
+               this.url = (this.url == null) ? "" : this.url.trim();
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/FunctionalMenuRole.java
new file mode 100644 (file)
index 0000000..0f4a6b4
--- /dev/null
@@ -0,0 +1,133 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="fn_menu_functional_roles")
+public class FunctionalMenuRole implements Serializable {
+       private static final long serialVersionUID = 1L;
+
+       @Id
+    @GeneratedValue(strategy=GenerationType.IDENTITY)
+       @Column(name = "ID")
+       public Integer id;
+       
+       @Column(name = "MENU_ID")
+       public Long menuId;
+       
+       @Column(name = "APP_ID")
+       public Integer appId;
+       
+       @Column(name = "ROLE_ID")
+       public Integer roleId;
+
+       public Integer getId() {
+               return id;
+       }
+
+       public void setId(Integer id) {
+               this.id = id;
+       }
+
+       public Long getMenuId() {
+               return menuId;
+       }
+
+       public void setMenuId(Long menuId) {
+               this.menuId = menuId;
+       }
+
+       public Integer getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Integer appId) {
+               this.appId = appId;
+       }
+
+       public Integer getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Integer roleId) {
+               this.roleId = roleId;
+       }
+
+       @Override
+       public String toString() {
+               return "FunctionalMenuRole [id=" + id + ", menuId=" + menuId + ", appId=" + appId + ", roleId=" + roleId + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + ((menuId == null) ? 0 : menuId.hashCode());
+               result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
+               return result;
+       }
+
+       @Override
+    public boolean equals(Object o) {
+
+        if (o == this) return true;
+        if (!(o instanceof FunctionalMenuRole)) {
+            return false;
+        }
+        FunctionalMenuRole functionalMenuRole = (FunctionalMenuRole) o;
+        System.out.println("test");
+        return  id.equals(functionalMenuRole.getId()) &&
+                       menuId.equals(functionalMenuRole.menuId) &&
+                       appId.equals(functionalMenuRole.appId) &&
+                       roleId.equals(functionalMenuRole.roleId) ;
+    }
+       
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/GlobalRoleWithApplicationRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/GlobalRoleWithApplicationRoleFunction.java
new file mode 100644 (file)
index 0000000..b872409
--- /dev/null
@@ -0,0 +1,130 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class GlobalRoleWithApplicationRoleFunction implements Serializable {
+       
+       /**
+        * 
+        */
+       private static final long serialVersionUID = 1L;
+       @Id
+       @Column(name = "role_id")
+       private Long roleId;
+       @Id
+       @Column(name = "role_name")
+       private String  roleName;
+       @Id
+       @Column(name = "active_Yn")
+    private boolean active;
+       @Id
+       @Column(name = "priority")
+    private Integer priority;
+       @Id
+       @Column(name = "function_cd")
+    private String functionCd;
+       @Id
+       @Column(name = "function_name")
+    private String functionName;
+       @Id
+       @Column(name = "app_id")
+    private long appId;
+       
+       @Id
+       @Column(name = "role_app_id")
+       private long roleAppId;
+       
+       public Long getRoleId() {
+               return roleId;
+       }
+       public void setRoleId(long roleId) {
+               this.roleId = roleId;
+       }
+       public String getRoleName() {
+               return roleName;
+       }
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+       public boolean isActive() {
+               return active;
+       }
+       public void setActive(boolean active) {
+               this.active = active;
+       }
+       public Integer getPriority() {
+               return priority;
+       }
+       public void setPriority(Integer priority) {
+               this.priority = priority;
+       }
+       public String getFunctionCd() {
+               return functionCd;
+       }
+       public void setFunctionCd(String functionCd) {
+               this.functionCd = functionCd;
+       }
+       public String getFunctionName() {
+               return functionName;
+       }
+       public void setFunctionName(String functionName) {
+               this.functionName = functionName;
+       }
+       public long getAppId() {
+               return appId;
+       }
+       public void setAppId(long appId) {
+               this.appId = appId;
+       }
+       @Override
+       public String toString() {
+               return "GlobalRoleWithApplicationRoleFucnction [roleId=" + roleId + ", roleName=" + roleName + ", active="
+                               + active + ", priority=" + priority + ", functionCd=" + functionCd + ", functionName=" + functionName
+                               + ", appId=" + appId + "]";
+       }
+
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/LocalRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/LocalRole.java
new file mode 100644 (file)
index 0000000..3d9ec97
--- /dev/null
@@ -0,0 +1,77 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class LocalRole implements Serializable {
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name = "ROLE_ID")
+       public Integer roleId;
+
+       @Column(name = "ROLE_NAME")
+       public String rolename;
+
+       public void normalize() {
+               this.rolename = (this.rolename == null) ? "" : this.rolename.trim();
+       }
+
+       public Integer getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Integer roleId) {
+               this.roleId = roleId;
+       }
+
+       public String getRolename() {
+               return rolename;
+       }
+
+       public void setRolename(String rolename) {
+               this.rolename = rolename;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..8347d4f
--- /dev/null
@@ -0,0 +1,123 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+/**
+ * Model of rows in the fn_app table; serialized as a message add or update an
+ * on-boarded application.
+ */
+public class OnboardingApp {
+
+       public Long id;
+
+       public String name;
+
+       public String imageUrl;
+
+       public String imageLink;
+
+       public String description;
+
+       public String notes;
+
+       public String url;
+
+       public String alternateUrl;
+
+       public String restUrl;
+
+       public Boolean isOpen;
+
+       public Boolean isEnabled;
+
+       public Long motsId;
+
+       public String myLoginsAppName;
+
+       public String myLoginsAppOwner;
+
+       public String username;
+
+       public String appPassword;
+
+       public String thumbnail;
+
+       public String uebTopicName;
+
+       public String uebKey;
+
+       public String uebSecret;
+
+       public Boolean restrictedApp;
+       
+       public Boolean isCentralAuth;
+       
+       public String nameSpace;
+
+       /**
+        * 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.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();
+       }
+
+       public void setUebTopicName(String topicName) {
+               this.uebTopicName = topicName;
+       }
+
+       public void setUebKey(String key) {
+               this.uebKey = key;
+       }
+
+       public void setUebSecret(String secret) {
+               this.uebSecret = secret;
+       }
+
+       // 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 setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingWidget.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/OnboardingWidget.java
new file mode 100644 (file)
index 0000000..4205324
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+@Entity
+public class OnboardingWidget implements Serializable {
+
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name = "WIDGET_ID")
+       public Long id;
+
+       @Column(name = "WDG_NAME")
+       public String name;
+
+       @Column(name = "APP_ID")
+       public Long appId;
+
+       @Column(name = "APP_NAME")
+       public String appName;
+
+       @Column(name = "WDG_WIDTH")
+       public Integer width;
+
+       @Column(name = "WDG_HEIGHT")
+       public Integer height;
+
+       @Column(name = "WDG_URL")
+       public String url;
+
+       public void normalize() {
+               this.name = (this.name == null) ? "" : this.name.trim();
+               this.appName = (this.appName == null) ? "" : this.appName.trim();
+               if (this.width == null)
+                       this.width = new Integer(0);
+               if (this.height == null)
+                       this.height = new Integer(0);
+               this.url = (this.url == null) ? "" : this.url.trim();
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java
new file mode 100644 (file)
index 0000000..f3ec779
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * This is to handle portal admins
+ */
+@Entity
+@Table(name = "fn_user")
+public class PortalAdmin implements Serializable {
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.IDENTITY)
+       @Column(name = "user_id")
+       public Long userId;
+
+       @Column(name = "login_id")
+       public String loginId;
+
+       @Column(name = "first_name")
+       public String firstName;
+
+       @Column(name = "last_name")
+       public String lastName;
+
+       public Long getUserId() {
+               return userId;
+       }
+
+       public void setUserId(Long userId) {
+               this.userId = userId;
+       }
+
+       public String getLoginId() {
+               return loginId;
+       }
+
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+
+       public String getFirstName() {
+               return firstName;
+       }
+
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       public String getLastName() {
+               return lastName;
+       }
+
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdminUserRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdminUserRole.java
new file mode 100644 (file)
index 0000000..a79075b
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * This is to handle portal admins
+ */
+@Entity
+@Table(name="fn_user_role")
+public class PortalAdminUserRole implements Serializable{
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name = "user_id")
+       public Long userId;
+       
+       @Id
+       @Column(name = "role_id")
+       public Long roleId;
+       
+       @Column(name = "app_id")
+       public Long appId;
+               
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ProfileDetail.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/ProfileDetail.java
new file mode 100644 (file)
index 0000000..d190189
--- /dev/null
@@ -0,0 +1,97 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class ProfileDetail {
+       
+       private String firstName;
+       private String lastName;
+       private String middleName;
+       private String email;
+       private String loginId;
+       private String loginPassword;
+       
+       public ProfileDetail(){}
+       public ProfileDetail(String firstName, String lastName, String middleName, String email, String loginId, String loginPassword) {
+               this.firstName = firstName;
+               this.lastName = lastName;
+               this.middleName = middleName;
+               this.email = email;
+               this.loginId = loginId;
+               this.loginPassword = loginPassword;
+       }
+
+       public String getFirstName() {
+               return firstName;
+       }
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+       public String getLastName() {
+               return lastName;
+       }
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+       public String getMiddleName() {
+               return middleName;
+       }
+       public void setMiddleName(String middleName) {
+               this.middleName = middleName;
+       }
+       public String getEmail() {
+               return email;
+       }
+       public void setEmail(String email) {
+               this.email = email;
+       }
+       public String getLoginId() {
+               return loginId;
+       }
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+       public String getLoginPassword() {
+               return loginPassword;
+       }
+       public void setLoginPassword(String loginPassword) {
+               this.loginPassword = loginPassword;
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RemoteRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RemoteRole.java
new file mode 100644 (file)
index 0000000..a86f10f
--- /dev/null
@@ -0,0 +1,91 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class RemoteRole {
+
+       private Long id;
+       private String name;
+       
+       public Long getId() {
+               return id;
+       }
+       public void setId(Long id) {
+               this.id = id;
+       }
+       public String getName() {
+               return name;
+       }
+       public void setName(String name) {
+               this.name = name;
+       }
+       
+       @Override
+       public String toString() {
+               return "RemoteRole [id=" + id + ", name=" + name + "]";
+       }
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((id == null) ? 0 : id.hashCode());
+               result = prime * result + ((name == null) ? 0 : name.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               RemoteRole other = (RemoteRole) obj;
+               if (id == null) {
+                       if (other.id != null)
+                               return false;
+               } else if (!id.equals(other.id))
+                       return false;
+               if (name == null) {
+                       if (other.name != null)
+                               return false;
+               } else if (!name.equals(other.name))
+                       return false;
+               return true;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RemoteUserWithRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RemoteUserWithRoles.java
new file mode 100644 (file)
index 0000000..39127c1
--- /dev/null
@@ -0,0 +1,214 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * User description which we receive in response from request to remote
+ * application: applicationsRestClientService.get(RemoteUserWithRoles[].class,
+ * appId, "/users"). It contains the most important info about remote
+ * application user including his roles in this application.
+ */
+public class RemoteUserWithRoles {
+
+       private Long orgId;
+
+       private Long managerId;
+
+       private String firstName;
+
+       private String middleInitial;
+
+       private String lastName;
+
+       private String phone;
+
+       private String email;
+
+       private String hrid;
+
+       private String orgUserId;
+
+       private String orgCode;
+
+       private String orgManagerUserId;
+
+       private String jobTitle;
+
+       private String loginId;
+
+       private Boolean active;
+
+       private List<RemoteRole> roles = new ArrayList<RemoteRole>();
+
+       public Long getOrgId() {
+               return orgId;
+       }
+
+       public void setOrgId(Long orgId) {
+               this.orgId = orgId;
+       }
+
+       public Long getManagerId() {
+               return managerId;
+       }
+
+       public void setManagerId(Long managerId) {
+               this.managerId = managerId;
+       }
+
+       public String getFirstName() {
+               return firstName;
+       }
+
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       public String getMiddleInitial() {
+               return middleInitial;
+       }
+
+       public void setMiddleInitial(String middleInitial) {
+               this.middleInitial = middleInitial;
+       }
+
+       public String getLastName() {
+               return lastName;
+       }
+
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+
+       public String getPhone() {
+               return phone;
+       }
+
+       public void setPhone(String phone) {
+               this.phone = phone;
+       }
+
+       public String getEmail() {
+               return email;
+       }
+
+       public void setEmail(String email) {
+               this.email = email;
+       }
+
+       public String getHrid() {
+               return hrid;
+       }
+
+       public void setHrid(String hrid) {
+               this.hrid = hrid;
+       }
+
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       public void setOrgUserId(String orgUserId) {
+               if(this.orgUserId == null)
+                       this.orgUserId = orgUserId;
+       }
+
+       public String getOrgCode() {
+               return orgCode;
+       }
+
+       public void setOrgCode(String orgCode) {
+               this.orgCode = orgCode;
+       }
+
+       public String getOrgManagerUserId() {
+               return orgManagerUserId;
+       }
+
+       public void setOrgManagerUserId(String orgManagerUserId) {
+               this.orgManagerUserId = orgManagerUserId;
+       }
+
+       public String getJobTitle() {
+               return jobTitle;
+       }
+
+       public void setJobTitle(String jobTitle) {
+               this.jobTitle = jobTitle;
+       }
+
+       public String getLoginId() {
+               return loginId;
+       }
+
+       public void setLoginId(String loginId) {
+               this.loginId = loginId;
+       }
+
+       public Boolean getActive() {
+               return active;
+       }
+
+       public void setActive(Boolean active) {
+               this.active = active;
+       }
+
+       public List<RemoteRole> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<RemoteRole> roles) {
+               this.roles = roles;
+       }
+
+       @Override
+       public String toString() {
+               return "RemoteUserWithRoles [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName
+                               + ", middleInitial=" + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", email="
+                               + email + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", orgManagerUserId="
+                               + orgManagerUserId + ", jobTitle=" + jobTitle + ", loginId=" + loginId + ", active=" + active
+                               + ", roles=" + roles + "]";
+       }
+       
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RoleInAppForUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RoleInAppForUser.java
new file mode 100644 (file)
index 0000000..12fc0ab
--- /dev/null
@@ -0,0 +1,123 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class RoleInAppForUser {
+
+
+       public RoleInAppForUser() {
+       }
+       
+       public RoleInAppForUser(Long id, String name) {
+               this.roleId = id;
+               this.roleName = name;
+       }
+
+       public Long roleId;
+
+       public String roleName;
+
+       public Boolean isApplied;
+
+       public Long getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+
+       public Boolean getIsApplied() {
+               return isApplied;
+       }
+
+       public void setIsApplied(Boolean isApplied) {
+               this.isApplied = isApplied;
+       }
+
+       @Override
+       public String toString() {
+               return "RoleInAppForUser [roleId=" + roleId + ", roleName=" + roleName + ", isApplied=" + isApplied + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((isApplied == null) ? 0 : isApplied.hashCode());
+               result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
+               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               RoleInAppForUser other = (RoleInAppForUser) obj;
+               if (isApplied == null) {
+                       if (other.isApplied != null)
+                               return false;
+               } else if (!isApplied.equals(other.isApplied))
+                       return false;
+               if (roleId == null) {
+                       if (other.roleId != null)
+                               return false;
+               } else if (!roleId.equals(other.roleId))
+                       return false;
+               if (roleName == null) {
+                       if (other.roleName != null)
+                               return false;
+               } else if (!roleName.equals(other.roleName))
+                       return false;
+               return true;
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RolesInAppForUser.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/RolesInAppForUser.java
new file mode 100644 (file)
index 0000000..0d79020
--- /dev/null
@@ -0,0 +1,51 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class RolesInAppForUser {
+
+       public String orgUserId;
+       
+       public Long appId;
+
+       public List<RoleInAppForUser> roles = new ArrayList<RoleInAppForUser>();
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/UserApplicationRoles.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/UserApplicationRoles.java
new file mode 100644 (file)
index 0000000..3f88bc0
--- /dev/null
@@ -0,0 +1,104 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A specific application user and his application specific roles.
+ *
+ */
+public class UserApplicationRoles {
+
+       private Long appId;
+
+       private String orgUserId;
+
+       private String firstName;
+
+       private String lastName;
+
+       private List<RemoteRole> roles = new ArrayList<RemoteRole>();
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getOrgUserId() {
+               return orgUserId;
+       }
+
+       public void setOrgUserId(String orgUserId) {
+               this.orgUserId = orgUserId;
+       }
+
+       public String getFirstName() {
+               return firstName;
+       }
+
+       public void setFirstName(String firstName) {
+               this.firstName = firstName;
+       }
+
+       public String getLastName() {
+               return lastName;
+       }
+
+       public void setLastName(String lastName) {
+               this.lastName = lastName;
+       }
+
+       public List<RemoteRole> getRoles() {
+               return roles;
+       }
+
+       public void setRoles(List<RemoteRole> roles) {
+               this.roles = roles;
+       }
+       
+       @Override
+       public String toString() {
+               return "UserApplicationRoles [appId=" + appId + ", orgUserId=" + orgUserId + ", firstName=" + firstName
+                               + ", lastName=" + lastName + ", roles=" + roles + "]";
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/UserWithNameSurnameTitle.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/UserWithNameSurnameTitle.java
new file mode 100644 (file)
index 0000000..dab2c5f
--- /dev/null
@@ -0,0 +1,100 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class UserWithNameSurnameTitle {
+       
+       public String orgUserId;
+
+       public String firstName;
+
+       public String lastName;
+
+       public String jobTitle;
+       
+       public UserWithNameSurnameTitle(String orgUserId, String firstName, String lastName, String jobTitle) {
+               this.orgUserId = orgUserId;
+               this.firstName = firstName;
+               this.lastName = lastName;
+               this.jobTitle = jobTitle;
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
+               result = prime * result + ((jobTitle == null) ? 0 : jobTitle.hashCode());
+               result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
+               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               UserWithNameSurnameTitle other = (UserWithNameSurnameTitle) obj;
+               if (firstName == null) {
+                       if (other.firstName != null)
+                               return false;
+               } else if (!firstName.equals(other.firstName))
+                       return false;
+               if (jobTitle == null) {
+                       if (other.jobTitle != null)
+                               return false;
+               } else if (!jobTitle.equals(other.jobTitle))
+                       return false;
+               if (lastName == null) {
+                       if (other.lastName != null)
+                               return false;
+               } else if (!lastName.equals(other.lastName))
+                       return false;
+               if (orgUserId == null) {
+                       if (other.orgUserId != null)
+                               return false;
+               } else if (!orgUserId.equals(other.orgUserId))
+                       return false;
+               return true;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/WidgetCatalogPersonalization.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/WidgetCatalogPersonalization.java
new file mode 100644 (file)
index 0000000..6ca466a
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+/**
+ * Model for the object PUT to the controller when the user takes an action on
+ * a widget in the catalog.
+ */
+
+public class WidgetCatalogPersonalization {
+       
+               public Long widgetId;
+               public Boolean select;
+               // not needed as only 'SHOW' and 'HIDE' status_cd is expected from the micro service now
+               //public Boolean pending;
+
+               public Long getWidgetId() {
+                       return widgetId;
+               }
+
+               public void setWidgetId(Long widgetId) {
+                       this.widgetId = widgetId;
+               }
+
+               public Boolean getSelect() {
+                       return select;
+               }
+
+               public void setSelect(Boolean select) {
+                       this.select = select;
+               }
+
+               /*public Boolean getPending() {
+                       return pending;
+               }
+
+               public void setPending(Boolean pending) {
+                       this.pending = pending;
+               }*/
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java
new file mode 100644 (file)
index 0000000..d006f8e
--- /dev/null
@@ -0,0 +1,229 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ueb;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EcompApp;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.ueb.Helper;
+import org.onap.portalsdk.core.onboarding.ueb.Publisher;
+import org.onap.portalsdk.core.onboarding.ueb.UebException;
+import org.onap.portalsdk.core.onboarding.ueb.UebManager;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsg;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.onap.portalapp.portal.ueb.EPUebHelper;
+import org.onap.portalapp.portal.ueb.EPUebMsgTypes;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class EPUebHelper {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
+       
+       @Autowired
+       private EPAppService appsService;
+       
+       @Autowired
+       private SessionFactory sessionFactory;
+       
+       @SuppressWarnings("unused")
+       private Publisher epPublisher;
+       
+       public EPUebHelper() {
+               
+       }
+       //
+       // This should only be called by the ECOMP Portal App, other Apps have just one publisher and use appPublisher
+       //
+       @SuppressWarnings("unused")
+       @EPMetricsLog
+       public void refreshPublisherList()
+       {
+               Session localSession = null;
+           boolean addedPublisher = false;
+           
+               try {
+                       localSession = sessionFactory.openSession();
+               
+                       List<EcompApp> apps = appsService.getEcompAppAppsFullList();
+                       for (int i = 0; i < apps.size(); i++) 
+                       {
+                               if ((apps.get(i).isEnabled()) &&
+                                       (apps.get(i).getUebTopicName() != null) &&
+                                       !(apps.get(i).getUebTopicName().toUpperCase().contains("ECOMP-PORTAL-INBOX")))
+                               {
+                                       logger.debug(EELFLoggerDelegate.debugLogger, "UEBManager adding publisher for " + apps.get(i).getUebTopicName());
+                                       UebManager.getInstance().addPublisher(apps.get(i).getUebTopicName());
+                       addedPublisher = true;
+                           }
+                               else if ((apps.get(i).getId() != 1) && // App may have been disabled, remove the publisher
+                                                !(apps.get(i).isEnabled()))
+                               {
+                                       if(apps.get(i).getUebTopicName()!=null){
+                                               UebManager.getInstance().removePublisher(apps.get(i).getUebTopicName());
+                                       }
+                               }
+                       }
+               }
+               catch (Exception e)
+               {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebSystemError, e, "add/remove Publisher");
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while refreshing the publisher list", e);
+               }
+               
+               //publisherList.print();
+               
+               if (addedPublisher == true) // Give publishers time to initialize
+               {
+                       Helper.sleep(400);
+               }
+       }
+       
+       @PostConstruct
+       @EPMetricsLog
+       public void initUeb() {
+               try {
+                       epPublisher = new Publisher(PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY), 
+                                                           PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), 
+                                                           PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, e);
+               }
+               
+               Thread thread = new Thread("EPUebManager: postConstructMethod - refreshPublisherList") {
+                   public void run(){
+                       refreshPublisherList();
+                   }
+               };
+               thread.start();
+               
+       }
+
+       @EPMetricsLog
+       public void addPublisher(EPApp app) {
+               // TODO Auto-generated method stub
+               try {
+                       UebManager.getInstance().addPublisher(app.getUebTopicName());
+               } catch (UebException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "addPublisher failed", e);
+               }
+       }
+       
+       public boolean checkAvailability() {
+               //
+               //  Test existence of topic at UEB url
+               //
+               //  (ie http://uebsb91kcdc.it.com:3904/topics/ECOMP-PORTAL-INBOX)
+               //
+               boolean available = true;
+               LinkedList<String> urlList = (LinkedList<String>) Helper.uebUrlList();
+               if (!urlList.isEmpty()) {
+                   String url = "http://" + urlList.getFirst() + ":3904/topics/" + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME);
+                   if (!url.isEmpty()) {
+                       try {
+                           URL siteURL = new URL(url);
+                           HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
+                           connection.setRequestMethod("GET");
+                           connection.connect();
+                    
+                           int code = connection.getResponseCode();
+                           if (code == 200) {
+                               available = true;
+                           }
+                           else {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, url);
+                               available = false;
+                               logger.warn(EELFLoggerDelegate.errorLogger, "Warning! UEB topic existence check failed, topic = " + url );
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Warning! UEB topic existence check failed, topic = " + url );
+                           }
+                       }
+                       catch (Exception e) {
+                           available = false;
+                                       logger.error(EELFLoggerDelegate.errorLogger, "checkAvailability failed", e);
+                       }
+                   }
+               }
+               return available;
+       }
+       
+    public boolean MessageCanBeSentToTopic() {
+    
+       boolean sentMsgSuccessfully = false;
+       
+           UebMsg msg = new UebMsg();
+           msg.putSourceTopicName(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+           msg.putPayload("Pinging topic for health check");
+           msg.putMsgType(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK);
+       
+           try {
+                  // epPublisher.send(msg);
+                   sentMsgSuccessfully = true;
+           } 
+           catch (Exception e) {
+               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckUebClusterError, e);
+                   sentMsgSuccessfully = false;
+                   logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to " 
+                                    + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME), e); 
+           } 
+           
+           return sentMsgSuccessfully;
+    }
+    
+}
+
+
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java
new file mode 100644 (file)
index 0000000..7e49f8f
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ueb;
+
+import org.onap.portalsdk.core.onboarding.ueb.UebMsgTypes;
+
+public interface EPUebMsgTypes extends UebMsgTypes {
+
+       public static final String UEB_MSG_TYPE_HEALTH_CHECK = "uebHealthCheckPing";
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/CustomLoggingFilter.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/CustomLoggingFilter.java
new file mode 100644 (file)
index 0000000..0b564ee
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.filter.Filter;
+import ch.qos.logback.core.spi.FilterReply;
+
+/**
+ * Custom Filter class bind with logback.xml
+ * configuration file to strip out certain log messages
+ * coming out of special packages or classes.
+ *
+ */
+public class CustomLoggingFilter extends Filter<ILoggingEvent> {
+
+       /**
+        * Custom Filter is added to strip out the continuous U-EB logging messages
+        * But make sure we log the ERROR & WARNING Level messages.
+        */
+       @Override
+       public FilterReply decide(ILoggingEvent event) {
+               try {
+                       if ((event.getLevel() != Level.ERROR || event.getLevel() != Level.WARN) && 
+                               (event.getThreadName().equalsIgnoreCase("UEBConsumerThread")) &&
+                               (event.getLoggerName().contains("org.openecomp.nsa") || event.getLoggerName().contains("org.apache.http"))
+                               ) {
+                               return FilterReply.DENY;
+                       } else {
+                               return FilterReply.NEUTRAL;
+                       }
+               } catch(Exception e) {
+                       return FilterReply.NEUTRAL;
+               } 
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EPCommonSystemProperties.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EPCommonSystemProperties.java
new file mode 100644 (file)
index 0000000..0d3ff51
--- /dev/null
@@ -0,0 +1,95 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import org.onap.portalsdk.core.util.SystemProperties;
+
+public class EPCommonSystemProperties extends SystemProperties {
+
+       public static final String LOGIN_URL_NO_RET_VAL                         = "login_url_no_ret_val";
+       public static final String ECOMP_APP_ID                         = "ecomp_app_id";
+       public static final String SYS_ADMIN_ROLE_ID                    = "sys_admin_role_id";
+       public static final String DUBLICATED_FIELD_VALUE_ECOMP_ERROR   = "1201";
+       public static final String ACCOUNT_ADMIN_ROLE_ID                = "account_admin_role_id";
+       public static final String RESTRICTED_APP_ROLE_ID                               = "restricted_app_role_id";
+       public static final String FE_URL                                       = "frontend_url";
+       public static final String HEALTH_POLL_INTERVAL_SECONDS         = "health_poll_interval_seconds";
+       public static final String HEALTHFAIL_ALERT_EVERY_X_INTERVALS   = "health_fail_alert_every_x_intervals";
+       public static final String USER_GUIDE_URL                       = "user_guide_link";
+       
+       public static final String USER_FIRST_NAME                                              = "USER_FIRST_NAME";
+       public static final String USER_LAST_NAME                                               = "USER_LAST_NAME";
+       public static final String USER_EMAIL                                                   = "USER_EMAIL";
+       public static final String USER_ORG_USERID                                              = "USER_ORG_USERID";
+       
+       public static final String USH_TICKET_URL                                               = "ush_ticket_url"; 
+
+       public static final String EXTERNAL_API_RESPONSE_CODE                   = "External_API_ResponseCode";
+       public static final String COOKIE_DOMAIN                        = "cookie_domain";
+
+       public static final String FEEDBACK_EMAIL_ADDRESS                               = "feedback_email_address";
+       public static final String PORTAL_INFO_URL                                              = "portal_info_url";
+       
+       public static final String ONLINE_USER_UPDATE_RATE                              = "online_user_update_rate";
+       public static final String ONLINE_USER_UPDATE_DURATION                  = "online_user_update_duration";
+       
+       public static final String NOTIFICATION_UPDATE_RATE                             = "notification_update_rate";
+       public static final String NOTIFICATION_UPDATE_DURATION                 = "notification_update_duration";
+       
+       public static final String WINDOW_WIDTH_THRESHOLD_LEFT_MENU             = "window_width_threshold_left_menu";
+       public static final String WINDOW_WIDTH_THRESHOLD_RIGHT_MENU    = "window_width_threshold_right_menu";
+               
+       public static final String AUDITLOG_DEL_DAY_FROM                                = "auditlog_del_day_from";
+       public static final String AUDITLOG_DELETE_CRON                                 = "auditlog_delete_cron";
+       
+       public static final String AUTH_USER_SERVER                                     = "auth_user_server";
+       public static final String EXTERNAL_ACCESS_ENABLE                               = "external_access_enable";
+
+       public static final String EXTERNAL_SYSTEM_NOTIFICATION_URL             = "external_system_notification_url";
+       public static final String EXTERNAL_CENTRAL_AUTH_USER_NAME              = "ext_central_access_user_name";
+       public static final String EXTERNAL_CENTRAL_AUTH_PASSWORD       = "ext_central_access_password";
+       public static final String EXTERNAL_CENTRAL_ACCESS_URL              = "ext_central_access_url";
+       public static final String EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN  = "ext_central_access_user_domain";
+       public static final String REMOTE_CENTRALISED_SYSTEM_ACCESS             = "remote_centralized_system_access";
+
+       public static final String WIDGET_MS_PROTOCOL                                   = "microservices.widget.protocol";
+       public static final String WIDGET_MS_HOSTNAME                                   = "microservices.widget.hostname";
+       
+       public static final String REMOTE_CENTRALIZED_SYSTEM_ACCESS             = "remote_centralized_system_access";
+
+}
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
new file mode 100644 (file)
index 0000000..efd84b9
--- /dev/null
@@ -0,0 +1,563 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.DatatypeConverter;
+
+import org.apache.commons.lang.StringUtils;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.onap.portalapp.portal.domain.EPUser;
+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.PortalApiConstants;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class EcompPortalUtils {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EcompPortalUtils.class);
+       
+       private static final String FUNCTION_PIPE = "|";
+       
+       // TODO: GLOBAL_LOGIN_URL is the same as in SessionTimeoutInterceptor.
+       // It should be defined in SystemProperties.
+       private static final String GLOBAL_LOGIN_URL = "global-login-url";
+       
+       // It is a regular expression used for while creating a External Central Auth Role 
+       public static final String EXTERNAL_CENTRAL_AUTH_ROLE_HANDLE_SPECIAL_CHARACTERS = "([^A-Z^a-z^0-9^\\.^%^(^)^=^:])";
+       
+       /**
+        * @param orgUserId
+        *            User ID to validate
+        * @return true if orgUserId is not empty and contains only alphanumeric, false
+        *         otherwise
+        */
+       public static boolean legitimateUserId(String orgUserId) {
+               return orgUserId.matches("^[a-zA-Z0-9]+$");
+       }
+
+       /**
+        * Splits the string into a list of tokens using the specified regular
+        * expression
+        * 
+        * @param source
+        *            String to split
+        * @param regex
+        *            tokens
+        * @return List of tokens split from the source
+        */
+       public static List<String> parsingByRegularExpression(String source, String regex) {
+               List<String> tokens = new ArrayList<String>();
+               if (source != null && source.length() > 0) {
+                       String[] parsed = source.split(regex);
+                       for (String token : parsed) {
+                               if (token.length() > 0) {
+                                       tokens.add(token);
+                               }
+                       }
+               }
+               return tokens;
+       }
+
+       /**
+        * Builds a JSON object with error code and message information.
+        * 
+        * @param errorCode
+        *            error code
+        * @param errorMessage
+        *            message
+        * @return JSON object as a String
+        */
+       public static String jsonErrorMessageResponse(int errorCode, String errorMessage) {
+               return "{\"error\":{\"code\":" + errorCode + "," + "\"message\":\"" + errorMessage + "\"}}";
+       }
+
+       /**
+        * Builds a JSON object with the specified message
+        * 
+        * @param message
+        *            Message to embed
+        * @return JSON object as a String
+        */
+       public static String jsonMessageResponse(String message) {
+               return String.format("{\"message\":\"%s\"}", message);
+       }
+
+       /**
+        * Serializes the specified object as JSON and writes the result to the debug
+        * log. If serialization fails, logs a message to the error logger.
+        * 
+        * @param logger
+        *            Logger for the class where the object was built; the logger
+        *            carries the class name.
+        * @param source
+        *            First portion of the log message
+        * @param msg
+        *            Second portion of the log message
+        * @param obj
+        *            Object to serialize as JSON
+        */
+       public static void logAndSerializeObject(EELFLoggerDelegate logger, String source, String msg, Object obj) {
+               try {
+                       String objectAsJson = new ObjectMapper().writeValueAsString(obj);
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       String.format("source= [%s]; %s [%s];", source, msg, objectAsJson));
+               } catch (JsonProcessingException e) {
+                       logger.warn(EELFLoggerDelegate.errorLogger, "logAndSerializedObject failed to serialize", e);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "logAndSerializedObject failed", e);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+               }
+       }
+
+       /**
+        * Serializes the specified object as JSON and writes the result to the debug
+        * log. If serialization fails, logs a message to the error logger.
+        * 
+        * @param source
+        *            First portion of the log message
+        * @param msg
+        *            Second portion of the log message
+        * @param obj
+        *            Object to serialize as JSON
+        */
+       public static void logAndSerializeObject(String source, String msg, Object obj) {
+               logAndSerializeObject(logger, source, msg, obj);
+       }
+
+       public static void rollbackTransaction(Transaction transaction, String errorMessage) {
+               logger.error(EELFLoggerDelegate.errorLogger, errorMessage);
+               try {
+                       if (transaction != null) {
+                               transaction.rollback();
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeExecuteRollbackError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing a rollback transaction",
+                                       e);
+               }
+       }
+
+       public static void closeLocalSession(Session localSession, String errorMessage) {
+               logger.error(EELFLoggerDelegate.errorLogger, errorMessage);
+               try {
+                       if (localSession != null) {
+                               localSession.close();
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoCloseSessionError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, errorMessage + ", closeLocalSession exception", e);
+               }
+       }
+
+       /**
+        * Set response status to Unauthorized if user == null and to Forbidden in all
+        * (!) other cases. Logging is not performed if invocator == null
+        * 
+        * @param user
+        *            User object
+        * @param response
+        *            HttpServletResponse
+        * @param invocator
+        *            may be null
+        */
+       public static void setBadPermissions(EPUser user, HttpServletResponse response, String invocator) {
+               if (user == null) {
+                       String loginUrl = SystemProperties.getProperty(EPCommonSystemProperties.LOGIN_URL_NO_RET_VAL);
+                       response.setHeader(GLOBAL_LOGIN_URL, loginUrl);
+                       response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
+                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_UNAUTHORIZED));
+               } else {
+                       response.setStatus(HttpServletResponse.SC_FORBIDDEN);
+                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_FORBIDDEN));
+               }
+               if (invocator != null) {
+                       logger.warn(EELFLoggerDelegate.errorLogger,
+                                       invocator + ", permissions problem, response status = " + response.getStatus());
+               }
+       }
+
+       public static int getExternalAppResponseCode() {
+               String responseCode = MDC.get(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
+               int responseCodeInt = 0;
+               try {
+                       if (responseCode != null && responseCode != "") {
+                               responseCodeInt = Integer.valueOf(responseCode);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getExternalAppResponseCode failed", e);
+               }
+               return responseCodeInt;
+       }
+
+       // This method might be just for testing purposes.
+       public static void setExternalAppResponseCode(int responseCode) {
+               try {
+                       String code = String.valueOf(responseCode);
+                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,code );
+                       code=StringUtils.EMPTY;
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "setExternalAppResponseCode failed", e);
+               }
+       }
+
+       public static String getHTTPStatusString(int httpStatusCode) {
+               String httpStatusString = "unknown_error";
+               try {
+                       httpStatusString = org.springframework.http.HttpStatus.valueOf(httpStatusCode).name();
+                       if (httpStatusString != null) {
+                               httpStatusString = httpStatusString.toLowerCase();
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getHTTPStatusString failed", e);
+               }
+               return httpStatusString;
+       }
+
+       public static String getFEErrorString(Boolean internal, int responseCode) {
+               // Return a String like the following:
+               // "Internal Ecomp Error: 500 internal_server_error" or
+               // "External App Error: 404 not_found"
+               // TODO: create our own Ecomp error codes, starting with 1000 and up.
+               String internalExternalString = internal ? "Ecomp Error: " : "App Error: ";
+               String httpStatusString = "unknown_error";
+               try {
+                       if (responseCode < 1000) {
+                               httpStatusString = getHTTPStatusString(responseCode);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getFEErrorString failed", e);
+               }
+               String responseString = internalExternalString + responseCode + " " + httpStatusString;
+               return responseString;
+       }
+
+       public static boolean isProductionBuild() {
+               boolean productionBuild = true;
+               String epVersion = EcompVersion.buildNumber;
+               if (epVersion != null) {
+                       int buildNum = epVersion.lastIndexOf('.');
+                       if (buildNum > 0) {
+                               int buildNumber = Integer.parseInt(epVersion.substring(buildNum + 1));
+                               if (buildNumber < 3000) // Production versions are 3000+, (ie
+                                                                               // 1.0.3003)
+                               {
+                                       productionBuild = false;
+                               }
+                       }
+               }
+               return productionBuild;
+       }
+
+       public static String getMyIpAdddress() {
+               InetAddress ip;
+               String localIp;
+               try {
+                       ip = InetAddress.getLocalHost();
+                       localIp = ip.getHostAddress();
+               } catch (UnknownHostException e) {
+                       localIp = "unknown";
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMyIpAdddress failed ", e);
+               }
+               return localIp;
+       }
+
+       public static String getMyHostName() {
+               InetAddress ip;
+               String hostName;
+               try {
+                       ip = InetAddress.getLocalHost();
+                       hostName = ip.getHostName();
+               } catch (UnknownHostException e) {
+                       hostName = "unknown";
+                       logger.error(EELFLoggerDelegate.errorLogger, "getMyHostName failed", e);
+               }
+               return hostName;
+       }
+
+       /**
+        * Returns a default property if the expected one is not available
+        * 
+        * @param property
+        *            Key
+        * @param defaultValue
+        *            default Value
+        * @return Default value if property is not defined or yields the empty string;
+        *         else the property value.
+        */
+       public static String getPropertyOrDefault(String property, String defaultValue) {
+               if (!SystemProperties.containsProperty(property))
+                       return defaultValue;
+               String value = SystemProperties.getProperty(property);
+               if (value == null || "".equals(value))
+                       return defaultValue;
+               return value;
+       }
+
+       /**
+        * Calculates the time duration of a function call for logging purpose. It
+        * stores the result by using "MDC.put(SystemProperties.MDC_TIMER,
+        * timeDifference);" It is important to call
+        * "MDC.remove(SystemProperties.MDC_TIMER);" after this method call to clean up
+        * the record in MDC
+        *
+        * @param beginDateTime
+        *            the given begin time for the call
+        * @param endDateTime
+        *            the given end time for the call
+        * 
+        */
+       public static void calculateDateTimeDifferenceForLog(String beginDateTime, String endDateTime) {
+               if (beginDateTime != null && endDateTime != null) {
+                       try {
+                               SimpleDateFormat ecompLogDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
+
+                               Date beginDate = ecompLogDateFormat.parse(beginDateTime);
+                               Date endDate = ecompLogDateFormat.parse(endDateTime);
+                               String timeDifference = String.format("%d", endDate.getTime() - beginDate.getTime());
+                               MDC.put(SystemProperties.MDC_TIMER, timeDifference);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "calculateDateTimeDifferenceForLog failed", e);
+                       }
+               }
+       }
+
+       /**
+        * Answers the protocol to use.
+        * 
+        * @return Protocol name from property file; defaults to https.
+        */
+       public static String widgetMsProtocol() {
+               return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_PROTOCOL, "https");
+       }
+
+       /**
+        * Answers the host to use.
+        * 
+        * @return Host name from property file; defaults to localhost.
+        */
+       public static String localOrDockerHost() {
+               return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_HOSTNAME, "localhost");
+       }
+
+       /**
+        * It returns headers where username and password of external central auth is
+        * encoded to base64
+        * 
+        * @return header which contains external central auth username and password
+        *         base64 encoded
+        * @throws Exception
+        *             if unable to decrypt the password
+        */
+       public static HttpHeaders base64encodeKeyForAAFBasicAuth() throws Exception {
+               String userName = "";
+               String decryptedPass = "";
+               if (EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME)
+                               && EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD)) {
+                       decryptedPass = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD);
+                       userName = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME);
+               }
+               String decPass = decrypted(decryptedPass);
+               String usernamePass = userName + ":" + decPass;
+               String encToBase64 = String.valueOf((DatatypeConverter.printBase64Binary(usernamePass.getBytes())));
+               HttpHeaders headers = new HttpHeaders();
+               headers.add("Authorization", "Basic " + encToBase64);
+               headers.setContentType(MediaType.APPLICATION_JSON);
+               return headers;
+       }
+
+       private static String decrypted(String encrypted) throws Exception {
+               String result = "";
+               if (encrypted != null && encrypted.length() > 0) {
+                       try {
+                               result = CipherUtil.decryptPKC(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key));
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
+                               throw e;
+                       }
+               }
+               return result;
+       }
+
+       public static String truncateString(String originString, int size){
+               if(originString.length()>=size){
+                       StringBuilder stringBuilder = new StringBuilder();
+                       stringBuilder.append(originString);
+                       stringBuilder.setLength(size);
+                       stringBuilder.append("...");
+                       return stringBuilder.toString();
+               }
+               return originString;
+       }
+       
+       /**
+        * 
+        * If function code value has any pipes it does pipe filter and 
+        * returns value.
+        * 
+        * @param functionCode
+        * @return function instance without pipe
+        */
+       public static String getFunctionCode(String functionCode) {
+               String finalFunctionCodeVal = "";
+               if (functionCode.contains(FUNCTION_PIPE)) {
+                       int count = StringUtils.countMatches(functionCode, FUNCTION_PIPE);
+                       if (count == 2)
+                               finalFunctionCodeVal = functionCode.substring(
+                                               functionCode.indexOf(FUNCTION_PIPE) + 1,
+                                               functionCode.lastIndexOf(FUNCTION_PIPE));
+                       else
+                               finalFunctionCodeVal = functionCode
+                                               .substring(functionCode.lastIndexOf(FUNCTION_PIPE) + 1);
+               } else{
+                       finalFunctionCodeVal = functionCode;
+               }
+               return finalFunctionCodeVal;
+       }
+       
+       /**
+        * 
+        * If function code value has any pipes it does pipe filter and 
+        * returns value.
+        * 
+        * @param functionCode
+        * @return function Type without pipe
+        */
+       public static String getFunctionType(String functionCode) {
+               String finalFunctionCodeVal = "";
+               if (functionCode.contains(FUNCTION_PIPE)) {
+                       int count = StringUtils.countMatches(functionCode, FUNCTION_PIPE);
+                       if (count == 2){
+                               String[] getTypeValue = functionCode.split("\\"+FUNCTION_PIPE);         
+                               finalFunctionCodeVal = getTypeValue[0];
+                       }
+               } else{
+                       finalFunctionCodeVal = functionCode;
+               }
+               return finalFunctionCodeVal;
+       }
+       
+       /**
+        * 
+        * If function code value has any pipes it does pipe filter and 
+        * returns value.
+        * 
+        * @param functionCode
+        * @return function Action without pipe
+        */
+       public static String getFunctionAction(String functionCode) {
+               String finalFunctionCodeVal = "";
+               if (functionCode.contains(FUNCTION_PIPE)) {
+                       int count = StringUtils.countMatches(functionCode, FUNCTION_PIPE);
+                       if (count == 2)
+                               finalFunctionCodeVal = functionCode.substring(
+                                               functionCode.lastIndexOf(FUNCTION_PIPE)+1);
+               } else{
+                       finalFunctionCodeVal = functionCode;
+               }
+               return finalFunctionCodeVal;
+       }
+       
+       /**
+        * 
+        * It check whether the external auth namespace is matching with current namepsace exists in local DB
+        * 
+        * @param permTypeVal
+        * @param appNamespaceVal
+        * @return true or false
+        */
+       public static boolean checkNameSpaceMatching(String permTypeVal, String appNamespaceVal) {
+               String[] typeNamespace = permTypeVal.split("\\.");
+               String[] appNamespace = appNamespaceVal.split("\\.");
+               boolean isNamespaceMatching = true;
+               for (int k = 0; k < appNamespace.length; k++) {
+                       if (!appNamespace[k].equals(typeNamespace[k]))
+                               isNamespaceMatching = false;
+               }
+               return isNamespaceMatching;
+       }
+       
+       public static boolean checkIfRemoteCentralAccessAllowed() {
+               boolean result = false;
+               String rmtCentralAccess = SystemProperties.getProperty(EPCommonSystemProperties.REMOTE_CENTRALISED_SYSTEM_ACCESS);
+               if(rmtCentralAccess == null) {
+               logger.error(EELFLoggerDelegate.errorLogger, "Please check in system.properties whether the property exists or not!");
+                       return false;
+               }else if(new Boolean(rmtCentralAccess)){
+               logger.debug(EELFLoggerDelegate.debugLogger, "checkIfRemoteCentralAccessAllowed: {}",rmtCentralAccess);
+                       result = true;
+               }
+               return result;
+       }
+       
+       /**
+        * 
+        * It validates whether given string is JSON or not
+        * 
+        * @param jsonInString
+        * @return true or false
+        */
+         public static boolean isJSONValid(String jsonInString ) {
+                   try {
+                      final ObjectMapper mapper = new ObjectMapper();
+                      mapper.readTree(jsonInString);
+                      return true;
+                   } catch (IOException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to parse Json!", e);
+                      return false;
+                   }
+                 }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompVersion.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/EcompVersion.java
new file mode 100644 (file)
index 0000000..7e05754
--- /dev/null
@@ -0,0 +1,51 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+//
+// Hardcoded for now, wanted to use maven and resource file.  Possibly just read
+// pom.properties file with version added, but spent several hours already running
+// into issues with that and other ideas not working.  So, for 1604 deadlines I 
+// am just putting the version in the code here... for now.
+//
+public final class EcompVersion {
+
+       // TODO - not used - manifest service reads from manifest
+    public static final String buildNumber="1610.1.999";
+    
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/HashMapFromList.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/HashMapFromList.java
new file mode 100644 (file)
index 0000000..e31c73b
--- /dev/null
@@ -0,0 +1,115 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+/**
+ * 
+ * @author Vladimir Turovets This class is used to create HashMap<String, T>
+ *         from the list of T objects. We suppose that
+ *         1) T object contains field 'parmName' or getter 'getParmName()'.
+ *         The value of object.parmName or object.getParmName() is used as
+ *         a key in created hashMap.
+ *         2) for all objects in the list 'parmName' or getter
+ *         'getParmName().toString' has to be unique and not null.
+ *         This class has one function only:
+ *         HashMap<String, T> hashMap(List<T> list, String name) and returns
+ *         hash map created from list.
+ *
+ * @param <T>
+ * Type 
+ */
+public class HashMapFromList<T> {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HashMapFromList.class);
+       
+       public HashMap<String, T> hashMap(List<T> list, String name) {
+               HashMap<String, T> result = new HashMap<String, T>();
+               if (list == null || list.size() == 0 || name == null) {
+                       return result;
+               }
+               name = name.trim();
+               if (name.length() > 0) {
+                       T object = list.get(0);
+                       try {
+                               String parmName = name;
+                               Field field = object.getClass().getField(parmName);
+                               for (T obj : list) {
+                                       try {
+                                               Object o = field.get(obj);
+                                               if (o != null)
+                                                       result.put(o.toString(), obj);
+                                       } catch (Exception e1) {
+                                               logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 1: object of class " + object.getClass().getName() + ", field " + parmName, e1);
+                                               return new HashMap<String, T>();
+                                       }
+                               }
+                       } catch (Exception e) {
+                               String getterName = "get" + (name.length() == 1 ? name.toUpperCase() : (name.substring(0, 1).toUpperCase() + name.substring(1)));
+                               try {
+                                       Class<?>[] parmClasses = null;
+                                       Method method = object.getClass().getMethod(getterName, parmClasses);
+                                       Object[] parmValues = new Object[0];
+                                       for (T obj : list) {
+                                               try {
+                                                       Object o = method.invoke(obj, parmValues);
+                                                       if (o != null)
+                                                               result.put(o.toString(), obj);
+                                               } catch (Exception e2) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 2: object of class " + object.getClass().getName() + ", method " + getterName, e2);
+                                                       return new HashMap<String, T>();
+                                               }
+                                       }
+                               } catch (Exception e3) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 3: object of class " + object.getClass().getName() + ", bad field '" + name + "' or method '" + getterName + "()", e3);
+                                       return new HashMap<String, T>();
+                               }
+                       }
+               }
+               if (list.size() != result.size()) {
+                       logger.warn(EELFLoggerDelegate.errorLogger, "Duplicated or empty keys were found!!!");
+               }
+               return result;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/ParallelExecutor.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/ParallelExecutor.java
new file mode 100644 (file)
index 0000000..b4ad9c9
--- /dev/null
@@ -0,0 +1,101 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+public abstract class ParallelExecutor<T> {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ParallelExecutor.class);
+
+       protected static abstract class ThreadOperation<T> {
+               public abstract T execute(List<Object> parms);
+       }
+
+       protected abstract ThreadOperation<T> getThreadOperation();
+
+       private static class CallableOperationThread<T> implements Callable<T> {
+
+               List<Object> parms;
+
+               private ThreadOperation<T> operation;
+
+               public CallableOperationThread(ThreadOperation<T> operation, List<Object> parms) {
+                       this.parms = parms;
+                       this.operation = operation;
+               }
+
+               @Override
+               public T call() throws Exception {
+                       return this.operation.execute(this.parms);
+               }
+
+       }
+
+       public List<T> performAllOperations(int ThreadPoolSize, List<List<Object>> listOfParms) {
+               List<T> result = new ArrayList<T>();
+               if (ThreadPoolSize > 0 && listOfParms != null) {
+                       ExecutorService executor = Executors.newFixedThreadPool(ThreadPoolSize);
+                       List<Future<T>> list = new ArrayList<Future<T>>();
+                       for (List<Object> parms : listOfParms) {
+                               CallableOperationThread<T> getter = new CallableOperationThread<T>(this.getThreadOperation(), parms);
+                               Future<T> submit = executor.submit(getter);
+                               list.add(submit);
+                       }
+                       for (Future<T> future : list) {
+                               try {
+                                       if (future != null) {
+                                               result.add(future.get());
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "performAllOperations failed", e);
+                               }
+                       }
+                       executor.shutdown();
+               }
+               return result;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/PortalConstants.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/utils/PortalConstants.java
new file mode 100644 (file)
index 0000000..7f92483
--- /dev/null
@@ -0,0 +1,50 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+public interface PortalConstants {
+       public static final Long PORTAL_APP_ID = 1L;
+       public static final Long DEFAULT_NOTIFICATION_CREATOR = 1L;
+       public static final String REST_AUX_API = "/auxapi";
+       public static final String PORTAL_AUX_API = "/portalApi";
+       public static final Long ACCOUNT_ADMIN_ROLE_ID = 999L;
+       public static final Long SYS_ADMIN_ROLE_ID = 1L;
+       public static final String ADMIN_ROLE = "Account Administrator";
+       public static final String PORTAL_ADMIN_ROLE = "System Administrator";
+       public static final Integer AUDIT_LOG_COMMENT_SIZE = 990;
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/AdminAuthExtension.java
new file mode 100644 (file)
index 0000000..7f401ff
--- /dev/null
@@ -0,0 +1,53 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Service("adminAuthExtension")
+@Transactional
+public class AdminAuthExtension {
+       
+       public void saveUserExtension(EPUser user){
+               //app's developer implement their own logic here, like updating app's related tables
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/EPProfileService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/EPProfileService.java
new file mode 100644 (file)
index 0000000..a08e274
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalsdk.core.domain.Profile;
+
+
+public interface EPProfileService {
+       List<Profile> findAll();
+       
+       Profile getProfile(int id);
+       
+       EPUser getUser(String id);
+       
+       void saveUser(EPUser user);
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/EPProfileServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/EPProfileServiceImpl.java
new file mode 100644 (file)
index 0000000..35090d9
--- /dev/null
@@ -0,0 +1,89 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.dao.ProfileDao;
+import org.onap.portalsdk.core.domain.Profile;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service("epProfileService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class EPProfileServiceImpl implements EPProfileService {
+
+       @Autowired
+       private ProfileDao profileDao;
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @SuppressWarnings("unchecked")
+       public List<Profile> findAll() {
+               return getDataAccessService().getList(Profile.class, null);
+       }
+
+       public EPUser getUser(String userId) {
+               return (EPUser) getDataAccessService().getDomainObject(EPUser.class, Long.parseLong(userId), null);
+       }
+
+       public void saveUser(EPUser user) {
+               getDataAccessService().saveDomainObject(user, null);
+       }
+
+       public Profile getProfile(int id) {
+               return profileDao.getProfile(id);
+       }
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallService.java
new file mode 100644 (file)
index 0000000..91b9e0c
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service;
+
+public interface RemoteWebServiceCallService {
+
+       /**
+        * Answers whether the specified credentials match application information
+        * in the database.
+        * 
+        * @param secretKey
+        *            Key used to decrypt passwords; ignored if null.
+        * @param requestUebKey
+        *            UEB key that identifies the application
+        * @param requestUserName
+        *            User name for the application
+        * @param requestPassword
+        *            Password for the application
+        * @return True if the UEB key and the credentials match the database
+        *         entries; else false.
+        * @throws Exception
+        *             If decryption fails.
+        */
+       public boolean verifyRESTCredential(String secretKey, String requestUebKey, String requestUserName,
+                       String requestPassword) throws Exception;
+
+       /**
+        * 
+        * @param requestUebKey
+        *            UEB key
+        * @return boolean
+        * @throws Exception
+        *             on error
+        */
+       public boolean verifyAppKeyCredential(String requestUebKey) throws Exception;
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/CoreTimeoutHandler.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/CoreTimeoutHandler.java
new file mode 100644 (file)
index 0000000..03bc729
--- /dev/null
@@ -0,0 +1,183 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service.sessionmgt;
+
+import java.util.Calendar;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.servlet.http.HttpSession;
+
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.domain.sessionmgt.TimeoutVO;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Service
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class CoreTimeoutHandler {
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CoreTimeoutHandler.class);
+
+       public static final Map<String, HttpSession> sessionMap = new Hashtable<String, HttpSession>();
+       public static final Integer repeatInterval = 15 * 60; // 15 minutes
+       ObjectMapper mapper = new ObjectMapper();
+
+       public static void sessionCreated(String portalJSessionId, String jSessionId, HttpSession session) {
+
+               storeMaxInactiveTime(session);
+
+               // this key is a combination of portal jsession id and app session id
+               session.setAttribute(PortalApiConstants.PORTAL_JSESSION_ID, jSessionKey(jSessionId, portalJSessionId));
+               sessionMap.put((String) session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID), session);
+
+       }
+
+       protected static void storeMaxInactiveTime(HttpSession session) {
+
+               if (session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME) == null)
+                       session.setAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME, session.getMaxInactiveInterval());
+       }
+
+       public static void sessionDestroyed(HttpSession session) {
+
+               try {
+                       sessionMap.remove((String) session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID));
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "sessionDestroyed failed on session " + session.getId(), e);
+               }
+
+       }
+
+       public String gatherSessionExtenstions() {
+
+               Map<String, TimeoutVO> sessionTimeoutMap = new Hashtable<String, TimeoutVO>();
+               String jsonMap = "";
+
+               for (String jSessionKey : sessionMap.keySet()) {
+
+                       try {
+                               // get the expirytime in seconds
+                               HttpSession session = sessionMap.get(jSessionKey);
+
+                               Long lastAccessedTimeMilliSec = session.getLastAccessedTime();
+                               Long maxIntervalMilliSec = session.getMaxInactiveInterval() * 1000L;
+                               // Long currentTimeMilliSec = Calendar.getInstance().getTimeInMillis() ;
+                               // (maxIntervalMilliSec - (currentTimeMilliSec - lastAccessedTimeMilliSec) + ;
+                               Calendar instance = Calendar.getInstance();
+                               instance.setTimeInMillis(session.getLastAccessedTime());
+                               logger.info(EELFLoggerDelegate.errorLogger,
+                                               "gatherSessionExtenstions: Session Management: Last Accessed time for " + jSessionKey + ": "
+                                                               + instance.getTime());
+
+                               Long sessionTimOutMilliSec = maxIntervalMilliSec + lastAccessedTimeMilliSec;
+
+                               sessionTimeoutMap.put(portalJSessionId(jSessionKey),
+                                               new TimeoutVO(jSessionId(jSessionKey), sessionTimOutMilliSec));
+
+                               jsonMap = mapper.writeValueAsString(sessionTimeoutMap);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "gatherSessionExtenstions failed", e);
+                       }
+               }
+
+               return jsonMap;
+
+       }
+
+       public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception {
+
+               Map<String, TimeoutVO> sessionTimeoutMap;
+               try {
+                       TypeReference<Hashtable<String, TimeoutVO>> typeRef = new TypeReference<Hashtable<String, TimeoutVO>>() {
+                       };
+
+                       sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, typeRef);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "updateSessionExtensions failed 1", e);
+                       return;
+               }
+               for (String jPortalSessionId : sessionTimeoutMap.keySet()) {
+                       try {
+
+                               TimeoutVO extendedTimeoutVO = mapper
+                                               .readValue(mapper.writeValueAsString(sessionTimeoutMap.get(jPortalSessionId)), TimeoutVO.class);
+                               HttpSession session = sessionMap.get(jSessionKey(extendedTimeoutVO.getjSessionId(), jPortalSessionId));
+
+                               if (session == null) {
+                                       continue;
+                               }
+
+                               Long lastAccessedTimeMilliSec = session.getLastAccessedTime();
+                               Long maxIntervalMilliSec = session.getMaxInactiveInterval() * 1000L;
+                               Long sessionTimOutMilliSec = maxIntervalMilliSec + lastAccessedTimeMilliSec;
+
+                               Long maxTimeoutTimeMilliSec = extendedTimeoutVO.getSessionTimOutMilliSec();
+                               if (maxTimeoutTimeMilliSec > sessionTimOutMilliSec) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "updateSessionExtensions: Session Management: updated session max idle time");
+                                       session.setMaxInactiveInterval((int) (maxTimeoutTimeMilliSec - lastAccessedTimeMilliSec) / 1000);
+                               }
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               "updateSessionExtensions failed", e);
+                       }
+
+               }
+
+       }
+
+       protected static String jSessionKey(String jSessionId, String portalJSessionId) {
+               return portalJSessionId + "-" + jSessionId;
+       }
+
+       protected String portalJSessionId(String jSessionKey) {
+               return jSessionKey.split("-")[0];
+       }
+
+       protected String jSessionId(String jSessionKey) {
+               return jSessionKey.split("-")[1];
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/ManageService.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/service/sessionmgt/ManageService.java
new file mode 100644 (file)
index 0000000..3c08f91
--- /dev/null
@@ -0,0 +1,125 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service.sessionmgt;
+
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.quartz.CronExpression;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+@Service("manageService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class ManageService implements PortalTimeoutHandler.SessionCommInf {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManageService.class);
+       
+       @Autowired
+       private EPAppService appService;
+       
+       @Autowired
+       private SessionCommunication sessionCommunication;
+
+       public Integer fetchSessionSlotCheckInterval(String... params) {
+
+               String defaultCronExpressionStr = "0 0/5 * * * ? *";
+               String cronExpressionStr = SystemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON);
+
+               if (cronExpressionStr == null) {
+                       cronExpressionStr = defaultCronExpressionStr;
+               }
+
+               CronExpression cal = null;
+               try {
+                       cal = new CronExpression(cronExpressionStr);
+               } catch (ParseException e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+               final Date nowTime = Calendar.getInstance().getTime();
+               Date nextTime = cal.getNextValidTimeAfter(nowTime);
+               Date nextNextTime = cal.getNextValidTimeAfter(nextTime);
+
+               final int timeDiff = (int)(nextNextTime.getTime()-nextTime.getTime());
+               logger.debug(EELFLoggerDelegate.debugLogger, "Time interval between subsequent session checks " + timeDiff);
+
+               return timeDiff;
+       }
+
+       public void extendSessionTimeOuts(String... params) {
+               try {
+                       String sessionMap = params[3];
+       
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Extending the App sessions for last minute request: " + sessionMap);
+                       
+                       if (StringUtils.isEmpty(sessionMap)) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "extendSessionTimeOuts: Skipping session updates since the portal session value is empty.");
+                       } else {
+                               List<OnboardingApp> appList = appService.getEnabledNonOpenOnboardingApps();
+                               for (OnboardingApp onApp : appList) {
+                                       sessionCommunication.pingSession(onApp, sessionMap);
+                               }
+                               updateSessionExtensions(sessionMap);
+                               sessionCommunication.clear(false);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "extendSessionTimeOuts failed", e);
+               }
+       }
+
+       public String gatherSessionExtenstions() {
+               return PortalTimeoutHandler.gatherSessionExtensions();
+       }
+
+       public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception {
+               PortalTimeoutHandler.updateSessionExtensions(sessionTimeoutMapStr);
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..ee52579
--- /dev/null
@@ -0,0 +1,290 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service.sessionmgt;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.exception.UrlAccessRestrictedException;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.slf4j.MDC;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import com.att.eelf.configuration.Configuration;
+
+@Service("sessionCommunication")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class SessionCommunication {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunication.class);
+
+       @EPAuditLog
+       public String sendGet(OnboardingApp app) throws Exception {
+               String appResponse = "";
+               String appName = "";
+               int responseCode = 0;
+               if (app != null && app.name != null && app.name != "") {
+                       try {
+                               appName = app.name;
+                               String url = app.restUrl + "/sessionTimeOuts";
+                               String encriptedPwdDB = app.appPassword;
+                               String appUserName = app.username;
+
+                               setLocalMDCContext(app, "/sessionTimeOuts", url);
+
+                               URL obj = new URL(url);
+
+                               HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+                               // optional default is GET
+                               con.setRequestMethod("GET");
+                               con.setConnectTimeout(3000);
+                               con.setReadTimeout(8000);
+                               // add request header
+                               con.setRequestProperty("username", appUserName);
+                               con.setRequestProperty("password", encriptedPwdDB);
+
+                               // con.set
+                               responseCode = con.getResponseCode();
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
+
+                               BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
+                               String inputLine;
+                               StringBuffer response = new StringBuffer();
+
+                               while ((inputLine = in.readLine()) != null) {
+                                       response.append(inputLine);
+                               }
+
+                               in.close();
+                               appResponse = response.toString();
+                       } catch (UrlAccessRestrictedException e) {
+                               responseCode = HttpServletResponse.SC_UNAUTHORIZED;
+                               logger.error(EELFLoggerDelegate.errorLogger, String.format(
+                                               "SessionCommunication.sendGet received an un-authorized exception. AppName: %s", appName));
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
+                       } catch (Exception e) {
+                               responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+                               String message = String.format(
+                                               "SessionCommunication.sendGet encountered an Exception. AppName: %s, Details: %s", appName,
+                                               e.toString());
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
+                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       } finally {
+                               EcompPortalUtils.setExternalAppResponseCode(responseCode);
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger, "SessionCommunication sendGet: app is null");
+               }
+               return appResponse;
+       }
+
+       @EPAuditLog
+       public Boolean pingSession(OnboardingApp app, String sessionTimeoutMap) throws Exception {
+               String appName = "";
+               int responseCode = 0;
+               try {
+                       if (app == null)
+                               throw new Exception("SessionCommunication.pingSession: app is null");
+                       if (app != null && app.name != null && app.name != "") {
+                               appName = app.name;
+                       }
+                       String url = app.restUrl + "/updateSessionTimeOuts";
+                       String encriptedPwdDB = app.appPassword;
+                       String appUserName = app.username;
+
+                       setLocalMDCContext(app, "/updateSessionTimeOuts", url);
+
+                       URL obj = new URL(url);
+
+                       HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+                       // optional default is GET
+                       con.setRequestMethod("POST");
+                       con.setConnectTimeout(3000);
+                       con.setReadTimeout(15000);
+
+                       // add request header
+                       con.setRequestProperty("username", appUserName);
+                       con.setRequestProperty("password", encriptedPwdDB);
+
+                       con.setRequestProperty("sessionMap", sessionTimeoutMap);
+                       con.setDoInput(true);
+                       con.setDoOutput(true);
+                       con.getOutputStream().write(sessionTimeoutMap.getBytes());
+                       con.getOutputStream().flush();
+                       con.getOutputStream().close();
+
+                       responseCode = con.getResponseCode();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
+               } catch (UrlAccessRestrictedException e) {
+                       responseCode = HttpServletResponse.SC_UNAUTHORIZED;
+                       String message = String.format(
+                                       "SessionCommunication.pingSession received an un-authorized exception. AppName: %s", appName);
+                       logger.error(EELFLoggerDelegate.errorLogger, message);
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
+               } catch (Exception e) {
+                       responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+                       String message = String.format(
+                                       "SessionCommunication.pingSession encountered an Exception. AppName: %s, Details: %s", appName, e.toString());
+                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
+                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
+               } finally {
+                       EcompPortalUtils.setExternalAppResponseCode(responseCode);
+               }
+
+               return true;
+       }
+
+       @EPAuditLog
+       public Boolean timeoutSession(OnboardingApp app, String portalJSessionId) throws Exception {
+               String appName = "Unknwon";
+               int responseCode = 0;
+               if (app != null && app.name != null && app.name != "") {
+                       try {
+                               appName = app.name;
+                               String url = app.restUrl + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId;
+
+                               String encriptedPwdDB = app.appPassword;
+                               String appUserName = app.username;
+                               // String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB,
+                               // SystemProperties.getProperty(SystemProperties.Decryption_Key));
+
+                               setLocalMDCContext(app, "/timeoutSession", url);
+
+                               URL obj = new URL(url);
+                               HttpURLConnection con = (HttpURLConnection) obj.openConnection();
+
+                               // optional default is GET
+                               con.setRequestMethod("POST");
+                               con.setConnectTimeout(3000);
+                               con.setReadTimeout(15000);
+
+                               // add request header
+                               con.setRequestProperty("username", appUserName);
+                               con.setRequestProperty("password", encriptedPwdDB);
+
+                               // con.setRequestProperty("portalJSessionId", portalJSessionId);
+                               con.setDoInput(true);
+                               con.setDoOutput(true);
+                               con.getOutputStream().flush();
+                               con.getOutputStream().close();
+
+                               responseCode = con.getResponseCode();
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
+                       } catch (UrlAccessRestrictedException e) {
+                               responseCode = HttpServletResponse.SC_UNAUTHORIZED;
+                               String message = String.format(
+                                               "SessionCommunication.timeoutSession received an un-authorized exception. AppName: %s",
+                                               appName);
+                               logger.error(EELFLoggerDelegate.errorLogger, message);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
+                       } catch (Exception e) {
+                               responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
+                               String message = String.format(
+                                               "SessionCommunication.timeoutSession encountered an Exception. AppName: %s, Details: %s", 
+                                               appName, e.toString());
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
+                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
+                       } finally {
+                               EcompPortalUtils.setExternalAppResponseCode(responseCode);
+                       }
+               } else {
+                       logger.error(EELFLoggerDelegate.errorLogger, "SessionCommunication pingSession: app is null");
+               }
+               return true;
+       }
+
+       @EPMetricsLog
+       private void setLocalMDCContext(OnboardingApp app, String restPath, String url) {
+               setRequestId();
+               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
+               if (url != null && url.contains("https")) {
+                       MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
+               }
+               MDC.put(EPCommonSystemProperties.FULL_URL, url);
+               MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.myLoginsAppName);
+               MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath);
+       }
+
+       /**
+        * Generates request id, service name fields and loads them into MDC, as these
+        * values could be empty as these session timeout requests are generated at
+        * scheduled intervals using quartz scheduler.
+        */
+       @EPMetricsLog
+       public void setRequestId() {
+               String requestId = MDC.get(Configuration.MDC_KEY_REQUEST_ID);
+               if (StringUtils.isEmpty(requestId)) {
+                       MDC.put(Configuration.MDC_KEY_REQUEST_ID, UUID.randomUUID().toString());
+               }
+
+               MDC.put(Configuration.MDC_SERVICE_NAME, "/quartz/keepSessionAlive");
+               MDC.put(EPCommonSystemProperties.PARTNER_NAME, EPCommonSystemProperties.ECOMP_PORTAL_BE);
+       }
+
+       /**
+        * Remove the values from MDC as these requests are executed at regular
+        * intervals based on quartz rather incoming REST API requests.
+        * 
+        * @param bAll
+        */
+       @EPMetricsLog
+       public void clear(Boolean bAll) {
+               MDC.remove(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
+               if (bAll) {
+                       MDC.remove(Configuration.MDC_KEY_REQUEST_ID);
+                       MDC.remove(Configuration.MDC_SERVICE_NAME);
+                       MDC.remove(EPCommonSystemProperties.PARTNER_NAME);
+               }
+       }
+}
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
new file mode 100644 (file)
index 0000000..e795e98
--- /dev/null
@@ -0,0 +1,269 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.service.sessionmgt;
+
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpSession;
+
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.quartz.PersistJobDataAfterExecution;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.domain.sessionmgt.TimeoutVO;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * Executed periodically by Quartz to discover remote application sessions and
+ * update timeouts suitably.
+ */
+@PersistJobDataAfterExecution
+@DisallowConcurrentExecution
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class TimeoutHandler extends QuartzJobBean {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TimeoutHandler.class);
+       
+       private ObjectMapper mapper = new ObjectMapper();
+
+       /**
+        * Supports static call {@link #timeoutSessions(HttpSession)}
+        */
+       private static List<OnboardingApp> onboardedAppList = null;
+       
+       @Autowired
+       private SessionCommunication sessionCommunication;
+       
+       @Override
+       protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
+               try {
+                       //Create a request id if there is none available,
+                       //and which will internally be used when making
+                       //session extended timeout calls to the partner applications.
+                       if (getSessionCommunication()!=null) {
+                               getSessionCommunication().setRequestId();
+                       }
+                       logger.info(EELFLoggerDelegate.debugLogger, "Quartz Cronjob for Session Management begins");
+                       
+                       ManageService manageService = (ManageService) applicationContext.getBean("manageService");
+                       EPAppService appService = (EPAppService) applicationContext.getBean("epAppService");
+
+                       List<OnboardingApp> appList = appService.getEnabledNonOpenOnboardingApps();
+                       onboardedAppList = appList;
+                       TypeReference<Hashtable<String, TimeoutVO>> typeRef = new TypeReference<Hashtable<String, TimeoutVO>>() {
+                       };
+                       String portalJsonSessionStr;
+                       Map<String, TimeoutVO> portalSessionTimeoutMap = null;
+
+                       portalJsonSessionStr = manageService.gatherSessionExtenstions();
+                       if (portalJsonSessionStr == null || portalJsonSessionStr == "") {
+                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management: Portal session information is empty.");
+                               return;
+                       }
+                       
+                       try {
+                               portalSessionTimeoutMap = mapper.readValue(portalJsonSessionStr, typeRef);
+                       } catch (JsonMappingException | JsonParseException je) {
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
+                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management: JSON Mapping Exception occurred while gathering the Session", je);
+                               return;
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management: Error while gather Session from portal", e);
+                               return;
+                       }
+                       
+                       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);
+                                       continue;
+                               }
+                               logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Calling App " + app.name + " at URL " + app.restUrl);
+                               String jsonSessionStr = fetchAppSessions(app);
+                               logger.info(EELFLoggerDelegate.debugLogger, "Session Management: App " + app.name + " returned  " + jsonSessionStr);
+                               if (jsonSessionStr == null || jsonSessionStr.isEmpty())
+                                       continue;
+
+                               try {
+                                       Map<String, TimeoutVO> sessionTimeoutMap = mapper.readValue(jsonSessionStr, typeRef);
+                                       appSessionTimeOutMap.put(app.id, sessionTimeoutMap);
+                                       for (String portalJSessionId : sessionTimeoutMap.keySet()) {
+                                               final TimeoutVO maxTimeoutVO = portalSessionTimeoutMap.get(portalJSessionId);
+                                               final TimeoutVO compareTimeoutVO = sessionTimeoutMap.get(portalJSessionId);
+                                               if (maxTimeoutVO != null && compareTimeoutVO != null) {
+                                                       if (maxTimeoutVO.compareTo(compareTimeoutVO) < 0)
+                                                               portalSessionTimeoutMap.get(portalJSessionId)
+                                                                               .setSessionTimOutMilliSec(compareTimeoutVO.getSessionTimOutMilliSec());
+                                               }
+                                       }
+                               } catch (JsonParseException | JsonMappingException e) {
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
+                                       logger.error(EELFLoggerDelegate.errorLogger, 
+                                                       "JSON Mapping/Processing Exception occurred while mapping/parsing the jsonSessionStr", e);
+                                       continue;
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while mapping/parsing the jsonSessionStr", e);
+                                       continue;
+                               }
+
+                       }
+
+                       // 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);
+                                       continue;
+                               }
+
+                               Map<String, TimeoutVO> sessionTimeoutMap = appSessionTimeOutMap.get(app.id);
+                               if (sessionTimeoutMap == null || sessionTimeoutMap.isEmpty())
+                                       continue;
+
+                               for (String portalJSessionId : sessionTimeoutMap.keySet()) {
+                                       try {
+                                               final TimeoutVO maxTimeoutVO = portalSessionTimeoutMap.get(portalJSessionId);
+                                               final TimeoutVO setTimeoutVO = sessionTimeoutMap.get(portalJSessionId);
+                                               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);
+                                                       logger.warn(EELFLoggerDelegate.errorLogger, message);
+                                                       continue;
+                                               }
+                                               setTimeoutVO.setSessionTimOutMilliSec(maxTimeoutVO.getSessionTimOutMilliSec());
+                                       } catch (Exception e) {
+                                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management:  error while updating the session timeout map", e);
+                                               continue;
+                                       }
+                               }
+                               logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Updating App " + app.restUrl);
+                               String sessionTimeoutMapStr = "";
+                               try {
+                                       sessionTimeoutMapStr = mapper.writeValueAsString(sessionTimeoutMap);
+                               } catch (JsonProcessingException je) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "executeInternal failed while processing sessionTimeOutMap object to a String", je);
+                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
+                               }
+                               pingAppSessions(app, sessionTimeoutMapStr);
+                       }
+                       String portalSessionTimeoutMapStr = "";
+                       try {
+                               portalSessionTimeoutMapStr = mapper.writeValueAsString(portalSessionTimeoutMap);
+                       } catch (JsonProcessingException je) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while processing portalSessionTimeOutMap object to a String", je);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
+                       }
+                       manageService.updateSessionExtensions(portalSessionTimeoutMapStr);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management:  error in managing session timeouts", e);
+               } finally {
+                       getSessionCommunication().clear(true);
+               }
+       }
+
+       private String fetchAppSessions(OnboardingApp app) throws Exception {
+               String jsonSessionValue = getSessionCommunication().sendGet(app);
+               getSessionCommunication().clear(false);
+               return jsonSessionValue;
+       }
+
+       private void pingAppSessions(OnboardingApp app, String sessionTimeoutMapStr) throws Exception {
+               getSessionCommunication().pingSession(app, sessionTimeoutMapStr);
+               getSessionCommunication().clear(false);
+       }
+
+       public void timeoutSessions(HttpSession session) throws Exception {
+               String portalJSessionId = portalJSessionId(session);
+               if (onboardedAppList == null)
+                       return;
+
+               for (OnboardingApp app : onboardedAppList) {
+                       getSessionCommunication().timeoutSession(app, portalJSessionId);
+                       getSessionCommunication().clear(false);
+               }
+       }
+
+       protected static String portalJSessionId(HttpSession session) {
+               final Object attribute = session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID);
+               if (attribute == null)
+                       return "";
+               String jSessionKey = (String) attribute;
+               return jSessionKey.split("-")[0];
+       }
+
+       private static ApplicationContext applicationContext;
+
+       public static void setApplicationContext(ApplicationContext _applicationContext) {
+               applicationContext = _applicationContext;
+       }
+
+       public SessionCommunication getSessionCommunication() {
+               if(sessionCommunication == null){
+                       if (applicationContext != null)                         
+                               sessionCommunication = (SessionCommunication)applicationContext.getBean("sessionCommunication");
+               }
+               
+               return sessionCommunication;
+       }
+
+       public void setSessionCommunication(SessionCommunication sessionCommunication) {
+               this.sessionCommunication = sessionCommunication;
+       }
+
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/util/EPUserUtils.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/util/EPUserUtils.java
new file mode 100644 (file)
index 0000000..2292934
--- /dev/null
@@ -0,0 +1,401 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.util;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.UUID;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+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.exceptions.RoleFunctionException;
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.exception.SessionExpiredException;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.menu.MenuBuilder;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.AppUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class EPUserUtils {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUserUtils.class);
+
+       private final static Long ACCOUNT_ADMIN_ROLE_ID = 999L;
+
+       public static final String ALL_ROLE_FUNCTIONS = "allRoleFunctions";
+       
+       // These decode values are based on HexDecoder
+       private static final String decodeValueOfForwardSlash = "2f";
+       private static final String decodeValueOfHyphen = "2d";
+       private static final String decodeValueOfAsterisk = "2a";
+
+       private static DataAccessService dataAccessService;
+
+       /**
+        * Gets the EPUser object from the session.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return EPUser object that was created upon login
+        * @throws SessionExpiredException
+        *             if no session exists.
+        */
+       public static EPUser getUserSession(HttpServletRequest request) {
+               HttpSession session = AppUtils.getSession(request);
+               if (session == null)
+                       throw new SessionExpiredException();
+               return (EPUser) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
+       }
+
+       /**
+        * Establishes the user's portal session
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @param user
+        *            EPUser
+        * @param applicationMenuData
+        *            Menu data
+        * @param businessDirectMenuData
+        *            Menu data
+        * @param loginMethod_ignored
+        *            How the user authenticated; ignored
+        * @param ePRoleFunctionService
+        *            role function service
+        * @throws DecoderException 
+        */
+       @SuppressWarnings("rawtypes")
+       public static void setUserSession(HttpServletRequest request, EPUser user, Set applicationMenuData,
+                       Set businessDirectMenuData, String loginMethod_ignored, EPRoleFunctionService ePRoleFunctionService) throws RoleFunctionException {
+               HttpSession session = request.getSession(true);
+
+               // clear the current user session to avoid any conflicts
+               EPUserUtils.clearUserSession(request);
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+
+               setAllRoleFunctions(ePRoleFunctionService.getRoleFunctions(), session);
+
+               ePRoleFunctionService.getRoleFunctions(request, user);
+
+               // truncate the role (and therefore the role function) data to save
+               // memory in the session
+               user.setEPRoles(null);
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_NAME), user.getFullName());
+
+               ServletContext context = session.getServletContext();
+               int licenseVerificationFlag = 3;
+               try {
+                       licenseVerificationFlag = (Integer) context.getAttribute("licenseVerification");
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "setUserSession failed to get licenseVerification attribute",
+                                       e);
+               }
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME), "My Portal");
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME),
+                               MenuBuilder.filterMenu(applicationMenuData, request));
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_ATTRIBUTE_NAME),
+                               MenuBuilder.filterMenu(businessDirectMenuData, request));
+       }
+
+       /**
+        * Creates a set of role function names and stores the set as a session
+        * attribute.
+        * 
+        * @param allRoleFunctions
+        *            List of role functions.
+        * @param session
+        *            HttpSession
+        * @throws DecoderException 
+        */
+       private static void setAllRoleFunctions(List<RoleFunction> allRoleFunctions, HttpSession session) throws RoleFunctionException {
+               if (allRoleFunctions == null)
+                       return;
+               Set<String> roleFnSet = new HashSet<String>();
+               for (RoleFunction roleFn : allRoleFunctions){
+                       roleFnSet.add(decodeFunctionCode(roleFn.getCode()));
+               }
+               session.setAttribute(ALL_ROLE_FUNCTIONS, roleFnSet);
+       }
+
+       
+       public static String decodeFunctionCode(String str) throws RoleFunctionException{
+               String decodedString = str;
+               List<Pattern> decodingList = new ArrayList<>();
+               decodingList.add(Pattern.compile(decodeValueOfForwardSlash));
+               decodingList.add(Pattern.compile(decodeValueOfHyphen));
+               decodingList.add(Pattern.compile(decodeValueOfAsterisk));
+               for (Pattern xssInputPattern : decodingList) {
+                       try {
+                               decodedString = decodedString.replaceAll("%" + xssInputPattern,
+                                               new String(Hex.decodeHex(xssInputPattern.toString().toCharArray())));
+                       } catch (DecoderException e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to decode the Rolefunction: "+ str,
+                                               e);
+                               throw new RoleFunctionException("decode failed", e);            
+                       }
+               }
+               
+               return decodedString;
+       }
+       
+       /**
+        * Removes all stored attributes from the user's session
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @throws SessionExpiredException
+        *             if no session exists
+        */
+       private static void clearUserSession(HttpServletRequest request) {
+               HttpSession session = AppUtils.getSession(request);
+               if (session == null)
+                       throw new SessionExpiredException();
+
+               // removes all stored attributes from the current user's session
+               session.removeAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
+               session.removeAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
+               session.removeAttribute(SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_ATTRIBUTE_NAME));
+               session.removeAttribute(SystemProperties.getProperty(SystemProperties.ROLES_ATTRIBUTE_NAME));
+               session.removeAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
+       }
+
+       /**
+        * Gets role information from the user session, in the cached user object. As a
+        * side effect sets a session variable with the roles.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return Map of role ID to role object
+        */
+       @SuppressWarnings("rawtypes")
+       public static HashMap getRoles(HttpServletRequest request) {
+               HashMap roles = null;
+
+               HttpSession session = AppUtils.getSession(request);
+               roles = (HashMap) session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLES_ATTRIBUTE_NAME));
+
+               // if roles are not already cached, let's grab them from the user
+               // session
+               if (roles == null) {
+                       EPUser user = getUserSession(request);
+
+                       // get all user roles (including the tree of child roles)
+                       roles = getAllUserRoles(user);
+
+                       session.setAttribute(SystemProperties.getProperty(SystemProperties.ROLES_ATTRIBUTE_NAME), roles);
+               }
+
+               return roles;
+       }
+
+       /**
+        * Builds a map of role ID to role object.
+        * 
+        * @param user
+        *            EPUser
+        * @return Map of role ID to role object
+        */
+       @SuppressWarnings({ "rawtypes", "unchecked" })
+       private static HashMap getAllUserRoles(EPUser user) {
+               HashMap roles = new HashMap();
+               Iterator i = user.getEPRoles().iterator();
+
+               while (i.hasNext()) {
+                       EPRole role = (EPRole) i.next();
+
+                       if (role.getActive()) {
+                               roles.put(role.getId(), role);
+
+                               // let's take a recursive trip down the tree to add all child
+                               // roles
+                               addChildRoles(role, roles);
+                       }
+               }
+
+               // Additionally; the account admin role is overloaded between ecomp
+               // portal and partners; lets also include that
+               Iterator<EPUserApp> appRolesIterator = user.getEPUserApps().iterator();
+               while (appRolesIterator.hasNext()) {
+                       EPRole role = (EPRole) appRolesIterator.next().getRole();
+
+                       if (role.getActive() && role.getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
+                               roles.put(role.getId(), role);
+
+                               // let's take a recursive trip down the tree to add all child
+                               // roles
+                               addChildRoles(role, roles);
+                       }
+               }
+
+               return roles;
+       }
+
+       /**
+        * Adds all child roles of the specified role to the map of roles.
+        * 
+        * @param role
+        *            EPRole
+        * @param roles
+        *            Maps role id to role object
+        */
+       @SuppressWarnings({ "rawtypes", "unchecked" })
+       private static void addChildRoles(EPRole role, HashMap roles) {
+               Set childRoles = role.getChildRoles();
+
+               if (childRoles != null && childRoles.size() > 0) {
+                       Iterator j = childRoles.iterator();
+                       while (j.hasNext()) {
+                               EPRole childRole = (EPRole) j.next();
+
+                               if (childRole.getActive()) {
+                                       roles.put(childRole.getId(), childRole);
+
+                                       addChildRoles(childRole, roles);
+                               }
+                       }
+               }
+
+       }
+
+       public static boolean hasRole(EPUser user, String roleKey) {
+               return getAllUserRoles(user).keySet().contains(new Long(roleKey));
+       }
+
+       public static DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       @Autowired
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               EPUserUtils.dataAccessService = dataAccessService;
+       }
+
+       /**
+        * Gets the user's ID from the user object in the session
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return Integer ID of current user
+        */
+       public static int getUserId(HttpServletRequest request) {
+               return getUserIdAsLong(request).intValue();
+       }
+
+       /**
+        * Gets the user's ID from the user object in the session
+        * 
+        * @param request
+        *            HttpServletREquest
+        * @return Long ID of current user
+        */
+       public static Long getUserIdAsLong(HttpServletRequest request) {
+               Long userId = new Long(SystemProperties.getProperty(SystemProperties.APPLICATION_USER_ID));
+               if (request != null) {
+                       if (getUserSession(request) != null) {
+                               userId = getUserSession(request).getId();
+                       }
+               }
+               return userId;
+       }
+
+       /**
+        * Gets the request ID from the request.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return Request ID
+        */
+       public static String getRequestId(HttpServletRequest request) {
+               Enumeration<String> headerNames = request.getHeaderNames();
+
+               String requestId = "";
+               try {
+                       while (headerNames.hasMoreElements()) {
+                               String headerName = (String) headerNames.nextElement();
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "One header is " + headerName + " : " + request.getHeader(headerName));
+                               if (headerName.equalsIgnoreCase(SystemProperties.ECOMP_REQUEST_ID)) {
+                                       requestId = request.getHeader(headerName);
+                                       break;
+                               }
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRequestId failed", e);
+               }
+
+               return (requestId.isEmpty() ? UUID.randomUUID().toString() : requestId);
+       }
+
+       /**
+        * Gets the full URL from the request.
+        * 
+        * @param request
+        *            HttpServletRequest
+        * @return Full URL
+        */
+       public static String getFullURL(HttpServletRequest request) {
+               if (request != null) {
+                       StringBuffer requestURL = request.getRequestURL();
+                       String queryString = request.getQueryString();
+
+                       if (queryString == null) {
+                               return requestURL.toString();
+                       } else {
+                               return requestURL.append('?').append(queryString).toString();
+                       }
+               }
+               return "";
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/util/SystemType.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/util/SystemType.java
new file mode 100644 (file)
index 0000000..bf27749
--- /dev/null
@@ -0,0 +1,44 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.util;
+
+public enum SystemType {
+
+       APPLICATION,
+//     SYSTEM
+}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/command/EPLoginBean.java
deleted file mode 100644 (file)
index 54a17fc..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.command;
-
-import java.util.Set;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalsdk.core.domain.support.FusionCommand;
-
-public class EPLoginBean extends FusionCommand {
-    private String loginId;
-    private String loginPwd;
-    private String hrid;
-    private String orgUserId;
-    private String siteAccess;
-    private String loginErrorMessage;
-
-    private EPUser user;
-    private Set<?>  menu;
-    private Set<?>  businessDirectMenu;
-
-    /**
-     * getLoginId
-     *
-     * @return String
-     */
-    public String getLoginId() {
-        return loginId;
-    }
-
-    /**
-     * getLoginPwd
-     *
-     * @return String
-     */
-    public String getLoginPwd() {
-        return loginPwd;
-    }
-
-    /**
-     * getMenu
-     *
-     * @return Set
-     */
-    public Set<?> getMenu() {
-        return menu;
-    }
-
-    /**
-     * getUser
-     *
-     * @return User
-     */
-    public EPUser getUser() {
-        return user;
-    }
-
-    /**
-     * getHrid
-     *
-     * @return String
-     */
-    public String getHrid() {
-        return hrid;
-    }
-
-    /**
-     * getSiteAccess
-     *
-     * @return String
-     */
-    public String getSiteAccess() {
-        return siteAccess;
-    }
-
-    /**
-     * getBusinessDirectMenu
-     *
-     * @return Set
-     */
-    public Set<?> getBusinessDirectMenu() {
-        return businessDirectMenu;
-    }
-
-    /**
-     * getLoginErrorMessage
-     *
-     * @return String
-     */
-    public String getLoginErrorMessage() {
-        return loginErrorMessage;
-    }
-
-    public String getOrgUserId() {
-        return orgUserId;
-    }
-
-    /**
-     * setLoginId
-     *
-     * @param loginId String
-     */
-    public void setLoginId(String loginId) {
-        this.loginId = loginId;
-    }
-
-    /**
-     * setLoginPwd
-     *
-     * @param loginPwd String
-     */
-    public void setLoginPwd(String loginPwd) {
-        this.loginPwd = loginPwd;
-    }
-
-    public void setMenu(Set<?> menu) {
-        this.menu = menu;
-    }
-
-    /**
-     * setUser
-     *
-     * @param user User
-     */
-    public void setUser(EPUser user) {
-        this.user = user;
-    }
-
-    /**
-     * setHrid
-     *
-     * @param hrid String
-     */
-    public void setHrid(String hrid) {
-        this.hrid = hrid;
-    }
-
-    /**
-     * setSiteAccess
-     *
-     * @param siteAccess String
-     */
-    public void setSiteAccess(String siteAccess) {
-        this.siteAccess = siteAccess;
-    }
-
-    /**
-     * setBusinessDirectMenu
-     *
-     * @param businessDirectMenu Set
-     */
-    public void setBusinessDirectMenu(Set<?> businessDirectMenu) {
-        this.businessDirectMenu = businessDirectMenu;
-    }
-
-    /**
-     * setLoginErrorMessage
-     *
-     * @param loginErrorMessage String
-     */
-    public void setLoginErrorMessage(String loginErrorMessage) {
-        this.loginErrorMessage = loginErrorMessage;
-    }
-
-    public void setOrgUserId(String orgUserId) {
-        this.orgUserId = orgUserId;
-    }
-}
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/command/PostSearchBean.java
deleted file mode 100644 (file)
index 38aae80..0000000
+++ /dev/null
@@ -1,391 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.command;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalsdk.core.command.support.SearchBase;
-
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-
-@JsonSerialize
-public class PostSearchBean extends SearchBase {
-
-    private EPUser     user     = null;
-    private EPUser     userOrig = null;
-    private String[] selected;
-    private String[] postHrid;
-    private String[] postOrgUserId;
-    private String[] postFirstName;
-    private String[] postLastName;
-    private String[] postOrgCode;
-    private String[] postPhone;
-    private String[] postEmail;
-    private String[] postAddress1;
-    private String[] postAddress2;
-    private String[] postCity;
-    private String[] postState;
-    private String[] postZipCode;
-    private String[] postLocationClli;
-    private String[] postBusinessCountryCode;
-    private String[] postBusinessCountryName;
-    private String[] postDepartment;
-    private String[] postDepartmentName;
-    private String[] postBusinessUnit;
-    private String[] postBusinessUnitName;
-    private String[] postJobTitle;
-    private String[] postOrgManagerUserId;
-    private String[] postCommandChain;
-    private String[] postCompanyCode;
-    private String[] postCompany;
-    private String[] postCostCenter;
-    private String[] postSiloStatus;
-    private String[] postFinancialLocCode;
-
-
-    public PostSearchBean() {
-      this(null);
-    } // PostSearchBean
-
-    public PostSearchBean(List<?> items) {
-      super(items);
-
-      user     = new EPUser();
-      userOrig = new EPUser();
-
-      setSortBy1("");
-      setSortBy1Orig("");
-
-      //setSortByList(...);
-    }  // PostSearchBean
-
-
-    public String getFirstName()                      { return user.getFirstName(); }
-    public String getLastName()                       { return user.getLastName(); }
-    public String getHrid()                           { return user.getHrid(); }
-    public String getOrgUserId()                      { return user.getOrgUserId(); }
-    public String getOrgCode()                        { return user.getOrgCode(); }
-    public String getEmail()                          { return user.getEmail(); }
-    public String getOrgManagerUserId()                  { return user.getOrgManagerUserId(); }
-    
-    public String getFirstNameOrig()                  { return user.getFirstName(); }
-    public String getLastNameOrig()                   { return user.getLastName(); }
-    public String getHridOrig()                       { return user.getHrid(); }
-    public String getOrgUserIdOrig()                  { return user.getOrgUserId(); }
-    public String getOrgCodeOrig()                    { return user.getOrgCode(); }
-    public String getEmailOrig()                      { return user.getEmail(); }
-    public String getOrgManagerUserIdOrig()              { return user.getOrgManagerUserId(); }
-    
-    
-    public EPUser getUser()                             { return user; }
-
-    public String[] getPostEmail() {
-        return postEmail;
-    }
-
-    public String[] getPostFirstName() {
-        return postFirstName;
-    }
-
-    public String[] getPostHrid() {
-        return postHrid;
-    }
-
-    public String[] getPostLastName() {
-        return postLastName;
-    }
-
-    public String[] getPostOrgCode() {
-        return postOrgCode;
-    }
-
-    public String[] getPostPhone() {
-        return postPhone;
-    }
-
-    public String[] getPostOrgUserId() {
-        return postOrgUserId;
-    }
-
-    public String[] getSelected() {
-        return selected;
-    }
-
-    public String[] getPostAddress1() {
-        return postAddress1;
-    }
-
-    public String[] getPostBusinessCountryCode() {
-        return postBusinessCountryCode;
-    }
-
-    public String[] getPostCity() {
-        return postCity;
-    }
-
-    public String[] getPostCommandChain() {
-        return postCommandChain;
-    }
-
-    public String[] getPostCompany() {
-        return postCompany;
-    }
-
-    public String[] getPostCompanyCode() {
-        return postCompanyCode;
-    }
-
-    public String[] getPostDepartment() {
-        return postDepartment;
-    }
-
-    public String[] getPostDepartmentName() {
-        return postDepartmentName;
-    }
-
-    public String[] getPostBusinessCountryName() {
-        return postBusinessCountryName;
-    }
-
-    public String[] getPostJobTitle() {
-        return postJobTitle;
-    }
-
-    public String[] getPostLocationClli() {
-        return postLocationClli;
-    }
-
-    public String[] getPostManagerUserId() {
-        return postOrgManagerUserId;
-    }
-
-    public String[] getPostState() {
-        return postState;
-    }
-
-    public String[] getPostZipCode() {
-        return postZipCode;
-    }
-
-    public void setFirstName(String value)            { user.setFirstName(value); }
-    public void setLastName(String value)             { user.setLastName(value); }
-    public void setHrid(String value)                 { user.setHrid(value); }
-    public void setOrgUserId(String value)            { user.setOrgUserId(value); }
-    public void setOrgCode(String value)              { user.setOrgCode(value); }
-    public void setEmail(String value)                { user.setEmail(value); }
-    public void setOrgManagerUserId(String value)     { user.setOrgManagerUserId(value); }
-    
-    public void setFirstNameOrig(String value)        { userOrig.setFirstName(value); }
-    public void setLastNameOrig(String value)         { userOrig.setLastName(value); }
-    public void setHridOrig(String value)             { userOrig.setHrid(value); }
-    public void setOrgUserIdOrig(String value)        { userOrig.setOrgUserId(value); }
-    public void setOrgCodeOrig(String value)          { userOrig.setOrgCode(value); }
-    public void setEmailOrig(String value)            { userOrig.setEmail(value); }
-    public void setOrgManagerUserIdOrig(String value) { userOrig.setOrgManagerUserId(value); }
-    
-    public void setUser(EPUser value)                   { this.user = value; }
-
-    public void setPostEmail(String[] postEmail) {
-        this.postEmail = postEmail;
-    }
-
-    public void setPostFirstName(String[] postFirstName) {
-        this.postFirstName = postFirstName;
-    }
-
-    public void setPostHrid(String[] postHrid) {
-        this.postHrid = postHrid;
-    }
-
-    public void setPostLastName(String[] postLastName) {
-        this.postLastName = postLastName;
-    }
-
-    public void setPostOrgCode(String[] postOrgCode) {
-        this.postOrgCode = postOrgCode;
-    }
-
-    public void setPostPhone(String[] postPhone) {
-        this.postPhone = postPhone;
-    }
-
-    public void setPostUserId(String[] postOrgUserId) {
-        this.postOrgUserId = postOrgUserId;
-    }
-
-    public void setSelected(String[] selected) {
-        this.selected = selected;
-    }
-
-    public void setPostAddress1(String[] postAddress1) {
-        this.postAddress1 = postAddress1;
-    }
-
-    public void setPostBusinessCountryCode(String[] postBusinessCountryCode) {
-        this.postBusinessCountryCode = postBusinessCountryCode;
-    }
-
-    public void setPostCity(String[] postCity) {
-        this.postCity = postCity;
-    }
-
-    public void setPostCommandChain(String[] postCommandChain) {
-        this.postCommandChain = postCommandChain;
-    }
-
-    public void setPostCompany(String[] postCompany) {
-        this.postCompany = postCompany;
-    }
-
-    public void setPostCompanyCode(String[] postCompanyCode) {
-        this.postCompanyCode = postCompanyCode;
-    }
-
-    public void setPostDepartment(String[] postDepartment) {
-        this.postDepartment = postDepartment;
-    }
-
-    public void setPostDepartmentName(String[] postDepartmentName) {
-        this.postDepartmentName = postDepartmentName;
-    }
-
-    public void setPostBusinessCountryName(String[] postBusinessCountryName) {
-        this.postBusinessCountryName = postBusinessCountryName;
-    }
-
-    public void setPostJobTitle(String[] postJobTitle) {
-        this.postJobTitle = postJobTitle;
-    }
-
-    public void setPostLocationClli(String[] postLocationClli) {
-        this.postLocationClli = postLocationClli;
-    }
-
-    public void setPostManagerUserId(String[] postOrgManagerUserId) {
-        this.postOrgManagerUserId = postOrgManagerUserId;
-    }
-
-    public void setPostState(String[] postState) {
-        this.postState = postState;
-    }
-
-    public void setPostZipCode(String[] postZipCode) {
-        this.postZipCode = postZipCode;
-    }
-    
-    public String[] getPostAddress2() {
-               return postAddress2;
-       }
-
-       public void setPostAddress2(String[] postAddress2) {
-               this.postAddress2 = postAddress2;
-       }
-
-       public EPUser getUserOrig() {
-               return userOrig;
-       }
-
-       public void setUserOrig(EPUser userOrig) {
-               this.userOrig = userOrig;
-       }
-
-       public String[] getPostBusinessUnit() {
-               return postBusinessUnit;
-       }
-
-       public void setPostBusinessUnit(String[] postBusinessUnit) {
-               this.postBusinessUnit = postBusinessUnit;
-       }
-
-       public String[] getPostBusinessUnitName() {
-               return postBusinessUnitName;
-       }
-
-       public void setPostBusinessUnitName(String[] postBusinessUnitName) {
-               this.postBusinessUnitName = postBusinessUnitName;
-       }
-
-       public String[] getPostCostCenter() {
-               return postCostCenter;
-       }
-
-       public void setPostCostCenter(String[] postCostCenter) {
-               this.postCostCenter = postCostCenter;
-       }
-
-       public String[] getPostSiloStatus() {
-               return postSiloStatus;
-       }
-
-       public void setPostSiloStatus(String[] postSiloStatus) {
-               this.postSiloStatus = postSiloStatus;
-       }
-
-       public String[] getPostFinancialLocCode() {
-               return postFinancialLocCode;
-       }
-
-       public void setPostFinancialLocCode(String[] postFinancialLocCode) {
-               this.postFinancialLocCode = postFinancialLocCode;
-       }
-
-       public void resetSearch() {
-          super.resetSearch();
-          setUser(new EPUser());
-       } // resetSearch
-
-
-       public boolean isCriteriaUpdated() {
-          if(user==null&&userOrig==null)
-            return false;
-          else if(user==null||userOrig==null)
-            return true;
-          else
-            return (! (
-                Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))&&
-                Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))&&
-                //Utilities.nvl(user.getHrid()).equals(Utilities.nvl(userOrig.getHrid()))&&
-                Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))&&
-                Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))&&
-                Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))&&
-                Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId()))&&
-                true));
-       } // isCriteriaUpdated
-
-}      // PostSearchBean
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/NotificationCleanup.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/NotificationCleanup.java
deleted file mode 100644 (file)
index 2c11824..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import java.util.TimerTask;
-
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-public class NotificationCleanup extends TimerTask {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(NotificationCleanup.class);
-
-       @Override
-       public void run() {
-               logger.debug(EELFLoggerDelegate.debugLogger, "run: cleaning the ep-notification table");
-               UserNotificationService notificationService = NotificationCleanupConfig.getApplicationContext()
-                               .getBean(UserNotificationService.class);
-               notificationService.deleteNotificationsFromEpUserNotificationTable();
-               notificationService.deleteNotificationsFromEpRoleNotificationTable();
-               notificationService.deleteNotificationsFromEpNotificationTable();
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/NotificationCleanupConfig.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/NotificationCleanupConfig.java
deleted file mode 100644 (file)
index 016a55e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.annotation.PostConstruct;
-
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class NotificationCleanupConfig implements ApplicationContextAware {
-       
-       // Once every 10 minutes should be adequate
-       public final static int CLEANUP_PERIOD_MINUTES = 10;
-       
-       private static ApplicationContext applicationContext;
-
-       public void setApplicationContext(ApplicationContext context) throws BeansException {
-               applicationContext = context;
-       }
-
-       public static ApplicationContext getApplicationContext() {
-               return applicationContext;
-
-       }
-
-       @PostConstruct
-       public void StartSchedular() {
-               TimerTask task = new NotificationCleanup();
-               Timer timer = new Timer();
-               timer.schedule(task, 1000, CLEANUP_PERIOD_MINUTES * 60 * 1000);
-       }
-
-       @Bean
-       public NotificationCleanupConfig getConfig() {
-               return new NotificationCleanupConfig();
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/PortalCentralAccessConfiguration.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/PortalCentralAccessConfiguration.java
deleted file mode 100644 (file)
index 0b701a2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceImpl;
-import org.openecomp.portalsdk.core.service.CentralAccessCondition;
-import org.openecomp.portalsdk.core.service.LocalAccessCondition;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Conditional;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-public class PortalCentralAccessConfiguration {
-
-       
-          @Bean
-          @Conditional(LocalAccessCondition.class)
-          public EPRoleFunctionService ePRoleFunctionServiceImpl() {
-             return  new EPRoleFunctionServiceImpl();
-          }
-          
-         
-          @Bean
-          @Conditional(CentralAccessCondition.class)
-          public EPRoleFunctionService ePRoleFunctionServiceCentralizedImpl() {
-             return  new EPRoleFunctionServiceCentralizedImpl();
-          }
-          
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/SwaggerConfig.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/SwaggerConfig.java
deleted file mode 100644 (file)
index 94659d7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-@Configuration
-@EnableSwagger2
-public class SwaggerConfig {
-
-    @Bean
-    public Docket api(){
-        return new Docket(DocumentationType.SWAGGER_2)
-            .select()
-            .apis(RequestHandlerSelectors.any())
-            .paths(PathSelectors.regex("/auxapi/.*"))
-            .build()
-            .apiInfo(apiInfo());
-    }
-
-    private ApiInfo apiInfo() {
-        return new ApiInfoBuilder()
-            .title("ECOMP Portal API Documentation")
-            .description("ECOMP Portal API Documentation")
-            .version("1.2.6")
-            .termsOfServiceUrl("http://terms-of-services.url")
-            .license("LICENSE")
-            .licenseUrl("http://url-to-license.com")
-            .build();
-    }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/SwaggerMVCConfig.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/config/SwaggerMVCConfig.java
deleted file mode 100644 (file)
index 399d586..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-
-@Configuration
-@EnableWebMvc
-public class SwaggerMVCConfig extends WebMvcConfigurerAdapter {
-
-    @Override 
-    public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
-        registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
-    }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPFusionBaseController.java
deleted file mode 100644 (file)
index fb84bf6..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.controller.FusionBaseController;
-import org.openecomp.portalsdk.core.domain.MenuData;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.ModelAttribute;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Controller
-public abstract class EPFusionBaseController extends FusionBaseController {
-       
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPFusionBaseController.class);
-               
-       @Override
-       public boolean isAccessible() {
-               return true;
-       }
-
-       public boolean isRESTfulCall() {
-               return true;
-       }
-
-       @ModelAttribute("menu")
-       public Map<String, Object> messages(HttpServletRequest request) {
-               HttpSession session = null;
-               Map<String, Object> model = new HashMap<String, Object>();
-               session = request.getSession();
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (session != null && user != null) {
-                       @SuppressWarnings("unchecked")
-                       Set<MenuData> menuResult = (Set<MenuData>) session
-                                       .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
-                       try {
-                               model = setMenu(menuResult);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "messages failed", e);
-                       }
-               }
-               
-               return model;
-       }
-
-       public Map<String, Object> setMenu(Set<MenuData> menuResult) throws Exception {
-               ObjectMapper mapper = new ObjectMapper();
-               List<List<MenuData>> childItemList = new ArrayList<List<MenuData>>();
-               
-               List<MenuData> parentList = new ArrayList<MenuData>();
-               
-               Map<String, Object> model = new HashMap<String, Object>();
-               for (MenuData menu : menuResult) {
-                       MenuData parentData = new MenuData();
-                       parentData.setLabel(menu.getLabel());
-                       parentData.setAction(menu.getAction());
-                       parentData.setImageSrc(menu.getImageSrc());
-                       parentList.add(parentData);
-                       List<MenuData> tempList = new ArrayList<MenuData>();
-                       for (Object o : menu.getChildMenus()) {
-                               MenuData m = (MenuData) o;
-                               MenuData data = new MenuData();
-                               data.setLabel(m.getLabel());
-                               data.setAction(m.getAction());
-                               data.setImageSrc(m.getImageSrc());
-                               tempList.add(data);
-                       }
-                       childItemList.add(tempList);
-               }
-               model.put("childItemList",  mapper.writeValueAsString(childItemList));
-               model.put("parentList", mapper.writeValueAsString(parentList));
-               return model;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPRestrictedBaseController.java
deleted file mode 100644 (file)
index 0d81b50..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-public class EPRestrictedBaseController extends EPFusionBaseController{
-       
-       protected String viewName;
-       private String exceptionView;
-       
-       @Override
-       public boolean isAccessible() {
-               return false;
-       }
-       
-       @Override
-       public boolean isRESTfulCall(){
-               return false;
-       }
-       
-       protected String getViewName() {
-               return viewName;
-       }
-       
-       protected void setViewName(String viewName) {
-               this.viewName = viewName;
-       }
-
-       public String getExceptionView() {
-        return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
-       }
-
-       public void setExceptionView(String exceptionView) {
-               this.exceptionView = exceptionView;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPRestrictedRESTfulBaseController.java
deleted file mode 100644 (file)
index af88055..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-public class EPRestrictedRESTfulBaseController extends EPFusionBaseController{
-       
-       protected String viewName;
-       private String exceptionView;
-       
-       @Override
-       public boolean isAccessible() {
-               return false;
-       }
-       
-       @Override
-       public boolean isRESTfulCall(){
-               return true;
-       }
-       
-       protected String getViewName() {
-               return viewName;
-       }
-       
-       protected void setViewName(String viewName) {
-               this.viewName = viewName;
-       }
-
-       public String getExceptionView() {
-        return (exceptionView == null) ? "runtime_error_handler" : exceptionView;
-       }
-
-       public void setExceptionView(String exceptionView) {
-               this.exceptionView = exceptionView;
-       }
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/EPUnRestrictedBaseController.java
deleted file mode 100644 (file)
index f6ba65c..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-public class EPUnRestrictedBaseController extends EPFusionBaseController{
-       protected String viewName;
-       
-       @Override
-       public boolean isAccessible() {
-               return true;
-       }
-       
-       @Override
-       public boolean isRESTfulCall(){
-               return false;
-       }
-       
-       protected String getViewName() {
-               return viewName;
-       }
-
-       protected void setViewName(String viewName) {
-               this.viewName = viewName;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/controller/sessionmgt/SessionCommunicationController.java
deleted file mode 100644 (file)
index 4ce72b0..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller.sessionmgt;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedRESTfulBaseController;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalapp.service.sessionmgt.ManageService;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-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 io.swagger.annotations.ApiOperation;
-
-
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class SessionCommunicationController  extends EPRestrictedRESTfulBaseController {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunicationController.class);
-       
-       @Autowired
-       private ManageService manageService;
-               
-       protected boolean isAuxRESTfulCall(){
-               return true;
-       }
-       
-       @ApiOperation(value = "Gets session slot-check interval, a duration in milliseconds.",
-    response = Integer.class)
-       @RequestMapping(value={"/getSessionSlotCheckInterval"}, method = RequestMethod.GET, 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)
-       public Boolean extendSessionTimeOuts(HttpServletRequest request, HttpServletResponse response, @RequestParam String sessionMap) throws Exception {
-               manageService.extendSessionTimeOuts(sessionMap);
-               
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/externalsystemapproval/model/ExternalSystemRoleApproval.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/externalsystemapproval/model/ExternalSystemRoleApproval.java
deleted file mode 100644 (file)
index 9309dbe..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.externalsystemapproval.model;
-
-import java.io.Serializable;
-
-public class ExternalSystemRoleApproval implements Serializable {
-
-       private static final long serialVersionUID = 6048830318039958615L;
-
-       private String roleName;
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/externalsystemapproval/model/ExternalSystemUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/externalsystemapproval/model/ExternalSystemUser.java
deleted file mode 100644 (file)
index 660af6a..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.externalsystemapproval.model;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ExternalSystemUser {
-
-       private String loginId;
-       
-       private String applicationName;
-       
-       private String myloginrequestId;
-       
-       private List<ExternalSystemRoleApproval> roles;
-
-       public ExternalSystemUser() {
-               roles = new ArrayList<ExternalSystemRoleApproval>();
-       }
-
-       public String getApplicationName() {
-               return applicationName;
-       }
-
-       public void setApplicationName(String applicationName) {
-               this.applicationName = applicationName;
-       }
-
-       public String getLoginId() {
-               return loginId;
-       }
-
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       }
-
-       public List<ExternalSystemRoleApproval> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<ExternalSystemRoleApproval> roles) {
-               this.roles = roles;
-       }
-
-       public String getMyloginrequestId() {
-               return myloginrequestId;
-       }
-
-       public void setMyloginrequestId(String myloginrequestId) {
-               this.myloginrequestId = myloginrequestId;
-       }
-       
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/lm/FusionLicenseManagerImpl.java
deleted file mode 100644 (file)
index 1bba3c2..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.lm;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.ServletContext;
-
-import org.openecomp.portalsdk.core.lm.FusionLicenseManager;
-import org.springframework.stereotype.Component;
-
-/*
- *  Please note that this class is not being used; its a dummy stub to have a qualifying bean for the interface.
- */
-
-@Component
-public class FusionLicenseManagerImpl implements FusionLicenseManager {
-
-       @Override
-       public void initKeyStoreParam() {
-               
-       }
-       
-       @Override
-       public void initCipherParam() {
-               
-       }
-
-       @Override       
-       public void initLicenseParam() {
-               
-       }
-
-       @Override
-       public void doInitWork() {
-               
-       }
-
-       @Override
-       public int installLicense() {
-               return 0;
-       }
-
-       @Override
-       public synchronized int verifyLicense(ServletContext context) {
-               return 0;
-       }
-
-       @Override
-       public void generateLicense(Map<String, String> clientInfoMap, List<String> ipAddressList) throws Exception {
-               
-       }
-       
-       @Override
-       public String nvl(String s) {
-               return null;
-       }
-
-       @Override
-       public Date getExpiredDate() {
-               return null;
-       }
-
-       @Override       
-       public void setExpiredDate(Date expiredDate) {
-               
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/lm/LicenseableClassImpl.java
deleted file mode 100644 (file)
index 1cb882e..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.lm;
-
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-
-import org.openecomp.portalsdk.core.lm.LicenseableClass;
-
-/*
- *  Please note that this class is not being used; its a dummy stub to have a qualifying bean for the interface.
- */
-
-public class LicenseableClassImpl implements LicenseableClass {
-                 
-       public String getApplicationName() {
-               return "";
-       }
-
-       public InputStream getPublicKeystoreAsInputStream() throws FileNotFoundException {
-         return null;
-       }
-
-       public String getAlias() {
-               return "";
-       }
-
-       public String getKeyPasswd() {
-               return "";
-       }
-
-       public String getPublicKeystorePassword() {
-               return "";
-       }
-
-       public String getCipherParamPassword() {
-               return "";
-       }
-
-       @SuppressWarnings("rawtypes")
-       public Class getClassToLicense() {
-               return this.getClass();
-       }
-}
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/model/Result.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/model/Result.java
deleted file mode 100644 (file)
index 55d5599..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.model;
-
-public class Result {
-       private String result;
-       
-       public Result(String result) {
-               this.result = result;
-       }
-
-       public String getResult() {
-               return result;
-       }
-
-       public void setResult(String result) {
-               this.result = result;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppCatalogController.java
deleted file mode 100644 (file)
index 35390b1..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppService;
-import org.openecomp.portalapp.portal.transport.AppCatalogPersonalization;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.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;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class AppCatalogController extends EPRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppCatalogController.class);
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-       @Autowired
-       private EPAppService appService;
-       @Autowired
-       private PersUserAppService persUserAppService;
-
-       /**
-        * RESTful service method to fetch all enabled applications, with details
-        * about which are accessible to the current user, selected by the current
-        * user.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @throws IOException If sendError fails
-        * @return List of items suitable for display
-        */
-       @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.GET, produces = "application/json")
-       public List<AppCatalogItem> getAppCatalog(HttpServletRequest request, HttpServletResponse response)
-                       throws IOException {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<AppCatalogItem> appCatalog = null;
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getAppCatalog");
-                       } else {
-                               if (adminRolesService.isSuperAdmin(user))
-                                       appCatalog = appService.getAdminAppCatalog(user);
-                               else
-                                       appCatalog = appService.getUserAppCatalog(user);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getAppCatalog", "GET result =", appCatalog);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppCatalog failed", e);
-                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
-               }
-               return appCatalog;
-       }
-
-       /**
-        * RESTful service to accept a user's action made on the application
-        * catalog.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param persRequest
-        *            JSON with data including application ID
-        * @param response
-        *            HttpServletResponse
-        * @return FieldsValidator
-        * @throws IOException If sendError fails
-        */
-       @RequestMapping(value = { "/portalApi/appCatalog" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator putAppCatalogSelection(HttpServletRequest request,
-                       @RequestBody AppCatalogPersonalization persRequest, HttpServletResponse response) throws IOException {
-               FieldsValidator result = new FieldsValidator();
-               EPApp app = appService.getApp(persRequest.getAppId());
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (app == null || user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "putAppCatalogSelection");
-                       } else {
-                               persUserAppService.setPersUserAppValue(user, app, persRequest.getSelect(), persRequest.getPending());
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putAppCatalogSelection failed", e);
-                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
-               }
-               result.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-               return result;
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppContactUsController.java
deleted file mode 100644 (file)
index 611e1bb..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.JSONObject;
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AppContactUsService;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-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.RestController;
-
-@RestController
-@RequestMapping("/portalApi/contactus")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class AppContactUsController extends EPRestrictedBaseController {
-
-       static final String FAILURE = "failure";
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppContactUsController.class);
-
-       @Autowired
-       private AppContactUsService contactUsService;
-
-       /**
-        * Answers a JSON object with three items from the system.properties file:
-        * user self-help ticket URL, email for feedback, and Portal info link.
-        * 
-        * @param request HttpServletRequest
-        * @return PortalRestResponse
-        */
-       @RequestMapping(value = "/feedback", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<String> getPortalDetails(HttpServletRequest request) {
-               PortalRestResponse<String> portalRestResponse = null;
-               try {
-                       final String ticketUrl = SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL);
-                       final String portalInfoUrl = SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL);
-                       final String feedbackEmail = SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS);
-                       HashMap<String, String> map = new HashMap<String, String>();
-                       map.put(EPCommonSystemProperties.USH_TICKET_URL, ticketUrl);
-                       map.put(EPCommonSystemProperties.PORTAL_INFO_URL, portalInfoUrl);
-                       map.put(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS, feedbackEmail);
-                       JSONObject j = new JSONObject(map);
-                       String contactUsPortalResponse = j.toString();
-                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                                       contactUsPortalResponse);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE, e.getMessage());
-               }
-               return portalRestResponse;
-       }
-
-       /**
-        * Answers the contents of the contact-us table, extended with the
-        * application name.
-        * 
-        * @param request HttpServletRequest
-        * @return PortalRestResponse<List<AppContactUsItem>>
-        */
-       @RequestMapping(value = "/list", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<AppContactUsItem>> getAppContactUsList(HttpServletRequest request) {
-               PortalRestResponse<List<AppContactUsItem>> portalRestResponse = null;
-               try {
-                       List<AppContactUsItem> contents = contactUsService.getAppContactUs();
-                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.OK, "success",
-                                       contents);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppContactUsList failed", e);
-                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.ERROR,
-                                       e.getMessage(), null);
-               }
-               return portalRestResponse;
-       }
-
-       /**
-        * Answers a list of objects, one per application, extended with available
-        * data on how to contact that app's organization (possibly none).
-        * 
-        * @param request HttpServletRequest
-        * @return PortalRestResponse<List<AppContactUsItem>>
-        */
-       @RequestMapping(value = "/allapps", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<AppContactUsItem>> getAppsAndContacts(HttpServletRequest request) {
-               PortalRestResponse<List<AppContactUsItem>> portalRestResponse = null;
-               try {
-                       List<AppContactUsItem> contents = contactUsService.getAppsAndContacts();
-                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.OK, "success",
-                                       contents);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAllAppsAndContacts failed", e);
-                       portalRestResponse = new PortalRestResponse<List<AppContactUsItem>>(PortalRestStatusEnum.ERROR,
-                                       e.getMessage(), null);
-               }
-               return portalRestResponse;
-       }
-
-       /**
-        * Sorts by category name.
-        */
-       private Comparator<AppCategoryFunctionsItem> appCategoryFunctionsItemComparator = new Comparator<AppCategoryFunctionsItem>() {
-               @Override
-               public int compare(AppCategoryFunctionsItem o1, AppCategoryFunctionsItem o2) {
-                       return o1.getCategory().compareTo(o2.getCategory());
-               }
-       };
-       
-       /**
-        * Answers a list of objects with category-application-function details. Not
-        * all applications participate in the functional menu.
-        * 
-        * @param request HttpServletRequest
-        * @return PortalRestResponse<List<AppCategoryFunctionsItem>>
-        */
-       @RequestMapping(value = "/functions", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<AppCategoryFunctionsItem>> getAppCategoryFunctions(HttpServletRequest request) {
-               PortalRestResponse<List<AppCategoryFunctionsItem>> portalRestResponse = null;
-               try {
-                       List<AppCategoryFunctionsItem> contents = contactUsService.getAppCategoryFunctions();
-                       // logger.debug(EELFLoggerDelegate.debugLogger,
-                       // "getAppCategoryFunctions: result list size is " +
-                       // contents.size());
-                       Collections.sort(contents, appCategoryFunctionsItemComparator);
-                       portalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>(PortalRestStatusEnum.OK,
-                                       "success", contents);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppCategoryFunctions failed", e);
-                       // TODO build JSON error
-                       portalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>(PortalRestStatusEnum.ERROR,
-                                       e.getMessage(), null);
-               }
-               return portalRestResponse;
-       }
-
-       /**
-        * Accepts a new application's contact us details.
-        * 
-        * @param contactUs AppContactUsItem
-        * @return PortalRestResponse<String>
-        */
-       @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> save(@RequestBody AppContactUsItem contactUs) {
-
-               if (contactUs == null || contactUs.getAppName() == null)
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE,
-                                       "AppName cannot be null or empty");
-
-               String saveAppContactUs = FAILURE;
-               try {
-                       saveAppContactUs = contactUsService.saveAppContactUs(contactUs);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveAppContactUs, e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveAppContactUs, "");
-       }
-
-       @RequestMapping(value = "/saveAll", method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> save(@RequestBody List<AppContactUsItem> contactUsList) {
-
-               String saveAppContactUs = FAILURE;
-               try {
-                       saveAppContactUs = contactUsService.saveAppContactUs(contactUsList);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveAppContactUs, e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveAppContactUs, "");
-       }
-
-       /**
-        * Deletes the specified application's contact-us details entry from the
-        * table.
-        * 
-        * @param id app ID
-        * @return PortalRestResponse<String>
-        */
-       @RequestMapping(value = "/delete/{appid}", method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> delete(@PathVariable("appid") Long id) {
-
-               String saveAppContactUs = FAILURE;
-               try {
-                       saveAppContactUs = contactUsService.deleteContactUs(id);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveAppContactUs, e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveAppContactUs, "");
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppsController.java
deleted file mode 100644 (file)
index e9a1a95..0000000
+++ /dev/null
@@ -1,740 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
-import org.openecomp.portalapp.portal.domain.AppsResponse;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.domain.UserRoles;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.EPLeftMenuService;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.LocalRole;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-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;
-
-@RestController
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class AppsController extends EPRestrictedBaseController {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsController.class);
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-
-       @Autowired
-       private EPAppService appService;
-
-       @Autowired
-       private EPLeftMenuService leftMenuService;
-
-       /**
-        * RESTful service method to fetch all Applications available to current
-        * user
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List<EcompApp>
-        */
-       @RequestMapping(value = { "/portalApi/userApps" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EcompApp> getUserApps(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EcompApp> ecompApps = null;
-
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getUserApps");
-                       } else {
-                               ecompApps = appService.transformAppsToEcompApps(appService.getUserApps(user));
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApps", "GET result =", ecompApps);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserApps failed", e);
-               }
-
-               return ecompApps;
-       }
-
-       /**
-        * RESTful service method to fetch all applications accessible to the
-        * current user, with personalizations.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List<EcompApp>
-        * @throws IOException
-        *             if sendError fails
-        */
-       @RequestMapping(value = { "/portalApi/persUserApps" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EcompApp> getPersUserApps(HttpServletRequest request, HttpServletResponse response) throws IOException {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EcompApp> ecompApps = null;
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getPersUserApps");
-                       } else {
-                               List<EPApp> apps = null;
-                               if (adminRolesService.isSuperAdmin(user))
-                                       apps = appService.getPersAdminApps(user);
-                               else
-                                       apps = appService.getPersUserApps(user);
-                               ecompApps = appService.transformAppsToEcompApps(apps);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userPersApps", "GET result =", ecompApps);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getPersUserApps failed", e);
-                       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
-               }
-               return ecompApps;
-       }
-
-       /**
-        * RESTful service method to fetch applications for which the current user
-        * is an Administrator
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List<AppIdAndNameTransportModel>
-        */
-       @RequestMapping(value = { "/portalApi/adminApps" }, method = RequestMethod.GET, produces = "application/json")
-       public List<AppIdAndNameTransportModel> getAdminApps(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<AppIdAndNameTransportModel> adminApps = null;
-
-               try {
-                       if (!adminRolesService.isAccountAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getAdminApps");
-                       } else {
-                               adminApps = appService.getAdminApps(user);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminApps", "GET result =", adminApps);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAdminApps failed", e);
-               }
-
-               return adminApps;
-       }
-
-       /**
-        * RESTful service method to fetch Applications for user who is super admin
-        * and/or app admin.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List<AppIdAndNameTransportModel>
-        */
-       @RequestMapping(value = {
-                       "/portalApi/appsForSuperAdminAndAccountAdmin" }, method = RequestMethod.GET, produces = "application/json")
-       public List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(HttpServletRequest request,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<AppIdAndNameTransportModel> adminApps = null;
-
-               try {
-                       if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getAdminApps");
-                       } else {
-                               adminApps = appService.getAppsForSuperAdminAndAccountAdmin(user);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/appsForSuperAdminAndAccountAdmin",
-                                               "GET result =", adminApps);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsForSuperAdminAndAccountAdmin failed", e);
-               }
-
-               return adminApps;
-       }
-
-       /**
-        * RESTful service method to fetch left menu items from the user's session.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return JSON with left menu
-        */
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       @RequestMapping(value = { "/portalApi/leftmenuItems" }, method = RequestMethod.GET, produces = "application/json")
-       public String getLeftMenuItems(HttpServletRequest request, HttpServletResponse response) {
-               String menuList = null;
-               Set menuSet = (Set) AppUtils.getSession(request)
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
-
-               Set roleFunctionSet = (Set) AppUtils.getSession(request)
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
-
-               EPUser user = EPUserUtils.getUserSession(request);
-
-               try {
-                       menuList = leftMenuService.getLeftMenuItems(user, menuSet, roleFunctionSet);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/leftmenuItems", "GET result =", menuList);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getLeftMenuItems failed", e);
-               }
-               return menuList;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/userAppsOrderBySortPref" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EcompApp> getUserAppsOrderBySortPref(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EcompApp> ecompApps = null;
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getUserAppsOrderBySortPref");
-                       } else {
-                               String usrSortPref = request.getParameter("mparams");
-                               if (usrSortPref.equals("")) {
-                                       usrSortPref = "N";
-                               }
-                               switch (usrSortPref) {
-                               case "N":
-                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByName(user));
-                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
-                                                       ecompApps);
-                                       break;
-                               case "L":
-                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByLastUsed(user));
-                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
-                                                       ecompApps);
-                                       break;
-                               case "F":
-                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByMostUsed(user));
-                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
-                                                       ecompApps);
-                                       break;
-                               case "M":
-                                       ecompApps = appService.transformAppsToEcompApps(appService.getAppsOrderByManual(user));
-                                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsOrderBySortPref", "GET result =",
-                                                       ecompApps);
-                                       break;
-                               default:
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "getUserAppsOrderBySortPref failed: no match for " + usrSortPref);
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppsOrderBySortPref failed", e);
-               }
-               return ecompApps;
-       }
-
-       /**
-        * Sets the user apps manual sort preference
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @param epAppsManualPref
-        *            sort pref
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = {
-                       "/portalApi/saveUserAppsSortingManual" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator putUserAppsSortingManual(HttpServletRequest request,
-                       @RequestBody List<EPAppsManualPreference> epAppsManualPref, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       fieldsValidator = appService.saveAppsSortManual(epAppsManualPref, user);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserAppsSortingManual failed", e);
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/saveUserAppsSortingManual", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/saveUserWidgetsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator putUserWidgetsSortManual(HttpServletRequest request,
-                       @RequestBody List<EPWidgetsSortPreference> saveManualWidgetSData, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       fieldsValidator = appService.saveWidgetsSortManual(saveManualWidgetSData, user);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortManual failed", e);
-               }
-               // return fieldsValidator;
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/putUserWidgetsSortManual", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/updateWidgetsSortPref" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator putUserWidgetsSortPref(HttpServletRequest request,
-                       @RequestBody List<EPWidgetsSortPreference> delManualWidgetData, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       fieldsValidator = appService.deleteUserWidgetSortPref(delManualWidgetData, user);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortPref failed", e);
-
-               }
-               // return fieldsValidator;
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/putUserWidgetsSortPref", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       /**
-        * Deletes the user app manual sort preference record
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @param delManualAppData
-        *            data to delete
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = {
-                       "/portalApi/UpdateUserAppsSortManual" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator deleteUserAppSortManual(HttpServletRequest request,
-                       @RequestBody EPDeleteAppsManualSortPref delManualAppData, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       fieldsValidator = appService.deleteUserAppSortManual(delManualAppData, user);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserAppSortManual failed", e);
-
-               }
-               // return fieldsValidator;
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/deleteUserAppSortManual", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/saveUserAppsSortingPreference" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator putUserAppsSortingPreference(HttpServletRequest request,
-                       @RequestBody EPAppsSortPreference userAppsValue, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       fieldsValidator = appService.saveAppsSortPreference(userAppsValue, user);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserAppsSortingPreference failed", e);
-
-               }
-
-               // return fieldsValidator;
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/putUserAppsSortingPreference", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/userAppsSortTypePreference" }, method = RequestMethod.GET, produces = "application/String")
-       public String getUserAppsSortTypePreference(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               String userSortPreference = null;
-
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "userAppsSortTypePreference");
-                       } else {
-                               userSortPreference = appService.getUserAppsSortTypePreference(user);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppsSortTypePreference", "GET result =",
-                                               userSortPreference);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppsSortTypePreference failed", e);
-               }
-
-               return userSortPreference;
-       }
-
-       /**
-        * RESTful service method to fetch Application Administrators to Super
-        * Administrator user. Attention: Users which have Super Administrator roles
-        * only are not included!
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @return List<AdminUserApplications>
-        */
-       @RequestMapping(value = { "/portalApi/accountAdmins" }, method = RequestMethod.GET, produces = "application/json")
-       public List<AdminUserApplications> getAppsAdministrators(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<AdminUserApplications> admins = null;
-               try {
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getAppsAdministrators");
-                       } else {
-                               admins = appService.getAppsAdmins();
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/accountAdmins", "GET result =", admins);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsAdministrators failed", e);
-               }
-
-               return admins;
-       }
-
-       @RequestMapping(value = { "/portalApi/availableApps" }, method = RequestMethod.GET, produces = "application/json")
-       public List<AppsResponse> getApps(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<AppsResponse> apps = null;
-               try {
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getApps");
-                       } else {
-                               apps = appService.getAllApps(false);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/availableApps", "GET result =", apps);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getApps failed", e);
-               }
-
-               return apps;
-       }
-
-       /**
-        * Gets all apps, both active and inactive; i.e., all on-boarded apps,
-        * regardless of enabled status.
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @return List of applications
-        */
-       @RequestMapping(value = {
-                       "/portalApi/allAvailableApps" }, method = RequestMethod.GET, produces = "application/json")
-       public List<AppsResponse> getAllApps(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<AppsResponse> apps = null;
-               try {
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getApps");
-                       } else {
-                               apps = appService.getAllApps(true);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/availableApps", "GET result =", apps);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAllApps failed", e);
-               }
-
-               return apps;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @return List of applications
-        */
-       @RequestMapping(value = { "/portalApi/appsFullList" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EcompApp> getAppsFullList(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EcompApp> ecompApps = null;
-               if (user == null) {
-                       EcompPortalUtils.setBadPermissions(user, response, "getAppsFullList");
-               } else {
-                       ecompApps = appService.getEcompAppAppsFullList();
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/appsFullList", "GET result =", ecompApps);
-               }
-               return ecompApps;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @return UserRoles
-        */
-       @RequestMapping(value = { "/portalApi/userProfile" }, method = RequestMethod.GET, produces = "application/json")
-       public UserRoles getUserProfile(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               UserRoles userAndRoles = null;
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getUserProfile");
-                       } else {
-                               userAndRoles = appService.getUserProfileNormalized(user);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserProfile failed", e);
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userProfile", "getUserProfile result =",
-                               userAndRoles);
-               return userAndRoles;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param appId
-        *            application ID
-        * @return List<LocalRole>
-        */
-       @RequestMapping(value = { "/portalApi/appRoles/{appId}" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<LocalRole> getAppRoles(HttpServletRequest request, @PathVariable("appId") Long appId) {
-               List<LocalRole> roleList = null;
-               try {
-                       roleList = appService.getAppRoles(appId);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/appRoles/" + appId, "GET result =", roleList);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppRoles failed", e);
-               }
-
-               return roleList;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @return List<OnboardingApp>
-        */
-       @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.GET, produces = "application/json")
-       public List<OnboardingApp> getOnboardingApps(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<OnboardingApp> onboardingApps = null;
-               try {
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getOnboardingApps");
-                       } else {
-                               onboardingApps = appService.getOnboardingApps();
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps", "GET result =",
-                                               "onboardingApps of size " + onboardingApps.size());
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getOnboardingApps failed", e);
-               }
-
-               return onboardingApps;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @param modifiedOnboardingApp
-        *            app to update
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.PUT, produces = "application/json")
-       public FieldsValidator putOnboardingApp(HttpServletRequest request,
-                       @RequestBody OnboardingApp modifiedOnboardingApp, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "putOnboardingApp");
-                       } else {
-                               modifiedOnboardingApp.normalize();
-                               fieldsValidator = appService.modifyOnboardingApp(modifiedOnboardingApp, user);
-                               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putOnboardingApps failed", e);
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @param newOnboardingApp
-        *            app to add
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/onboardingApps" }, method = RequestMethod.POST, produces = "application/json")
-       public FieldsValidator postOnboardingApp(HttpServletRequest request, @RequestBody OnboardingApp newOnboardingApp,
-                       HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "postOnboardingApps");
-                       } else {
-                               newOnboardingApp.normalize();
-                               fieldsValidator = appService.addOnboardingApp(newOnboardingApp, user);
-                               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "postOnboardingApp failed", e);
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps", "POST result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       /**
-        * REST endpoint to process a request to delete an on-boarded application.
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @param appId
-        *            ID of app to delete
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/onboardingApps/{appId}" }, method = {
-                       RequestMethod.DELETE }, produces = "application/json")
-       public FieldsValidator deleteOnboardingApp(HttpServletRequest request, @PathVariable("appId") Long appId,
-                       HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "deleteOnboardingApps");
-                       } else {
-                               fieldsValidator = appService.deleteOnboardingApp(user, appId);
-                               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteOnboardingApp failed", e);
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/onboardingApps" + appId, "DELETE result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       /**
-        * Gets the application thumbnail image; sets status 404 if none exists.
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param response
-        *            HTTP servlet response
-        * @param appId
-        *            Application ID
-        * @return Bytes with the app thumbnail image; null if not available.
-        */
-       @RequestMapping(value = { "/portalApi/appThumbnail/{appId}" }, method = { RequestMethod.GET })
-       public HttpEntity<byte[]> getAppThumbnail(HttpServletRequest request, @PathVariable("appId") Long appId,
-                       HttpServletResponse response) {
-               EPApp app = appService.getApp(appId);
-               if (app == null || app.getImageUrl() == null || app.getThumbnail() == null || app.getThumbnail().length == 0) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "getAppThumbnail: no app and/or no thumbnail for app " + appId);
-                       response.setStatus(HttpServletResponse.SC_NOT_FOUND);
-                       return null;
-               }
-               String url = app.getImageUrl();
-               int indexOfDot = url.lastIndexOf('.');
-               String urlSuffix = indexOfDot > 0 ? url.substring(indexOfDot + 1).toLowerCase() : "UNK";
-               // Default to JPG if no usable suffix.
-               MediaType mediaType = MediaType.IMAGE_JPEG;
-               if ("png".equals(urlSuffix))
-                       mediaType = MediaType.IMAGE_PNG;
-               else if ("gif".equals(urlSuffix))
-                       mediaType = MediaType.IMAGE_GIF;
-               HttpHeaders header = new HttpHeaders();
-               header.setContentType(mediaType);
-               header.setContentLength(app.getThumbnail().length);
-               return new HttpEntity<byte[]>(app.getThumbnail(), header);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppsControllerExternalRequest.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AppsControllerExternalRequest.java
deleted file mode 100644 (file)
index d729504..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-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.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.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import io.swagger.annotations.ApiOperation;
-
-/**
- * Processes requests from external systems (i.e., not the front-end web UI).
- * First use case is ECOMP Controller, which has to create an admin and onboard
- * itself upon launch of a fresh Portal.
- * 
- * Listens on the "auxapi" path prefix. Provides alternate implementations of
- * methods in several existing controllers because an EPUser object is not
- * available in the session for these requests.
- * 
- * Checks credentials sent via HTTP Basic Authentication. The Portal's basic
- * HTTP authentication system requires that the user names and endpoints are
- * registered together.
- */
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class AppsControllerExternalRequest implements BasicAuthenticationController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsControllerExternalRequest.class);
-
-       private static final String ONBOARD_APP = "/onboardApp";
-
-       // Where is this used?
-       public boolean isAuxRESTfulCall() {
-               return true;
-       }
-
-       /**
-        * For testing whether a user is a superadmin.
-        */
-       @Autowired
-       private AdminRolesService adminRolesService;
-
-       /**
-        * For onboarding or updating an app
-        */
-       @Autowired
-       private EPAppService appService;
-
-       /**
-        * For promoting a user to Portal admin
-        */
-       @Autowired
-       private PortalAdminService portalAdminService;
-
-       /**
-        * For creating a new user
-        */
-       @Autowired
-       private UserService userService;
-
-       /**
-        * Creates a new user as a Portal administrator.
-        * 
-        * <PRE>
-        { 
-               "loginId" : "abc123",
-               "loginPwd": "",
-               "email":"ecomp@controller" 
-        }
-        * </PRE>
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param epUser
-        *            User details; the email and orgUserId fields are mandatory
-        * @param response
-        *            HttpServletResponse
-        * @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")
-       @ResponseBody
-       public PortalRestResponse<String> postPortalAdmin(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody EPUser epUser) {
-               EcompPortalUtils.logAndSerializeObject(logger, "postPortalAdmin", "request", epUser);
-               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
-
-               // Check mandatory fields.
-               if (epUser.getEmail() == null || epUser.getEmail().trim().length() == 0 //
-                               || epUser.getLoginId() == null || epUser.getLoginId().trim().length() == 0 //
-                               || epUser.getLoginPwd() == null) {
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage("Missing required field: email, loginId, or loginPwd");
-                       return portalResponse;
-               }
-
-               try {
-                       // Check for existing user; create if not found.
-                       List<EPUser> userList = userService.getUserByUserId(epUser.getOrgUserId());
-                       if (userList == null || userList.size() == 0) {
-                               // Create user with first, last names etc.; do check for
-                               // duplicates.
-                               String userCreateResult = userService.saveNewUser(epUser, "Yes");
-                               if (!"success".equals(userCreateResult)) {
-                                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                                       portalResponse.setMessage(userCreateResult);
-                                       return portalResponse;
-                               }
-                       }
-
-                       // Check for Portal admin status; promote if not.
-                       if (adminRolesService.isSuperAdmin(epUser)) {
-                               portalResponse.setStatus(PortalRestStatusEnum.OK);
-                       } else {
-                               FieldsValidator fv = portalAdminService.createPortalAdmin(epUser.getOrgUserId());
-                               if (fv.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                                       portalResponse.setStatus(PortalRestStatusEnum.OK);
-                               } else {
-                                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                                       portalResponse.setMessage(fv.toString());
-                               }
-                       }
-               } catch (Exception ex) {
-                       // Uncaught exceptions yield 404 and an empty error page
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage(ex.toString());
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "postPortalAdmin", "response", portalResponse);
-               return portalResponse;
-       }
-
-       /**
-        * Gets the specified application that is on-boarded in Portal.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param appId
-        *            Application ID to get
-        * @param response
-        *            httpServletResponse
-        * @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")
-       @ResponseBody
-       public OnboardingApp getOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("appId") Long appId) {
-               EPApp epApp = appService.getApp(appId);
-               OnboardingApp obApp = new OnboardingApp();
-               appService.createOnboardingFromApp(epApp, obApp);
-               EcompPortalUtils.logAndSerializeObject(logger, "getOnboardAppExternal", "response", obApp);
-               return obApp;
-       }
-
-       /**
-        * Adds a new application to Portal. The My Logins App Owner in the request
-        * must be the organization user ID of a person who is a Portal
-        * administrator.
-        * 
-        * <pre>
-        * { 
-               "myLoginsAppOwner" : "abc123",
-               "name": "dashboard",
-               "url": "http://k8s/something",
-               "restUrl" : "http://targeturl.com",
-               "restrictedApp" : true,
-               "isOpen" : true,
-               "isEnabled": false
-               }
-        * </pre>
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            httpServletResponse
-        * @param newOnboardApp
-        *            Message with details about the app to add
-        * @return PortalRestResponse
-        */
-       @ApiOperation(value = "Adds a new application to Portal.", response = PortalRestResponse.class)
-       @RequestMapping(value = { ONBOARD_APP }, method = RequestMethod.POST, produces = "application/json")
-       @ResponseBody
-       public PortalRestResponse<String> postOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody OnboardingApp newOnboardApp) {
-               EcompPortalUtils.logAndSerializeObject(logger, "postOnboardAppExternal", "request", newOnboardApp);
-               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
-
-               // Validate fields
-               if (newOnboardApp.id != null) {
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage("Unexpected field: id");
-                       return portalResponse;
-               }
-               if (newOnboardApp.name == null || newOnboardApp.name.trim().length() == 0 //
-                               || newOnboardApp.url == null || newOnboardApp.url.trim().length() == 0 //
-                               || newOnboardApp.restUrl == null || newOnboardApp.restUrl.trim().length() == 0
-                               || newOnboardApp.myLoginsAppOwner == null || newOnboardApp.myLoginsAppOwner.trim().length() == 0
-                               || newOnboardApp.restrictedApp == null //
-                               || newOnboardApp.isOpen == null //
-                               || newOnboardApp.isEnabled == null) {
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage(
-                                       "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
-                       return portalResponse;
-               }
-
-               try {
-                       List<EPUser> userList = userService.getUserByUserId(newOnboardApp.myLoginsAppOwner);
-                       if (userList == null || userList.size() != 1) {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage("Failed to find user: " + newOnboardApp.myLoginsAppOwner);
-                               return portalResponse;
-                       }
-
-                       EPUser epUser = userList.get(0);
-                       // Check for Portal admin status
-                       if (! adminRolesService.isSuperAdmin(epUser)) {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage("User lacks Portal admin role: " + epUser.getLoginId());
-                               return portalResponse;                          
-                       }
-                               
-                       newOnboardApp.normalize();
-                       FieldsValidator fv = appService.addOnboardingApp(newOnboardApp, epUser);
-                       if (fv.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                               portalResponse.setStatus(PortalRestStatusEnum.OK);
-                       } else {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage(fv.toString());
-                       }
-               } catch (Exception ex) {
-                       // Uncaught exceptions yield 404 and an empty error page
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage(ex.toString());
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "postOnboardAppExternal", "response", portalResponse);
-               return portalResponse;
-       }
-
-       /**
-        * Updates information about an on-boarded application in Portal. The My
-        * Logins App Owner in the request must be the organization user ID of a
-        * person who is a Portal administrator.
-        * <pre>
-          { 
-               "id" : 123,
-               "myLoginsAppOwner" : "abc123",
-               "name": "dashboard",
-               "url": "http://k8s/something",
-               "restUrl" : "http://targeturl.com",
-               "restrictedApp" : true,
-               "isOpen" : true,
-               "isEnabled": false
-               }
-               </pre>
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            httpServletResponse
-        * @param appId
-        *            application id
-        * @param oldOnboardApp
-        *            Message with details about the app to add
-        * @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")
-       @ResponseBody
-       public PortalRestResponse<String> putOnboardAppExternal(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("appId") Long appId, @RequestBody OnboardingApp oldOnboardApp) {
-               EcompPortalUtils.logAndSerializeObject(logger, "putOnboardAppExternal", "request", oldOnboardApp);
-               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
-               // Validate fields.
-               if (oldOnboardApp.id == null || !appId.equals(oldOnboardApp.id)) {
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage("Unexpected value for field: id");
-                       return portalResponse;
-               }
-               if (oldOnboardApp.name == null || oldOnboardApp.name.trim().length() == 0 //
-                               || oldOnboardApp.url == null || oldOnboardApp.url.trim().length() == 0 //
-                               || oldOnboardApp.restUrl == null || oldOnboardApp.restUrl.trim().length() == 0
-                               || oldOnboardApp.myLoginsAppOwner == null || oldOnboardApp.myLoginsAppOwner.trim().length() == 0
-                               || oldOnboardApp.restrictedApp == null //
-                               || oldOnboardApp.isOpen == null //
-                               || oldOnboardApp.isEnabled == null) {
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage(
-                                       "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
-                       return portalResponse;
-               }
-
-               try {
-                       List<EPUser> userList = userService.getUserByUserId(oldOnboardApp.myLoginsAppOwner);
-                       if (userList == null || userList.size() != 1) {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage("Failed to find user: " + oldOnboardApp.myLoginsAppOwner);
-                               return portalResponse;
-                       }
-
-                       EPUser epUser = userList.get(0);
-                       // Check for Portal admin status
-                       if (! adminRolesService.isSuperAdmin(epUser)) {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage("User lacks Portal admin role: " + epUser.getLoginId());
-                               return portalResponse;                          
-                       }
-
-                       oldOnboardApp.normalize();
-                       FieldsValidator fv = appService.modifyOnboardingApp(oldOnboardApp, epUser);
-                       if (fv.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                               portalResponse.setStatus(PortalRestStatusEnum.OK);
-                       } else {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage(fv.toString());
-                       }
-               } catch (Exception ex) {
-                       // Uncaught exceptions yield 404 and an empty error page
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       portalResponse.setMessage(ex.toString());
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "putOnboardAppExternal", "response", portalResponse);
-               return portalResponse;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AuditLogController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/AuditLogController.java
deleted file mode 100644 (file)
index aa8d7bf..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-@RestController
-@RequestMapping("/portalApi/auditLog")
-public class AuditLogController extends EPRestrictedBaseController {
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardController.class);
-
-       @Autowired
-       private AuditService auditService;
-
-       /**
-        * Store audit log of the specified access type.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param affectedAppId
-        *            App ID
-        * @param type
-        *            Access type
-        * @param comment
-        *            Comment
-        */
-       @RequestMapping(value = "/store", method = RequestMethod.GET, 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,
-                               comment);
-               String cd_type = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       /* Check type of Activity CD */
-                       if (type.equals("app")) {
-                               cd_type = AuditLog.CD_ACTIVITY_APP_ACCESS;
-                       } else if (type.equals("tab")) {
-                               cd_type = AuditLog.CD_ACTIVITY_TAB_ACCESS;
-                       } else if (type.equals("functional")) {
-                               cd_type = AuditLog.CD_ACTIVITY_FUNCTIONAL_ACCESS;
-                       } else if (type.equals("leftMenu")) {
-                               cd_type = AuditLog.CD_ACTIVITY_LEFT_MENU_ACCESS;
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Storing auditLog failed! Activity CD type is not correct.");
-                       }
-                       /* Store the audit log only if it contains valid Activity CD */
-                       if (cd_type != null) {
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setActivityCode(cd_type);
-                               /*
-                                * Check affectedAppId and comment and see if these two values are valid
-                                */
-                               if (comment != null && !comment.equals("") && !comment.equals("undefined"))
-                                       auditLog.setComments(EcompPortalUtils.truncateString(comment, PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               if (affectedAppId != null && !affectedAppId.equals("") && !affectedAppId.equals("undefined"))
-                                       auditLog.setAffectedRecordId(affectedAppId);
-                               long userId = EPUserUtils.getUserId(request);
-                               auditLog.setUserId(userId);
-                               auditService.logActivity(auditLog, null);
-
-                               // Log file
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage(
-                                               "AuditLogController.auditLog", cd_type, user.getOrgUserId(), affectedAppId, comment));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "auditLog failed", e);
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BEPropertyReaderController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BEPropertyReaderController.java
deleted file mode 100644 (file)
index 2d8fd18..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.FusionBaseController;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalapp.portal.domain.BEProperty;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-
-@RestController
-@RequestMapping("/portalApi/properties")
-public class BEPropertyReaderController extends FusionBaseController{
-       @RequestMapping(value = "/readProperty", method = RequestMethod.GET, 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)));
-               } catch (Exception e) {
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
-               }               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BasicAuthAccountController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BasicAuthAccountController.java
deleted file mode 100644 (file)
index 6004d69..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.BasicAuthAccountService;
-import org.openecomp.portalapp.util.EPUserUtils;
-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.RestController;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class BasicAuthAccountController extends EPRestrictedBaseController {
-
-       @Autowired
-       private BasicAuthAccountService basicAuthAccountService;
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-
-       /**
-        * Saves Basic Authentication account for external systems
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param newBasicAuthAccount
-        *            BasicAuthCredentials
-        * @return Id of the newly created account
-        * @throws Exception
-        *             on failure
-        */
-       @RequestMapping(value = { "/portalApi/basicAuthAccount" }, method = RequestMethod.POST)
-       public PortalRestResponse<String> createBasicAuthAccount(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody BasicAuthCredentials newBasicAuthAccount) throws Exception {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Authorization Required",
-                                       "Admin Only Operation! ");
-               }
-
-               if (newBasicAuthAccount == null) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "newBasicAuthAccount cannot be null or empty");
-               }
-               long accountId = basicAuthAccountService.saveBasicAuthAccount(newBasicAuthAccount);
-
-               List<Long> endpointIdList = new ArrayList<>();
-               try {
-                       for (EPEndpoint ep : newBasicAuthAccount.getEndpoints()) {
-                               endpointIdList.add(basicAuthAccountService.saveEndpoints(ep));
-                       }
-                       for (Long endpointId : endpointIdList) {
-                               basicAuthAccountService.saveEndpointAccount(accountId, endpointId);
-                       }
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-
-       /**
-        * Returns list of all BasicAuthCredentials in the system
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List<BasicAuthCredentials>
-        * @throws Exception
-        *             on failure
-        */
-
-       @RequestMapping(value = { "/portalApi/basicAuthAccount" }, method = RequestMethod.GET)
-       public PortalRestResponse<List<BasicAuthCredentials>> getBasicAuthAccount(HttpServletRequest request,
-                       HttpServletResponse response) throws Exception {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       return new PortalRestResponse<List<BasicAuthCredentials>>(PortalRestStatusEnum.ERROR,
-                                       "UnAuthorized! Admin Only Operation", new ArrayList<>());
-               }
-
-               return new PortalRestResponse<List<BasicAuthCredentials>>(PortalRestStatusEnum.OK, "Success",
-                               basicAuthAccountService.getAccountData());
-       }
-
-       /**
-        * Updates an existing BasicAuthCredentials account
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param accountId
-        *            account ID
-        * @param newBasicAuthAccount
-        *            BasicAuthCredentials
-        * @return PortalRestResponse<String>
-        * @throws Exception
-        *             on failure
-        */
-       @RequestMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }, method = RequestMethod.PUT)
-       public PortalRestResponse<String> updateAccount(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("accountId") long accountId, @RequestBody BasicAuthCredentials newBasicAuthAccount)
-                       throws Exception {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Authorization Required",
-                                       "Admin Only Operation! ");
-               }
-
-               if (newBasicAuthAccount == null) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "BasicAuthCredentials cannot be null or empty");
-               }
-               try {
-                       basicAuthAccountService.updateBasicAuthAccount(accountId, newBasicAuthAccount);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-
-       /**
-        * deletes an existing BasicAuthCredentials account
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param accountId
-        *            account ID
-        * @return PortalRestResponse<String>
-        * @throws Exception
-        *             on failure
-        */
-       @RequestMapping(value = { "/portalApi/basicAuthAccount/{accountId}" }, method = RequestMethod.DELETE)
-       public PortalRestResponse<String> deleteAccount(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("accountId") long accountId) throws Exception {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Authorization Required",
-                                       "Admin Only Operation! ");
-               }
-
-               try {
-                       basicAuthAccountService.deleteEndpointAccout(accountId);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BasicAuthenticationController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/BasicAuthenticationController.java
deleted file mode 100644 (file)
index ad0829f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-/**
- * Marker interface to indicate that requests to this controller present HTTP
- * Basic Authentication credentials.
- */
-public interface BasicAuthenticationController {
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/CommonWidgetController.java
deleted file mode 100644 (file)
index 9d046cb..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.controller.DashboardController.WidgetCategory;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class CommonWidgetController extends EPRestrictedBaseController implements BasicAuthenticationController{
-       
-       
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CommonWidgetController.class);
-       @Autowired
-       private DashboardSearchService searchService;
-       
-       /**
-        * Validates the resource type parameter.
-        * 
-        * @param resourceType
-        * @return True if known in the enum WidgetCategory, else false.
-        */
-       private boolean isValidResourceType(String resourceType) {
-               if (resourceType == null)
-                       return false;
-               for (WidgetCategory wc : WidgetCategory.values())
-                       if (wc.name().equals(resourceType))
-                               return true;
-               return false;
-       }
-       
-       /**
-        * Gets all widgets of the specified resource type.
-        * 
-        * @param request
-        * @param resourceType
-        *            Request parameter.
-        * @return Rest response wrapped around a CommonWidgetMeta object.
-        */
-       @RequestMapping(value = "/commonWidgets", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
-                       @RequestParam String resourceType) {
-               if (!isValidResourceType(resourceType)){
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Unexpected resource type {}", resourceType);
-                       return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.ERROR,
-                                       "Unexpected resource type " + resourceType, null);
-               }
-               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
-                               searchService.getWidgetData(resourceType));
-       }
-               
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ConsulClientController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ConsulClientController.java
deleted file mode 100644 (file)
index e1b39f3..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.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.RestController;
-
-import com.orbitz.consul.ConsulException;
-import com.orbitz.consul.model.health.ServiceHealth;
-
-import io.searchbox.client.config.exception.NoServerConfiguredException;
-
-@RestController
-@RequestMapping("/portalApi/consul")
-public class ConsulClientController extends EPRestrictedBaseController {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ConsulClientController.class);
-
-       @Autowired
-       private ConsulHealthService consulHealthService;
-
-       // Get location of a healthy node running our service
-       @RequestMapping(value = { "/service/{service}" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<String> getServiceLocation(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("service") String service) {
-
-               try {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Success!",
-                                       consulHealthService.getServiceLocation(service, null));
-               } catch (NoServerConfiguredException e) {
-                       logger.error(logger.errorLogger, "No healthy service exception!");
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.WARN, "Warning!",
-                                       "No healthy service exception!");
-               } catch (ConsulException e) {
-                       logger.error(logger.errorLogger, "Couldn't connect ot consul - Is consul running?");
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Error!",
-                                       "Couldn't connect ot consul - Is consul running?");
-               }
-       }
-
-       @RequestMapping(value = { "/service/healthy/{service}" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<ServiceHealth>> getAllHealthyNodes(HttpServletRequest request,
-                       HttpServletResponse response, @PathVariable("service") String service) {
-               try {
-                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.OK, "Success!",
-                                       consulHealthService.getAllHealthyNodes(service));
-               } catch (ConsulException e) {
-                       logger.error(logger.errorLogger, "Couldn't connect to consul - shouldn't break anything.");
-                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.ERROR, "Error!", new ArrayList<>());
-               }
-       }
-
-       @RequestMapping(value = { "/service/all/{service}" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<ServiceHealth>> getAllNodes(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("service") String service) {
-               try {
-                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.OK, "Success!",
-                                       consulHealthService.getAllNodes(service));
-               } catch (ConsulException e) {
-                       logger.error(logger.errorLogger, "Couldn't connect to consul - shouldn't break anything.");
-                       return new PortalRestResponse<List<ServiceHealth>>(PortalRestStatusEnum.ERROR, "Error!", new ArrayList<>());
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/DashboardController.java
deleted file mode 100644 (file)
index aaeea44..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * Controller supplies data to Angular services on the dashboard page.
- */
-@Configuration
-@RestController
-@RequestMapping("/portalApi/dashboard")
-public class DashboardController extends EPRestrictedBaseController {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardController.class);
-
-       @Autowired
-       private DashboardSearchService searchService;
-       @Autowired
-       private AuditService auditService;
-       
-       public enum WidgetCategory {
-               EVENTS, NEWS, IMPORTANTRESOURCES;
-       }
-
-       /**
-        * Validates the resource type parameter.
-        * 
-        * @param resourceType
-        * @return True if known in the enum WidgetCategory, else false.
-        */
-       private boolean isValidResourceType(String resourceType) {
-               if (resourceType == null)
-                       return false;
-               for (WidgetCategory wc : WidgetCategory.values())
-                       if (wc.name().equals(resourceType))
-                               return true;
-               return false;
-       }
-
-       /**
-        * Gets all widgets of the specified resource type. 
-        * In iteration 41 (when widget will utilized service onboarding), this method can be removed, instead we will use CommonWidgetController.java (basic auth based)
-        * 
-        * @param request
-        * @param resourceType
-        *            Request parameter.
-        * @return Rest response wrapped around a CommonWidgetMeta object.
-        */
-       @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
-                       @RequestParam String resourceType) {
-               if (!isValidResourceType(resourceType))
-                       return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.ERROR,
-                                       "Unexpected resource type " + resourceType, null);
-               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
-                               searchService.getWidgetData(resourceType));
-       }
-       
-       
-       /**
-        * Saves a batch of events, news or resources.
-        * 
-        * @param commonWidgetMeta
-        *            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")
-       public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta);
-               if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals(""))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
-                                       "Category cannot be null or empty");
-               if (!isValidResourceType(commonWidgetMeta.getCategory()))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                       "Unexpected resource type " + commonWidgetMeta.getCategory(), null);
-               // validate dates
-               for (CommonWidget cw : commonWidgetMeta.getItems()) {
-                       String err = validateCommonWidget(cw);
-                       if (err != null)
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.saveWidgetDataBulk(commonWidgetMeta));
-       }
-
-       /**
-        * Saves one: event, news or resource
-        * 
-        * @param commonWidget
-        *            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")
-       public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget);
-               if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals(""))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
-                                       "Category cannot be null or empty");
-               String err = validateCommonWidget(commonWidget);
-               if (err != null)
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.saveWidgetData(commonWidget));
-       }
-
-       /**
-        * Used by the validate function
-        */
-       private final SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd");
-
-       /**
-        * Validates the content of a common widget.
-        * 
-        * @param cw
-        * @return null on success; an error message if validation fails.
-        * @throws Exception
-        */
-       private String validateCommonWidget(CommonWidget cw) {
-               if (!isValidResourceType(cw.getCategory()))
-                       return "Invalid category: " + cw.getCategory();
-               if (cw.getTitle() == null || cw.getTitle().trim().length() == 0)
-                       return "Title is missing";
-               if (cw.getHref() == null || cw.getHref().trim().length() == 0)
-                       return "HREF is missing";
-               if (!cw.getHref().toLowerCase().startsWith("http"))
-                       return "HREF does not start with http";
-               if (cw.getSortOrder() == null)
-                       return "Sort order is null";
-               if (WidgetCategory.EVENTS.name().equals(cw.getCategory())) {
-                       if (cw.getEventDate() == null || cw.getEventDate().trim().length() == 0)
-                               return "Date is missing";
-                       try {
-                               yearMonthDayFormat.setLenient(false);
-                               Date date = yearMonthDayFormat.parse(cw.getEventDate());
-                               if (date == null)
-                                       return "Failed to parse date " + cw.getEventDate();
-                       } catch (ParseException ex) {
-                               return ex.toString();
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * Deletes one: event, news or resource
-        * 
-        * @param commonWidget
-        *            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")
-       public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget);
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.deleteWidgetData(commonWidget));
-       }
-
-       /**
-        * Searches all portal for the input string.
-        * 
-        * @param request
-        * @param searchString
-        * @return Rest response wrapped around a Map of String to List of Search
-        *         Result Item.
-        */
-       @EPAuditLog
-       @RequestMapping(value = "/search", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request,
-                       @RequestParam String searchString) {
-
-               if (searchString != null)
-                       searchString = searchString.trim();
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (user == null) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
-                                               "searchPortal: User object is null? - check logs",
-                                               new HashMap<String, List<SearchResultItem>>());
-                       } else if (searchString == null || searchString.length() == 0) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null",
-                                               new HashMap<String, List<SearchResultItem>>());
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'",
-                                               user.getLoginId(), searchString);
-                               Map<String, List<SearchResultItem>> results = searchService.searchResults(user.getLoginId(),
-                                               searchString);
-                               /*Audit log the search*/
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_SEARCH);
-                               auditLog.setComments(EcompPortalUtils.truncateString(searchString, PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,EPEELFLoggerAdvice.getCurrentDateTimeUTC());          
-                               auditService.logActivity(auditLog, null);
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP,EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger, EPLogUtil.formatAuditLogMessage("DashboardController.PortalRestResponse", 
-                                               EcompAuditLog.CD_ACTIVITY_SEARCH, user.getOrgUserId(), null, searchString));    
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchPortal failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
-                                       new HashMap<String, List<SearchResultItem>>());
-               }
-       }
-
-       /**
-        * Gets all active users.
-        * 
-        * TODO: should only the superuser be allowed to use this API?
-        * 
-        * @param request
-        * @return Rest response wrapped around a list of String
-        */
-       @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json")
-       public List<String> getActiveUsers(HttpServletRequest request) {
-               List<String> activeUsers = null;
-               List<String> onlineUsers = new ArrayList<>();
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       String userId = user.getOrgUserId();
-
-                       activeUsers = searchService.getRelatedUsers(userId);
-                       HashSet<String> usersSet = CollaborateList.getInstance().getAllUserName();
-                       for (String users : activeUsers) {
-                               if (usersSet.contains(users)) {
-                                       onlineUsers.add(users);
-                               }
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e);
-               }
-               return onlineUsers;
-       }
-       
-       /**
-        * Gets the refresh interval and duration of a cycle of continuous refreshing for the online users side panel, both in milliseconds.
-        * 
-        * @param request
-        * @return Rest response wrapped around a number that is the number of milliseconds.
-        */
-       @RequestMapping(value = "/onlineUserUpdateRate", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<Map<String, String>> getOnlineUserUpdateRate(HttpServletRequest request) {
-               try {
-                       String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE);     
-                       String updateDuration = SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION);                             
-                       Integer rateInMiliSec = Integer.valueOf(updateRate)*1000;
-                       Integer durationInMiliSec = Integer.valueOf(updateDuration)*1000;
-                       Map<String, String> results = new HashMap<String,String>();
-                       results.put("onlineUserUpdateRate", String.valueOf(rateInMiliSec));
-                       results.put("onlineUserUpdateDuration", String.valueOf(durationInMiliSec));                     
-                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getOnlineUserUpdateRate failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
-               }               
-       }
-
-       /**
-        * Gets the window width threshold for collapsing right menu from system.properties.
-        * 
-        * @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")
-       public PortalRestResponse<Map<String, String>> getWindowWidthThresholdForRightMenu(HttpServletRequest request) {
-               try {
-                       String windowWidthString = SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU);    
-                       Integer windowWidth = Integer.valueOf(windowWidthString);
-                       Map<String, String> results = new HashMap<String,String>();
-                       results.put("windowWidth", String.valueOf(windowWidth));
-                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getWindowWidthThresholdForRightMenu failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
-               }               
-       }
-
-
-       /**
-        * Gets the window width threshold for collapsing left menu from system.properties.
-        * 
-        * @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")
-       public PortalRestResponse<Map<String, String>> getWindowWidthThresholdForLeftMenu(HttpServletRequest request) {
-               try {
-                       String windowWidthString = SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU);     
-                       Integer windowWidth = Integer.valueOf(windowWidthString);
-                       Map<String, String> results = new HashMap<String,String>();
-                       results.put("windowWidth", String.valueOf(windowWidth));
-                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getWindowWidthThresholdForLeftMenu failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
-               }               
-       }
-       
-       /**
-        * Gets only those users that are 'related' to the currently logged-in user.
-        * 
-        * @param request
-        * @return Rest response wrapped around a List of String
-        */
-       @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (user == null) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "User object is null? - check logs",
-                                               new ArrayList<>());
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "activeUsers: searching for user {}", user.getLoginId());
-                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",
-                                               searchService.getRelatedUsers(user.getLoginId()));
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "activeUsers failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
-                                       new ArrayList<>());
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java
deleted file mode 100644 (file)
index 313ae68..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/portalApi/search")
-public class DashboardSearchResultController extends EPRestrictedBaseController {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardSearchResultController.class);
-
-       @Autowired
-       private DashboardSearchService searchService;
-
-       /**
-        * Gets all widgets by type: NEW or RESOURCE
-        * 
-        * @param request
-        * @param resourceType
-        *            Request parameter.
-        * @return Rest response wrapped around a CommonWidgetMeta object.
-        */
-       @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
-                       @RequestParam String resourceType) {
-               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
-                               searchService.getWidgetData(resourceType));
-       }
-
-       /**
-        * Saves all: news and resources
-        * 
-        * @param commonWidgetMeta
-        *            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")
-       public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta);
-               if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals(""))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
-                                       "Category cannot be null or empty");
-               // validate dates
-               for (CommonWidget cw : commonWidgetMeta.getItems()) {
-                       String err = validateCommonWidget(cw);
-                       if (err != null)
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.saveWidgetDataBulk(commonWidgetMeta));
-       }
-
-       /**
-        * Saves one: news or resource
-        * 
-        * @param commonWidget
-        *            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")
-       public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget);
-               if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals(""))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
-                                       "Cateogry cannot be null or empty");
-               String err = validateCommonWidget(commonWidget);
-               if (err != null)
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.saveWidgetData(commonWidget));
-       }
-
-       /**
-        * Used by the validate function
-        */
-       private final SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd");
-
-       /**
-        * Validates the content of a common widget.
-        * 
-        * @param cw
-        * @return null on success; an error message if validation fails.
-        * @throws Exception
-        */
-       private String validateCommonWidget(CommonWidget cw) {
-               try {
-                       if (cw.getEventDate() != null && cw.getEventDate().trim().length() > 0)
-                               yearMonthDayFormat.parse(cw.getEventDate());
-               } catch (ParseException ex) {
-                       return ex.toString();
-               }
-               return null;
-       }
-
-       /**
-        * Deletes one: news or resource
-        * 
-        * @param commonWidget
-        *            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")
-       public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget);
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.deleteWidgetData(commonWidget));
-       }
-
-       /**
-        * Searches all portal for the input string.
-        * 
-        * @param request
-        * @param searchString
-        * @return Rest response wrapped around a Map of String to List of Search
-        *         Result Item.
-        */
-       @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request,
-                       @RequestParam String searchString) {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (user == null) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
-                                               "searchPortal: User object is null? - check logs",
-                                               new HashMap<String, List<SearchResultItem>>());
-                       } else if (searchString == null || searchString.trim().length() == 0) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null",
-                                               new HashMap<String, List<SearchResultItem>>());
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'",
-                                               user.getLoginId(), searchString);
-                               Map<String, List<SearchResultItem>> results = searchService.searchResults(user.getLoginId(),
-                                               searchString);
-                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchPortal failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
-                                       new HashMap<String, List<SearchResultItem>>());
-               }
-       }
-
-       /**
-        * Gets all active users.
-        * 
-        * TODO: should only the superuser be allowed to use this API?
-        * 
-        * @param request
-        * @return Rest response wrapped around a list of String
-        */
-       @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json")
-       public List<String> getActiveUsers(HttpServletRequest request) {
-               List<String> activeUsers = null;
-               List<String> onlineUsers = new ArrayList<>();
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       String userId = user.getOrgUserId();
-
-                       activeUsers = searchService.getRelatedUsers(userId);
-                       HashSet<String> usersSet = CollaborateList.getInstance().getAllUserName();
-                       for (String users : activeUsers) {
-                               if (usersSet.contains(users)) {
-                                       onlineUsers.add(users);
-                               }
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e);
-               }
-               return onlineUsers;
-       }
-
-       /**
-        * Gets only those users that are 'related' to the currently logged-in user.
-        * 
-        * @param request
-        * @return Rest response wrapped around a List of String
-        */
-       @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (user == null) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "User object is null? - check logs",
-                                               new ArrayList<>());
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "activeUsers: searching for user {}", user.getLoginId());
-                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",
-                                               searchService.getRelatedUsers(user.getLoginId()));
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "activeUsers failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
-                                       new ArrayList<>());
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAccessRolesController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAccessRolesController.java
deleted file mode 100644 (file)
index 5770d16..0000000
+++ /dev/null
@@ -1,551 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesService;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-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.RestController;
-import org.springframework.web.client.HttpClientErrorException;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import io.swagger.annotations.ApiOperation;
-
-@RestController
-@RequestMapping("/auxapi")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class ExternalAccessRolesController implements BasicAuthenticationController {
-
-       private static final String LOGIN_ID = "LoginId";
-
-       @Autowired
-       private AuditService auditService;
-
-       private static final String UEBKEY = "uebkey";
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAccessRolesController.class);
-
-       @Autowired
-       private ExternalAccessRolesService externalAccessRolesService;
-
-       @ApiOperation(value = "Gets user role for an application.", response = String.class, responseContainer = "List")
-       @RequestMapping(value = { "/user/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
-       public String getUser(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("loginId") String loginId) throws Exception {
-
-               String answer = null;
-               try {
-                       answer = externalAccessRolesService.getUserWithRoles(loginId, request.getHeader(UEBKEY));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUser failed", e);
-               }
-               return answer;
-       }
-
-       @ApiOperation(value = "Gets roles for an application.", response = CentralRole.class, responseContainer = "Json")
-       @RequestMapping(value = { "/roles" }, method = RequestMethod.GET, produces = "application/json")
-       public List<CentralRole> getRolesForApp(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRolesForApp");
-               List<EPApp> applicationList = new ArrayList<>();
-               applicationList = externalAccessRolesService.getApp(request.getHeader(UEBKEY));
-               EPApp app = applicationList.get(0);
-               externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
-               List<CentralRole> answer = null;
-               try {
-                       answer = externalAccessRolesService.getRolesForApp(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       if ("Application not found".equalsIgnoreCase(e.getMessage())) {
-                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
-                       }
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRolesForApp failed", e);
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRolesForApp");
-               return answer;
-       }
-
-       @ApiOperation(value = "Gets all role functions for an application.", response = CentralRoleFunction.class, responseContainer = "Json")
-       @RequestMapping(value = { "/functions" }, method = RequestMethod.GET, produces = "application/json")
-       public List<CentralRoleFunction> getRoleFunctionsList(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               List<CentralRoleFunction> answer = null;
-               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRoleFunctionsList");
-               try {
-                       answer = externalAccessRolesService.getRoleFuncList(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunctionsList failed", e);
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRoleFunctionsList");
-               return answer;
-       }
-
-       @ApiOperation(value = "Gets role information for an application.", response = CentralRole.class, responseContainer = "Json")
-       @RequestMapping(value = { "/role/{role_id}" }, method = RequestMethod.GET, produces = "application/json")
-       public CentralRole getRoleInfo(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("role_id") Long roleId) throws Exception {
-               CentralRole answer = null;
-               logger.debug(EELFLoggerDelegate.debugLogger, "Request received for getRoleInfo");
-
-               try {
-                       answer = externalAccessRolesService.getRoleInfo(roleId, request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleInfo failed", e);
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "Request completed for getRoleInfo");
-               return answer;
-       }
-
-       @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")
-       public CentralRoleFunction getRoleFunction(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("code") String code) throws Exception {
-               CentralRoleFunction centralRoleFunction = null;
-               try {
-                       centralRoleFunction = externalAccessRolesService.getRoleFunction(code, request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleInfo failed", e);
-               }
-               return centralRoleFunction;
-       }
-
-       @ApiOperation(value = "Saves role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = { "/roleFunction" }, method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> saveRoleFunction(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody String roleFunc) throws Exception {
-
-               ObjectMapper mapper = new ObjectMapper();
-               List<EPApp> applicationList = externalAccessRolesService.getApp(request.getHeader(UEBKEY));
-               EPApp requestedApp = applicationList.get(0);
-               Long appId = requestedApp.getId();
-               try {
-                       String data = roleFunc;
-                       CentralRoleFunction availableRoleFunction = mapper.readValue(data, CentralRoleFunction.class);
-                       availableRoleFunction.setAppId(appId);
-                       boolean saveOrUpdateResponse = externalAccessRolesService.saveCentralRoleFunction(availableRoleFunction,
-                                       requestedApp);
-                       if (saveOrUpdateResponse) {
-                               EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
-                               EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
-                               CentralRoleFunction function = externalAccessRolesService
-                                               .getRoleFunction(availableRoleFunction.getCode(), request.getHeader(UEBKEY));
-                               String activityCode = (function.getCode() == null)
-                                               ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION
-                                               : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION;
-                               logger.info(EELFLoggerDelegate.applicationLogger, "saveRoleFunction: succeeded for app {}, function {}",
-                                               app.getId(), availableRoleFunction.getCode());
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(activityCode);
-                               auditLog.setComments(
-                                               EcompPortalUtils.truncateString(
-                                                               "saveRoleFunction role for app:" + app.getId() + " and function:'"
-                                                                               + availableRoleFunction.getCode() + "'",
-                                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               auditLog.setAffectedRecordId(user.getOrgUserId());
-                               auditService.logActivity(auditLog, null);
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.saveRoleFunction", activityCode,
-                                                               String.valueOf(user.getId()), user.getOrgUserId(), availableRoleFunction.getCode()));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed");
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               "Failed to saveRoleFunction for '" + availableRoleFunction.getCode() + "'", "Failed");
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveRoleFunction failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Saved", "Success");
-       }
-
-       @ApiOperation(value = "Deletes role function for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = { "/roleFunction/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
-       public PortalRestResponse<String> deleteRoleFunction(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("code") String code) throws Exception {
-               try {
-                       EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
-                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
-                       boolean getDelFuncResponse = externalAccessRolesService.deleteCentralRoleFunction(code, app);
-                       if (getDelFuncResponse) {
-                               logger.info(EELFLoggerDelegate.applicationLogger, "deleteRoleFunction: succeeded for app {}, role {}",
-                                               app.getId(), code);
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION);
-                               auditLog.setComments(EcompPortalUtils.truncateString(
-                                               "Deleted function for app:" + app.getId() + " and function code:'" + code + "'",
-                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               auditLog.setAffectedRecordId(user.getOrgUserId());
-                               auditService.logActivity(auditLog, null);
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.deleteRoleFunction",
-                                                               EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION, String.valueOf(user.getId()),
-                                                               user.getOrgUserId(), code));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction failed");
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               "Failed to deleteRoleFunction for '" + code + "'", "Failed");
-                       }
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunction failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
-                                       "Failed to deleteRoleFunction for '" + code + "'", "Failed");
-               }
-               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Successfully Deleted", "Success");
-
-       }
-
-       @ApiOperation(value = "Saves role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = { "/role" }, method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> saveRole(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody Role role) throws Exception {
-               try {
-                       EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
-                       EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
-                       boolean getAddResponse = externalAccessRolesService.saveRoleForApplication(role, request.getHeader(UEBKEY));
-                       if (getAddResponse) {
-                               String activityCode = (role.getId() == null) ? EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_ADD_ROLE
-                                               : EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_ROLE_AND_FUNCTION;
-                               logger.info(EELFLoggerDelegate.applicationLogger, "saveRole: succeeded for app {}, role {}",
-                                               app.getId(), role.getName());
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(activityCode);
-                               auditLog.setComments(EcompPortalUtils.truncateString(
-                                               "saveRole role for app:" + app.getId() + " and role:'" + role.getName() + "'",
-                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               auditLog.setAffectedRecordId(user.getOrgUserId());
-                               auditService.logActivity(auditLog, null);
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.saveRole", activityCode,
-                                                               String.valueOf(user.getId()), user.getOrgUserId(), role.getName()));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       } else {
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
-                                               "Failed to saveRole for '" + role.getName() + "'", "Failed");
-
-                       }
-               } catch (Exception e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveRole failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to saveRole", "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Saved", "Success");
-       }
-
-       @ApiOperation(value = "Deletes role for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = { "/deleteRole/{code}" }, method = RequestMethod.DELETE, produces = "application/json")
-       public PortalRestResponse<String> deleteRole(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable String code) throws Exception {
-               try {
-                       boolean deleteResponse = externalAccessRolesService.deleteRoleForApplication(code,
-                                       request.getHeader(UEBKEY));
-                       if (deleteResponse) {
-                               EPUser user = externalAccessRolesService.getUser(request.getHeader(LOGIN_ID)).get(0);
-                               EPApp app = externalAccessRolesService.getApp(request.getHeader(UEBKEY)).get(0);
-                               logger.info(EELFLoggerDelegate.applicationLogger, "deleteRole: succeeded for app {}, role {}",
-                                               app.getId(), code);
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE);
-                               auditLog.setComments(EcompPortalUtils.truncateString(
-                                               "Deleted role for app:" + app.getId() + " and role:'" + code + "'",
-                                               PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               auditLog.setAffectedRecordId(user.getOrgUserId());
-                               auditService.logActivity(auditLog, null);
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("ExternalAccessRolesController.deleteRole",
-                                                               EcompAuditLog.CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE, String.valueOf(user.getId()),
-                                                               user.getOrgUserId(), code));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "deleteRole failed");
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               "Failed to deleteRole for '" + code + "'", "Failed");
-                       }
-               } catch (Exception e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRole failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to deleteRole", "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully Deleted", "Success");
-
-       }
-
-       @ApiOperation(value = "Gets active roles for an application.", response = CentralRole.class, responseContainer = "Json")
-       @RequestMapping(value = { "/activeRoles" }, method = RequestMethod.GET, produces = "application/json")
-       public List<CentralRole> getActiveRoles(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               List<CentralRole> cenRole = null;
-               try {
-                       cenRole = externalAccessRolesService.getActiveRoles(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveRoles failed", e);
-               }
-               return cenRole;
-
-       }
-
-       @ApiOperation(value = "deletes user roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = {
-                       "/deleteDependcyRoleRecord/{roleId}" }, method = RequestMethod.DELETE, produces = "application/json")
-       public PortalRestResponse<String> deleteDependencyRoleRecord(HttpServletRequest request,
-                       HttpServletResponse response, @PathVariable("roleId") Long roleId) throws Exception {
-               try {
-                       boolean deleteResponse = externalAccessRolesService.deleteDependencyRoleRecord(roleId,
-                                       request.getHeader(UEBKEY), request.getHeader(LOGIN_ID));
-                       if (!deleteResponse) {
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Failed to deleteDependencyRoleRecord",
-                                               "Failed");
-                       }
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "Failed to deleteDependencyRoleRecord",
-                                       "Failed");
-               }
-               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "Successfully Deleted", "Success");
-       }
-
-       @ApiOperation(value = "Bulk upload functions for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = { "/upload/portal/functions" }, method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> bulkUploadFunctions(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               Integer result = 0;
-               try {
-                       result = externalAccessRolesService.bulkUploadFunctions(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions",
-                                       "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
-       }
-
-       @ApiOperation(value = "Bulk upload roles for an application.", response = PortalRestResponse.class, responseContainer = "Json")
-       @RequestMapping(value = { "/upload/portal/roles" }, method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> bulkUploadRoles(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               Integer result = 0;
-               try {
-                       result = externalAccessRolesService.bulkUploadRoles(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoles", "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
-       }
-
-       @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")
-       public PortalRestResponse<String> bulkUploadRoleFunctions(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               Integer result = 0;
-               try {
-                       result = externalAccessRolesService.bulkUploadRolesFunctions(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoleFunctions failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoleFunctions",
-                                       "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
-       }
-
-       @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")
-       public PortalRestResponse<String> bulkUploadUserRoles(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               Integer result = 0;
-               try {
-                       result = externalAccessRolesService.bulkUploadUserRoles(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadUserRoles failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadUserRoles",
-                                       "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added: " + result, "Success");
-       }
-
-       @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")
-       public PortalRestResponse<String> bulkUploadPartnerFunctions(HttpServletRequest request,
-                       HttpServletResponse response, @RequestBody List<RoleFunction> upload) throws Exception {
-               try {
-                       externalAccessRolesService.bulkUploadPartnerFunctions(request.getHeader(UEBKEY), upload);
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadFunctions",
-                                       "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
-       }
-
-       @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")
-       public PortalRestResponse<String> bulkUploadPartnerRoles(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody List<Role> upload) throws Exception {
-               try {
-                       externalAccessRolesService.bulkUploadPartnerRoles(request.getHeader(UEBKEY), upload);
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "Failed to bulkUploadRoles", "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
-       }
-
-       @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")
-       public PortalRestResponse<String> bulkUploadPartnerRoleFunctions(HttpServletRequest request,
-                       HttpServletResponse response, @RequestBody List<Role> upload) throws Exception {
-               try {
-                       externalAccessRolesService.bulkUploadPartnerRoleFunctions(request.getHeader(UEBKEY), upload);
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                       "Failed to bulkUploadPartnerRoleFunctions", "Failed");
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Successfully added", "Success");
-       }
-
-       @ApiOperation(value = "Gets all functions along with global functions", response = List.class, responseContainer = "Json")
-       @RequestMapping(value = { "/menuFunctions" }, method = RequestMethod.GET, produces = "application/json")
-       public List<String> getMenuFunctions(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               List<String> functionsList = null;
-               try {
-                       functionsList = externalAccessRolesService.getMenuFunctionsList(request.getHeader(UEBKEY));
-               } catch (HttpClientErrorException e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuFunctions failed", e);
-               }
-               return functionsList;
-       }
-
-       @ApiOperation(value = "Gets all active Users of application", response = String.class, responseContainer = "Json")
-       @RequestMapping(value = { "/users" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EcompUser> getUsersOfApplication(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               List<EcompUser> users = null;
-               try {
-                       users = externalAccessRolesService.getAllAppUsers(request.getHeader(UEBKEY));
-               } catch (Exception e) {
-                       response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUsersOfApplication failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return users;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java
deleted file mode 100644 (file)
index c30b41a..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedRESTfulBaseController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPRoleService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-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.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import io.swagger.annotations.ApiOperation;
-
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppsRestfulController.class);
-
-       @Autowired
-       private FunctionalMenuService functionalMenuService;
-
-       @Autowired
-       private EPLoginService epLoginService;
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-
-       @Autowired
-       private UserNotificationService userNotificationService;
-
-       @Autowired
-       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")
-       @ResponseBody
-       public PortalAPIResponse publishNotification(HttpServletRequest request,
-                       @RequestBody EpNotificationItem notificationItem) throws Exception {
-               String appKey = request.getHeader("uebkey");
-               EPApp app = findEpApp(appKey);
-               List<Long> postRoleIds = new ArrayList<Long>();
-               for (Long roleId : notificationItem.getRoleIds()) {
-                       EPRole role = epRoleService.getRole(app.getId(), roleId);
-                       if (role != null)
-                               postRoleIds.add(role.getId());
-               }
-
-               // --- recreate the user notification object with the POrtal Role Ids
-               EpNotificationItem postItem = new EpNotificationItem();
-               postItem.setRoleIds(postRoleIds);
-               postItem.setIsForAllRoles("N");
-               postItem.setIsForOnlineUsers("N");
-               postItem.setActiveYn("Y");
-               postItem.setPriority(notificationItem.getPriority());
-               postItem.setMsgHeader(notificationItem.getMsgHeader());
-               postItem.setMsgDescription(notificationItem.getMsgDescription());
-               postItem.setStartTime(notificationItem.getStartTime());
-               postItem.setEndTime(notificationItem.getEndTime());
-               postItem.setCreatedDate(Calendar.getInstance().getTime());
-               // default creator to 1 for now
-               postItem.setCreatorId(PortalConstants.DEFAULT_NOTIFICATION_CREATOR);
-               // ----
-
-               try {
-                       userNotificationService.saveNotification(postItem);
-               } catch (Exception e) {
-                       return new PortalAPIResponse(false, e.getMessage());
-               }
-
-               PortalAPIResponse response = new PortalAPIResponse(true, "success");
-               return response;
-       }
-
-       private EPApp findEpApp(String uebKey) {
-               List<?> list = null;
-               StringBuffer criteria = new StringBuffer();
-               criteria.append(" where ueb_key = '" + uebKey + "'");
-               list = getDataAccessService().getList(EPApp.class, criteria.toString(), null, null);
-               return (list == null || list.size() == 0) ? null : (EPApp) list.get(0);
-       }
-
-       @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")
-       public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request,
-                       HttpServletResponse response) throws Exception {
-               String loginId = "";
-               String userAgent = "";
-               List<FavoritesFunctionalMenuItemJson> favorites = null;
-
-               loginId = request.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID);
-               userAgent = MDC.get(EPCommonSystemProperties.PARTNER_NAME);
-
-               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
-               logger.info(EELFLoggerDelegate.errorLogger,
-                               "getFavorites request was received from " + userAgent + " for the user " + loginId + ".");
-               if (epUser == null || epUser.getId() == null) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "No User record found for the LoginId '" + loginId + "' in the database.");
-                       throw new Exception("Received null for Login-Id.");
-               } else {
-                       favorites = functionalMenuService.getFavoriteItems(epUser.getId());
-                       FieldsValidator fieldsValidator = new FieldsValidator();
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-
-                       EcompPortalUtils.logAndSerializeObject(logger, "/getFavorites", "result = ", favorites);
-               }
-
-               return favorites;
-       }
-
-       @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")
-       public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request,
-                       HttpServletResponse response) throws Exception {
-               String loginId = "";
-               String userAgent = "";
-               List<FunctionalMenuItem> fnMenuItems = null;
-
-               loginId = request.getHeader("LoginId");
-               userAgent = MDC.get(EPCommonSystemProperties.PARTNER_NAME);
-
-               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
-               logger.info(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemsForUser request was received from "
-                               + userAgent + " for the user " + loginId + ".");
-               if (epUser == null || epUser.getId() == null) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "No User record found for the LoginId '" + loginId + "' in the database.");
-                       throw new Exception("Received null for Login-Id.");
-               } else if (adminRolesService.isSuperAdmin(epUser)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
-                       fnMenuItems = functionalMenuService.getFunctionalMenuItems();
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
-                       fnMenuItems = functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId());
-               }
-
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/functionalMenuItemsForUser", "result = ", fnMenuItems);
-
-               return fnMenuItems;
-       }
-
-       @ExceptionHandler(Exception.class)
-       protected void handleBadRequests(Exception e, HttpServletResponse response) throws IOException {
-               logger.warn(EELFLoggerDelegate.errorLogger, "Handling bad request", e);
-               response.sendError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/FunctionalMenuController.java
deleted file mode 100644 (file)
index 5243cad..0000000
+++ /dev/null
@@ -1,666 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.json.JSONObject;
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.SharedContext;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.service.SharedContextService;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRolesList;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItemWithRoles;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * Supports menus at the top of the Portal app landing page.
- */
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class FunctionalMenuController extends EPRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuController.class);
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-       @Autowired
-       private FunctionalMenuService functionalMenuService;
-       @Autowired
-       private SharedContextService sharedContextService;
-       @Autowired
-       private SearchService searchService;
-
-       /**
-        * RESTful service method to fetch all the FunctionalMenuItems.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List of FunctionalMenuItem objects
-        */
-       @RequestMapping(value = { "/portalApi/functionalMenu" }, method = RequestMethod.GET, 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;
-               try {
-                       menuItems = functionalMenuService.getFunctionalMenuItems();
-                       functionalMenuService.assignHelpURLs(menuItems);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenu", "result =", menuItems);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItems failed", e);
-               }
-               return menuItems;
-       }
-
-       /**
-        * RESTful service method to get ECOMP Portal Title.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return PortalRestResponse of ECOMP portal title
-        */
-       @RequestMapping(value = { "/portalApi/ecompTitle" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<String> getECOMPTitle(HttpServletRequest request, HttpServletResponse response) {
-               PortalRestResponse<String> portalRestResponse = null;
-               try {
-                       String ecompTitle = SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME);
-                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success", ecompTitle);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/ecompTitle", "result =", ecompTitle);
-               } catch (Exception e) {
-                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), null);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getEcompTitle failed", e);
-               }
-               return portalRestResponse;
-       }
-
-       /**
-        * RESTful service method to fetch all the FunctionalMenuItems, both active and
-        * inactive, for the EditFunctionalMenu feature. Can only be accessed by the
-        * portal admin.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List of FunctionalMenuItem objects
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuForEditing" }, method = RequestMethod.GET, 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);
-               List<FunctionalMenuItem> menuItems = null;
-               try {
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getFunctionalMenuItemDetails");
-                       } else {
-                               menuItems = functionalMenuService.getFunctionalMenuItems(true);
-                       }
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForEditing", "result =",
-                                       menuItems);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForEditing failed", e);
-               }
-               return menuItems;
-       }
-
-       /**
-        * RESTful service method to fetch all the FunctionalMenuItems, active , for the
-        * Functional menu in notification Tree feature.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List of FunctionalMenuItem objects
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuForNotificationTree" }, method = RequestMethod.GET, produces = "application/json")
-       public List<FunctionalMenuItem> getMenuItemsForNotifications(HttpServletRequest request,
-                       HttpServletResponse response) {
-               // TODO: should only the superuser be allowed to use this API?
-               // EPUser user = EPUserUtils.getUserSession(request);
-               List<FunctionalMenuItem> menuItems = null;
-               try {
-                       menuItems = functionalMenuService.getFunctionalMenuItemsForNotificationTree(true);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForNotificationTree", "result =",
-                                       menuItems);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForNotifications failed", e);
-               }
-               return menuItems;
-       }
-
-       /**
-        * RESTful service method to fetch all FunctionalMenuItems associated with an
-        * application.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param appId
-        *            application ID
-        * @return List of FunctionalMenuItem objects
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuForApp/{appId}" }, method = RequestMethod.GET, produces = "application/json")
-       public List<FunctionalMenuItem> getMenuItemsForApp(HttpServletRequest request,
-                       @PathVariable("appId") Integer appId) {
-               // TODO: should only the superuser be allowed to use this API?
-               List<FunctionalMenuItem> menuItems = null;
-               try {
-                       menuItems = functionalMenuService.getFunctionalMenuItemsForApp(appId);
-                       functionalMenuService.assignHelpURLs(menuItems);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForApp/" + appId, "result =",
-                                       menuItems);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForApp failed", e);
-               }
-               return menuItems;
-       }
-
-       /**
-        * RESTful service method to fetch all FunctionalMenuItems associated with the
-        * applications and roles that a user has access to.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param orgUserId
-        *            user ID
-        * @return List of FunctionalMenuItem objects
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuForUser/{orgUserId}" }, method = RequestMethod.GET, produces = "application/json")
-       public List<FunctionalMenuItem> getMenuItemsForUser(HttpServletRequest request,
-                       @PathVariable("orgUserId") String orgUserId) {
-               // TODO: should only the superuser be allowed to use this API?
-               List<FunctionalMenuItem> menuItems = null;
-               try {
-                       menuItems = functionalMenuService.getFunctionalMenuItemsForUser(orgUserId);
-                       functionalMenuService.assignHelpURLs(menuItems);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForUser/" + orgUserId, "result =",
-                                       menuItems);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForUser failed", e);
-               }
-
-               return menuItems;
-       }
-
-       /**
-        * RESTful service method to fetch all FunctionalMenuItems associated with the
-        * applications and roles that the authenticated user has access to.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List of FunctionalMenuItem objects
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuForAuthUser" }, method = RequestMethod.GET, produces = "application/json")
-       public List<FunctionalMenuItem> getMenuItemsForAuthUser(HttpServletRequest request, HttpServletResponse response) {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<FunctionalMenuItem> menuItems = null;
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getMenuItemsForAuthUser");
-                       } else if (adminRolesService.isSuperAdmin(user)) {
-                               menuItems = functionalMenuService.getFunctionalMenuItems();
-                       } else {
-                               // calculate the menu items
-                               String orgUserId = user.getOrgUserId();
-                               menuItems = functionalMenuService.getFunctionalMenuItemsForUser(orgUserId);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuForUser/" + orgUserId,
-                                               "result =", menuItems);
-                       }
-                       functionalMenuService.assignHelpURLs(menuItems);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuItemsForAuthUser failed", e);
-               }
-               return menuItems;
-       }
-
-       /**
-        * RESTful service method to fetch the details for a functional menu item.
-        * Requirement: you must be the Ecomp portal super admin user.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param menuId
-        *            menu ID
-        * @return FunctionalMenuItem object
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuItemDetails/{menuId}" }, method = RequestMethod.GET, produces = "application/json")
-       public FunctionalMenuItem getFunctionalMenuItemDetails(HttpServletRequest request,
-                       @PathVariable("menuId") Integer menuId, HttpServletResponse response) {
-               // TODO: return FunctionalMenuItemJson
-               // TODO: modify FunctionalMenuItem to not include the transient fields
-               FunctionalMenuItem menuItem = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       if (!adminRolesService.isSuperAdmin(user)) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getFunctionalMenuItemDetails");
-                       } else {
-                               menuItem = functionalMenuService.getFunctionalMenuItemDetails(menuId);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItemDetails/" + menuId,
-                                               "result =", menuItem);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemDetails failed", e);
-               }
-
-               return menuItem;
-       }
-
-       /**
-        * RESTful service method to create a new menu item.
-        * 
-        * Requirement: you must be the Ecomp portal super admin user.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param menuItemJson
-        *            FunctionalMenuItemWithRoles
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/functionalMenuItem" }, method = RequestMethod.POST)
-       public FieldsValidator createFunctionalMenuItem(HttpServletRequest request,
-                       @RequestBody FunctionalMenuItemWithRoles menuItemJson, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "FunctionalMenuController.createFunctionalMenuItem bad permissions");
-                       EcompPortalUtils.setBadPermissions(user, response, "createFunctionalMenuItem");
-               } else {
-                       fieldsValidator = functionalMenuService.createFunctionalMenuItem(menuItemJson);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItem", "POST result =",
-                                       response.getStatus());
-               }
-
-               return fieldsValidator;
-       }
-
-       /**
-        * RESTful service method to update an existing menu item
-        * 
-        * Requirement: you must be the Ecomp portal super admin user.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param menuItemJson
-        *            FunctionalMenuItemWithRoles
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/functionalMenuItem" }, method = RequestMethod.PUT)
-       public FieldsValidator editFunctionalMenuItem(HttpServletRequest request,
-                       @RequestBody FunctionalMenuItemWithRoles menuItemJson, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "editFunctionalMenuItem");
-               } else {
-                       fieldsValidator = functionalMenuService.editFunctionalMenuItem(menuItemJson);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItem", "PUT result =",
-                                       response.getStatus());
-               }
-
-               return fieldsValidator;
-       }
-
-       /**
-        * RESTful service method to delete a menu item
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param menuId
-        *            menu identifier
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/functionalMenuItem/{menuId}" }, method = RequestMethod.DELETE)
-       public FieldsValidator deleteFunctionalMenuItem(HttpServletRequest request, @PathVariable("menuId") Long menuId,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "deleteFunctionalMenuItem");
-               } else {
-                       fieldsValidator = functionalMenuService.deleteFunctionalMenuItem(menuId);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuItem", "DELETE result =",
-                                       response.getStatus());
-               }
-
-               return fieldsValidator;
-       }
-
-       /**
-        * RESTful service to regenerate table
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/regenerateFunctionalMenuAncestors" }, method = RequestMethod.GET)
-       public FieldsValidator regenerateAncestorTable(HttpServletRequest request, HttpServletResponse response) {
-               // TODO: should only the superuser be allowed to use this API?
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "deleteFunctionalMenuItem");
-               } else {
-                       fieldsValidator = functionalMenuService.regenerateAncestorTable();
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/regenerateAncestorTable", "GET result =",
-                                       response.getStatus());
-               }
-
-               return fieldsValidator;
-       }
-
-       /**
-        * RESful service to set a favorite item.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param menuItemJson
-        *            FunctionalMenuItemWithRoles
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/setFavoriteItem" }, method = RequestMethod.POST)
-       public FieldsValidator addFavoriteItem(HttpServletRequest request,
-                       @RequestBody FavoritesFunctionalMenuItem menuItemJson, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               menuItemJson.userId = user.getId();
-               fieldsValidator = functionalMenuService.setFavoriteItem(menuItemJson);
-               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/setFavoriteItem", "Post result =",
-                               response.getStatus());
-
-               return fieldsValidator;
-       }
-
-       /**
-        * RESTful service to get favorites for the current user as identified in the
-        * session
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return List of FavoritesFunctionalMenuItemJson
-        */
-       @RequestMapping(value = {
-                       "/portalApi/getFavoriteItems" }, method = RequestMethod.GET, produces = "application/json")
-       public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<FavoritesFunctionalMenuItemJson> favorites = functionalMenuService.getFavoriteItems(user.getId());
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getFavoriteItems", "GET result =",
-                               response.getStatus());
-               return favorites;
-       }
-
-       /**
-        * RESTful service to delete a favorite menu item for the current user as
-        * identified in the session.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param menuId
-        *            menu identifier
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/removeFavoriteItem/{menuId}" }, method = RequestMethod.DELETE)
-       public FieldsValidator deleteFavoriteItem(HttpServletRequest request, @PathVariable("menuId") Long menuId,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               Long userId = user.getId();
-               fieldsValidator = functionalMenuService.removeFavoriteItem(userId, menuId);
-               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               EcompPortalUtils.logAndSerializeObject(logger, "/deleteFavoriteItem", "DELETE result =", response.getStatus());
-
-               return fieldsValidator;
-       }
-
-       /**
-        * RESTful service to get user information: user's first and last names, org
-        * user ID, email and last-login. (Actually has nothing to do with the real
-        * functional menu.) First attempts to get the information from the Tomcat
-        * session (i.e., the CSP cookie); if that fails, calls the shared context
-        * service to read the information from the database. Gives back what it found,
-        * any of which may be null, as a JSON collection.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return JSON collection of key-value pairs shown below.
-        */
-       @RequestMapping(value = {
-                       "/portalApi/functionalMenuStaticInfo" }, method = RequestMethod.GET, produces = "application/json")
-       public String getFunctionalMenuStaticInfo(HttpServletRequest request, HttpServletResponse response) {
-
-               // Get user details from session
-               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuStaticInfo: getting user info");
-               String fnMenuStaticResponse = null;
-               try {
-                       String orgUserIdStr = null, firstNameStr = null, lastNameStr = null, emailStr = null, lastLogin = null;
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       firstNameStr = user.getFirstName();
-                       lastNameStr = user.getLastName();
-                       orgUserIdStr = user.getOrgUserId();
-                       emailStr = user.getEmail();
-                       if (emailStr == null || emailStr.equals("")) {
-                               EPUser userResult = searchService.searchUserByUserId(orgUserIdStr);
-                               emailStr = userResult.getEmail();
-                       }
-                       SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ssZ");
-                       Date lastLoginDate = user.getLastLoginDate();
-                       if (lastLoginDate == null) {
-                               // should never happen
-                               logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuStaticInfo: no last login in session");
-                               lastLogin = "no last login available";
-                       } else {
-                               lastLogin = sdf.format(lastLoginDate);
-                       }
-
-                       // If any item is missing from session, try the Shared Context
-                       // service.
-                       SharedContext orgUserIdSC = null, firstNameSC = null, lastNameSC = null, emailSC = null;
-                       String sessionId = request.getSession().getId();
-                       if (firstNameStr == null)
-                               firstNameSC = sharedContextService.getSharedContext(sessionId,
-                                               EPCommonSystemProperties.USER_FIRST_NAME);
-                       if (lastNameStr == null)
-                               lastNameSC = sharedContextService.getSharedContext(sessionId, EPCommonSystemProperties.USER_LAST_NAME);
-                       if (emailStr == null)
-                               emailSC = sharedContextService.getSharedContext(sessionId, EPCommonSystemProperties.USER_EMAIL);
-                       if (orgUserIdStr == null)
-                               orgUserIdSC = sharedContextService.getSharedContext(sessionId,
-                                               EPCommonSystemProperties.USER_ORG_USERID);
-
-                       // Build the response
-                       Map<String, String> map = new HashMap<String, String>();
-                       map.put("firstName",
-                                       firstNameStr != null ? firstNameStr : (firstNameSC != null ? firstNameSC.getCvalue() : null));
-                       map.put("lastName",
-                                       lastNameStr != null ? lastNameStr : (lastNameSC != null ? lastNameSC.getCvalue() : null));
-                       map.put("email", emailStr != null ? emailStr : (emailSC != null ? emailSC.getCvalue() : null));
-                       map.put("userId",
-                                       orgUserIdStr != null ? orgUserIdStr : (orgUserIdSC != null ? orgUserIdSC.getCvalue() : null));
-                       map.put("last_login", lastLogin);
-                       JSONObject j = new JSONObject(map);
-                       fnMenuStaticResponse = j.toString();
-                       // Be chatty in the log
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/functionalMenuStaticInfo", "GET result =",
-                                       fnMenuStaticResponse);
-               } catch (Exception e) {
-                       // Should never happen.
-                       logger.error(EELFLoggerDelegate.errorLogger, "getFunctionalMenuStaticInfo failed", e);
-                       // Return a real error?
-                       // fnMenuStaticResponse = "{ \"status\": \"error\", \"message\": \""
-                       // + e.toString() + "\" }";
-                       // But the angular controller expects null on error.
-               }
-               return fnMenuStaticResponse;
-       }
-
-       private Comparator<BusinessCardApplicationRole> getUserAppRolesComparator = new Comparator<BusinessCardApplicationRole>() {
-               public int compare(BusinessCardApplicationRole o1, BusinessCardApplicationRole o2) {
-                       return o1.getAppName().compareTo(o2.getAppName());
-               }
-       };
-
-       /**
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param userId
-        *            user ID
-        * @return List<BusinessCardApplicationRolesList>
-        * @throws IOException
-        *             on error
-        */
-       @RequestMapping(value = {
-                       "/portalApi/userApplicationRoles" }, method = RequestMethod.GET, produces = "application/json")
-       public List<BusinessCardApplicationRolesList> getAppList(HttpServletRequest request,
-                       @RequestParam("userId") String userId) throws IOException {
-
-               List<BusinessCardApplicationRolesList> AppRoles = null;
-               try {
-                       List<BusinessCardApplicationRole> userAppRoleList = functionalMenuService.getUserAppRolesList(userId);
-
-                       Collections.sort(userAppRoleList, getUserAppRolesComparator);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApplicationRoles", "result =",
-                                       userAppRoleList);
-
-                       AppRoles = new ArrayList<BusinessCardApplicationRolesList>();
-                       for (BusinessCardApplicationRole userAppRole : userAppRoleList) {
-                               boolean found = false;
-                               List<String> roles = null;
-
-                               for (BusinessCardApplicationRolesList app : AppRoles) {
-                                       if (app.getAppName().equals(userAppRole.getAppName())) {
-                                               roles = app.getRoleNames();
-                                               roles.add(userAppRole.getRoleName());
-                                               app.setRoleNames(roles);
-                                               found = true;
-                                               break;
-                                       }
-                               }
-
-                               if (!found) {
-                                       roles = new ArrayList<String>();
-                                       roles.add(userAppRole.getRoleName());
-                                       AppRoles.add(new BusinessCardApplicationRolesList(userAppRole.getAppName(), roles));
-                               }
-
-                               Collections.sort(roles);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppList failed", e);
-               }
-
-               return AppRoles;
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/GetAccessController.java
deleted file mode 100644 (file)
index 71f745a..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-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.RestController;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.controller.EPUnRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.GetAccessService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class GetAccessController extends EPUnRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(GetAccessController.class);
-
-       @Autowired
-       private GetAccessService getAccessService;
-
-       /**
-        * Sorts the list by ECOMP function name.
-        */
-       private Comparator<GetAccessResult> getAccessComparator = new Comparator<GetAccessResult>() {
-               public int compare(GetAccessResult o1, GetAccessResult o2) {
-                       return o1.getAppName().compareTo(o2.getAppName());
-               }
-       };
-       
-       @RequestMapping(value = { "/portalApi/getAppList" }, method = RequestMethod.GET, produces = "application/json")
-       public List<GetAccessResult> getAppList(HttpServletRequest request) throws IOException {
-               List<GetAccessResult> appsList = null;
-               EPUser user = EPUserUtils.getUserSession(request);
-               appsList = getAccessService.getAppAccessList(user);
-               Collections.sort(appsList, getAccessComparator);
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getAppList", "result =", appsList);
-               return appsList;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/HealthCheckController.java
deleted file mode 100644 (file)
index ddb3a31..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-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.RestController;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.controller.EPUnRestrictedBaseController;
-import org.openecomp.portalapp.portal.listener.HealthMonitor;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import com.google.gson.Gson;
-
-/**
- * This controller processes requests for the health-check feature implemented
- * in the HealthMonitor, which runs in its own thread. These requests do not
- * require any authentication nor an active user session.
- */
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class HealthCheckController extends EPUnRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class);
-
-       private class HealthStatus {
-               public int statusCode;
-               @SuppressWarnings("unused")
-               public String body;
-
-               public HealthStatus(int code, String body) {
-                       this.statusCode = code;
-                       this.body = body;
-               }
-       }
-
-       private class HealthStatusInfo {
-               HealthStatusInfo(String healthCheckComponent) {
-                       this.healthCheckComponent = healthCheckComponent;
-                       this.healthCheckStatus = statusUp; // Default value
-                       this.version = "";
-                       this.description = statusOk; // Default value
-                       this.hostName = "";
-                       this.ipAddress = "";
-                       this.dbClusterStatus = "";
-                       this.dbPermissions = "";
-               }
-
-               @SuppressWarnings("unused")
-               public String healthCheckComponent;
-               @SuppressWarnings("unused")
-               public String healthCheckStatus;
-               @SuppressWarnings("unused")
-               public String version;
-               @SuppressWarnings("unused")
-               public String description;
-               @SuppressWarnings("unused")
-               public String hostName;
-               @SuppressWarnings("unused")
-               public String ipAddress;
-               @SuppressWarnings("unused")
-               public String dbClusterStatus;
-               @SuppressWarnings("unused")
-               public String dbPermissions;
-       }
-
-       private final String statusUp = "UP";
-       private final String statusDown = "DOWN";
-       private final String statusOk = "OK";
-
-       @RequestMapping(value = { "/portalApi/healthCheck" }, method = RequestMethod.GET, produces = "application/json")
-       public HealthStatus healthCheck(HttpServletRequest request, HttpServletResponse response) {
-               HealthStatus healthStatus = new HealthStatus(500, "");
-
-               // Return the status as 500 if it suspended due to manual fail over
-               if (HealthMonitor.isSuspended) {
-                       healthStatus.body = "Suspended";
-                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE,
-                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-                       return healthStatus;
-               }
-
-               try {
-                       boolean overallStatus = true;
-
-                       List<HealthStatusInfo> statusCollection = new ArrayList<HealthStatusInfo>();
-
-                       HealthStatusInfo beInfo = new HealthStatusInfo("BE");
-                       beInfo.hostName = EcompPortalUtils.getMyHostName();
-                       beInfo.ipAddress = EcompPortalUtils.getMyIpAdddress();
-                       if (!HealthMonitor.isBackEndUp()) {
-                               overallStatus = false;
-                               beInfo.healthCheckStatus = statusDown;
-                               beInfo.description = "Check the logs for more details";
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckError);
-                       }
-                       statusCollection.add(beInfo);
-
-                       HealthStatusInfo feInfo = new HealthStatusInfo("FE");
-                       if (!HealthMonitor.isFrontEndUp()) {
-                               overallStatus = false;
-                               feInfo.healthCheckStatus = statusDown;
-                               feInfo.description = "Check the logs for more details";
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.FeHealthCheckError);
-                       }
-                       statusCollection.add(feInfo);
-
-                       HealthStatusInfo dbInfo = new HealthStatusInfo("DB");
-                       if (!HealthMonitor.isDatabaseUp()) {
-                               overallStatus = false;
-                               dbInfo.healthCheckStatus = statusDown;
-                               dbInfo.description = "Check the logs for more details";
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
-                       }
-
-                       if (!HealthMonitor.isClusterStatusOk()) {
-                               dbInfo.dbClusterStatus = "Problem, check the logs for more details";
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
-                       } else {
-                               dbInfo.dbClusterStatus = statusOk;
-                       }
-
-                       if (!HealthMonitor.isDatabasePermissionsOk()) {
-                               dbInfo.dbPermissions = "Problem, check the logs for more details";
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
-                       } else {
-                               dbInfo.dbPermissions = statusOk;
-                       }
-                       statusCollection.add(dbInfo);
-
-                       HealthStatusInfo uebInfo = new HealthStatusInfo("UEB");
-                       if (!HealthMonitor.isUebUp()) {
-                               // As per test case review meeting, UEB is considered as
-                               // critical as DB. Hence commenting
-                               // overallStatus = false;
-                               uebInfo.healthCheckStatus = statusDown;
-                               uebInfo.description = "Check the logs for more details";
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError);
-                       }
-                       statusCollection.add(uebInfo);
-
-                       String json = "";
-                       try {
-                               json = new Gson().toJson(statusCollection);
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput);
-                       }
-                       logger.info(EELFLoggerDelegate.debugLogger, json);
-
-                       if (overallStatus) {
-                               healthStatus = new HealthStatus(200, json);
-                       } else {
-                               healthStatus = new HealthStatus(500, json);
-                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       }
-                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(healthStatus.statusCode));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,    "healthCheck failed", e);
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheck", "GET result =", response.getStatus());
-
-               return healthStatus;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/healthCheckSuspend" }, method = RequestMethod.GET, produces = "application/json")
-       public HealthStatus healthCheckSuspend(HttpServletRequest request, HttpServletResponse response) {
-               HealthStatus healthStatus = new HealthStatus(500, "Suspended for manual failover mechanism");
-
-               HealthMonitor.isSuspended = true;
-               healthStatus.statusCode = 200;
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheckSuspend", "GET result =",
-                               response.getStatus());
-
-               return healthStatus;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/healthCheckResume" }, method = RequestMethod.GET, produces = "application/json")
-       public HealthStatus healthCheckResume(HttpServletRequest request, HttpServletResponse response) {
-               HealthStatus healthStatus = new HealthStatus(500, "Resumed from manual failover mechanism");
-
-               HealthMonitor.isSuspended = false;
-               healthStatus.statusCode = 200;
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/healthCheckResume", "GET result =",
-                               response.getStatus());
-               return healthStatus;
-       }
-
-       @RequestMapping(value = { "/portalApi/ping" }, method = RequestMethod.GET, 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());
-
-               return healthStatus;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/ManifestController.java
deleted file mode 100644 (file)
index a40c3dc..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.jar.Attributes;
-
-import javax.servlet.http.HttpServletRequest;
-
-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.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.ManifestService;
-
-/**
- * This controller responds to a request for the web application manifest,
- * returning a JSON with the information that was created at build time.
- * 
- * Manifest entries have names with hyphens, which means Javascript code can't
- * simply use the shorthand object.key; instead use object['key'].
- */
-@RestController
-@Configuration("manifestPortalController")
-@EnableAspectJAutoProxy
-@RequestMapping("/")
-@EPAuditLog
-public class ManifestController extends RestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManifestController.class);
-
-       @Autowired
-       private ManifestService manifestService;
-
-       /**
-        * Gets the webapp manifest contents as a JSON object.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return A map of key-value pairs. On success:
-        * 
-        *         <pre>
-        * { "manifest" : { "key1": "value1", "key2": "value2" } }
-        *         </pre>
-        * 
-        *         On failure:
-        * 
-        *         <pre>
-        * { "error": "message" }
-        *         </pre>
-        */
-       @RequestMapping(value = { "/portalApi/manifest" }, method = RequestMethod.GET, produces = "application/json")
-       @ResponseBody
-       public Map<String, Object> getManifest(HttpServletRequest request) {
-               Map<String, Object> response = new HashMap<String, Object>();
-               try {
-                       Attributes attributes = manifestService.getWebappManifest();
-                       response.put("manifest", attributes);
-               } catch (Exception ex) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getManifest: failed to read manifest", ex);
-                       response.put("error", "failed to get manifest: " + ex.toString());
-               }
-               return response;
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceController.java
deleted file mode 100644 (file)
index 44e3223..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.MicroserviceService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpEntity;
-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.RestController;
-import org.springframework.web.client.RestTemplate;
-
-@SuppressWarnings("unchecked")
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class MicroserviceController extends EPRestrictedBaseController {
-       
-       String whatService = "widgets-service";
-       RestTemplate template = new RestTemplate();
-
-       @Autowired
-       private ConsulHealthService consulHealthService;
-
-       @Autowired
-       private MicroserviceService microserviceService;
-
-       @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.POST)
-       public PortalRestResponse<String> createMicroservice(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody MicroserviceData newServiceData) throws Exception {
-               if (newServiceData == null) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "MicroserviceData cannot be null or empty");
-               }
-               long serviceId = microserviceService.saveMicroservice(newServiceData);
-
-               try {
-                       microserviceService.saveServiceParameters(serviceId, newServiceData.getParameterList());
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices" }, method = RequestMethod.GET)
-       public List<MicroserviceData> getMicroservice(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               List<MicroserviceData> list = microserviceService.getMicroserviceData();
-               return list;
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.PUT)
-       public PortalRestResponse<String> updateMicroservice(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("serviceId") long serviceId, @RequestBody MicroserviceData newServiceData) throws Exception {
-
-               if (newServiceData == null) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "MicroserviceData cannot be null or empty");
-               }
-               try {
-                       microserviceService.updateMicroservice(serviceId, newServiceData);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-       
-       @RequestMapping(value = { "/portalApi/microservices/{serviceId}" }, method = RequestMethod.DELETE)
-       public PortalRestResponse<String> deleteMicroservice(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("serviceId") long serviceId) throws Exception {
-               try {
-                       ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
-                       };
-                       // If this service is assoicated with widgets, cannnot be deleted
-                       ResponseEntity<List<WidgetCatalog>> ans = (ResponseEntity<List<WidgetCatalog>>) template.exchange(
-                                       EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
-                                                       + "/widget/microservices/widgetCatalog/service/" + serviceId,
-                                       HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef);
-                       List<WidgetCatalog> widgets = ans.getBody();
-                       if(widgets.size() == 0)
-                               microserviceService.deleteMicroservice(serviceId);
-                       else{
-                               StringBuilder sb = new StringBuilder();
-                               for(int i = 0; i < widgets.size(); i++){
-                                       sb.append("'" + widgets.get(i).getName() + "' ");
-                                       if(i < (widgets.size()-1)){
-                                               sb.append(",");
-                                       }
-                               }
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.WARN, "SOME WIDGETS ASSOICATE WITH THIS SERVICE", sb.toString());
-                       }
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceProxyController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/MicroserviceProxyController.java
deleted file mode 100644 (file)
index 8655deb..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPUnRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.MicroserviceProxyService;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.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.RestController;
-import org.springframework.web.client.HttpClientErrorException;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class MicroserviceProxyController extends EPUnRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyController.class);
-
-       @Autowired
-       private MicroserviceProxyService microserviceProxyService;
-
-       @RequestMapping(value = { "/portalApi/microservice/proxy/{serviceId}" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public String getMicroserviceProxy(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("serviceId") long serviceId) throws Exception {
-               EPUser user = EPUserUtils.getUserSession(request);
-               String answer = "";
-               try {
-                       answer = microserviceProxyService.proxyToDestination(serviceId, user, request);
-               } catch (HttpClientErrorException e) {
-                       answer = e.getResponseBodyAsString();
-               }
-               return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
-       }
-
-       @RequestMapping(value = { "/portalApi/microservice/proxy/parameter/{widgetId}" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public String getMicroserviceProxyByWidgetId(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("widgetId") long widgetId) throws Exception {
-               EPUser user = EPUserUtils.getUserSession(request);
-               String answer = "";
-               try {
-                       answer = microserviceProxyService.proxyToDestinationByWidgetId(widgetId, user, request);
-               } catch (HttpClientErrorException e) {
-                       answer = e.getResponseBodyAsString();
-               }
-               return isValidJSON(answer) ? answer : "{\"error\":\"" + answer.replace(System.getProperty("line.separator"), "") + "\"}";
-       }
-
-       /**
-        * Check whether the response is a valid JSON
-        * @param response
-        * @return true if the response is valid JSON, otherwise, false
-        */
-       private boolean isValidJSON(String response) {
-               try {
-                       final ObjectMapper mapper = new ObjectMapper();
-                       mapper.readTree(response);
-                       return true;
-               } catch (IOException e) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "isValidJSON failed", e);
-                       return false;
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/PolicyController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/PolicyController.java
deleted file mode 100644 (file)
index 2fb5e9a..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.simple.JSONObject;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyProperties;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyResponseWrapper;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyRestInterfaceFactory;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyRestInterfaceIfc;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyUtil;
-import org.openecomp.portalapp.portal.scheduler.policy.RestObject;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-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;
-
-/**
- * Controller to handle Policy requests.
- */
-
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class PolicyController implements BasicAuthenticationController {
-
-       /** The logger. */
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyController.class);
-
-       @RequestMapping(value = "/get_policy", method = RequestMethod.POST)
-       public ResponseEntity<String> getPolicyInfo(HttpServletRequest request, @RequestBody JSONObject policy_request)
-                       throws Exception {
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "#####################POLICY API CALL STARTED ###############"
-                               + PolicyProperties.POLICY_GET_CONFIG_VAL);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "#####################Policy Request ###############" + policy_request.toString());
-
-               String path = SystemProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL);
-               PolicyResponseWrapper policyResWrapper = getPolicyConfig(policy_request, path);
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "$$$$$$$$$$$$$$$$$$$$$$ "
-                               + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
-
-               return (new ResponseEntity<String>(policyResWrapper.getResponse(),
-                               HttpStatus.valueOf(policyResWrapper.getStatus())));
-       }
-
-       protected static PolicyResponseWrapper getPolicyConfig(JSONObject request, String path) throws Exception {
-               String methodName = "getPolicyConfig";
-               String uuid = UUID.randomUUID().toString();
-               logger.debug(EELFLoggerDelegate.debugLogger, "starting getPolicyConfig ");
-
-               try {
-                       // STARTING REST API CALL AS AN FACTORY INSTACE
-                       PolicyRestInterfaceIfc policyRestController = PolicyRestInterfaceFactory.getInstance();
-
-                       RestObject<String> restObjStr = new RestObject<String>();
-                       String str = new String();
-                       restObjStr.set(str);
-                       policyRestController.<String>Post(str, request, uuid, path, restObjStr);
-                       PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse(restObjStr);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "<== " + methodName + " w=" + policyRespWrapper.getResponse());
-                       return policyRespWrapper;
-               } catch (Exception e) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
-
-                       throw e;
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java
deleted file mode 100644 (file)
index 29c3aed..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-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.RestController;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class PortalAdminController extends EPRestrictedBaseController {
-       @Autowired
-       PortalAdminService portalAdminService;
-       @Autowired
-       AdminRolesService adminRolesService;
-       @Autowired
-       AuditService auditService;
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalAdminController.class);
-
-       @RequestMapping(value = { "/portalApi/portalAdmins" }, method = RequestMethod.GET, produces = "application/json")
-       public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<PortalAdmin> portalAdmins = null;
-               if (user == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, null user");
-                       EcompPortalUtils.setBadPermissions(user, response, "getPortalAdmins");
-               } else if (!adminRolesService.isSuperAdmin(user)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, bad permissions");
-                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
-               } else {
-                       // return the list of portal admins
-                       portalAdmins = portalAdminService.getPortalAdmins();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "portalAdmins: called getPortalAdmins()");
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/getPortalAdmins", "result =", portalAdmins);
-               }
-
-               return portalAdmins;
-       }
-
-       /**
-        * RESTful service method to create a new portal admin. Requirement: you
-        * must be the Ecomp portal super admin user.
-        * @param request 
-        * @param userId 
-        * @param response 
-        * @return FieldsValidator 
-        */
-       @RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
-       public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userId,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               if (user == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin, null user");
-                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
-               } else if (!adminRolesService.isSuperAdmin(user)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin bad permissions");
-                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
-               } else {
-                       fieldsValidator = portalAdminService.createPortalAdmin(userId);
-                       int statusCode = fieldsValidator.httpStatusCode.intValue();
-                       response.setStatus(statusCode);
-                       if (statusCode == 200) {
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_ADD_PORTAL_ADMIN);
-                               auditLog.setAffectedRecordId(userId);
-                               try {
-                                       auditService.logActivity(auditLog, null);
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "createPortalAdmin: failed for save audit log", e);
-                               }
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("PortalAdminController.createPortalAdmin",
-                                                               EcompAuditLog.CD_ACTIVITY_ADD_PORTAL_ADMIN, user.getOrgUserId(), userId,
-                                                               "A new Portal Admin has been added"));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       }
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalAdmin", "POST result =", response.getStatus());
-
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = { "/portalApi/portalAdmin/{userInfo}" }, method = RequestMethod.DELETE)
-       public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("userInfo") String userInfo,
-                       HttpServletResponse response) {
-               int userIdIdx = userInfo.indexOf("-");
-               Long userId = null;
-               String sbcid = null;
-               FieldsValidator fieldsValidator = null;
-               try {
-                       if (userIdIdx == -1) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin missing userId");
-                               return fieldsValidator;
-                       } else {
-                               String userIdStr = userInfo.substring(0, userIdIdx);
-                               userId = Long.valueOf(userIdStr);
-                               sbcid = userInfo.substring(userIdIdx + 1, userInfo.length());
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin error while parsing the userInfo", e);
-               }
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "deletePortalAdmin");
-               } else {
-                       fieldsValidator = portalAdminService.deletePortalAdmin(userId);
-                       int statusCode = fieldsValidator.httpStatusCode.intValue();
-                       response.setStatus(statusCode);
-                       if (statusCode == 200) {
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_DELETE_PORTAL_ADMIN);
-                               auditLog.setAffectedRecordId(sbcid);
-                               auditService.logActivity(auditLog, null);
-                               
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("PortalAdminController.deletePortalAdmin",
-                                                               EcompAuditLog.CD_ACTIVITY_DELETE_PORTAL_ADMIN, user.getOrgUserId(), sbcid,
-                                                               "A Portal Admin has been deleted"));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       }
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalAdmin", "DELETE result =", response.getStatus());
-
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/adminAppsRoles/{appId}" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EPRole> rolesByApp = null;
-
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getUserApps");
-                       } else {
-                               rolesByApp = adminRolesService.getRolesByApp(user, appId);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,    "getRolesByApp failed", e);
-               }
-
-               return rolesByApp;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/RoleManageController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/RoleManageController.java
deleted file mode 100644 (file)
index 7c4a4e8..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.controller.core.RoleController;
-import org.openecomp.portalapp.controller.core.RoleFunctionListController;
-import org.openecomp.portalapp.controller.core.RoleListController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesService;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesServiceImpl;
-import org.openecomp.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.servlet.ModelAndView;
-
-/**
- * Proxies REST calls to role-management functions that arrive on paths
- * /portalApi/* over to controller methods provided by the SDK-Core library.
- * Those controller methods are mounted on paths not exposed by the Portal FE.
- */
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class RoleManageController extends EPRestrictedBaseController {
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RoleManageController.class);
-
-       @Autowired
-       private RoleController roleController;
-
-       @Autowired
-       private RoleListController roleListController;
-
-       @Autowired
-       private RoleFunctionListController roleFunctionListController;
-
-
-       @Autowired
-       ExternalAccessRolesService externalAccessRolesService;
-       /**
-        * Calls an SDK-Core library method that gets the available roles and writes
-        * them to the request object. Portal specifies a Hibernate mappings from
-        * the Role class to the fn_role_v view, which ensures that only Portal
-        * (app_id is null) roles are fetched.
-        * 
-        * Any method declared void (no return value) or returning null causes the
-        * audit log aspect method to declare failure. TODO: should return a JSON
-        * string.
-        * 
-        * @param request
-        * @param response
-        */
-       @RequestMapping(value = { "/portalApi/get_roles" }, method = RequestMethod.GET)
-       public void getRoles(HttpServletRequest request, HttpServletResponse response) {
-               getRoleListController().getRoles(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role_list/toggleRole" }, method = RequestMethod.POST)
-       public PortalRestResponse<String> toggleRole(HttpServletRequest request, HttpServletResponse response) {
-               PortalRestResponse<String> portalRestResponse = null;
-               try{
-                       getRoleListController().toggleRole(request, response);
-                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success", null);
-               }catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "failure", e.getMessage());
-               }
-               return portalRestResponse;              
-       }
-
-       @RequestMapping(value = { "/portalApi/role_list/removeRole" }, method = RequestMethod.POST)
-       public ModelAndView removeRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               return getRoleListController().removeRole(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role/saveRole" }, method = RequestMethod.POST)
-       public ModelAndView saveRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               return getRoleController().saveRole(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role/removeRoleFunction" }, method = RequestMethod.POST)
-       public ModelAndView removeRoleRoleFunction(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               return getRoleController().removeRoleFunction(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role/addRoleFunction" }, method = RequestMethod.POST)
-       public ModelAndView addRoleRoRoleFunction(HttpServletRequest request, HttpServletResponse response)
-                       throws Exception {
-               return getRoleController().addRoleFunction(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role/removeChildRole" }, method = RequestMethod.POST)
-       public ModelAndView removeChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               return getRoleController().removeChildRole(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role/addChildRole" }, method = RequestMethod.POST)
-       public ModelAndView addChildRole(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               return getRoleController().addChildRole(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/get_role" }, method = RequestMethod.GET)
-       public void getRole(HttpServletRequest request, HttpServletResponse response) throws Exception{
-               getRoleController().getRole(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/get_role_functions" }, method = RequestMethod.GET)
-       public void getRoleFunctionList(HttpServletRequest request, HttpServletResponse response) {
-               getRoleFunctionListController().getRoleFunctionList(request, response);
-       }
-
-       @RequestMapping(value = { "/portalApi/role_function_list/saveRoleFunction" }, method = RequestMethod.POST)
-       public void saveRoleFunction(HttpServletRequest request, HttpServletResponse response, @RequestBody String roleFunc) throws Exception {
-               getRoleFunctionListController().saveRoleFunction(request, response, roleFunc);
-       }
-
-       @RequestMapping(value = { "/portalApi/role_function_list/removeRoleFunction" }, method = RequestMethod.POST)
-       public void removeRoleFunction(HttpServletRequest request, HttpServletResponse response, @RequestBody String roleFunc) throws Exception {
-               getRoleFunctionListController().removeRoleFunction(request, response, roleFunc);
-       }
-
-       public RoleListController getRoleListController() {
-               return roleListController;
-       }
-
-       public void setRoleListController(RoleListController roleListController) {
-               this.roleListController = roleListController;
-       }
-
-       public RoleController getRoleController() {
-               return roleController;
-       }
-
-       public void setRoleController(RoleController roleController) {
-               this.roleController = roleController;
-       }
-
-       public RoleFunctionListController getRoleFunctionListController() {
-               return roleFunctionListController;
-       }
-
-       public void setRoleFunctionListController(RoleFunctionListController roleFunctionListController) {
-               this.roleFunctionListController = roleFunctionListController;
-       }
-
-       @RequestMapping(value = { "/portalApi/syncRoles" }, method = RequestMethod.GET)
-       public void  syncRoles(EPApp app)
-       {
-               try {
-                       externalAccessRolesService.syncApplicationRolesWithEcompDB(app);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.debugLogger, "failed syncRoles");
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/RolesApprovalSystemController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/RolesApprovalSystemController.java
deleted file mode 100644 (file)
index c9abc3b..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.transport.ExternalRequestFieldsValidator;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import io.swagger.annotations.ApiOperation;
-
-@RestController
-@RequestMapping("/auxapi")
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class RolesApprovalSystemController implements BasicAuthenticationController {
-       
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RolesApprovalSystemController.class);
-
-       @Autowired
-       private UserRolesService userRolesService;
-
-       /**
-        * Creates an application user with the specified roles.
-        * 
-        * @param request
-        * @param extSysUser
-        * @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")
-       public PortalRestResponse<String> postUserProfile(HttpServletRequest request,
-                       @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
-               ExternalRequestFieldsValidator reqResult = null;
-               try {
-                       logger.info(EELFLoggerDelegate.debugLogger, "postUserProfile: request received for app {}, user {}",
-                                       extSysUser.getApplicationName(), extSysUser.getLoginId());
-                       
-                       validateExtSystemUser(extSysUser, true);
-                reqResult = userRolesService.setExternalRequestUserAppRole(extSysUser, "POST");
-                if (!reqResult.isResult())
-                               throw new Exception(reqResult.getDetailMessage());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "postUserProfile: failed for app {}, user {}",
-                                       extSysUser.getApplicationName(), extSysUser.getLoginId(), e);
-                       if(reqResult == null || (!reqResult.isResult()  && !e.getMessage().contains("404") && !e.getMessage().contains("405"))){
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "save user profile failed"); 
-                   } else if(e.getMessage().contains("404")){
-                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "save user profile failed");
-                       } else if (e.getMessage().contains("405")) {
-                               response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(),
-                                               "save user profile failed");
-                       } else {
-                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(),
-                                               "save user profile failed");
-                       }
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, reqResult.getDetailMessage(), "Success");
-       }
-
-       /**
-        * Updates an application user to have only the specified roles.
-        * 
-        * @param request
-        * @param extSysUser
-        * @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")
-       public PortalRestResponse<String> putUserProfile(HttpServletRequest request,
-                       @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
-               ExternalRequestFieldsValidator reqResult = null;
-               try {
-                       logger.info(EELFLoggerDelegate.debugLogger, "putUserProfile: request received for app {}, user {}", 
-                                       extSysUser.getApplicationName(), extSysUser.getLoginId());
-                       validateExtSystemUser(extSysUser, true);
-                       reqResult = userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT");
-                        if (!reqResult.isResult())
-                                       throw new Exception(reqResult.getDetailMessage());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserProfile: failed for app {}, user {}",
-                                       extSysUser.getApplicationName(), extSysUser.getLoginId(), e);
-                       if(reqResult == null || (!reqResult.isResult()  && !e.getMessage().contains("404") && !e.getMessage().contains("405"))){
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "save user profile failed"); 
-                   } else if(e.getMessage().contains("404")){
-                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "save user profile failed");
-                       } else if (e.getMessage().contains("405")) {
-                               response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.getMessage(), "save user profile failed");
-                       } else{
-                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "save user profile failed");
-                       }
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, reqResult.getDetailMessage() , "Success");
-       }
-
-       /**
-        * Deletes an application user by removing all assigned roles.
-        * 
-        * @param request
-        * @param extSysUser
-        *            This object must have zero roles.
-        * @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")
-       public PortalRestResponse<String> deleteUserProfile(HttpServletRequest request,
-                       @RequestBody ExternalSystemUser extSysUser, HttpServletResponse response) {
-               ExternalRequestFieldsValidator reqResult  = null;
-               try {
-                       logger.info(EELFLoggerDelegate.debugLogger, "deleteUserProfile: request received for app {}, user {}", 
-                                       extSysUser.getApplicationName(), extSysUser.getLoginId());
-                       validateExtSystemUser(extSysUser, false);
-                       // Ignore any roles that might be mistakenly present in the request
-                       extSysUser.setRoles(new ArrayList<ExternalSystemRoleApproval>());
-                       reqResult = userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE");
-                        if (!reqResult.isResult())
-                                       throw new Exception(reqResult.getDetailMessage());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserProfile: failed for app {}, user {}",
-                                       extSysUser.getApplicationName(), extSysUser.getLoginId(), e);
-                       if(reqResult == null || (!reqResult.isResult()  && !e.getMessage().contains("404"))){
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "delete user profile failed"); 
-                   }else if(e.getMessage().contains("404")){
-                               response.setStatus(HttpServletResponse.SC_NOT_FOUND);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "delete user profile failed");
-                       } else{
-                               response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR,
-                                               e.getMessage(), "delete user profile failed");
-                       }
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "Deleted Successfully", "Success");
-       }
-
-       /**
-        * Checks for presence of required fields.
-        * 
-        * @param extSysUser
-        * @param rolesRequired
-        *            If true, checks whether roles are present
-        * @throws Exception
-        *             If any field is missing.
-        */
-       private void validateExtSystemUser(ExternalSystemUser extSysUser, boolean rolesRequired) throws Exception {
-               if (extSysUser.getLoginId() == null || extSysUser.getLoginId() == "")
-                       throw new Exception("Request has no login ID");
-               if (extSysUser.getApplicationName() == null || extSysUser.getApplicationName() == "")
-                       throw new Exception("Request has no application name");
-               if (extSysUser.getMyloginrequestId() == null)
-                       throw new Exception("Request has no request ID");
-               if (rolesRequired && (extSysUser.getRoles() == null || extSysUser.getRoles().size() == 0))
-                       throw new Exception("Request has no roles");
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/SchedulerController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/SchedulerController.java
deleted file mode 100644 (file)
index c2d54c6..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.simple.JSONObject;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.scheduler.SchedulerProperties;
-import org.openecomp.portalapp.portal.scheduler.SchedulerRestInterface;
-import org.openecomp.portalapp.portal.scheduler.SchedulerUtil;
-import org.openecomp.portalapp.portal.scheduler.restobjects.GetTimeSlotsRestObject;
-import org.openecomp.portalapp.portal.scheduler.restobjects.PostCreateNewVnfRestObject;
-import org.openecomp.portalapp.portal.scheduler.restobjects.PostSubmitVnfChangeRestObject;
-import org.openecomp.portalapp.portal.scheduler.wrapper.GetTimeSlotsWrapper;
-import org.openecomp.portalapp.portal.scheduler.wrapper.PostCreateNewVnfWrapper;
-import org.openecomp.portalapp.portal.scheduler.wrapper.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.http.HttpStatus;
-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.RestController;
-
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class SchedulerController implements BasicAuthenticationController {
-
-       @Autowired
-       private SchedulerRestInterface schedulerRestController;
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerController.class);
-
-       /** The request date format. */
-       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-
-       @RequestMapping(value = "/get_time_slots/{scheduler_request}", method = RequestMethod.GET)
-       public ResponseEntity<String> getTimeSlots(HttpServletRequest request,
-                       @PathVariable("scheduler_request") String scheduler_request) throws Exception {
-
-               Date startingTime = new Date();
-               String startTimeRequest = requestDateFormat.format(startingTime);
-
-               System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
-               System.out.println(startTimeRequest + " | Controller Scheduler GET : /get_time_slots/{scheduler_request} \n");
-               System.out.println("Original Request : \n " + scheduler_request + '\n');
-
-               String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_TIME_SLOTS) + scheduler_request;
-
-               GetTimeSlotsWrapper schedulerResWrapper = getTimeSlots(scheduler_request, path, scheduler_request);
-
-               Date endTime = new Date();
-               String endTimeRequest = requestDateFormat.format(endTime);
-               System.out.println(endTimeRequest + " | Controller Scheduler - GET\n");
-
-               return (new ResponseEntity<String>(schedulerResWrapper.getResponse(), HttpStatus.OK));
-
-       }
-
-       protected GetTimeSlotsWrapper getTimeSlots(String request, String path, String uuid) throws Exception {
-
-               try {
-                       // STARTING REST API CALL AS AN FACTORY INSTACE
-                       System.out.println("<== Get Time Slots Request START \n");
-
-                       GetTimeSlotsRestObject<String> restObjStr = new GetTimeSlotsRestObject<String>();
-                       String str = new String();
-
-                       restObjStr.set(str);
-
-                       schedulerRestController.Get(str, uuid, path, restObjStr);
-                       GetTimeSlotsWrapper schedulerRespWrapper = SchedulerUtil.getTimeSlotsWrapResponse(restObjStr);
-
-                       System.out.println(
-                                       "<== Get Time Slots Request END : Response = " + schedulerRespWrapper.getResponse() + '\n');
-
-                       return schedulerRespWrapper;
-
-               } catch (Exception e) {
-                       System.out.println("<== Get Time Slots Request ERROR : " + e.toString() + '\n');
-                       logger.error(EELFLoggerDelegate.errorLogger, "Get Time Slots Request failed", e);
-                       throw e;
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       @RequestMapping(value = "/post_create_new_vnf_change", method = RequestMethod.POST)
-       public ResponseEntity<String> postCreateNewVNFChange(HttpServletRequest request,
-                       @RequestBody JSONObject scheduler_request) throws Exception {
-
-               Date startingTime = new Date();
-               String startTimeRequest = requestDateFormat.format(startingTime);
-
-               System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
-               System.out.println(startTimeRequest + " | Controller Scheduler POST : post_create_new_vnf_change \n");
-
-               // Generating uuid
-               String uuid = UUID.randomUUID().toString();
-
-               scheduler_request.put("scheduleId", uuid);
-               System.out.println("<== UUID : " + uuid + '\n');
-
-               // adding uuid to the request payload
-               scheduler_request.put("scheduleId", uuid);
-
-               System.out.println("<== UUID : " + uuid + '\n');
-               System.out.println("Original Request : \n " + scheduler_request.toString() + '\n');
-
-               String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL)
-                               + uuid;
-
-               PostCreateNewVnfWrapper responseWrapper = postSchedulingRequest(scheduler_request, path, uuid);
-
-               Date endTime = new Date();
-               String endTimeRequest = requestDateFormat.format(endTime);
-               System.out.println(endTimeRequest + " | Controller Scheduler - POST\n");
-
-               return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.OK));
-       }
-
-       protected PostCreateNewVnfWrapper postSchedulingRequest(JSONObject request, String path, String uuid)
-                       throws Exception {
-
-               try {
-                       // STARTING REST API CALL AS AN FACTORY INSTACE
-                       System.out.println("<== Post Create New Vnf Scheduling Request START \n");
-
-                       PostCreateNewVnfRestObject<String> restObjStr = new PostCreateNewVnfRestObject<String>();
-                       String str = new String();
-
-                       restObjStr.set(str);
-                       schedulerRestController.<String>Post(str, request, path, restObjStr);
-
-                       int status = restObjStr.getStatusCode();
-                       if (status >= 200 && status <= 299) {
-                               restObjStr.setUUID(uuid);
-                       }
-
-                       PostCreateNewVnfWrapper responseWrapper = SchedulerUtil.postCreateNewVnfWrapResponse(restObjStr);
-
-                       System.out.println("<== Post Create New Vnf Scheduling Request END : Response = "
-                                       + responseWrapper.getResponse() + '\n');
-
-                       return responseWrapper;
-
-               } catch (Exception e) {
-                       System.out.println("<== Post Create New Vnf Scheduling Request ERROR : " + e.toString() + '\n');
-                       logger.error(EELFLoggerDelegate.errorLogger, "Post Create New Vnf Scheduling Request failed", e);
-                       throw e;
-               }
-       }
-
-       @RequestMapping(value = "/submit_vnf_change_timeslots", method = RequestMethod.POST)
-       public ResponseEntity<String> postSubmitVnfChangeTimeslots(HttpServletRequest request,
-                       @RequestBody JSONObject scheduler_request) throws Exception {
-
-               Date startingTime = new Date();
-               String startTimeRequest = requestDateFormat.format(startingTime);
-
-               System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
-               System.out.println(startTimeRequest + " | Controller Scheduler POST : submit_vnf_change_timeslots \n");
-
-               // Generating uuid
-               String uuid = (String) scheduler_request.get("scheduleId");
-               scheduler_request.remove("scheduleId");
-
-               System.out.println("<== UUID : " + uuid + '\n');
-               System.out.println("Original Request : \n " + scheduler_request.toString() + '\n');
-
-               String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SUBMIT_NEW_VNF_CHANGE)
-                               .replace("{scheduleId}", uuid);
-
-               PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = postSubmitSchedulingRequest(scheduler_request, path,
-                               uuid);
-
-               Date endTime = new Date();
-               String endTimeRequest = requestDateFormat.format(endTime);
-               System.out.println(endTimeRequest + " | Controller Scheduler - POST Submit\n");
-
-               return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.OK));
-       }
-
-       protected PostSubmitVnfChangeTimeSlotsWrapper postSubmitSchedulingRequest(JSONObject request, String path,
-                       String uuid) throws Exception {
-
-               try {
-                       // STARTING REST API CALL AS AN FACTORY INSTACE
-                       System.out.println("<== Post Submit Scheduling Request START \n");
-
-                       PostSubmitVnfChangeRestObject<String> restObjStr = new PostSubmitVnfChangeRestObject<String>();
-                       String str = new String();
-
-                       restObjStr.set(str);
-                       schedulerRestController.<String>Post(str, request, path, restObjStr);
-
-                       int status = restObjStr.getStatusCode();
-                       if (status >= 200 && status <= 299) {
-                               restObjStr.setUUID(uuid);
-                       }
-
-                       PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = SchedulerUtil
-                                       .postSubmitNewVnfWrapResponse(restObjStr);
-
-                       System.out.println(
-                                       "<== Post Submit Scheduling Request END : Response = " + responseWrapper.getResponse() + '\n');
-
-                       return responseWrapper;
-
-               } catch (Exception e) {
-                       System.out.println("<== Post Submit Scheduling Request ERROR : " + e.toString() + '\n');
-                       logger.error(EELFLoggerDelegate.errorLogger, "Post Submit Scheduling Request failed", e);
-                       throw e;
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/SharedContextRestController.java
deleted file mode 100644 (file)
index 352912a..0000000
+++ /dev/null
@@ -1,384 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedRESTfulBaseController;
-import org.openecomp.portalapp.portal.domain.SharedContext;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.SharedContextService;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import io.swagger.annotations.ApiOperation;
-
-/**
- * The shared-context feature allows onboarded applications to share data among
- * themselves easily for a given session. It basically implements a Java map:
- * put or get a key-value pair within a map identified by a session ID.
- * 
- * This REST endpoint listens on the Portal app server and answers requests made
- * by back-end application servers. Reads and writes values to the database
- * using a Hibernate service to ensure all servers in a high-availability
- * cluster see the same data.
- */
-@Configuration
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API + "/context")
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class SharedContextRestController extends EPRestrictedRESTfulBaseController {
-
-       /**
-        * Model for a one-element JSON object returned by many methods.
-        */
-       class SharedContextJsonResponse {
-               String response;
-       }
-
-       /**
-        * Access to the database
-        */
-       @Autowired
-       private SharedContextService contextService;
-
-       /**
-        * Logger for debug etc.
-        */
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SharedContextRestController.class);
-
-       /**
-        * Reusable JSON (de)serializer
-        */
-       private final ObjectMapper mapper = new ObjectMapper();
-
-       /**
-        * Gets a value for the specified context and key (RESTful service method).
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param context_id
-        *            ID that identifies the context, usually the ECOMP Portal
-        *            session key.
-        * @param ckey
-        *            Key for the key-value pair to fetch
-        * @return JSON with shared context object; response=null if not found.
-        * @throws Exception
-        *             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")
-       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);
-               if (context_id == null || ckey == null)
-                       throw new Exception("Received null for context_id and/or ckey");
-
-               SharedContext context = contextService.getSharedContext(context_id, ckey);
-               String jsonResponse = "";
-               if (context == null)
-                       jsonResponse = convertResponseToJSON(context);
-               else
-                       jsonResponse = mapper.writeValueAsString(context);
-
-               return jsonResponse;
-       }
-
-       /**
-        * Gets user information for the specified context (RESTful service method).
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param context_id
-        *            ID that identifies the context, usually the ECOMP Portal
-        *            session key.
-        * @return List of shared-context objects as JSON; should have user's first
-        *         name, last name and email address; null if none found
-        * @throws Exception
-        *             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")
-       public String getUserContext(HttpServletRequest request, @RequestParam String context_id) throws Exception {
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "getUserContext for ID " + context_id);
-               if (context_id == null)
-                       throw new Exception("Received null for context_id");
-
-               List<SharedContext> listSharedContext = new ArrayList<SharedContext>();
-               SharedContext firstNameContext = contextService.getSharedContext(context_id,
-                               EPCommonSystemProperties.USER_FIRST_NAME);
-               SharedContext lastNameContext = contextService.getSharedContext(context_id,
-                               EPCommonSystemProperties.USER_LAST_NAME);
-               SharedContext emailContext = contextService.getSharedContext(context_id, EPCommonSystemProperties.USER_EMAIL);
-               SharedContext orgUserIdContext = contextService.getSharedContext(context_id,
-                               EPCommonSystemProperties.USER_ORG_USERID);
-               if (firstNameContext != null)
-                       listSharedContext.add(firstNameContext);
-               if (lastNameContext != null)
-                       listSharedContext.add(lastNameContext);
-               if (emailContext != null)
-                       listSharedContext.add(emailContext);
-               if (orgUserIdContext != null)
-                       listSharedContext.add(orgUserIdContext);
-               String jsonResponse = convertResponseToJSON(listSharedContext);
-               return jsonResponse;
-       }
-
-       /**
-        * Tests for presence of the specified key in the specified context (RESTful
-        * service method).
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param context_id
-        *            ID that identifies the context, usually the ECOMP Portal
-        *            session key.
-        * @param ckey
-        *            Key for the key-value pair to test
-        * @return JSON with result indicating whether the context and key were
-        *         found.
-        * @throws Exception
-        *             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")
-       public String checkContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
-                       throws Exception {
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "checkContext for " + context_id + ", key " + ckey);
-               if (context_id == null || ckey == null)
-                       throw new Exception("Received null for contextId and/or key");
-
-               String response = null;
-               SharedContext context = contextService.getSharedContext(context_id, ckey);
-               if (context != null)
-                       response = "exists";
-
-               String jsonResponse = convertResponseToJSON(response);
-               return jsonResponse;
-       }
-
-       /**
-        * Removes the specified key in the specified context (RESTful service
-        * method).
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param context_id
-        *            ID that identifies the context, usually the ECOMP Portal
-        *            session key.
-        * @param ckey
-        *            Key for the key-value pair to remove
-        * @return JSON with result indicating whether the context and key were
-        *         found.
-        * @throws Exception
-        *             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")
-       public String removeContext(HttpServletRequest request, @RequestParam String context_id, @RequestParam String ckey)
-                       throws Exception {
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "removeContext for " + context_id + ", key " + ckey);
-               if (context_id == null || ckey == null)
-                       throw new Exception("Received null for contextId and/or key");
-
-               SharedContext context = contextService.getSharedContext(context_id, ckey);
-               String response = null;
-               if (context != null) {
-                       contextService.deleteSharedContext(context);
-                       response = "removed";
-               }
-
-               String jsonResponse = convertResponseToJSON(response);
-               return jsonResponse;
-       }
-
-       /**
-        * Clears all key-value pairs in the specified context (RESTful service
-        * method).
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param context_id
-        *            ID that identifies the context, usually the ECOMP Portal
-        *            session key.
-        * @return JSON with result indicating the number of key-value pairs
-        *         removed.
-        * @throws Exception
-        *             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")
-       public String clearContext(HttpServletRequest request, @RequestParam String context_id) throws Exception {
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "clearContext for " + context_id);
-               if (context_id == null)
-                       throw new Exception("clearContext: Received null for contextId");
-
-               int count = contextService.deleteSharedContexts(context_id);
-               String jsonResponse = convertResponseToJSON(Integer.toString(count));
-               return jsonResponse;
-       }
-
-       /**
-        * Sets a context value for the specified context and key (RESTful service
-        * method). Creates the context if no context with the specified ID-key pair
-        * exists, overwrites the value if it exists already.
-        * 
-        * @param request
-        *            HTTP servlet request
-        * @param userJson
-        *            JSON block with these tag-value pairs:
-        *            <UL>
-        *            <LI>context_id: ID that identifies the context
-        *            <LI>ckey: Key for the key-value pair to store
-        *            <LI>cvalue: Value to store
-        *            </UL>
-        * @return JSON with result indicating whether the value was added (key not
-        *         previously known) or replaced (key previously known).
-        * @throws Exception
-        *             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")
-       public String setContext(HttpServletRequest request, @RequestBody String userJson) throws Exception {
-
-               @SuppressWarnings("unchecked")
-               Map<String, Object> userData = mapper.readValue(userJson, Map.class);
-               // Use column names as JSON tags
-               final String contextId = (String) userData.get("context_id");
-               final String key = (String) userData.get("ckey");
-               final String value = (String) userData.get("cvalue");
-               if (contextId == null || key == null)
-                       throw new Exception("setContext: received null for contextId and/or key");
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "setContext: ID " + contextId + ", key " + key + "->" + value);
-               String response = null;
-               SharedContext existing = contextService.getSharedContext(contextId, key);
-               if (existing == null) {
-                       contextService.addSharedContext(contextId, key, value);
-               } else {
-                       existing.setCvalue(value);
-                       contextService.saveSharedContext(existing);
-               }
-               response = existing == null ? "added" : "replaced";
-               String jsonResponse = convertResponseToJSON(response);
-               return jsonResponse;
-       }
-
-       /**
-        * Creates a two-element JSON object tagged "response".
-        * 
-        * @param responseBody
-        * @return JSON object as String
-        * @throws JsonProcessingException
-        */
-       private String convertResponseToJSON(String responseBody) throws JsonProcessingException {
-               Map<String, String> responseMap = new HashMap<String, String>();
-               responseMap.put("response", responseBody);
-               String response = mapper.writeValueAsString(responseMap);
-               return response;
-       }
-
-       /**
-        * Converts a list of SharedContext objects to a JSON array.
-        * 
-        * @param contextList
-        * @return JSON array as String
-        * @throws JsonProcessingException
-        */
-       private String convertResponseToJSON(List<SharedContext> contextList) throws JsonProcessingException {
-               String jsonArray = mapper.writeValueAsString(contextList);
-               return jsonArray;
-       }
-
-       /**
-        * Creates a JSON object with the content of the shared context; null is ok.
-        * 
-        * @param context
-        * @return tag "response" with collection of context object's fields
-        * @throws JsonProcessingException
-        */
-       private String convertResponseToJSON(SharedContext context) throws JsonProcessingException {
-               Map<String, Object> responseMap = new HashMap<String, Object>();
-               responseMap.put("response", context);
-               String responseBody = mapper.writeValueAsString(responseMap);
-               return responseBody;
-       }
-
-       /**
-        * Handles any exception thrown by a method in this controller.
-        * 
-        * @param e
-        *            Exception
-        * @param response
-        *            HttpServletResponse
-        * @throws IOException
-        */
-       @ExceptionHandler(Exception.class)
-       protected void handleBadRequests(Exception e, HttpServletResponse response) throws IOException {
-               logger.error(EELFLoggerDelegate.errorLogger, "handleBadRequest caught exception", e);
-               response.sendError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/TicketEventController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/TicketEventController.java
deleted file mode 100644 (file)
index 76154c6..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.TicketEventService;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import io.swagger.annotations.ApiOperation;
-
-/**
- * Receives messages from the Collaboration Bus (C-BUS) notification and event
- * brokering tool. Creates notifications for ECOMP Portal users.
- */
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class TicketEventController implements BasicAuthenticationController {
-
-
-       @Autowired
-       private UserNotificationService userNotificationService;
-       
-       @Autowired
-       private TicketEventService ticketEventService;
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TicketEventController.class);
-
-       public boolean isAuxRESTfulCall() {
-               return true;
-       }
-
-       private final ObjectMapper mapper = new ObjectMapper();
-
-
-
-       @ApiOperation(value = "Accepts messages from external ticketing systems and creates notifications for Portal users.", response = PortalRestResponse.class)
-       @RequestMapping(value = { "/ticketevent" }, method = RequestMethod.POST)
-       public PortalRestResponse<String> handleRequest(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody String ticketEventJson) throws Exception {
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "Ticket Event notification" + ticketEventJson);
-               PortalRestResponse<String> portalResponse = new PortalRestResponse<>();
-               try {
-                       JsonNode ticketEventNotif = mapper.readTree(ticketEventJson);
-
-                       // Reject request if required fields are missing.
-                       String error = validateTicketEventMessage(ticketEventNotif);
-                       if (error != null) {
-                               portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                               portalResponse.setMessage(error);
-                               response.setStatus(400);
-                               return portalResponse;
-                       }
-
-                       EpNotificationItem epItem = new EpNotificationItem();
-                       epItem.setCreatedDate(new Date());
-                       epItem.setIsForOnlineUsers("Y");
-                       epItem.setIsForAllRoles("N");
-                       epItem.setActiveYn("Y");
-
-                       JsonNode event = ticketEventNotif.get("event");
-                       JsonNode header = event.get("header");
-                       JsonNode body = event.get("body");
-                       JsonNode application = ticketEventNotif.get("application");
-                       epItem.setMsgDescription(body.toString());
-                       Long eventDate = System.currentTimeMillis();
-                       if (body.get("eventDate") != null) {
-                               eventDate = body.get("eventDate").asLong();
-                       }
-                       String eventSource = header.get("eventSource").asText();
-                       epItem.setMsgSource(eventSource);
-                       String ticket = body.get("ticketNum").asText();
-                       String hyperlink = ticketEventService.getNotificationHyperLink(application, ticket, eventSource);                       
-                       if(body.get("notificationHyperlink")!=null){
-                               hyperlink=body.get("notificationHyperlink").asText();
-                       }
-                       epItem.setNotificationHyperlink(hyperlink);
-                       epItem.setStartTime(new Date(eventDate));
-                       Calendar calendar = Calendar.getInstance();
-                       calendar.setTime(epItem.getStartTime());
-                       int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
-                       calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth + 30);
-                       epItem.setEndTime(calendar.getTime());
-                       String severityString = "1";
-                       if (body.get("severity") != null) {
-                               severityString = (body.get("severity").toString()).substring(1, 2);
-                       }
-                       Long severity = Long.parseLong(severityString);
-                       epItem.setPriority(severity);
-                       epItem.setCreatorId(null);
-                       Set<EpRoleNotificationItem> roles = new HashSet<>();
-                       JsonNode SubscriberInfo = ticketEventNotif.get("SubscriberInfo");
-                       JsonNode userList = SubscriberInfo.get("UserList");
-                       String UserIds[] = userList.toString().replace("[", "").replace("]", "").trim().replace("\"", "")
-                                       .split(",");
-                       String assetID = eventSource + ' '
-                                       + userList.toString().replace("[", "").replace("]", "").trim().replace("\"", "") + ' '
-                                       + new Date(eventDate);
-                       if (body.get("assetID") != null) {
-                               assetID = body.get("assetID").asText();
-                       }
-                       epItem.setMsgHeader(assetID);
-                       List<EPUser> users = userNotificationService.getUsersByOrgIds(Arrays.asList(UserIds));
-                       for (String userId : UserIds) {
-                               EpRoleNotificationItem roleNotifItem = new EpRoleNotificationItem();
-                               for (EPUser user : users) {
-                                       if (user.getOrgUserId().equals(userId)) {
-                                               roleNotifItem.setRecvUserId(user.getId().intValue());
-                                               roles.add(roleNotifItem);
-                                               break;
-                                       }
-                               }
-
-                       }
-                       epItem.setRoles(roles);
-                       userNotificationService.saveNotification(epItem);
-
-                       portalResponse.setStatus(PortalRestStatusEnum.OK);
-                       portalResponse.setMessage("processEventNotification: notification created");
-                       portalResponse.setResponse("NotificationId is :" + epItem.notificationId);
-               } catch (Exception ex) {
-                       portalResponse.setStatus(PortalRestStatusEnum.ERROR);
-                       response.setStatus(400);
-                       portalResponse.setMessage(ex.toString());
-               }
-               return portalResponse;
-       }
-
-       /**
-        * Validates that mandatory fields are present.
-        * 
-        * @param ticketEventNotif
-        * @return Error message if a problem is found; null if all is well.
-        */
-       private String validateTicketEventMessage(JsonNode ticketEventNotif) {
-               JsonNode application = ticketEventNotif.get("application");
-               JsonNode event = ticketEventNotif.get("event");
-               JsonNode header = event.get("header");
-               JsonNode eventSource=header.get("eventSource");
-               JsonNode body = event.get("body");
-               JsonNode SubscriberInfo = ticketEventNotif.get("SubscriberInfo");
-               JsonNode userList = SubscriberInfo.get("UserList");
-
-               if (application == null||application.asText().length()==0||application.asText().equalsIgnoreCase("null"))
-                       return "Application is mandatory";
-               if (body == null)
-                       return "body is mandatory";
-               if (eventSource == null||eventSource.asText().trim().length()==0||eventSource.asText().equalsIgnoreCase("null"))
-                       return "Message Source is mandatory";
-               if (userList == null)
-                       return "At least one user Id is mandatory";
-               JsonNode eventDate=body.get("eventDate");
-               
-               if(eventDate!=null&&eventDate.asText().length()==8)
-                       return "EventDate is invalid";
-               String UserIds[] = userList.toString().replace("[", "").replace("]", "").trim().replace("\"", "")
-                               .split(",");            
-               List<EPUser> users = userNotificationService.getUsersByOrgIds(Arrays.asList(UserIds));
-               if(users==null||users.size()==0)
-                       return "Invalid Org User ID";
-               return null;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserController.java
deleted file mode 100644 (file)
index 0db19e1..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.transport.ProfileDetail;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-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;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class UserController extends EPRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserController.class);
-
-       @Autowired
-       private UserService userService;
-
-       /**
-        * RESTful service method to get ECOMP Logged in User details.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * 
-        * @return PortalRestResponse of EPUser
-        */
-       @RequestMapping(value = { "/portalApi/loggedinUser" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<ProfileDetail> getLoggedinUser(HttpServletRequest request) {
-               PortalRestResponse<ProfileDetail> portalRestResponse = null;
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       ProfileDetail profileDetail = new ProfileDetail(user.getFirstName(), user.getLastName(),
-                                       user.getMiddleInitial(), user.getEmail(), user.getLoginId(),  CipherUtil.decrypt(user.getLoginPwd()));
-                       portalRestResponse = new PortalRestResponse<ProfileDetail>(PortalRestStatusEnum.OK, "success",
-                                       profileDetail);
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/loggedinUser", "result =", profileDetail);
-               } catch (Exception e) {
-                       portalRestResponse = new PortalRestResponse<ProfileDetail>(PortalRestStatusEnum.ERROR, e.getMessage(),
-                                       null);
-                       logger.error(EELFLoggerDelegate.errorLogger, "getLoggedinUser failed", e);
-               }
-               return portalRestResponse;
-       }
-
-       /**
-        * RESTful service method to update ECOMP Logged in User in DB.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param profileDetail
-        *            Body with user information
-        * @return PortalRestResponse of String
-        */
-       @RequestMapping(value = {
-                       "/portalApi/modifyLoggedinUser" }, method = RequestMethod.PUT, produces = "application/json")
-       public PortalRestResponse<String> modifyLoggedinUser(HttpServletRequest request,
-                       @RequestBody ProfileDetail profileDetail) {
-               PortalRestResponse<String> portalRestResponse = null;
-               try {
-                       String errorMsg = "";
-                       if (profileDetail.getFirstName().equals("") || profileDetail.getLastName().equals("")
-                                       || profileDetail.getEmail().equals("") || profileDetail.getLoginId().equals("")
-                                       || profileDetail.getLoginPassword().equals("")) {
-                               errorMsg = "Required field(s) is missing";
-                               portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, errorMsg, null);
-                               logger.error(EELFLoggerDelegate.errorLogger, "modifyLoggedinUser failed", errorMsg);
-                       } else {
-                               EPUser user = EPUserUtils.getUserSession(request);
-                               user.setFirstName(profileDetail.getFirstName());
-                               user.setLastName(profileDetail.getLastName());
-                               user.setEmail(profileDetail.getEmail());
-                               user.setMiddleInitial(profileDetail.getMiddleName());
-                               user.setLoginId(profileDetail.getLoginId());
-                               user.setLoginPwd(CipherUtil.encrypt(profileDetail.getLoginPassword()));
-                               userService.saveUser(user);
-                               // Update user info in the session
-                               request.getSession().setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME),
-                                               user);
-                               portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success", null);
-                               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/modifyLoggedinUser", "result =", user);
-                       }
-               } catch (Exception e) {
-                       portalRestResponse = new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, e.toString(), null);
-                       logger.error(EELFLoggerDelegate.errorLogger, "modifyLoggedinUser failed", e);
-               }
-               return portalRestResponse;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserNotificationController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserNotificationController.java
deleted file mode 100644 (file)
index 3b5ba0c..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAppRole;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
-import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class UserNotificationController extends EPRestrictedBaseController {
-
-       @Autowired
-       FunctionalMenuService functionalMenuService;
-
-       @Autowired
-       UserNotificationService userNotificationService;
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserNotificationController.class);
-
-       @RequestMapping(value = {
-                       "/portalApi/getFunctionalMenuRole" }, method = RequestMethod.GET, produces = "application/json")
-       public List<FunctionalMenuRole> getMenuIdRoleId(HttpServletRequest request, HttpServletResponse response) {
-               // EPUser user = EPUserUtils.getUserSession(request);
-               List<FunctionalMenuRole> menuRoleList = null;
-               menuRoleList = functionalMenuService.getFunctionalMenuRole();
-               return menuRoleList;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/getNotifications" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<EpNotificationItem>> getNotifications(HttpServletRequest request,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               PortalRestResponse<List<EpNotificationItem>> portalRestResponse = null;
-               try {
-                       List<EpNotificationItem> notificationList = userNotificationService.getNotifications(user.getId());
-                       portalRestResponse = new PortalRestResponse<List<EpNotificationItem>>(PortalRestStatusEnum.OK, "success",
-                                       notificationList);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAllAppsAndContacts failed", e);
-                       portalRestResponse = new PortalRestResponse<List<EpNotificationItem>>(PortalRestStatusEnum.ERROR,
-                                       e.getMessage(), null);
-               }
-               return portalRestResponse;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/getAdminNotifications" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EpNotificationItemVO> getAdminNotifications(HttpServletRequest request, HttpServletResponse response) {
-               List<EpNotificationItemVO> adminNotificationList = null;
-               EPUser user = EPUserUtils.getUserSession(request);
-               adminNotificationList = userNotificationService.getAdminNotificationVOS(user.getId());
-               return adminNotificationList;
-       }
-
-       @RequestMapping(value = "/portalApi/saveNotification", method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> save(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody EpNotificationItem notificationItem) {
-
-               if (notificationItem == null || notificationItem.getMsgHeader() == null)
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "Notification Header cannot be null or empty");
-               if (notificationItem.getEndTime().compareTo(notificationItem.getStartTime()) < 0) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "End Time should be greater than  start time");
-               }
-
-               if ((notificationItem.getIsForAllRoles() == "N") && notificationItem.getRoleIds().isEmpty()) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE",
-                                       "No Roles Ids Exist for the selected Roles");
-               }
-
-               Long creatorId = UserUtils.getUserIdAsLong(request);
-               notificationItem.setCreatorId(creatorId);
-
-               // Front-end date picker does not accept a time value, so all
-               // values are the start of the chosen day in the local time zone.
-               // Move the end time value to the very end of the chosen day.
-               // Avoid Calendar.getDefault() which uses the server's locale.
-               Long endTime = notificationItem.getEndTime().getTime();
-               endTime += (23 * 3600 + 59 * 60 + 59) * 1000;
-               notificationItem.getEndTime().setTime(endTime);
-
-               try {
-                       userNotificationService.saveNotification(notificationItem);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/notificationUpdateRate" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<Map<String, String>> getNotificationUpdateRate(HttpServletRequest request) {
-               try {
-                       String updateRate = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_RATE);
-                       String updateDuration = SystemProperties.getProperty(EPCommonSystemProperties.NOTIFICATION_UPDATE_DURATION);
-                       Integer rateInMiliSec = Integer.valueOf(updateRate) * 1000;
-                       Integer durationInMiliSec = Integer.valueOf(updateDuration) * 1000;
-                       Map<String, String> results = new HashMap<String, String>();
-                       results.put("updateRate", String.valueOf(rateInMiliSec));
-                       results.put("updateDuration", String.valueOf(durationInMiliSec));
-                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getNotificationUpdateRate failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
-               }
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/notificationRead" }, method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<Map<String, String>> notificationRead(
-                       @RequestParam("notificationId") String notificationID, HttpServletRequest request) {
-               try {
-                       userNotificationService.setNotificationRead(Long.parseLong(notificationID), UserUtils.getUserId(request));
-                       return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", null);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "notificationRead failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.toString(), null);
-               }
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/getNotificationHistory" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EpNotificationItemVO> getNotificationHistory(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EpNotificationItemVO> notificationList = null;
-               notificationList = userNotificationService.getNotificationHistoryVO(user.getId());
-               return notificationList;
-       }
-
-       @RequestMapping(value = { "/portalApi/notificationRole/{notificationId}/roles" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<Integer> testGetRoles(HttpServletRequest request, @PathVariable("notificationId") Long notificationId) {
-               List<EpRoleNotificationItem> NotifRoles = userNotificationService.getNotificationRoles(notificationId);
-               ArrayList<Integer> rolesList = new ArrayList<Integer>();
-               for (EpRoleNotificationItem notifRole : NotifRoles) {
-                       rolesList.add(notifRole.roleId);
-               }
-               return rolesList;
-       }
-
-       @RequestMapping(value = { "/portalApi/getNotificationAppRoles" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<EcompAppRole> getNotificationAppRoles(HttpServletRequest request, HttpServletResponse response) {
-               List<EcompAppRole> epAppRoleList = null;
-               try {
-                       epAppRoleList = userNotificationService.getAppRoleList();
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "Exception occurred while performing UserNofiticationController.getNotificationAppRoles. Details: ",
-                                       e);
-               }
-               return epAppRoleList;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/getMessageRecipients" }, method = RequestMethod.GET, produces = "application/json")
-       public List<String> getMessageRecipients(@RequestParam("notificationId") Long notificationID) {
-               // EPUser user = EPUserUtils.getUserSession(request);
-               List<String> messageUserRecipients = null;
-               messageUserRecipients = userNotificationService.getMessageRecipients(notificationID);
-               return messageUserRecipients;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/UserRolesController.java
deleted file mode 100644 (file)
index b907909..0000000
+++ /dev/null
@@ -1,546 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.cxf.transport.http.HTTPException;
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.ApplicationsRestClientService;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class UserRolesController extends EPRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesController.class);
-
-       @Autowired
-       private SearchService searchService;
-       @Autowired
-       private AdminRolesService adminRolesService;
-       private @Autowired UserRolesService userRolesService;
-       @Autowired
-       private ApplicationsRestClientService applicationsRestClientService;
-       @Autowired
-       private AuditService auditService;
-
-       private static final String FAILURE = "failure";
-
-       /**
-        * RESTful service method to fetch users in the WebPhone external service
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param searchString
-        *            search string
-        * @param response
-        *            HttpServletResponse
-        * @return array of found users as json
-        */
-       @RequestMapping(value = { "/portalApi/queryUsers" }, method = RequestMethod.GET, produces = "application/json")
-       public String getPhoneBookSearchResult(HttpServletRequest request, @RequestParam("search") String searchString,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               String searchResult = null;
-               if (!adminRolesService.isSuperAdmin(user) && !adminRolesService.isAccountAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "getPhoneBookSearchResult");
-               } else {
-                       searchString = searchString.trim();
-                       if (searchString.length() > 2) {
-                               searchResult = searchService.searchUsersInPhoneBook(searchString);
-                       } else {
-                               logger.info(EELFLoggerDelegate.errorLogger,
-                                               "getPhoneBookSearchResult - too short search string: " + searchString);
-                       }
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/queryUsers", "result =", searchResult);
-
-               return searchResult;
-       }
-
-       /**
-        * RESTful service method to fetch applications where user is admin
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param orgUserId
-        *            search string
-        * @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")
-       public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(HttpServletRequest request,
-                       @RequestParam("user") String orgUserId, HttpServletResponse response) {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               AppsListWithAdminRole result = null;
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "getAppsWithAdminRoleStateForUser");
-               } else {
-                       if (EcompPortalUtils.legitimateUserId(orgUserId)) {
-                               result = adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId);
-                       } else {
-                               logger.info(EELFLoggerDelegate.errorLogger,
-                                               "getAppsWithAdminRoleStateForUser - parms error, no Organization User ID");
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                       }
-               }
-
-               StringBuilder adminAppRoles = new StringBuilder();
-               if(result != null){
-                       if ( result.appsRoles.size() >= 1) {
-                               adminAppRoles.append("User '" + result.orgUserId + "' has admin role to the apps = {");
-                               for (AppNameIdIsAdmin adminAppRole : result.appsRoles) {
-                                       if (adminAppRole.isAdmin) {
-                                               adminAppRoles.append(adminAppRole.appName + ", ");
-                                       }
-                               }
-                               adminAppRoles.append("}.");
-                       } else {
-                               adminAppRoles.append("User '" + result.orgUserId + "' has no Apps with Admin Role.");
-                       }
-               }else{
-                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: getAppsWithAdminRoleStateForUser result is null");
-               }
-               
-               logger.info(EELFLoggerDelegate.errorLogger, adminAppRoles.toString());
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "get result =", result);
-
-               return result;
-       }
-
-       /**
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param newAppsListWithAdminRoles
-        *            new apps
-        * @param response
-        *            HttpServletResponse
-        * @return FieldsValidator
-        */
-       @RequestMapping(value = { "/portalApi/adminAppsRoles" }, method = {
-                       RequestMethod.PUT }, produces = "application/json")
-       public FieldsValidator putAppsWithAdminRoleStateForUser(HttpServletRequest request,
-                       @RequestBody AppsListWithAdminRole newAppsListWithAdminRoles, HttpServletResponse response) {
-
-               // newAppsListWithAdminRoles.appsRoles
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               StringBuilder newAppRoles = new StringBuilder();
-               if(newAppsListWithAdminRoles != null ){
-                       if (newAppsListWithAdminRoles.appsRoles.size() >= 1) {
-                               newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has admin role to the apps = { ");
-                               for (AppNameIdIsAdmin adminAppRole : newAppsListWithAdminRoles.appsRoles) {
-                                       if (adminAppRole.isAdmin) {
-                                               newAppRoles.append(adminAppRole.appName + " ,");
-                                       }
-                               }
-                               newAppRoles.deleteCharAt(newAppRoles.length() - 1);
-                               newAppRoles.append("}.");
-                       } else {
-                               newAppRoles.append("User '" + newAppsListWithAdminRoles.orgUserId + "' has no Apps with Admin Role.");
-                       }
-               }else{
-                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: putAppsWithAdminRoleStateForUser result is null");
-               }
-               
-               logger.info(EELFLoggerDelegate.errorLogger, newAppRoles.toString());
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               boolean changesApplied = false;
-
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "putAppsWithAdminRoleStateForUser");
-               } else {
-                       changesApplied = adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles);
-                       AuditLog auditLog = new AuditLog();
-                       auditLog.setUserId(user.getId());
-                       auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN);
-                       auditLog.setAffectedRecordId(newAppsListWithAdminRoles.orgUserId);
-                       auditLog.setComments(EcompPortalUtils.truncateString(newAppRoles.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                       auditService.logActivity(auditLog, null);
-
-                       MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                       MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                       EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                       MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                       MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                       logger.info(EELFLoggerDelegate.auditLogger,
-                                       EPLogUtil.formatAuditLogMessage("UserRolesController.putAppsWithAdminRoleStateForUser",
-                                                       EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN, user.getOrgUserId(),
-                                                       newAppsListWithAdminRoles.orgUserId, newAppRoles.toString()));
-                       MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                       MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                       MDC.remove(SystemProperties.MDC_TIMER);
-               }
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/adminAppsRoles", "put result =", changesApplied);
-
-               return fieldsValidator;
-       }
-
-       /**
-        * It returns a list of user app roles for single app
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @param orgUserId
-        *            user ID
-        * @param appid
-        *            application ID
-        * @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")
-       public List<RoleInAppForUser> getAppRolesForUser(HttpServletRequest request, @RequestParam("user") String orgUserId,
-                       @RequestParam("app") Long appid, @RequestParam("externalRequest") Boolean extRequestValue,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<RoleInAppForUser> result = null;
-               String feErrorString = "";
-               if (!adminRolesService.isAccountAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "getAppRolesForUser");
-                       feErrorString = EcompPortalUtils.getFEErrorString(true, response.getStatus());
-               } else {
-                       if (EcompPortalUtils.legitimateUserId(orgUserId)) {
-                               result = userRolesService.getAppRolesForUser(appid, orgUserId, extRequestValue);
-                               int responseCode = EcompPortalUtils.getExternalAppResponseCode();
-                               if (responseCode != 0 && responseCode != 200) {
-                                       // external error
-                                       response.setStatus(responseCode);
-                                       feErrorString = EcompPortalUtils.getFEErrorString(false, responseCode);
-                               } else if (result == null) {
-                                       // If the result is null, there was an internal ecomp error
-                                       // in the service call.
-                                       response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                                       feErrorString = EcompPortalUtils.getFEErrorString(true,
-                                                       HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               }
-                       } else {
-                               logger.info(EELFLoggerDelegate.errorLogger, "getAppRolesForUser - no Organization User ID");
-                               response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
-                               feErrorString = EcompPortalUtils.getFEErrorString(true, HttpServletResponse.SC_BAD_REQUEST);
-                       }
-               }
-
-               StringBuilder sbUserApps = new StringBuilder();
-               if (result != null && result.size() >= 1) {
-                       sbUserApps.append("User '" + orgUserId + "' has Roles={");
-                       for (RoleInAppForUser appRole : result) {
-                               if (appRole.isApplied) {
-                                       sbUserApps.append(appRole.roleName + ", ");
-                               }
-                       }
-                       sbUserApps.append("} assigned to the appId '" + appid + "'.");
-               } else {
-                       // Not sure creating an empty object will make any difference
-                       // but would like to give it a shot for defect #DE221057
-                       if (result == null) {
-                               result = new ArrayList<RoleInAppForUser>();
-                       }
-                       sbUserApps.append("User '" + orgUserId + "' and appid " + appid + " has no roles");
-               }
-               logger.info(EELFLoggerDelegate.errorLogger, sbUserApps.toString());
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "get result =", result);
-               if (feErrorString != "") {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "LR: FEErrorString to header: " + feErrorString);
-
-                       response.addHeader("FEErrorString", feErrorString);
-                       response.addHeader("Access-Control-Expose-Headers", "FEErrorString");
-               }
-               return result;
-       }
-
-       @RequestMapping(value = { "/portalApi/userAppRoles" }, method = {
-                       RequestMethod.PUT }, produces = "application/json")
-       public FieldsValidator putAppWithUserRoleStateForUser(HttpServletRequest request,
-                       @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               StringBuilder sbUserApps = new StringBuilder();
-               if (newAppRolesForUser != null) {
-                       sbUserApps.append("User '" + newAppRolesForUser.orgUserId);
-                       if (newAppRolesForUser.appRoles != null && newAppRolesForUser.appRoles.size() >= 1) {
-                               sbUserApps.append("' has roles = { ");
-                               for (RoleInAppForUser appRole : newAppRolesForUser.appRoles) {
-                                       if (appRole.isApplied) {
-                                               sbUserApps.append(appRole.roleName + " ,");
-                                       }
-                               }
-                               sbUserApps.deleteCharAt(sbUserApps.length() - 1);
-                               sbUserApps.append("} assigned for the app " + newAppRolesForUser.appId);
-                       } else {
-                               sbUserApps.append("' has no roles assigned for app " + newAppRolesForUser.appId);
-                       }
-               }
-               logger.info(EELFLoggerDelegate.applicationLogger, "putAppWithUserRoleStateForUser: {}", sbUserApps.toString());
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               boolean changesApplied = false;
-               if (!adminRolesService.isAccountAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "putAppWithUserRoleStateForUser");
-               } else if(newAppRolesForUser==null){
-                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleStateForUser: newAppRolesForUser is null");
-               } else{
-                       changesApplied = userRolesService.setAppWithUserRoleStateForUser(user, newAppRolesForUser);
-                       if (changesApplied) {
-                               logger.info(EELFLoggerDelegate.applicationLogger,
-                                               "putAppWithUserRoleStateForUser: succeeded for app {}, user {}", newAppRolesForUser.appId,
-                                               newAppRolesForUser.orgUserId);
-
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               AuditLog auditLog = new AuditLog();
-                               auditLog.setUserId(user.getId());
-                               auditLog.setActivityCode(EcompAuditLog.CD_ACTIVITY_UPDATE_USER);
-                               auditLog.setAffectedRecordId(newAppRolesForUser.orgUserId);
-                               auditLog.setComments(EcompPortalUtils.truncateString(sbUserApps.toString(), PortalConstants.AUDIT_LOG_COMMENT_SIZE));
-                               auditService.logActivity(auditLog, null);
-                               
-                               MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                               EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                               MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                               logger.info(EELFLoggerDelegate.auditLogger,
-                                               EPLogUtil.formatAuditLogMessage("UserRolesController.putAppWithUserRoleStateForUser",
-                                                               EcompAuditLog.CD_ACTIVITY_UPDATE_USER, user.getOrgUserId(),
-                                                               newAppRolesForUser.orgUserId, sbUserApps.toString()));
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                               MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                               MDC.remove(SystemProperties.MDC_TIMER);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "putAppWithUserRoleStateForUser: failed for app {}, user {}", newAppRolesForUser.appId,
-                                               newAppRolesForUser.orgUserId);
-                       }
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userAppRoles", "put result =", changesApplied);
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = { "/portalApi/updateRemoteUserProfile" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public PortalRestResponse<String> updateRemoteUserProfile(HttpServletRequest request,
-                       HttpServletResponse response) {
-
-               String updateRemoteUserFlag = FAILURE;
-               try {
-                       // saveNewUser = userService.saveNewUser(newUser);
-                       String orgUserId = request.getParameter("loginId");
-                       Long appId = Long.parseLong(request.getParameter("appId"));
-                       userRolesService.updateRemoteUserProfile(orgUserId, appId);
-
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.OK, updateRemoteUserFlag, e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, updateRemoteUserFlag, "");
-
-       }
-
-       @RequestMapping(value = { "/portalApi/app/{appId}/users" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<UserApplicationRoles> getUsersFromAppEndpoint(HttpServletRequest request,
-                       @PathVariable("appId") Long appId) throws HTTPException {
-               try {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "/portalApi/app/{}/users was invoked", appId);
-                       List<UserApplicationRoles> appUsers = userRolesService.getUsersFromAppEndpoint(appId);
-                       return appUsers;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,    "getUsersFromAppEndpoint failed", e);
-                       return new ArrayList<UserApplicationRoles>();
-               }
-       }
-
-       @RequestMapping(value = { "/portalApi/app/{appId}/roles" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<EcompRole> testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId)
-                       throws HTTPException {
-               EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
-               List<EcompRole> rolesList = Arrays.asList(appRoles);
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/roles", "response for appId=" + appId,
-                               rolesList);
-
-               return rolesList;
-       }
-
-       @RequestMapping(value = { "/portalApi/admin/import/app/{appId}/roles" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<EPRole> importRolesFromRemoteApplication(HttpServletRequest request, @PathVariable("appId") Long appId)
-                       throws HTTPException {
-               List<EPRole> rolesList = userRolesService.importRolesFromRemoteApplication(appId);
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/admin/import/app/{appId}/roles",
-                               "response for appId=" + appId, rolesList);
-
-               return rolesList;
-       }
-
-       @RequestMapping(value = { "/portalApi/app/{appId}/user/{orgUserId}/roles" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public EcompRole testGetRoles(HttpServletRequest request, @PathVariable("appId") Long appId,
-                       @PathVariable("orgUserId") String orgUserId) throws Exception {
-               if (!EcompPortalUtils.legitimateUserId(orgUserId)) {
-                       String msg = "Error /user/<user>/roles not legitimate orgUserId = " + orgUserId;
-                       logger.error(EELFLoggerDelegate.errorLogger, msg);
-                       throw new Exception(msg);
-               }
-               EcompRole[] roles = applicationsRestClientService.get(EcompRole[].class, appId,
-                               String.format("/user/%s/roles", orgUserId));
-               if (roles.length != 1) {
-                       String msg = "Error /user/<user>/roles returned array. expected size 1 recieved size = " + roles.length;
-                       logger.error(EELFLoggerDelegate.errorLogger, msg);
-                       throw new Exception(msg);
-               }
-
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/app/{appId}/user/{orgUserId}/roles",
-                               "response for appId='" + appId + "' and orgUserId='" + orgUserId + "'", roles[0]);
-               return roles[0];
-       }
-
-       @RequestMapping(value = { "/portalApi/saveUserAppRoles" }, method = {
-                       RequestMethod.PUT }, produces = "application/json")
-       public FieldsValidator putAppWithUserRoleRequest(HttpServletRequest request,
-                       @RequestBody AppWithRolesForUser newAppRolesForUser, HttpServletResponse response) {
-               FieldsValidator fieldsValidator = null;
-               try {
-
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       fieldsValidator = userRolesService.putUserAppRolesRequest(newAppRolesForUser, user);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putAppWithUserRoleRequest failed", e);
-
-               }
-               // return fieldsValidator;
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/saveUserAppRoles", "PUT result =",
-                               response.getStatus());
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = { "/portalApi/appCatalogRoles" }, method = {
-                       RequestMethod.GET }, produces = "application/json")
-       public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(HttpServletRequest request,
-                       @RequestParam("appName") String appName) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EPUserAppCatalogRoles> userAppRoleList = null;
-               try {
-                       userAppRoleList = userRolesService.getUserAppCatalogRoles(user, appName);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserWidgetsSortPref failed", e);
-
-               }
-               Collections.sort(userAppRoleList, getUserAppCatalogRolesComparator);
-               EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/userApplicationRoles", "result =", userAppRoleList);
-
-               return userAppRoleList;
-
-       }
-
-       private Comparator<EPUserAppCatalogRoles> getUserAppCatalogRolesComparator = new Comparator<EPUserAppCatalogRoles>() {
-               public int compare(EPUserAppCatalogRoles o1, EPUserAppCatalogRoles o2) {
-                       return o1.getRolename().compareTo(o2.getRolename());
-               }
-       };
-
-       @RequestMapping(value = "/portalApi/externalRequestAccessSystem", method = RequestMethod.GET, produces = "application/json")
-       public ExternalSystemAccess readExternalRequestAccess(HttpServletRequest request) {
-               ExternalSystemAccess result = null;
-               try {
-                       result = userRolesService.getExternalRequestAccess();
-                       EcompPortalUtils.logAndSerializeObject(logger, "/portalApi/externalRequestAccessSystem", "GET result =",
-                                       result);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "readExternalRequestAccess failed: " + e.getMessage());
-               }
-               return result;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WebAnalyticsExtAppController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WebAnalyticsExtAppController.java
deleted file mode 100644 (file)
index 23b0e49..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.io.IOUtils;
-import org.openecomp.portalapp.controller.EPRestrictedRESTfulBaseController;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.AppsCacheService;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.transport.Analytics;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-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.concurrent.FailureCallback;
-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.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.client.AsyncRestTemplate;
-
-import io.swagger.annotations.ApiOperation;
-
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class WebAnalyticsExtAppController extends EPRestrictedRESTfulBaseController {
-
-       @Autowired
-       private ConsulHealthService consulHealthService;
-
-       private static final String MACHINE_LEARNING_SERVICE_CTX = "/ml_api";
-       private static final String REGISTER_ACTION = MACHINE_LEARNING_SERVICE_CTX + "/" + "registerAction";
-       private static final String CONSUL_ML_SERVICE_ID = "machine-learning";
-       private static final String APP_KEY = "uebkey";
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebAnalyticsExtAppController.class);
-       private AsyncRestTemplate restTemplate = new AsyncRestTemplate();
-
-
-       @Autowired
-       AuditService auditService;
-
-       @Autowired
-       AppsCacheService appCacheService;
-
-       SuccessCallback<ResponseEntity<String>> successCallback = new SuccessCallback<ResponseEntity<String>>() {
-               @Override
-               public void onSuccess(ResponseEntity<String> arg) {
-                       logger.info(EELFLoggerDelegate.debugLogger, arg.getBody());
-               }
-       };
-
-       FailureCallback failureCallback = new FailureCallback() {
-               @Override
-               public void onFailure(Throwable arg) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "storeAuxAnalytics failed", arg);
-               }
-       };
-
-       protected boolean isAuxRESTfulCall() {
-               return true;
-       }
-
-       /**
-        * Answers requests from partner applications for a file that is expected to
-        * contain javascript to support web analytics.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return String
-        * @throws Exception
-        *             on failure
-        */
-       @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")
-       public String getAnalyticsScript(HttpServletRequest request) throws Exception {
-               String responseText = "";
-               final String fileName = "analytics.txt";
-               InputStream analyticsFileStream = null;
-               try {
-                       analyticsFileStream = this.getClass().getClassLoader().getResourceAsStream(fileName);
-                       responseText = IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "Error reading contents of the file " + fileName, e);
-               } finally {
-                       if (analyticsFileStream != null)
-                               analyticsFileStream.close();
-               }
-
-               String feURLContext = SystemProperties.getProperty("frontend_url");
-               String feURL = feURLContext.substring(0, feURLContext.lastIndexOf('/'));
-
-               responseText = responseText.replace("PORTAL_ENV_URL", feURL);
-               return responseText;
-       }
-
-       /**
-        * Accepts data from partner applications with web analytics data.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param analyticsMap
-        *            Analytics
-        * @return PortalAPIResponse
-        * @throws Exception
-        *             on failure
-        */
-       @RequestMapping(value = { "/storeAnalytics" }, method = RequestMethod.POST, 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)
-                       throws Exception {
-               try {
-                       MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-                       String appName = "";
-                       try {
-                               appName = getAppName(request, appName);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               " Error retrieving Application to capture app name for analytics; Proceeding with empty app name");
-                       }
-
-                       try {
-                               storeAuxAnalytics(analyticsMap, appName);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               " Error retrieving Application to capture app name for analytics; Proceeding with empty app name");
-                       }
-
-                       MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, EPEELFLoggerAdvice.getCurrentDateTimeUTC());
-
-                       EcompPortalUtils.calculateDateTimeDifferenceForLog(
-                                       MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                       MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-                       logger.info(EELFLoggerDelegate.auditLogger,
-                                       EPLogUtil.formatStoreAnalyticsAuditLogMessage(analyticsMap.getUserid(), appName,
-                                                       "WebAnalyticsExtAppController.postWebAnalyticsData",
-                                                       EcompAuditLog.CD_ACTIVITY_STORE_ANALYTICS, analyticsMap.getAction(), analyticsMap.getPage(),
-                                                       analyticsMap.getFunction(), analyticsMap.getType()));
-
-                       MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                       MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                       MDC.remove(SystemProperties.MDC_TIMER);
-
-                       PortalAPIResponse response = new PortalAPIResponse(true, "success");
-                       return response;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "storeAnalytics failed", e);
-                       PortalAPIResponse response = new PortalAPIResponse(true, "error");
-                       return response;
-               }
-       }
-
-       protected String getAppName(HttpServletRequest request, String appName) {
-               String appKeyValue = request.getHeader(APP_KEY);
-               if (appKeyValue == null || appKeyValue.equals("")) {
-                       logger.error(EELFLoggerDelegate.errorLogger, " App Key unavailable; Proceeding with null app name");
-               } else {
-                       EPApp appRecord = appCacheService.getAppForAnalytics(appKeyValue);
-                       if (appRecord == null) {
-                               logger.error(EELFLoggerDelegate.errorLogger, " App could not be found for the key " + appKeyValue);
-                       } else
-                               appName = appRecord.getName();
-
-               }
-               return appName;
-       }
-
-       protected void storeAuxAnalytics(Analytics analyticsMap, String appName) {
-               logger.info(EELFLoggerDelegate.debugLogger,
-                               " Registering an action for recommendation: AppName/Function/UserId " + appName + "/"
-                                               + analyticsMap.getFunction() + "/" + analyticsMap.getUserid());
-
-               Map<String, String> requestMapping = new HashMap<String, String>();
-               requestMapping.put("id", analyticsMap.getUserid());
-               requestMapping.put("action", appName + "|" + analyticsMap.getFunction());
-
-               HttpHeaders headers = new HttpHeaders();
-               headers.setContentType(MediaType.APPLICATION_JSON);
-
-               // set your entity to send
-               HttpEntity<Map<String, String>> entity = new HttpEntity<Map<String, String>>(requestMapping, headers);
-
-               // send it!
-               ListenableFuture<ResponseEntity<String>> out = restTemplate.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                               + consulHealthService.getServiceLocation(CONSUL_ML_SERVICE_ID,
-                                                               SystemProperties.getProperty("microservices.m-learn.local.port"))
-                                               + REGISTER_ACTION,
-                               HttpMethod.POST, entity, String.class);
-               out.addCallback(successCallback, failureCallback);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogController.java
deleted file mode 100644 (file)
index 229ef1f..0000000
+++ /dev/null
@@ -1,417 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
-import org.openecomp.portalapp.portal.domain.WidgetParameterResult;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.MicroserviceService;
-import org.openecomp.portalapp.portal.service.WidgetParameterService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.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.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-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 WidgetsCatalogController extends EPRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogController.class);
-
-       private static final String MS_WIDGET_LOCAL_PORT = "microservices.widget.local.port";
-
-       private RestTemplate template = new RestTemplate();
-
-       private String whatService = "widgets-service";
-
-       @Autowired
-       private ConsulHealthService consulHealthService;
-
-       @Autowired
-       private MicroserviceService microserviceService;
-
-       @Autowired
-       private WidgetParameterService widgetParameterService;
-
-       @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;
-                       }
-               });
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET)
-       public List<WidgetCatalog> getUserWidgetCatalog(@PathVariable("loginName") String loginName) {
-               List<WidgetCatalog> widgets = new ArrayList<>();
-               try {
-                       ResponseEntity<List> ans = template.exchange(
-                                       EcompPortalUtils.widgetMsProtocol() + "://"
-                                                       + consulHealthService.getServiceLocation(whatService,
-                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                                       + "/widget/microservices/widgetCatalog/" + loginName,
-                                       HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), List.class);
-                       widgets = ans.getBody();
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserWidgetCatalog failed", e);
-                       // returning null because null help check on the UI if there was a
-                       // communication problem with Microservice.
-                       return null;
-               }
-               return widgets;
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.GET)
-       public List<WidgetCatalog> getWidgetCatalog() {
-               List<WidgetCatalog> widgets = new ArrayList<>();
-               try {
-                       ResponseEntity<List> ans = template.exchange(
-                                       EcompPortalUtils.widgetMsProtocol() + "://"
-                                                       + consulHealthService.getServiceLocation(whatService,
-                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                                       + "/widget/microservices/widgetCatalog",
-                                       HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), List.class);
-                       widgets = ans.getBody();
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getWidgetCatalog failed", e);
-                       // returning null because null help check on the UI if there was a
-                       // communication problem with Microservice.
-                       return null;
-               }
-               return widgets;
-       }
-
-       @RequestMapping(value = {
-                       "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
-       public void updateWidgetCatalog(@RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId) throws Exception {
-               template.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                               + consulHealthService.getServiceLocation(whatService,
-                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                               + "/widget/microservices/widgetCatalog/" + widgetId,
-                               HttpMethod.PUT, new HttpEntity<>(newWidgetCatalog, WidgetServiceHeaders.getInstance()), String.class);
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.DELETE)
-       public void deleteOnboardingWidget(@PathVariable("widgetId") long widgetId) throws Exception {
-               template.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                               + consulHealthService.getServiceLocation(whatService,
-                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                               + "/widget/microservices/widgetCatalog/" + widgetId,
-                               HttpMethod.DELETE, new HttpEntity<>(WidgetServiceHeaders.getInstance()), String.class);
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST)
-       public String updateWidgetCatalogWithFiles(HttpServletRequest request,
-                       @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
-               MultipartHttpServletRequest mRequest;
-               MultiValueMap<String, Object> multipartRequest = new LinkedMultiValueMap<>();
-               String fileName;
-               String tmpFolderName = "/tmp/";
-               String respond = null;
-               FileOutputStream fo = null;
-               try {
-                       mRequest = (MultipartHttpServletRequest) request;
-                       MultipartFile mFile = mRequest.getFile("file");
-                       fileName = mFile.getOriginalFilename();
-                       fo = new FileOutputStream(tmpFolderName + fileName);
-                       fo.write(mFile.getBytes());
-                       // silence sonar scan by calling close here
-                       fo.close();
-                       fo = null;
-
-                       HttpHeaders header = new HttpHeaders();
-                       header.setContentType(MediaType.MULTIPART_FORM_DATA);
-                       multipartRequest.add("file", new FileSystemResource(tmpFolderName + fileName));
-                       multipartRequest.add("widget", request.getParameter("newWidget"));
-                       respond = template.postForObject(
-                                       EcompPortalUtils.widgetMsProtocol() + "://"
-                                                       + consulHealthService.getServiceLocation(whatService,
-                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                                       + "/widget/microservices/widgetCatalog/" + widgetId,
-                                       new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
-                       File f = new File(tmpFolderName + fileName);
-                       f.delete();
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "updateWidgetCatalogWithFiles failed", e);
-               } finally {
-                       try {
-                               if (fo != null)
-                                       fo.close();
-                       } catch (IOException e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "updateWidgetCatalogWithFiles failed 2", e);
-                       }
-               }
-               return respond;
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/widgetCatalog" }, method = RequestMethod.POST)
-       public String createWidgetCatalog(HttpServletRequest request)
-                       throws Exception {
-               MultipartHttpServletRequest mRequest;
-               MultiValueMap<String, Object> multipartRequest = new LinkedMultiValueMap<>();
-               String fileName;
-               String tmpFolderName = "/tmp/";
-               String respond = null;
-               FileOutputStream fo = null;
-               try {
-                       mRequest = (MultipartHttpServletRequest) request;
-                       MultipartFile mFile = mRequest.getFile("file");
-                       fileName = mFile.getOriginalFilename();
-                       fo = new FileOutputStream(tmpFolderName + fileName);
-                       fo.write(mFile.getBytes());
-                       // silence sonar scan by calling close here
-                       fo.close();
-                       fo = null;
-
-                       HttpHeaders header = new HttpHeaders();
-                       header.setContentType(MediaType.MULTIPART_FORM_DATA);
-                       multipartRequest.add("file", new FileSystemResource(tmpFolderName + fileName));
-                       multipartRequest.add("widget", request.getParameter("newWidget"));
-
-                       respond = template.postForObject(
-                                       EcompPortalUtils.widgetMsProtocol() + "://"
-                                                       + consulHealthService.getServiceLocation(whatService,
-                                                                       SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                                       + "/widget/microservices/widgetCatalog",
-                                       new HttpEntity<>(multipartRequest, WidgetServiceHeaders.getInstance()), String.class);
-                       File f = new File(tmpFolderName + fileName);
-                       f.delete();
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "createWidgetCatalog failed", e);
-               } finally {
-                       try {
-                               if (fo != null)
-                                       fo.close();
-                       } catch (IOException e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "createWidgetCatalog failed 2", e);
-                       }
-               }
-               return respond;
-       }
-
-       @RequestMapping(value = "/portalApi/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
-       public String getWidgetFramework(@PathVariable("widgetId") long widgetId) throws Exception {
-               return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
-                               + consulHealthService.getServiceLocation(whatService,
-                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                               + "/widget/microservices/" + 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() + "://"
-                               + consulHealthService.getServiceLocation(whatService,
-                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                               + "/widget/microservices/" + widgetId + "/controller.js", String.class,
-                               WidgetServiceHeaders.getInstance());
-       }
-
-       @RequestMapping(value = "/portalApi/microservices/{widgetId}/style.css", method = RequestMethod.GET)
-       public String getWidgetCSS(@PathVariable("widgetId") long widgetId) throws Exception {
-               return template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://"
-                               + consulHealthService.getServiceLocation(whatService,
-                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                               + "/widget/microservices/" + widgetId + "/styles.css", String.class,
-                               WidgetServiceHeaders.getInstance());
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/parameters/{widgetId}" }, method = RequestMethod.GET)
-       public PortalRestResponse<List<WidgetParameterResult>> getWidgetParameterResult(HttpServletRequest request,
-                       @PathVariable("widgetId") long widgetId) throws Exception {
-               EPUser user = EPUserUtils.getUserSession(request);
-
-               List<WidgetParameterResult> list = new ArrayList<>();
-               Long serviceId = template.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                               + consulHealthService.getServiceLocation(whatService,
-                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                               + "/widget/microservices/widgetCatalog/parameters/" + widgetId,
-                               HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), Long.class).getBody();
-               if (serviceId == null) {
-                       // return ok/sucess and no service parameter for this widget
-                       return new PortalRestResponse<List<WidgetParameterResult>>(PortalRestStatusEnum.WARN,
-                                       "No service parameters for this widget", list);
-               } else {
-                       List<MicroserviceParameter> defaultParam = microserviceService.getParametersById(serviceId);
-                       for (MicroserviceParameter param : defaultParam) {
-                               WidgetParameterResult userResult = new WidgetParameterResult();
-                               userResult.setParam_id(param.getId());
-                               userResult.setDefault_value(param.getPara_value());
-                               userResult.setParam_key(param.getPara_key());
-                               WidgetCatalogParameter userValue = widgetParameterService.getUserParamById(widgetId, user.getId(),
-                                               param.getId());
-                               if (userValue == null)
-                                       userResult.setUser_value(param.getPara_value());
-                               else {
-                                       userResult.setUser_value(userValue.getUser_value());
-                               }
-                               list.add(userResult);
-                       }
-               }
-               return new PortalRestResponse<List<WidgetParameterResult>>(PortalRestStatusEnum.OK, "SUCCESS", list);
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.GET)
-       public List<WidgetCatalogParameter> getUserParameterById(       @PathVariable("paramId") long paramId) {
-               List<WidgetCatalogParameter> list = widgetParameterService.getUserParameterById(paramId);
-               return list;
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/services/{paramId}" }, method = RequestMethod.DELETE)
-       public void deleteUserParameterById(@PathVariable("paramId") long paramId) {
-               widgetParameterService.deleteUserParameterById(paramId);
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/download/{widgetId}" }, method = RequestMethod.GET)
-       public void doDownload(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("widgetId") long widgetId) throws Exception {
-
-               ServletContext context = request.getServletContext();
-               byte[] byteFile = template
-                               .exchange(
-                                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                                               + consulHealthService.getServiceLocation(whatService,
-                                                                               SystemProperties.getProperty(MS_WIDGET_LOCAL_PORT))
-                                                               + "/widget/microservices/download/" + widgetId,
-                                               HttpMethod.GET, new HttpEntity<>(WidgetServiceHeaders.getInstance()), byte[].class)
-                               .getBody();
-
-               File downloadFile = File.createTempFile("temp", ".zip");
-               FileOutputStream stream = new FileOutputStream(downloadFile.getPath());
-               stream.write(byteFile);
-               stream.close();
-
-               FileInputStream inputStream = new FileInputStream(downloadFile);
-               String mimeType = context.getMimeType(downloadFile.getPath());
-               if (mimeType == null) {
-                       mimeType = "application/octet-stream";
-               }
-
-               response.setContentType(mimeType);
-               response.setContentLength((int) downloadFile.length());
-               String headerKey = "Content-Disposition";
-               String headerValue = String.format("attachment; filename=\"%s\"", downloadFile.getName());
-               downloadFile.delete();
-               response.setHeader(headerKey, headerValue);
-
-               OutputStream outStream = response.getOutputStream();
-               byte[] buffer = new byte[32 * 1024];
-               int bytesRead;
-               while ((bytesRead = inputStream.read(buffer)) != -1) {
-                       outStream.write(buffer, 0, bytesRead);
-               }
-
-               inputStream.close();
-               outStream.close();
-       }
-
-       @RequestMapping(value = { "/portalApi/microservices/parameters" }, method = RequestMethod.POST)
-       public PortalRestResponse<String> saveWidgetParameter(HttpServletRequest request,
-                       @RequestBody WidgetCatalogParameter widgetParameters) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               widgetParameters.setUserId(user.getId());
-               try {
-                       WidgetCatalogParameter oldParam = widgetParameterService.getUserParamById(widgetParameters.getWidgetId(),
-                                       widgetParameters.getUserId(), widgetParameters.getParamId());
-                       if (oldParam != null) {
-                               widgetParameters.setId(oldParam.getId());
-                       }
-                       widgetParameterService.saveUserParameter(widgetParameters);
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveWidgetParameter failed", e);
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "FAILURE", e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "SUCCESS", "");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogMarkupController.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogMarkupController.java
deleted file mode 100644 (file)
index aefc3d0..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPUnRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.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.web.bind.annotation.PathVariable;
-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.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.multipart.commons.CommonsMultipartResolver;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class WidgetsCatalogMarkupController extends EPUnRestrictedBaseController {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetsCatalogMarkupController.class);
-       private RestTemplate template = new RestTemplate();
-       private final String whatService = "widgets-service";
-
-       @Autowired
-       private ConsulHealthService consulHealthService;
-
-       @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 (hostname.equals("localhost")) {
-                                       return true;
-                               }
-                               return false;
-                       }
-               });
-       }
-
-       @RequestMapping(value = "/portalApi/microservices/markup/{widgetId}", method = RequestMethod.GET)
-       public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("widgetId") long widgetId) throws RestClientException, Exception {
-               return template
-                               .getForObject(
-                                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                                               + consulHealthService.getServiceLocation(whatService,
-                                                                               SystemProperties.getProperty("microservices.widget.local.port"))
-                                                               + "/widget/microservices/markup/" + widgetId,
-                                               String.class, WidgetServiceHeaders.getInstance());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApp.java
deleted file mode 100644 (file)
index ed172f6..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class AdminUserApp implements Serializable{
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name="USER_ID")
-       private Long user_Id;
-       
-       @Column(name="FIRST_NAME")
-       private String firstName;
-       
-       @Column(name="LAST_NAME")
-       private String lastName;
-       
-       @Column(name="ORG_USER_ID")
-       private String orgUserId;
-
-       @Id
-       @Column(name="APP_ID")
-       private Long appId; 
-       
-       @Column(name="APP_NAME")
-       private String appName; 
-       
-       public Long getAppId() {
-               return appId;
-       }
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-       public Long getUser_Id() {
-               return user_Id;
-       }
-       public void setUserId(Long user_Id) {
-               this.user_Id = user_Id;
-       }
-       public String getFirstName() {
-               return firstName;
-       }
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-       public String getLastName() {
-               return lastName;
-       }
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-       public String getAppName() {
-               return appName;
-       }
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AdminUserApplications.java
deleted file mode 100644 (file)
index de0d406..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class AdminUserApplications {
-       private List<Application> apps = new ArrayList<Application>();
-       
-       private Long user_Id;
-       private String firstName;
-       private String lastName;
-       private String orgUserId;
-       
-       public AdminUserApplications(AdminUserApp app) {
-               setUser_Id(app.getUser_Id());
-               setOrgUserId(app.getOrgUserId());
-               setFirstName(app.getFirstName());
-               setLastName(app.getLastName());
-               
-               addApp(app.getAppId(), app.getAppName());
-       }
-       public Long getUser_Id() {
-               return user_Id;
-       }
-       public void setUser_Id(Long user_Id) {
-               this.user_Id = user_Id;
-       }
-       public String getFirstName() {
-               return firstName;
-       }
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-       public String getLastName() {
-               return lastName;
-       }
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-       public List<Application> getApps() {
-               return apps;
-       }
-       public void setApps(List<Application> apps) {
-               this.apps = apps;
-       }
-       public void addApp(Long otherAppId, String otherAppName) {
-               apps.add(new Application(otherAppId, otherAppName));
-       }
-
-       public class Application {
-               private Long appId; 
-               private String appName; 
-               
-               public Application(Long otherAppId, String otherAppName) {
-                       setAppId(otherAppId);
-                       setAppName(otherAppName);
-               }
-               public Long getAppId() {
-                       return appId;
-               }
-               public void setAppId(Long appId) {
-                       this.appId = appId;
-               }
-               public String getAppName() {
-                       return appName;
-               }
-               public void setAppName(String appName) {
-                       this.appName = appName;
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/App.java
deleted file mode 100644 (file)
index 8e4bf49..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-//@Entity
-//@Table(name = "FN_APP")
-public class App implements Serializable{
-       
-       private static final long serialVersionUID = 1L;
-
-       //@Id
-       //@Column(name = "APP_ID")
-       //@GeneratedValue(strategy=GenerationType.AUTO)
-       private Long appId;
-       
-       //@Column(name = "APP_Name")
-       private String appName;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-       
-
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppContactUs.java
deleted file mode 100644 (file)
index b816ff9..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-/**
- * Models rows in the fn_app_contact_us table added for 1610.1.
- */
-public class AppContactUs extends DomainVo {
-
-       private static final long serialVersionUID = -2742197830465055134L;
-
-       private EPApp app;
-       private String description;
-       private String contactEmail;
-       private String contactName;
-       private String url;
-       private String activeYN;
-
-       public EPApp getApp() {
-               return app;
-       }
-
-       public void setApp(EPApp app) {
-               this.app = app;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-       public String getContactEmail() {
-               return contactEmail;
-       }
-
-       public void setContactEmail(String contactEmail) {
-               this.contactEmail = contactEmail;
-       }
-
-       public String getContactName() {
-               return contactName;
-       }
-
-       public void setContactName(String contactName) {
-               this.contactName = contactName;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getActiveYN() {
-               return activeYN;
-       }
-
-       public void setActiveYN(String activeYN) {
-               this.activeYN = activeYN;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppIdAndNameTransportModel.java
deleted file mode 100644 (file)
index 00463f7..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class AppIdAndNameTransportModel implements Serializable{
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name="APP_ID")
-       private Long id;
-       
-       @Column(name="APP_NAME")
-       private String name;
-
-       @Column(name="APP_TYPE")
-       private Integer appType;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-       
-       public Boolean isRestrictedApp() {
-               return (this.appType == 2 ? true : false);
-       }
-
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/AppsResponse.java
deleted file mode 100644 (file)
index d3a940e..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-public class AppsResponse {
-       
-       public AppsResponse(Long id, String name, Boolean restrictedApp, Boolean enabled) {
-               this.index = id;
-               this.title = this.value = name;
-               this.restrictedApp = restrictedApp;
-               this.enabled = enabled;
-       }
-
-       public Long getIndex() {
-               return index;
-       }
-
-       public void setIndex(Long index) {
-               this.index = index;
-       }
-
-       public String getTitle() {
-               return title;
-       }
-
-       public void setTitle(String title) {
-               this.title = title;
-       }
-
-       public String getValue() {
-               return value;
-       }
-
-       public void setValue(String value) {
-               this.value = value;
-       }
-
-       // 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 setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-       
-       public Boolean getEnabled() {
-               return enabled;
-       }
-       
-       public void setEnabled(Boolean enabled) {
-               this.enabled = enabled;
-       }
-
-       private Long index;
-       private String title;
-       private String value;
-       public Boolean restrictedApp;
-       public Boolean enabled;
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BEProperty.java
deleted file mode 100644 (file)
index 8147903..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-public class BEProperty {
-       private String key;
-       private String value;
-
-       public BEProperty(String key, String value) {
-               this.key = key;
-               this.value = value;
-       }
-
-       public String getKey() {
-               return key;
-       }
-
-       public void setKey(String key) {
-               this.key = key;
-       }
-
-       public String getValue() {
-               return value;
-       }
-
-       public void setValue(String value) {
-               this.value = value;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((key == null) ? 0 : key.hashCode());
-               result = prime * result + ((value == null) ? 0 : value.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               BEProperty other = (BEProperty) obj;
-               if (key == null) {
-                       if (other.key != null)
-                               return false;
-               } else if (!key.equals(other.key))
-                       return false;
-               if (value == null) {
-                       if (other.value != null)
-                               return false;
-               } else if (!value.equals(other.value))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/BasicAuthCredentials.java
deleted file mode 100644 (file)
index 83cf21d..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.List;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class BasicAuthCredentials extends DomainVo {
-       
-       private static final long serialVersionUID = 1L;
-
-       public BasicAuthCredentials() {
-
-       }
-       
-       private Long id;
-       private String applicationName;
-       private String username;
-       private String password;
-       private String isActive;
-       private List<EPEndpoint> endpoints;
-       
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public String getApplicationName() {
-               return applicationName;
-       }
-
-       public void setApplicationName(String applicationName) {
-               this.applicationName = applicationName;
-       }
-
-       public String getUsername() {
-               return username;
-       }
-
-       public void setUsername(String username) {
-               this.username = username;
-       }
-
-       public String getPassword() {
-               return password;
-       }
-
-       public void setPassword(String password) {
-               this.password = password;
-       }
-
-       public String getIsActive() {
-               return isActive;
-       }
-
-       public void setIsActive(String isActive) {
-               this.isActive = isActive;
-       }
-       
-       public List<EPEndpoint> getEndpoints() {
-               return endpoints;
-       }
-
-       public void setEndpoints(List<EPEndpoint> endpoints) {
-               this.endpoints = endpoints;
-       }
-
-       @Override
-       public String toString() {
-               return "BasicAuthCredentials [id=" + id + ", applicationName=" + applicationName + ", username=" + username
-                               + ", password=" + password + ", isActive=" + isActive + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/CentralRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/CentralRoleFunction.java
deleted file mode 100644 (file)
index 49e4228..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-@SuppressWarnings("rawtypes")
-public class CentralRoleFunction extends DomainVo implements java.io.Serializable, Comparable {
-
-       /**
-       * 
-       */
-       private static final long serialVersionUID = -4018975640065252688L;
-       private String code;
-       private String name;
-       @JsonIgnore
-       private Long appId;
-       @JsonIgnore
-       private Long roleId;
-       private String editUrl;
-
-       public CentralRoleFunction() {
-
-       }
-
-       public CentralRoleFunction(Long id, String code, String name, Long appId, String editUrl) {
-               super();
-               this.id = id;
-               this.code = code;
-               this.name = name;
-               this.appId = appId;
-               this.editUrl = editUrl;
-       }
-
-       public CentralRoleFunction(String code, String name) {
-               super();
-               this.code = code;
-               this.name = name;
-       }
-
-       /**
-        * @return the code
-        */
-       public String getCode() {
-               return code;
-       }
-
-       /**
-        * @param code
-        *            the code to set
-        */
-       public void setCode(String code) {
-               this.code = code;
-       }
-
-       /**
-        * @return the name
-        */
-       public String getName() {
-               return name;
-       }
-
-       /**
-        * @param name
-        *            the name to set
-        */
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       /**
-        * @return the appId
-        */
-       public Long getAppId() {
-               return appId;
-       }
-
-       /**
-        * @param appId
-        *            the appId to set
-        */
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       /**
-        * @return the editUrl
-        */
-       public String getEditUrl() {
-               return editUrl;
-       }
-
-       /**
-        * @param editUrl
-        *            the editUrl to set
-        */
-       public void setEditUrl(String editUrl) {
-               this.editUrl = editUrl;
-       }
-
-       public int compareTo(Object obj) {
-               String c1 = getName();
-               String c2 = ((CentralRoleFunction) obj).getName();
-
-               return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPApp.java
deleted file mode 100644 (file)
index c27a9ad..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Arrays;
-
-import javax.persistence.Lob;
-
-import org.apache.commons.lang.StringUtils;
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-/**
- * Model for all columns in the fn_app table.
- */
-public class EPApp extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-
-       private String name;
-       private String imageUrl;
-       private String description;
-       private String notes;
-       private String url;
-       private String alternateUrl;
-       private String appRestEndpoint;
-       private String mlAppName;
-       private String mlAppAdminId;
-       private Long motsId;
-       private String username;
-       private String appPassword;
-       @Lob
-       private byte[] thumbnail;
-       private Boolean open;
-       private Boolean enabled;
-       private String uebTopicName;
-       private String uebKey;
-       private String uebSecret;
-       private Integer appType;
-       private AppContactUs contactUs;
-       private Boolean centralAuth;
-       private String  nameSpace;
-
-       public EPApp() {
-               // Attention!!!
-               // We set here all default values. We also place protection
-               // into setters for fields with default values.
-               // If we don't use such protection we are able to place null
-               // to these fields and save such fields into DB even if DB has
-               // default values for these fields.
-               this.name = "";
-               this.mlAppName = "";
-               this.mlAppAdminId = "";
-               this.username = "";
-               this.appPassword = "";
-               this.open = new Boolean(false);
-               this.enabled = new Boolean(true);
-               this.uebTopicName = "";
-               this.uebKey = "";
-               this.uebSecret = "";
-               this.appType = 1;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               if (StringUtils.isEmpty(name)) {
-                       name = "";
-               }
-               this.name = name;
-       }
-
-       public String getImageUrl() {
-               return imageUrl;
-       }
-
-       public void setImageUrl(String imageUrl) {
-               this.imageUrl = imageUrl;
-       }
-
-
-
-       public byte[] getThumbnail() {
-               return this.thumbnail;
-       }
-
-       public void setThumbnail(byte[] thumbnail) {
-               this.thumbnail = thumbnail;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-       public String getNotes() {
-               return notes;
-       }
-
-       public void setNotes(String notes) {
-               this.notes = notes;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getAlternateUrl() {
-               return alternateUrl;
-       }
-
-       public void setAlternateUrl(String alternateUrl) {
-               this.alternateUrl = alternateUrl;
-       }
-
-       public String getAppRestEndpoint() {
-               return appRestEndpoint;
-       }
-
-       public void setAppRestEndpoint(String appRestEndpoint) {
-               this.appRestEndpoint = appRestEndpoint;
-       }
-
-       public String getMlAppName() {
-               return mlAppName;
-       }
-
-       public void setMlAppName(String mlAppName) {
-               if (StringUtils.isEmpty(mlAppName)) {
-                       mlAppName = "";
-               }
-               this.mlAppName = mlAppName;
-       }
-
-       public String getMlAppAdminId() {
-               return mlAppAdminId;
-       }
-
-       public void setMlAppAdminId(String mlAppAdminId) {
-               if (StringUtils.isEmpty(mlAppAdminId)) {
-                       mlAppAdminId = "";
-               }
-               this.mlAppAdminId = mlAppAdminId;
-       }
-
-       public Long getMotsId() {
-               return motsId;
-       }
-
-       public void setMotsId(Long motsId) {
-               this.motsId = motsId;
-       }
-
-       public String getUsername() {
-               return username;
-       }
-
-       public void setUsername(String username) {
-               this.username = username;
-       }
-
-       public String getAppPassword() {
-               return appPassword;
-       }
-
-       public void setAppPassword(String appPassword) {
-               if (StringUtils.isEmpty(appPassword)) {
-                       appPassword = "";
-               }
-               this.appPassword = appPassword;
-       }
-
-       public Boolean getOpen() {
-               return open;
-       }
-
-       public void setOpen(Boolean open) {
-               if (open == null) {
-                       open = new Boolean(false);
-               }
-               this.open = open;
-       }
-
-       public Boolean getEnabled() {
-               return enabled;
-       }
-
-       public void setEnabled(Boolean enabled) {
-               if (enabled == null) {
-                       enabled = new Boolean(true);
-               }
-               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);
-       }
-
-       public int compareTo(Object obj) {
-               Long c1 = getId();
-               Long c2 = ((EPApp) obj).getId();
-
-               return c1.compareTo(c2);
-       }
-
-       public String getUebTopicName() {
-               return this.uebTopicName;
-       }
-
-       public void setUebTopicName(String topicName) {
-               if (StringUtils.isEmpty(topicName)) {
-                       this.uebTopicName = "";
-               }
-               this.uebTopicName = topicName;
-       }
-
-       public String getUebKey() {
-               return this.uebKey;
-       }
-
-       public void setUebKey(String uebKey) {
-               if (StringUtils.isEmpty(uebKey)) {
-                       this.uebKey = "";
-               }
-               this.uebKey = uebKey;
-       }
-
-       public String getUebSecret() {
-               return this.uebSecret;
-       }
-
-       public void setUebSecret(String uebSecret) {
-               if (StringUtils.isEmpty(uebSecret)) {
-                       this.uebSecret = "";
-               }
-               this.uebSecret = uebSecret;
-       }
-
-       public AppContactUs getContactUs() {
-               return contactUs;
-       }
-
-       public void setContactUs(AppContactUs contactUs) {
-               this.contactUs = contactUs;
-       }
-       
-       public Boolean getCentralAuth() {
-               return centralAuth;
-       }
-
-       public void setCentralAuth(Boolean centralAuth) {
-               if (centralAuth == null) {
-                       centralAuth = new Boolean(false);
-               }
-               this.centralAuth = centralAuth;
-       }
-       
-       public String getNameSpace() {
-               return nameSpace;
-       }
-
-       public void setNameSpace(String nameSpace) {
-               if (StringUtils.isEmpty(nameSpace)) {
-                       nameSpace = null;
-               }
-               this.nameSpace = nameSpace;
-       }
-
-       @Override
-       public String toString() {
-               String str = "[" + getId() + ":" + getName() + "]";
-               return str;
-       }
-
-       @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 + ((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 + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode());
-               result = prime * result + ((mlAppName == null) ? 0 : mlAppName.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 + 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());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               EPApp other = (EPApp) obj;
-               if (alternateUrl == null) {
-                       if (other.alternateUrl != null)
-                               return false;
-               } else if (!alternateUrl.equals(other.alternateUrl))
-                       return false;
-               if (appPassword == null) {
-                       if (other.appPassword != null)
-                               return false;
-               } else if (!appPassword.equals(other.appPassword))
-                       return false;
-               if (appRestEndpoint == null) {
-                       if (other.appRestEndpoint != null)
-                               return false;
-               } 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 (centralAuth == null) {
-                       if (other.centralAuth != null)
-                               return false;
-               } else if (!centralAuth.equals(other.centralAuth))
-                       return false;
-               if (contactUs == null) {
-                       if (other.contactUs != null)
-                               return false;
-               } else if (!contactUs.equals(other.contactUs))
-                       return false;
-               if (description == null) {
-                       if (other.description != null)
-                               return false;
-               } else if (!description.equals(other.description))
-                       return false;
-               if (enabled == null) {
-                       if (other.enabled != null)
-                               return false;
-               } else if (!enabled.equals(other.enabled))
-                       return false;
-               if (imageUrl == null) {
-                       if (other.imageUrl != null)
-                               return false;
-               } else if (!imageUrl.equals(other.imageUrl))
-                       return false;
-               if (mlAppAdminId == null) {
-                       if (other.mlAppAdminId != null)
-                               return false;
-               } else if (!mlAppAdminId.equals(other.mlAppAdminId))
-                       return false;
-               if (mlAppName == null) {
-                       if (other.mlAppName != null)
-                               return false;
-               } else if (!mlAppName.equals(other.mlAppName))
-                       return false;
-               if (motsId == null) {
-                       if (other.motsId != null)
-                               return false;
-               } else if (!motsId.equals(other.motsId))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       return false;
-               if (nameSpace == null) {
-                       if (other.nameSpace != null)
-                               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 (!Arrays.equals(thumbnail, other.thumbnail))
-                       return false;
-               if (uebKey == null) {
-                       if (other.uebKey != null)
-                               return false;
-               } else if (!uebKey.equals(other.uebKey))
-                       return false;
-               if (uebSecret == null) {
-                       if (other.uebSecret != null)
-                               return false;
-               } else if (!uebSecret.equals(other.uebSecret))
-                       return false;
-               if (uebTopicName == null) {
-                       if (other.uebTopicName != null)
-                               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)
-                               return false;
-               } else if (!username.equals(other.username))
-                       return false;
-               return true;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPAppRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPAppRoleFunction.java
deleted file mode 100644 (file)
index 1c621c7..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPAppRoleFunction extends DomainVo  implements java.io.Serializable{
-
-       private static final long serialVersionUID = 7752385247460299630L;
-       
-       private Long roleId;
-       private Long appId;
-       private String code;
-       
-       /**
-        * @return the roleId
-        */
-       public Long getRoleId() {
-               return roleId;
-       }
-       /**
-        * @param roleId the roleId to set
-        */
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-       /**
-        * @return the appId
-        */
-       public Long getAppId() {
-               return appId;
-       }
-       /**
-        * @param appId the appId to set
-        */
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-       /**
-        * @return the code
-        */
-       public String getCode() {
-               return code;
-       }
-       /**
-        * @param code the code to set
-        */
-       public void setCode(String code) {
-               this.code = code;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpoint.java
deleted file mode 100644 (file)
index 0abcfa8..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPEndpoint extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-
-       public EPEndpoint() {
-
-       }
-
-       private Long id;
-       private String name;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       @Override
-       public String toString() {
-               return "EPEndpoint [id=" + id + ", name=" + name + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPEndpointAccount.java
deleted file mode 100644 (file)
index b4f66f3..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPEndpointAccount extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-
-       public EPEndpointAccount() {
-
-       }
-
-       private Long id;
-       private Long ep_id;
-       private Long account_id;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public Long getEp_id() {
-               return ep_id;
-       }
-
-       public void setEp_id(Long ep_id) {
-               this.ep_id = ep_id;
-       }
-
-       public Long getAccount_id() {
-               return account_id;
-       }
-
-       public void setAccount_id(Long account_id) {
-               this.account_id = account_id;
-       }
-
-       @Override
-       public String toString() {
-               return "EPEndpointAccount [id=" + id + ", ep_id=" + ep_id + ", account_id=" + account_id + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPRole.java
deleted file mode 100644 (file)
index fdc70ee..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Iterator;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-public class EPRole extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-       private String  name;
-    private boolean active;
-    private Integer priority;
-    
-    // ECOMP will identify the specific remote application role id by appID;appRoleId among all the application roles it persists.
-    private Long appId;     // used by ECOMP only 
-    private Long appRoleId; // used by ECOMP only
-
-    private SortedSet<RoleFunction>     roleFunctions = new TreeSet<RoleFunction>();
-    
-    private SortedSet<EPRole> childRoles = new TreeSet<EPRole>();
-    
-    @JsonIgnore
-    private SortedSet<EPRole> parentRoles = new TreeSet<EPRole>();
-
-    public EPRole() {}
-
-    public String getName() {
-        return name;
-    }
-
-    public boolean getActive() {
-        return active;
-    }
-
-    public SortedSet<RoleFunction> getRoleFunctions() {
-        return roleFunctions;
-    }
-
-    public Integer getPriority() {
-        return priority;
-    }
-
-    public SortedSet<EPRole> getChildRoles() {
-        return childRoles;
-    }
-
-    public SortedSet<EPRole> getParentRoles() {
-        return parentRoles;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setActive(boolean active) {
-        this.active = active;
-    }
-
-    public void setRoleFunctions(SortedSet<RoleFunction> roleFunctions) {
-        this.roleFunctions = roleFunctions;
-    }
-
-    public void setPriority(Integer priority) {
-        this.priority = priority;
-    }
-
-    public void setChildRoles(SortedSet<EPRole> childRoles) {
-        this.childRoles = childRoles;
-    }
-
-    public void setParentRoles(SortedSet<EPRole> parentRoles) {
-        this.parentRoles = parentRoles;
-    }
-
-    public void addRoleFunction(RoleFunction roleFunction) {
-        this.roleFunctions.add(roleFunction);
-    }
-
-    public void addChildRole(EPRole role) {
-        this.childRoles.add(role);
-    }
-
-    public void addParentRole(EPRole role) {
-        this.parentRoles.add(role);
-    }
-
-    public String getEditUrl() {
-        return "/role.htm?role_id=" + getId();         
-    }
-    
-       public String getToggleActiveImage() {
-               return "/static/fusion/images/" + (getActive() ? "active.png" : "inactive.png" );
-       }
-
-       public String getToggleActiveAltText() {
-               return getActive() ? "Click to Deactivate Role" : "Click to Activate Role";
-       }
-    
-    public void removeChildRole(Long roleId) {
-      Iterator<EPRole> i = this.childRoles.iterator();
-
-      while (i.hasNext()) {
-        EPRole childRole = (EPRole)i.next();
-        if (childRole.getId().equals(roleId)) {
-          this.childRoles.remove(childRole);
-          break;
-        }
-      }
-    }
-
-    public void removeParentRole(Long roleId) {
-        Iterator<EPRole> i = this.parentRoles.iterator();
-
-        while (i.hasNext()) {
-          EPRole parentRole = (EPRole)i.next();
-          if (parentRole.getId().equals(roleId)) {
-            this.parentRoles.remove(parentRole);
-            break;
-          }
-        }
-      }
-
-    public void removeRoleFunction(String roleFunctionCd) {
-      Iterator<RoleFunction> i = this.roleFunctions.iterator();
-
-      while (i.hasNext()) {
-        RoleFunction roleFunction = (RoleFunction)i.next();
-        if (roleFunction.getCode().equals(roleFunctionCd)) {
-          this.roleFunctions.remove(roleFunction);
-          break;
-        }
-      }
-    }
-
-    public int compareTo(Object obj){
-       EPRole other = (EPRole)obj;
-
-       if(this.appId == null)
-               if(other.getAppId() == null)
-                       return compareByName(other); //equal
-               else
-                       return -1; 
-       else // this.appId != null
-               if(other.getAppId() == null)
-                       return 1;  // appId != null, but others is null
-               else{
-                       int appIdCompareResult = appId.compareTo(other.getAppId());
-                       return appIdCompareResult == 0? compareByName(other) : appIdCompareResult;
-               }
-    }
-
-       private int compareByName(EPRole other) {
-               String c1 = getName();
-       String c2 = other.getName();
-
-       return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
-       }
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public Long getAppRoleId() {
-               return appRoleId;
-       }
-
-       public void setAppRoleId(Long appRoleId) {
-               this.appRoleId = appRoleId;
-       }
-       
-       @Override
-       public String toString() {
-               return "[Id = " + id + ", name = " + name + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUser.java
deleted file mode 100644 (file)
index e5e09ac..0000000
+++ /dev/null
@@ -1,668 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Date;
-import java.util.Iterator;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-public class EPUser extends User {
-           
-           private Long   orgId;
-           private Long   managerId;
-           private String firstName;
-           private String middleInitial;
-           private String lastName;
-           private String phone;
-           private String fax;
-           private String cellular;
-           private String email;
-           private Long   addressId;
-           private String alertMethodCd;
-           private String hrid;
-           private String orgUserId;
-           private String orgCode;
-           private String address1;
-           private String address2;
-           private String city;
-           private String state;
-           private String zipCode;
-           private String country;
-           private String orgManagerUserId;
-           private String locationClli;
-           private String businessCountryCode;
-           private String businessCountryName;
-           private String businessUnit;
-           private String businessUnitName;
-           private String department;
-           private String departmentName;
-           private String companyCode;
-           private String company;
-           private String zipCodeSuffix;
-           private String jobTitle;
-           private String commandChain;
-           private String siloStatus;
-           private String costCenter;
-           private String financialLocCode;
-           
-           
-         
-           private String loginId;
-           private String loginPwd;
-           private Date   lastLoginDate;
-           private boolean active;
-           private boolean internal;
-           private Long    selectedProfileId;
-           private Long timeZoneId;
-           private boolean online;
-           private String chatId;
-       
-           private static final long serialVersionUID = 1L;
-
-           private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUser.class);
-               private static final String ECOMP_PORTAL_NAME = "ECOMP";
-               private boolean isGuest = false;
-               
-               private SortedSet<EPUserApp> userApps = new TreeSet<EPUserApp>();
-               private SortedSet<EPRole> pseudoRoles = new TreeSet<EPRole>();
-
-           public EPUser() {}
-
-           public Long getAddressId() {
-               return addressId;
-           }
-
-           public String getAlertMethodCd() {
-               return alertMethodCd;
-           }
-
-           public String getCellular() {
-               return cellular;
-           }
-
-           public String getEmail() {
-               return email;
-           }
-
-           public String getFax() {
-               return fax;
-           }
-
-           public String getFirstName() {
-               return firstName;
-           }
-
-           public String getHrid() {
-               return hrid;
-           }
-
-           public Date getLastLoginDate() {
-               return lastLoginDate;
-           }
-
-           public String getLastName() {
-               return lastName;
-           }
-
-           @JsonIgnore
-           public String getFullName() {
-               return getFirstName() + " " + getLastName();    
-           }
-           
-           public String getLoginId() {
-               return loginId;
-           }
-
-           public String getLoginPwd() {
-               return loginPwd;
-           }
-
-           public Long getManagerId() {
-               return managerId;
-           }
-
-           public String getMiddleInitial() {
-               return middleInitial;
-           }
-
-           public String getOrgCode() {
-               return orgCode;
-           }
-
-           public Long getOrgId() {
-               return orgId;
-           }
-
-           public String getPhone() {
-               return phone;
-           }
-
-           public String getOrgUserId() {
-               return orgUserId;
-           }
-
-           public boolean getActive() {
-               return active;
-           }
-
-           public boolean getInternal() {
-               return internal;
-           }
-
-           public String getAddress1() {
-               return address1;
-           }
-
-           public String getAddress2() {
-               return address2;
-           }
-
-           public String getCity() {
-               return city;
-           }
-
-           public String getCountry() {
-               return country;
-           }
-
-           public String getState() {
-               return state;
-           }
-
-           public String getZipCode() {
-               return zipCode;
-           }
-
-           public String getBusinessCountryCode() {
-               return businessCountryCode;
-           }
-
-           public String getCommandChain() {
-               return commandChain;
-           }
-
-           public String getCompany() {
-               return company;
-           }
-
-           public String getCompanyCode() {
-               return companyCode;
-           }
-
-           public String getDepartment() {
-               return department;
-           }
-
-           public String getJobTitle() {
-               return jobTitle;
-           }
-
-           public String getLocationClli() {
-               return locationClli;
-           }
-
-           public String getOrgManagerUserId() {
-               return orgManagerUserId;
-           }
-
-           public String getZipCodeSuffix() {
-               return zipCodeSuffix;
-           }
-
-           public String getBusinessCountryName() {
-               return businessCountryName;
-           }
-
-           public Long getSelectedProfileId() {
-               return selectedProfileId;
-           }
-
-           public void setAddressId(Long addressId) {
-               this.addressId = addressId;
-           }
-
-           public void setAlertMethodCd(String alertMethodCd) {
-               this.alertMethodCd = alertMethodCd;
-           }
-
-           public void setCellular(String cellular) {
-               this.cellular = cellular;
-           }
-
-           public void setEmail(String email) {
-               this.email = email;
-           }
-
-           public void setFax(String fax) {
-               this.fax = fax;
-           }
-
-           public void setFirstName(String firstName) {
-               this.firstName = firstName;
-           }
-
-           public void setHrid(String hrid) {
-               this.hrid = hrid;
-           }
-
-           public void setLastLoginDate(Date lastLoginDate) {
-               this.lastLoginDate = lastLoginDate;
-           }
-
-           public void setLastName(String lastName) {
-               this.lastName = lastName;
-           }
-
-           public void setLoginId(String loginId) {
-               this.loginId = loginId;
-           }
-
-           public void setLoginPwd(String loginPwd) {
-               this.loginPwd = loginPwd;
-           }
-
-           public void setManagerId(Long managerId) {
-               this.managerId = managerId;
-           }
-
-           public void setMiddleInitial(String middleInitial) {
-               this.middleInitial = middleInitial;
-           }
-
-           public void setOrgCode(String orgCode) {
-               this.orgCode = orgCode;
-           }
-
-           public void setOrgId(Long orgId) {
-               this.orgId = orgId;
-           }
-
-           public void setPhone(String phone) {
-               this.phone = phone;
-           }
-
-           public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-           }
-
-           public void setActive(boolean active) {
-               this.active = active;
-           }
-
-           public void setInternal(boolean internal) {
-               this.internal = internal;
-           }
-
-           public void setAddress1(String address1) {
-               this.address1 = address1;
-           }
-
-           public void setAddress2(String address2) {
-               this.address2 = address2;
-           }
-
-           public void setCity(String city) {
-               this.city = city;
-           }
-
-           public void setCountry(String country) {
-               this.country = country;
-           }
-
-           public void setState(String state) {
-               this.state = state;
-           }
-
-           public void setZipCode(String zipCode) {
-               this.zipCode = zipCode;
-           }
-
-           public void setBusinessCountryCode(String businessCountryCode) {
-               this.businessCountryCode = businessCountryCode;
-           }
-
-           public void setCommandChain(String commandChain) {
-               this.commandChain = commandChain;
-           }
-
-           public void setCompany(String company) {
-               this.company = company;
-           }
-
-           public void setCompanyCode(String companyCode) {
-               this.companyCode = companyCode;
-           }
-
-           public void setDepartment(String department) {
-               this.department = department;
-           }
-
-           public void setJobTitle(String jobTitle) {
-               this.jobTitle = jobTitle;
-           }
-
-           public void setLocationClli(String locationClli) {
-               this.locationClli = locationClli;
-           }
-
-           public void setOrgManagerUserId(String orgManagerUserId) {
-               this.orgManagerUserId = orgManagerUserId;
-           }
-
-           public void setZipCodeSuffix(String zipCodeSuffix) {
-               this.zipCodeSuffix = zipCodeSuffix;
-           }
-
-           public void setBusinessCountryName(String businessCountryName) {
-               this.businessCountryName = businessCountryName;
-           }
-
-           public SortedSet<EPRole> getPseudoRoles() {
-                       return pseudoRoles;
-               }
-           
-           public void setPseudoRoles(SortedSet<EPRole> pseudoRoles) {
-               this.pseudoRoles = pseudoRoles;
-           }
-
-           public void setSelectedProfileId(Long selectedProfileId) {
-               this.selectedProfileId = selectedProfileId;
-           }
-           
-               public Long getTimeZoneId() {
-                       return timeZoneId;
-               }
-
-               public void setTimeZoneId(Long timeZoneId) {
-                       this.timeZoneId = timeZoneId;
-               }
-
-               public String getBusinessUnit() {
-                       return businessUnit;
-               }
-
-               public void setBusinessUnit(String businessUnit) {
-                       this.businessUnit = businessUnit;
-               }
-
-               public String getSiloStatus() {
-                       return siloStatus;
-               }
-
-               public void setSiloStatus(String siloStatus) {
-                       this.siloStatus = siloStatus;
-               }
-
-               public String getCostCenter() {
-                       return costCenter;
-               }
-
-               public void setCostCenter(String costCenter) {
-                       this.costCenter = costCenter;
-               }
-
-               public String getFinancialLocCode() {
-                       return financialLocCode;
-               }
-
-               public void setFinancialLocCode(String financialLocCode) {
-                       this.financialLocCode = financialLocCode;
-               }
-               
-               public String getBusinessUnitName() {
-                       return businessUnitName;
-               }
-
-               public void setBusinessUnitName(String businessUnitName) {
-                       this.businessUnitName = businessUnitName;
-               }
-
-               public String getDepartmentName() {
-                       return departmentName;
-               }
-
-               public void setDepartmentName(String departmentName) {
-                       this.departmentName = departmentName;
-               }
-
-               public int compareTo(Object obj){
-             EPUser user = (EPUser)obj;
-
-             String c1 = getLastName() + getFirstName() + getMiddleInitial();
-             String c2 = user.getLastName() + user.getFirstName() + user.getMiddleInitial();
-
-             return c1.compareTo(c2);
-           }
-
-               public boolean isOnline() {
-                       return online;
-               }
-
-               public void setOnline(boolean online) {
-                       this.online = online;
-               }
-
-               public String getChatId() {
-                       return chatId;
-               }
-
-               public void setChatId(String chatId) {
-                       this.chatId = chatId;
-               }
-
-               
-       public void setPseudoEPRoles(SortedSet<EPRole> pseudoRoles) {
-               this.pseudoRoles = pseudoRoles;
-       }
-       
-       public SortedSet<EPUserApp> getEPUserApps() {
-               return userApps;
-       }
-
-       public void setEPUserApps(SortedSet<EPUserApp> userApps) {
-               this.userApps = userApps;
-       }
-
-       public void addUserApp(EPUserApp userApp) {
-               userApps.add(userApp);
-       }
-       
-       public void addAppRoles(EPApp app, SortedSet<EPRole> roles) {
-               if (roles != null) {
-                       // add all
-                       SortedSet<EPUserApp> userApps = new TreeSet<EPUserApp>();
-                       // this.userApps.removeAll(this.userApps);
-                       Iterator<EPRole> itr = roles.iterator();
-                       while (itr.hasNext()) {
-                               EPRole role = (EPRole) itr.next();
-                               EPUserApp userApp = new EPUserApp();
-                               userApp.setUserId(this.id);
-                               userApp.setApp(app);
-                               userApp.setRole(role);
-                               userApps.add(userApp);
-                       }
-                       setEPUserApps(userApps);
-               } else {
-                       // remove all
-                       setEPUserApps(null);
-               }
-
-       }
-
-       public SortedSet<EPRole> getAppEPRoles(EPApp app) {
-               
-               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - app = {}", app.getName());
-               
-               SortedSet<EPRole> roles = new TreeSet<EPRole>();
-               SortedSet<EPUserApp> userAppRoles = getEPUserApps();
-               
-               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - userApps = ", userAppRoles.size());
-
-               Iterator<EPUserApp> userAppRolesIterator = userAppRoles.iterator();
-               EPUserApp userAppRole = null;
-               // getting default app
-               while (userAppRolesIterator.hasNext()) {
-                       EPUserApp tempUserApp = (EPUserApp) userAppRolesIterator.next();
-                       if (tempUserApp.getApp().getId().equals(app.getId())) {
-
-                               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - for user {}, found application {}", this.getFullName(), app.getName());
-                               
-                               userAppRole = tempUserApp;
-                               
-                               EPRole role = userAppRole.getRole();
-                               if(role.getActive()){
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - Role {} is active - adding for user {} and app {}", role.getName(), this.getFullName(), app.getName());
-                                       roles.add((EPRole) role);
-                               }
-                               else{
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - Role {} is NOT active - NOT adding for user {} and app {}", role.getName(), this.getFullName(), app.getName());
-                               }                               
-                       }
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "In EPUser.getAppEPRoles() - roles = ", roles.size());
-
-               return roles;
-       }
-
-       
-       /**
-        * Attention! Not for use in ECOMP
-        */
-       public SortedSet<EPRole> getAppRoles(EPApp app) {
-               SortedSet<EPRole> roles = new TreeSet<EPRole>();
-               SortedSet<EPUserApp> apps = getEPUserApps();
-               Iterator<EPUserApp> appsItr = apps.iterator();
-               EPUserApp userApp = null;
-               // getting default app
-               while (appsItr.hasNext()) {
-                       EPUserApp tempUserApp = (EPUserApp) appsItr.next();
-                       if (tempUserApp.getApp().getId().equals(app.getId())) {
-                               userApp = tempUserApp;
-                               roles.add((EPRole) userApp.getRole());
-                       }
-               }
-               return roles;
-       }
-
-       
-
-       /**
-        * Attention! Not for use in ECOMP
-        */
-       public SortedSet<EPRole> getEPRoles() {
-               EPApp app = new EPApp();
-               app.setId(new Long(PortalConstants.PORTAL_APP_ID));
-               app.setName(ECOMP_PORTAL_NAME);
-               return getAppEPRoles(app);
-       }
-
-       /**
-        * Attention! Not for use in ECOMP
-        */
-       public void setEPRoles(SortedSet<EPRole> roles) {
-               EPApp app = new EPApp();
-               app.setId(new Long(PortalConstants.PORTAL_APP_ID));
-               app.setName(ECOMP_PORTAL_NAME);
-               addAppRoles(app, roles);
-       }
-
-       /**
-        * Attention! Not for use in ECOMP
-        */
-       public void removeEPRole(Long roleId) {
-               SortedSet<EPUserApp> apps = getEPUserApps();
-               Iterator<EPUserApp> appsItr = apps.iterator();
-               // getting default app
-               while (appsItr.hasNext()) {
-                       EPUserApp tempUserApp = (EPUserApp) appsItr.next();
-                       if (tempUserApp.equals(new Long(PortalConstants.PORTAL_APP_ID)) && tempUserApp.getRole().getId().equals(roleId)) {
-                               appsItr.remove();
-                       }
-               }
-       }
-
-       /**
-        * Attention! Not for use in ECOMP
-        */
-       public void addEPRole(EPRole role) {
-               if (role != null) {
-                       SortedSet<EPRole> roles = getEPRoles();
-                       if (roles == null) {
-                               roles = new TreeSet<EPRole>();
-                       }
-                       roles.add(role);
-                       setEPRoles(roles);
-               }
-       }
-       
-       public boolean isGuest() {
-               return isGuest;
-       }
-
-       public void setGuest(boolean isGuest) {
-               this.isGuest = isGuest;
-       }
-
-       @Override
-       public String toString() {
-               return "EPUser [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName + ", middleInitial="
-                               + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", fax=" + fax + ", cellular="
-                               + cellular + ", email=" + email + ", addressId=" + addressId + ", alertMethodCd=" + alertMethodCd
-                               + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", address1=" + address1
-                               + ", address2=" + address2 + ", city=" + city + ", state=" + state + ", zipCode=" + zipCode
-                               + ", country=" + country + ", orgManagerUserId=" + orgManagerUserId + ", locationClli=" + locationClli
-                               + ", businessCountryCode=" + businessCountryCode + ", businessCountryName=" + businessCountryName
-                               + ", businessUnit=" + businessUnit + ", businessUnitName=" + businessUnitName + ", department="
-                               + department + ", departmentName=" + departmentName + ", companyCode=" + companyCode + ", company="
-                               + company + ", zipCodeSuffix=" + zipCodeSuffix + ", jobTitle=" + jobTitle + ", commandChain="
-                               + commandChain + ", siloStatus=" + siloStatus + ", costCenter=" + costCenter + ", financialLocCode="
-                               + financialLocCode + ", loginId=" + loginId + ", loginPwd=" + loginPwd + ", lastLoginDate="
-                               + lastLoginDate + ", active=" + active + ", internal=" + internal + ", selectedProfileId="
-                               + selectedProfileId + ", timeZoneId=" + timeZoneId + ", online=" + online + ", chatId=" + chatId
-                               + ", isGuest=" + isGuest + ", userApps=" + userApps + ", pseudoRoles=" + pseudoRoles + "]";
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserApp.java
deleted file mode 100644 (file)
index 80189dd..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-
-@SuppressWarnings("rawtypes")
-public class EPUserApp implements java.io.Serializable, Comparable {
-
-       private static final long serialVersionUID = 1L;
-       
-       private Long userId;
-       private EPApp app;
-       private EPRole role;
-       private Short priority;
-       
-       public EPUserApp() {
-       }
-       
-       public Long getAppId() {
-               return this.getApp().getId();
-       }
-       
-       public Long getRoleId() {
-               return (role == null) ? null : role.getId();
-       }
-       
-       public Long getAppRoleId() {
-               return (role.getAppRoleId() == null) ? null : role.getAppRoleId();
-       }
-               
-       @Override 
-       public String toString() {
-               String str = "[u: "+getUserId()+"; a: "+getAppId()+", r: "+getRoleId()+"; appRoleId: "+getAppRoleId()+"]";
-               return str;
-       }
-       
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long id) {
-               this.userId = id;
-       }
-
-       public EPApp getApp() {
-               return app;
-       }
-
-       public void setApp(EPApp app) {
-               this.app = app;
-       }
-
-       public EPRole getRole() {
-               return role;
-       }
-
-       public void setRole(EPRole role) {
-               this.role = role;
-       }
-               
-       public Short getPriority() {
-               return this.priority;
-       }
-
-       public void setPriority(Short priority) {
-               this.priority = priority;
-       }
-
-       public boolean equals(Object other) {
-               if ((this == other))
-                       return true;
-               if ((other == null))
-                       return false;
-               if (!(other instanceof EPUserApp))
-                       return false;
-               EPUserApp castOther = (EPUserApp) other;
-
-               return (this.getUserId().equals(castOther.getUserId()))
-                               && (this.getApp().getId().equals(castOther.getApp().getId()))
-                               && (this.getRole().getId().equals(castOther.getRole().getId()))
-                               && ((this.priority==null && castOther.getPriority()==null) || this.getPriority().equals(castOther.getPriority()));
-       }
-
-       public int hashCode() {
-               int result = 17;
-
-               result = 37 * result + (int) (this.getUserId()==null ? 0 : this.getUserId().intValue());
-               result = 37 * result + (int) (this.getApp().getId()==null ? 0 : this.getApp().getId().intValue());
-               result = 37 * result + (int) (this.getRole().getId()==null ? 0 : this.getRole().getId().intValue());
-               result = 37 * result + (int) (this.priority==null ? 0 : this.priority);
-               return result;
-       }
-
-       public int compareTo(Object other){
-           EPUserApp castOther = (EPUserApp) other;
-
-           Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.getApp()==null||this.getApp().getId()==null ? 0 : this.getApp().getId()) + (this.getRole()==null||this.getRole().getId()==null ? 0 : this.getRole().getId()) + (this.priority==null ? 0 : this.priority);
-           Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.getRole()==null||castOther.getRole().getId()==null ? 0 : castOther.getRole().getId()) + (castOther.priority==null ? 0 : castOther.priority);
-
-           return c1.compareTo(c2);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRoles.java
deleted file mode 100644 (file)
index 2074beb..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude
-public class EPUserAppCatalogRoles extends DomainVo {
-
-       private static final long serialVersionUID = -5259869298825093816L;
-
-
-       @Id
-       @Column(name="requested_role_id")
-       public Long requestedRoleId;
-       
-       
-       @Id
-       @Column(name="role_name")
-       public String rolename;
-       
-       @Id
-       @Column(name="request_status")
-       public String requestStatus;
-       
-       @Id
-       @Column(name="app_id")
-       public Long appId;
-
-       public Long getRequestedRoleId() {
-               return requestedRoleId;
-       }
-
-       public void setRequestedRoleId(Long requestedRoleId) {
-               this.requestedRoleId = requestedRoleId;
-       }
-
-       public String getRolename() {
-               return rolename;
-       }
-
-       public void setRolename(String rolename) {
-               this.rolename = rolename;
-       }
-
-       public String getRequestStatus() {
-               return requestStatus;
-       }
-
-       public void setRequestStatus(String requestStatus) {
-               this.requestStatus = requestStatus;
-       }
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String toString() {
-               return "EPUserAppCatalogRoles [requestedRoleId=" + requestedRoleId + ", rolename=" + rolename
-                               + ", requestStatus=" + requestStatus + ", appId=" + appId + "]";
-       }
-
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRoles.java
deleted file mode 100644 (file)
index fe6d197..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class EPUserAppRoles extends DomainVo {
-
-       private static final long serialVersionUID = -1484592641766545668L;
-
-       @Id
-       @Column(name ="role_id")
-       public Long roleId;
-       
-       @Id
-       @Column(name ="app_id")
-       public Long appId;
-       
-       public Long getRoleId() {
-               return roleId;
-       }
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-       public Long getAppId() {
-               return appId;
-       }
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-       
-       @Override
-       public String toString() {
-               return "EpUserAppRoles [roleId=" + roleId + ", appId=" + appId + "]";
-       }
-}
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequest.java
deleted file mode 100644 (file)
index 651ef5e..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Date;
-import java.util.Set;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPUserAppRolesRequest extends DomainVo {
-
-       private static final long serialVersionUID = -7225288307806389019L;
-       private Long userId;
-       private Long appId;
-       private Date createdDate;
-       private Date updatedDate;
-       private String requestStatus;
-
-       private Set<EPUserAppRolesRequestDetail> epRequestIdDetail;
-
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public Date getCreatedDate() {
-               return createdDate;
-       }
-
-       public void setCreatedDate(Date createdDate) {
-               this.createdDate = createdDate;
-       }
-
-       public Date getUpdatedDate() {
-               return updatedDate;
-       }
-
-       public void setUpdatedDate(Date updatedDate) {
-               this.updatedDate = updatedDate;
-       }
-
-       public String getRequestStatus() {
-               return requestStatus;
-       }
-
-       public void setRequestStatus(String requestStatus) {
-               this.requestStatus = requestStatus;
-       }
-
-       public Set<EPUserAppRolesRequestDetail> getEpRequestIdDetail() {
-               return epRequestIdDetail;
-       }
-
-       public void setEpRequestIdDetail(Set<EPUserAppRolesRequestDetail> epMyLoginsDetail) {
-               this.epRequestIdDetail = epMyLoginsDetail;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
-               result = prime * result + ((epRequestIdDetail == null) ? 0 : epRequestIdDetail.hashCode());
-               result = prime * result + ((requestStatus == null) ? 0 : requestStatus.hashCode());
-               result = prime * result + ((updatedDate == null) ? 0 : updatedDate.hashCode());
-               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               EPUserAppRolesRequest other = (EPUserAppRolesRequest) obj;
-               if (appId == null) {
-                       if (other.appId != null)
-                               return false;
-               } else if (!appId.equals(other.appId))
-                       return false;
-               if (createdDate == null) {
-                       if (other.createdDate != null)
-                               return false;
-               } else if (!createdDate.equals(other.createdDate))
-                       return false;
-               if (epRequestIdDetail == null) {
-                       if (other.epRequestIdDetail != null)
-                               return false;
-               } else if (!epRequestIdDetail.equals(other.epRequestIdDetail))
-                       return false;
-               if (requestStatus == null) {
-                       if (other.requestStatus != null)
-                               return false;
-               } else if (!requestStatus.equals(other.requestStatus))
-                       return false;
-               if (updatedDate == null) {
-                       if (other.updatedDate != null)
-                               return false;
-               } else if (!updatedDate.equals(other.updatedDate))
-                       return false;
-               if (userId == null) {
-                       if (other.userId != null)
-                               return false;
-               } else if (!userId.equals(other.userId))
-                       return false;
-               return true;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetail.java
deleted file mode 100644 (file)
index 8bf83a3..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPUserAppRolesRequestDetail extends DomainVo {
-
-       private static final long serialVersionUID = -4908856671135348157L;
-
-       private Long reqRoleId;
-       private String reqType;
-       private EPUserAppRolesRequest epRequestIdData;
-
-       public EPUserAppRolesRequest getEpRequestIdData() {
-               return epRequestIdData;
-       }
-
-       public void setEpRequestIdData(EPUserAppRolesRequest epRequestIdData) {
-               this.epRequestIdData = epRequestIdData;
-       }
-
-       public Long getReqRoleId() {
-               return reqRoleId;
-       }
-
-       public void setReqRoleId(Long reqRoleId) {
-               this.reqRoleId = reqRoleId;
-       }
-
-       public String getReqType() {
-               return reqType;
-       }
-
-       public void setReqType(String reqType) {
-               this.reqType = reqType;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((epRequestIdData == null) ? 0 : epRequestIdData.hashCode());
-               result = prime * result + ((reqRoleId == null) ? 0 : reqRoleId.hashCode());
-               result = prime * result + ((reqType == null) ? 0 : reqType.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               EPUserAppRolesRequestDetail other = (EPUserAppRolesRequestDetail) obj;
-               if (epRequestIdData == null) {
-                       if (other.epRequestIdData != null)
-                               return false;
-               } else if (!epRequestIdData.equals(other.epRequestIdData))
-                       return false;
-               if (reqRoleId == null) {
-                       if (other.reqRoleId != null)
-                               return false;
-               } else if (!reqRoleId.equals(other.reqRoleId))
-                       return false;
-               if (reqType == null) {
-                       if (other.reqType != null)
-                               return false;
-               } else if (!reqType.equals(other.reqType))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreference.java
deleted file mode 100644 (file)
index 0d7ee8f..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPUserAppsManualSortPreference extends DomainVo {
-
-       private static final long serialVersionUID = -6270136291139278216L;
-       private int userId;
-       private Long appId;
-       private int appManualSortOrder;
-       
-       public int getUserId() {
-               return userId;
-       }
-       public void setUserId(int userId) {
-               this.userId = userId;
-       }
-       public Long getAppId() {
-               return appId;
-       }
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-       public int getAppManualSortOrder() {
-               return appManualSortOrder;
-       }
-       public void setAppManualSortOrder(int appManualSortOrder) {
-               this.appManualSortOrder = appManualSortOrder;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreference.java
deleted file mode 100644 (file)
index 7d0a860..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPUserAppsSortPreference extends DomainVo{
-
-       private static final long serialVersionUID = -5267000174894006433L;
-
-       private int userId;
-       private String sortPref;
-       
-       public int getUserId() {
-               return userId;
-       }
-       public void setUserId(final int userId) {
-               this.userId = userId;
-       }
-       public String getSortPref() {
-               return sortPref;
-       }
-       public void setSortPref(final String sortPref) {
-               this.sortPref = sortPref;
-       }
-               
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPUserNotification.java
deleted file mode 100644 (file)
index 993c7db..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-
-public class EPUserNotification extends DomainVo {     
-       private Long userId;
-       private Long notificationId;
-       private String viewed;
-       private Date updateTime;
-       
-       public Long getUserId() {
-               return userId;
-       }
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-       public Long getNotificationId() {
-               return notificationId;
-       }
-       public void setNotificationId(Long notificationId) {
-               this.notificationId = notificationId;
-       }
-       public String getViewed() {
-               return viewed;
-       }
-       public void setViewed(String viewed) {
-               this.viewed = viewed;
-       }
-       public Date getUpdateTime() {
-               return updateTime;
-       }
-       public void setUpdateTime(Date updateTime) {
-               this.updateTime = updateTime;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreference.java
deleted file mode 100644 (file)
index 1c515d6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class EPWidgetsManualSortPreference extends DomainVo{
-
-       private static final long serialVersionUID = 4607102334801223570L;
-       private int userId;
-       private Long widgetId;
-       private int widgetRow;
-       private int widgetCol;
-       private int widgetWidth;
-       private int widgetHeight;
-
-       public int getUserId() {
-               return userId;
-       }
-       public void setUserId(int userId) {
-               this.userId = userId;
-       }
-       public Long getWidgetId() {
-               return widgetId;
-       }
-       public void setWidgetId(Long widgetId) {
-               this.widgetId = widgetId;
-       }
-       public int getWidgetRow() {
-               return widgetRow;
-       }
-       public void setWidgetRow(int widgetRow) {
-               this.widgetRow = widgetRow;
-       }
-       public int getWidgetCol() {
-               return widgetCol;
-       }
-       public void setWidgetCol(int widgetCol) {
-               this.widgetCol = widgetCol;
-       }
-       public int getWidgetWidth() {
-               return widgetWidth;
-       }
-       public void setWidgetWidth(int widgetWidth) {
-               this.widgetWidth = widgetWidth;
-       }
-       public int getWidgetHeight() {
-               return widgetHeight;
-       }
-       public void setWidgetHeight(int widgetHeight) {
-               this.widgetHeight = widgetHeight;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompApp.java
deleted file mode 100644 (file)
index 30be688..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-/**
- * Model for a subset of the columns in the fn_app table.
- */
-public class EcompApp {
-       
-       protected Long id;
-
-       public Long getId() {
-               return id;
-       }
-       
-       public void setId(Long id) {
-               this.id = id;
-       }
-       
-    private String name;
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-       
-       private String imageUrl;
-
-       public String getImageUrl() {
-               return imageUrl;
-       }
-
-       public void setImageUrl(String imageUrl) {
-               this.imageUrl = imageUrl;
-       }
-       
-       private String description;
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-       
-       private String notes;
-
-       public String getNotes() {
-               return notes;
-       }
-
-       public void setNotes(String notes) {
-               this.notes = notes;
-       }       
-
-       private String url;
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       private String alternateUrl;
-
-       public String getAlternateUrl() {
-               return alternateUrl;
-       }
-
-       public void setAlternateUrl(String alternateUrl) {
-               this.alternateUrl = alternateUrl;
-       }
-       
-       private String uebTopicName;
-       
-       public String getUebTopicName() {
-               return uebTopicName;
-       }
-       
-       public void setUebTopicName(String topicName) {
-               this.uebTopicName = topicName;
-       }
-       
-       private String uebKey;
-       
-       public String getUebKey() {
-               return uebKey;
-       }
-       
-       public void setUebKey(String uebKey) {
-               this.uebKey = uebKey;
-       }
-       
-       private String uebSecret;
-       
-       public String getUebSecret() {
-               return uebSecret;
-       }
-       
-       public void setUebSecret(String secret) {
-               this.uebSecret = secret;
-       }
-       
-       private Boolean enabled;
-       
-       public Boolean isEnabled() {
-               return enabled;
-       }
-       
-       public void setEnabled(Boolean enable) {
-               this.enabled = enable;
-       }
-
-       private Boolean restrictedApp;
-       
-       public Boolean isRestrictedApp() {
-               return restrictedApp;
-       }
-       
-       public void setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-
-       private Boolean centralAuth;
-
-       public Boolean getCentralAuth() {
-               return centralAuth;
-       }
-
-       public void setCentralAuth(Boolean centralAuth) {
-               this.centralAuth = centralAuth;
-       }
-
-       private String nameSpace;
-       
-       public String getNameSpace() {
-               return nameSpace;
-       }
-
-       public void setNameSpace(String nameSpace) {
-               this.nameSpace = nameSpace;
-       }
-
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRole.java
deleted file mode 100644 (file)
index e60b220..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
-
-@Entity
-@IdClass(EcompAppRoleId.class)
-public class EcompAppRole {
-
-       @Id
-       @Column(name="app_id")
-       private Long appId;
-       @Id
-       @Column(name="app_name")
-       private String appName; 
-       
-       @Id
-       @Column(name="role_id")
-       private Integer roleId;
-       
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-
-       public Integer getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Integer roleId) {
-               this.roleId = roleId;
-       }
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAppRoleId.java
deleted file mode 100644 (file)
index c61052d..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-
-public class EcompAppRoleId implements Serializable{
-       
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name="app_id")
-       private Long appId;
-       @Id
-       @Column(name="app_name")
-       private String appName; 
-       
-       @Id
-       @Column(name="role_id")
-       private Integer roleId;
-       
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-
-       public Integer getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Integer roleId) {
-               this.roleId = roleId;
-       }
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/EcompAuditLog.java
deleted file mode 100644 (file)
index 517b917..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.domain.AuditLog;
-
-public class EcompAuditLog extends AuditLog {
-
-       private static final long serialVersionUID = 7970458389782626231L;
-       
-       // values of activity_cd column in table fu_lu_activity
-       // as loaded by DML sql script
-       public static final String CD_ACTIVITY_ADD_CHILD_ROLE = "add_child_role";
-       public static final String CD_ACTIVITY_ADD_ROLE = "add_role";
-       public static final String CD_ACTIVITY_ADD_ROLE_FUNCTION = "add_role_function";
-       public static final String CD_ACTIVITY_ADD_USER_ROLE = "add_user_role";
-       public static final String CD_ACTIVITY_APP_ACCESS = "app_access";
-       public static final String CD_ACTIVITY_FUNCTIONAL_ACCESS = "functional_access";
-       public static final String CD_ACTIVITY_GUEST_LOGIN = "guest_login";
-       public static final String CD_ACTIVITY_LOGIN = "login";
-       public static final String CD_ACTIVITY_LOGOUT = "logout";
-       public static final String CD_ACTIVITY_MOBILE_LOGIN = "mobile_login";
-       public static final String CD_ACTIVITY_MOBILE_LOGOUT = "mobile_logout";
-       public static final String CD_ACTIVITY_REMOVE_CHILD_ROLE = "remove_child_role";
-       public static final String CD_ACTIVITY_REMOVE_ROLE = "remove_role";
-       public static final String CD_ACTIVITY_REMOVE_ROLE_FUNCTION = "remove_role_function";
-       public static final String CD_ACTIVITY_REMOVE_USER_ROLE = "remove_user_role";
-       public static final String CD_ACTIVITY_TAB_ACCESS = "tab_access";
-       public static final String CD_ACTIVITY_SEARCH = "search";
-       public static final String CD_ACTIVITY_ADD_PORTAL_ADMIN = "apa ";
-       public static final String CD_ACTIVITY_DELETE_PORTAL_ADMIN = "dpa";
-       public static final String CD_ACTIVITY_UPDATE_USER = "uu ";
-       public static final String CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN = "uaa ";
-       public static final String CD_ACTIVITY_STORE_ANALYTICS = "store_analytics";
-       public static final String CD_ACTIVITY_EXTERNAL_AUTH_ADD_ROLE = "eaar";
-       public static final String CD_ACTIVITY_EXTERNAL_AUTH_ADD_FUNCTION = "eaaf";
-       public static final String CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_FUNCTION = "eauf";
-       public static final String CD_ACTIVITY_EXTERNAL_AUTH_UPDATE_ROLE_AND_FUNCTION = "eaurf";
-       public static final String CD_ACTIVITY_EXTERNAL_AUTH_DELETE_ROLE = "eadr";
-       public static final String CD_ACTIVITY_EXTERNAL_AUTH_DELETE_FUNCTION = "eadf";
-       /**
-        * Creates a new object with the created field set to the current date-time.
-        */
-       public EcompAuditLog() {
-               setCreated(new Date());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalRoleDetails.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalRoleDetails.java
deleted file mode 100644 (file)
index 2ba6a57..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.List;
-
-public class ExternalRoleDetails implements Comparable {
-
-       
-       private String  name;
-    private boolean active;
-    private Integer priority;
-    
-    private Long appId;     // used by ECOMP only 
-    private Long appRoleId; // used by ECOMP only
-
-       private List<EPAppRoleFunction> perms;
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public boolean isActive() {
-               return active;
-       }
-
-       public void setActive(boolean active) {
-               this.active = active;
-       }
-
-       public Integer getPriority() {
-               return priority;
-       }
-
-       public void setPriority(Integer priority) {
-               this.priority = priority;
-       }
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public Long getAppRoleId() {
-               return appRoleId;
-       }
-
-       public void setAppRoleId(Long appRoleId) {
-               this.appRoleId = appRoleId;
-       }
-
-
-
-       public List<EPAppRoleFunction> getPerms() {
-               return perms;
-       }
-
-       public void setPerms(List<EPAppRoleFunction> perms) {
-               this.perms = perms;
-       }
-
-       @Override
-       public int compareTo(Object obj) {
-               EPRole other = (EPRole)obj;
-
-       String c1 = getName();
-       String c2 = other.getName();
-
-       return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
-       }
-
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccess.java
deleted file mode 100644 (file)
index b4c0895..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-public class ExternalSystemAccess {
-       
-       private String key;
-       private Boolean accessValue;
-               
-       public ExternalSystemAccess(String key, Boolean accessValue){
-               this.key = key;
-               this.accessValue = accessValue;
-       }
-       
-       public String getKey() {
-               return key;
-       }
-       public void setKey(String key) {
-               this.key = key;
-       }
-
-       public Boolean getAccessValue() {
-               return accessValue;
-       }
-
-       public void setAccessValue(Boolean accessValue) {
-               this.accessValue = accessValue;
-       }
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppID.java
deleted file mode 100644 (file)
index 5087d02..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.List;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Transient;
-/***
- * 
- * This class is almost identical to org.openecomp.portalapp.portal.transport.FunctionalMenuItem
- * The only difference is the appId field. In FunctionMenuItem, we used @Transient as an attribute, and we are using @Column in this class.
- * In some sql queries, we need to have appId, but it's not a field in fn_menu_functional table.
- * 
- * @author robertlo
- *
- */
-@Entity
-public class FunctionalMenuItemWithAppID{
-       private static final long serialVersionUID = 1L;
-
-       @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-       @Column(name = "MENU_ID")
-       public Long menuId;
-       
-       @Column(name = "COLUMN_NUM")
-       public Integer column;
-       
-       @Column(name = "TEXT")
-       public String text;
-       
-       @Column(name = "PARENT_MENU_ID")
-       public Integer parentMenuId;
-       
-       @Column(name = "URL")
-       public String url;
-       
-       @Column(name="ACTIVE_YN")
-       public String active_yn;
-
-       @Column(name="APP_ID")
-       public Integer appid;
-       
-       @Transient
-       public List<Integer> roles;
-       
-       @Transient
-       public Boolean restrictedApp;
-       
-       public void normalize() {
-               if (this.column == null)
-                       this.column = new Integer(1);
-               this.text = (this.text == null) ? "" : this.text.trim();
-               if (this.parentMenuId == null)
-                       this.parentMenuId = new Integer(-1);
-               this.url = (this.url == null) ? "" : this.url.trim();
-       }
-
-       @Override
-       public String toString() {
-               return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
-                               + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
-                               + ", restrictedApp=" + restrictedApp + "]";
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public void setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-}
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResult.java
deleted file mode 100644 (file)
index 5c43de2..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude
-public class GetAccessResult implements Serializable{
-
-
-       private static final long serialVersionUID = 5239527705869613411L;
-
-       @Id
-       @Column(name="row_id")
-       private String rowId;
-       
-       @Column(name="role_id")
-       private Long roleId;
-       
-       @Column(name="ecomp_function",nullable=true)
-       private String ecompFunction;
-       
-       @Column(name="app_name")
-       private String appName; 
-       
-       @Column(name="app_mots_id",nullable=true)
-       private Integer appMotsId;
-       
-       @Column(name="role_name")
-       private String roleName;
-       
-       @Column(name="role_actv",nullable=true)
-       private String roleActive;
-       
-       
-       @Column(name="request_type",nullable=true)
-       private String reqType;
-       
-       
-       
-       public String getRowId() {
-               return rowId;
-       }
-       public void setRowId(String rowId) {
-               this.rowId = rowId;
-       }
-       public Long getRoleId() {
-               return roleId;
-       }
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       } 
-       public String getEcompFunction() {
-               return ecompFunction;
-       }
-       public void setEcompFunction(String ecompFunction) {
-               this.ecompFunction = ecompFunction;
-       }
-       public String getAppName() {
-               return appName;
-       }
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-       public Integer getAppMotsId() {
-               return appMotsId;
-       }
-       public void setAppMotsId(Integer appMotsId) {
-               this.appMotsId = appMotsId;
-       }
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       public String getRoleActive() {
-               return roleActive;
-       }
-       public void setRoleActive(String roleActive) {
-               this.roleActive = roleActive;
-       }
-       public String getReqType() {
-               return reqType;
-       }
-       public void setReqType(String reqType) {
-               this.reqType = reqType;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/GetAccessResultId.java
deleted file mode 100644 (file)
index df7faac..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-
-public class GetAccessResultId implements Serializable{
-       
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name="ecomp_function")
-       private String ecompFunction;
-
-       @Id
-       @Column(name="app_name")
-       private String appName; 
-       
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-       
-       public String getEcompFunction() {
-               return ecompFunction;
-       }
-       public void setEcompFunction(String ecompFunction) {
-               this.ecompFunction = ecompFunction;
-       }
-       public String getAppName() {
-               return appName;
-       }
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceData.java
deleted file mode 100644 (file)
index d99523a..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.List;
-
-import javax.persistence.Column;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class MicroserviceData extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-
-       public MicroserviceData() {
-
-       }
-
-       private Long id;
-
-       private String name;
-
-       private String active;
-
-       private String desc;
-
-       private long appId;
-
-       private String url;
-
-       private String securityType;
-
-       private String username;
-
-       private String password;
-
-       private List<MicroserviceParameter> parameterList;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getActive() {
-               return active;
-       }
-
-       public void setActive(String active) {
-               this.active = active;
-       }
-
-       public String getDesc() {
-               return desc;
-       }
-
-       public void setDesc(String desc) {
-               this.desc = desc;
-       }
-
-       public long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(long appId) {
-               this.appId = appId;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getSecurityType() {
-               return securityType;
-       }
-
-       public void setSecurityType(String securityType) {
-               this.securityType = securityType;
-       }
-
-       public String getUsername() {
-               return username;
-       }
-
-       public void setUsername(String username) {
-               this.username = username;
-       }
-
-       public String getPassword() {
-               return password;
-       }
-
-       public void setPassword(String password) {
-               this.password = password;
-       }
-
-       public List<MicroserviceParameter> getParameterList() {
-               return parameterList;
-       }
-
-       public void setParameterList(List<MicroserviceParameter> parameterList) {
-               this.parameterList = parameterList;
-       }
-
-       @Override
-       public String toString() {
-               return "MicroserviceData [id=" + id + ", name=" + name + ", desc=" + desc + ", appId=" + appId + ", url=" + url
-                               + ", securityType=" + securityType + ", username=" + username + ", password=" + password
-                               + ", parameterList=" + parameterList + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/MicroserviceParameter.java
deleted file mode 100644 (file)
index 8ed012e..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class MicroserviceParameter extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-
-       public MicroserviceParameter() {
-
-       }
-
-       private Long id;
-
-       private long serviceId;
-
-       private String para_key;
-
-       private String para_value;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public long getServiceId() {
-               return serviceId;
-       }
-
-       public void setServiceId(long serviceId) {
-               this.serviceId = serviceId;
-       }
-
-       public String getPara_key() {
-               return para_key;
-       }
-
-       public void setPara_key(String para_key) {
-               this.para_key = para_key;
-       }
-
-       public String getPara_value() {
-               return para_value;
-       }
-
-       public void setPara_value(String para_value) {
-               this.para_value = para_value;
-       }
-
-       @Override
-       public String toString() {
-               return "MicroserviceParameter [id=" + id + ", serviceId=" + serviceId + ", para_key=" + para_key
-                               + ", para_value=" + para_value + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserAppSelection.java
deleted file mode 100644 (file)
index 6dbc5d3..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-/**
- * Models a row in the table with personalization of user app selections.
- */
-public class PersUserAppSelection extends DomainVo {
-
-       private static final long serialVersionUID = 1545308654500121206L;
-
-       private Long userId;
-
-       private Long appId;
-
-       private String statusCode;
-
-       public PersUserAppSelection() {}
-       
-       /**
-        * Convenience constructor
-        * 
-        * @param id
-        * @param userId
-        * @param appId
-        * @param statusCode
-        */
-       public PersUserAppSelection(final Long id, final Long userId, final Long appId, final String statusCode) {
-               super.id = id;
-               this.userId = userId;
-               this.appId = appId;
-               this.statusCode = statusCode;
-       }
-       
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-
-       public String getStatusCode() {
-               return statusCode;
-       }
-
-       public void setStatusCode(String statusCode) {
-               this.statusCode = statusCode;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
-               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               PersUserAppSelection other = (PersUserAppSelection) obj;
-               if (appId == null) {
-                       if (other.appId != null)
-                               return false;
-               } else if (!appId.equals(other.appId))
-                       return false;
-               if (statusCode == null) {
-                       if (other.statusCode != null)
-                               return false;
-               } else if (!statusCode.equals(other.statusCode))
-                       return false;
-               if (userId == null) {
-                       if (other.userId != null)
-                               return false;
-               } else if (!userId.equals(other.userId))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelection.java
deleted file mode 100644 (file)
index f049a52..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-/**
- * Models a row in the table with personalization of user widget selections.
- */
-public class PersUserWidgetSelection extends DomainVo {
-
-       /**
-        * 
-        */
-       private static final long serialVersionUID = -6547880514779039200L;
-
-       private Long userId;
-
-       private Long widgetId;
-
-       private String statusCode;
-
-       public PersUserWidgetSelection() {}
-       
-       /**
-        * Convenience constructor
-        * 
-        * @param id
-        * @param userId
-        * @param widgetId
-        * @param statusCode
-        */
-       public PersUserWidgetSelection(final Long id, final Long userId, final Long widgetId, final String statusCode) {
-               super.id = id;
-               this.userId = userId;
-               this.widgetId = widgetId;
-               this.statusCode = statusCode;
-       }
-       
-       public Long getWidgetId() {
-               return widgetId;
-       }
-
-       public void setWidgetId(Long widgetId) {
-               this.widgetId = widgetId;
-       }
-
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-
-       public String getStatusCode() {
-               return statusCode;
-       }
-
-       public void setStatusCode(String statusCode) {
-               this.statusCode = statusCode;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((statusCode == null) ? 0 : statusCode.hashCode());
-               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
-               result = prime * result + ((widgetId == null) ? 0 : widgetId.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               PersUserWidgetSelection other = (PersUserWidgetSelection) obj;
-               if (statusCode == null) {
-                       if (other.statusCode != null)
-                               return false;
-               } else if (!statusCode.equals(other.statusCode))
-                       return false;
-               if (userId == null) {
-                       if (other.userId != null)
-                               return false;
-               } else if (!userId.equals(other.userId))
-                       return false;
-               if (widgetId == null) {
-                       if (other.widgetId != null)
-                               return false;
-               } else if (!widgetId.equals(other.widgetId))
-                       return false;
-               return true;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/RoleApp.java
deleted file mode 100644 (file)
index 8b3f2a8..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-//@Entity
-//@Table(name = "FN_ROLE")
-public class RoleApp implements Serializable{
-       private static final long serialVersionUID = 1L;
-
-       //@Id
-       //@Column(name = "ROLE_ID")
-       //@GeneratedValue(strategy=GenerationType.AUTO)
-       private Long roleId;
-       
-       
-       //@Column(name = "ROLE_Name")
-       private String roleName;
-       
-       //@ManyToOne(fetch = FetchType.EAGER)
-       //@JoinColumn(name="APP_ID")
-       private App app;
-       
-       //@JsonIgnore
-       //@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
-       private Set<WidgetCatalog> widgets;
-
-       /*@PreRemove
-       private void removeGroupsFromUsers() {
-           for (WidgetCatalog w : widgets) {
-               w.getWidgetRoles().remove(this);
-           }
-       }*/
-       
-       /*@ManyToOne
-       @JoinColumn(name = "WIDGET_ID", nullable = false)
-       WidgetCatalog widgetCatalog;*/
-
-       //@JsonIgnore
-       //@ManyToMany(mappedBy = "widgetRoles")
-       //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
-       //private Set<WidgetCatalog> widgets  = new HashSet<WidgetCatalog>();
-       
-       public Long getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-
-       public App getApp() {
-               return app;
-       }
-
-       public void setApp(App app) {
-               this.app = app;
-       }
-       
-       
-
-       public Set<WidgetCatalog> getWidgets() {
-               return widgets;
-       }
-
-       public void setWidgets(Set<WidgetCatalog> widgets) {
-               this.widgets = widgets;
-       }
-
-       @Override
-       public String toString() {
-               return "Role [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/SharedContext.java
deleted file mode 100644 (file)
index 710e910..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.Date;
-
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-/**
- * A shared context is a key-value pair in a session. All shared-context objects
- * should be dropped when a session is destroyed. Because there's always a
- * chance of missing that event, this object notes its creation time so that it
- * can be expired after a suitable time interval.
- */
-@Entity
-@Table(name = "fn_shared_context")
-public class SharedContext extends DomainVo {
-
-       // generated
-       private static final long serialVersionUID = 7287469622586677888L;
-
-       @Id
-       @GeneratedValue(strategy = GenerationType.AUTO)
-       private Long id;
-       private Date create_time;
-       private String context_id;
-       private String ckey;
-       private String cvalue;
-
-       /**
-        * Mandatory no-argument constructor
-        */
-       public SharedContext() {
-       }
-
-       /**
-        * Convenience constructor. The database ID and creation timestamp are
-        * populated when the object is added to the database.
-        * 
-        * @param contextId
-        *            context ID
-        * @param key
-        *            context key
-        * @param value
-        *            context value
-        */
-       public SharedContext(final String contextId, final String key, final String value) {
-               this.context_id = contextId;
-               this.ckey = key;
-               this.cvalue = value;
-       }
-
-       /**
-        * Gets the database row ID.
-        * 
-        * @return Database row ID
-        */
-       public Long getId() {
-               return id;
-       }
-
-       /**
-        * Sets the database row ID.
-        * 
-        * @param id
-        *            database row ID
-        */
-       public void setId(final Long id) {
-               this.id = id;
-       }
-
-       /**
-        * Gets the creation time
-        * 
-        * @return Creation time as a Date
-        */
-       public Date getCreate_time() {
-               return create_time;
-       }
-
-       /**
-        * Sets the creation time
-        * 
-        * @param create_time
-        *            Date
-        */
-       public void setCreate_time(final Date create_time) {
-               this.create_time = create_time;
-       }
-
-       /**
-        * Gets the context ID
-        * 
-        * @return Context ID
-        */
-       public String getContext_id() {
-               return context_id;
-       }
-
-       /**
-        * Sets the context ID
-        * 
-        * @param context_id
-        *            String
-        */
-       public void setContext_id(final String context_id) {
-               this.context_id = context_id;
-       }
-
-       /**
-        * Gets the key of the key-value pair. Called ckey because "key" is a
-        * reserved word in Mysql.
-        * 
-        * @return The key
-        */
-       public String getCkey() {
-               return ckey;
-       }
-
-       /**
-        * Sets the key of the key-value pair.
-        * 
-        * @param ckey
-        *            String
-        */
-       public void setCkey(final String ckey) {
-               this.ckey = ckey;
-       }
-
-       /**
-        * Gets the value of the key-value pair. Called cvalue because "value" is a
-        * reserved word in Mysql.
-        * 
-        * @return value
-        */
-       public String getCvalue() {
-               return cvalue;
-       }
-
-       /**
-        * Sets the value of the key-value pair.
-        * 
-        * @param cvalue
-        *            value
-        */
-       public void setCvalue(final String cvalue) {
-               this.cvalue = cvalue;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserIdRoleId.java
deleted file mode 100644 (file)
index 9d59bf3..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class UserIdRoleId implements Serializable{
-       
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name="USER_ID")
-       private String user_Id;
-       
-       @Column(name="ROLE_ID")
-       private String roleId;
-       
-       @Column(name="ORG_USER_ID")
-       private String orgUserId;
-       
-       @Column(name="APP_ID")
-       private String appId;
-
-       public String getUser_Id() {
-               return user_Id;
-       }
-
-       public void setUser_Id(String id) {
-               this.user_Id = id;
-       }
-
-       public String getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(String roleId) {
-               this.roleId = roleId;
-       }
-       
-       public String getAppId() {
-               return appId;
-       }
-
-       public void setAppId(String appId) {
-               this.appId = appId;
-       }
-       
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRole.java
deleted file mode 100644 (file)
index 38b74a5..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class UserRole implements Serializable{
-       private static final long serialVersionUID = 1L;
-       
-       
-       @Id
-       @Column(name="USER_ID")
-       private Long user_Id;
-       
-       @Id
-       @Column(name="ROLE_ID")
-       private Long roleId;
-       
-       @Column(name="ORG_USER_ID")
-       private String orgUserId;
-
-       
-       @Column(name="FIRST_NAME")
-       private String firstName;
-       
-       @Column(name="LAST_NAME")
-       private String lastName;
-
-       
-       @Column(name="ROLE_NAME")
-       private String roleName; 
-       
-       public String getFirstName() {
-               return firstName;
-       }
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-       public String getLastName() {
-               return lastName;
-       }
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       public Long getUser_Id() {
-               return user_Id;
-       }
-       public void setUser_Id(Long user_Id) {
-               this.user_Id = user_Id;
-       }
-       public Long getRoleId() {
-               return roleId;
-       }
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/UserRoles.java
deleted file mode 100644 (file)
index 578292a..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-
-public class UserRoles implements Serializable {
-       private static final long serialVersionUID = 1L;
-
-       /* 
-       private static final HashMap<Long, String> rolesDictionary;
-       // remove hard coded roles
-       static {
-               rolesDictionary = new HashMap<Long, String>();
-               rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID)).longValue(), "superAdmin");
-               rolesDictionary.put(Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID)).longValue(), "admin");
-       }
-       */
-
-       public UserRoles(UserRole user) {
-               setOrgUserId(user.getOrgUserId());
-               setFirstName(user.getFirstName());
-               setLastName(user.getLastName());
-               setGuestSession(user.getUser_Id()==-1 ? true : false);
-
-               addRole(user.getRoleName());
-       }
-
-       public void addRole(String roleName) {
-               //String normalizedRole = normalizeRole(roleId);
-               if (!getRoles().contains(roleName)) {
-                       this.roles.add(roleName);
-               }
-       }
-
-       /*
-       public static String normalizeRole(Long role) {
-               String roleTranslated = rolesDictionary.get(role);
-               return roleTranslated == null ? "user" : roleTranslated;
-       }
-       */
-
-       private String orgUserId;
-       private String firstName;
-       private String lastName;
-       private boolean guestSession;
-
-       // TODO: Make into set
-       private List<String> roles = new ArrayList<String>();
-
-       public String getFirstName() {
-               return firstName;
-       }
-
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-
-       public String getLastName() {
-               return lastName;
-       }
-
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-
-       public List<String> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<String> roles) {
-               this.roles = roles;
-       }
-
-       public void setGuestSession(boolean guestSession) {
-               this.guestSession = guestSession;
-       }
-
-       public boolean getGuestSession() {
-               return this.guestSession;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/Widget.java
deleted file mode 100644 (file)
index 33f2df8..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.apache.commons.lang.StringUtils;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class Widget extends DomainVo {
-
-       private static final long serialVersionUID = 1L;
-
-       private String name;
-
-       private Integer width;
-
-       private Integer height;
-
-       private String url;
-
-       private Long appId;
-
-       public Widget() {
-               // Attention!!!
-               // We set here all default values. We also place protection
-               // into setters for fields with default values.
-               // If we don't use such protection we are able to place null
-               // to these fields and save such fields into DB even if DB has
-               // default values for these fields.
-               this.name = "";
-               this.width = new Integer(0);
-               this.height = new Integer(0);
-               this.url = "";
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               if (StringUtils.isEmpty(name)) {
-                       name = "";
-               }
-               this.name = name;
-       }
-
-       public Integer getWidth() {
-               return width;
-       }
-
-       public void setWidth(Integer width) {
-               if (width == null) {
-                       width = new Integer(0);
-               }
-               this.width = width;
-       }
-
-       public Integer getHeight() {
-               return height;
-       }
-
-       public void setHeight(Integer height) {
-               if (height == null) {
-                       height = new Integer(0);
-               }
-               this.height = height;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               if (StringUtils.isEmpty(url)) {
-                       url = "";
-               }
-               this.url = url;
-       }
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalog.java
deleted file mode 100644 (file)
index edf6eb8..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.io.Serializable;
-import java.util.Set;
-
-public class WidgetCatalog implements Serializable{
-
-       private static final long serialVersionUID = 1L;
-
-       private long id;
-       
-       private String name;
-       
-       private String desc;
-       
-       private String fileLocation;
-       
-       private String allowAllUser;
-       
-       private Long serviceId;
-       
-       private String sortOrder;
-
-       private String statusCode;
-       
-       private Set<RoleApp> widgetRoles;
-       
-       public long getId() {
-               return id;
-       }
-       public void setId(long id) {
-               this.id = id;
-       }
-       public String getName() {
-               return name;
-       }
-       public void setName(String name) {
-               this.name = name;
-       }
-       
-       public Long getServiceId() {
-               return serviceId;
-       }
-       public void setServiceId(Long serviceId) {
-               this.serviceId = serviceId;
-       }
-       public String getDesc() {
-               return desc;
-       }
-       public void setDesc(String desc) {
-               this.desc = desc;
-       }
-       public String getFileLocation() {
-               return fileLocation;
-       }
-       public void setFileLocation(String fileLocation) {
-               this.fileLocation = fileLocation;
-       }
-       
-       public String getAllowAllUser() {
-               return allowAllUser;
-       }
-       public void setAllowAllUser(String allowAllUser) {
-               this.allowAllUser = allowAllUser;
-       }
-       public Set<RoleApp> getWidgetRoles() {
-               return widgetRoles;
-       }
-       public void setWidgetRoles(Set<RoleApp> widgetRoles) {
-               this.widgetRoles = widgetRoles;
-       }
-       
-       public String getSortOrder() {
-               return sortOrder;
-       }
-       public void setSortOrder(String sortOrder) {
-               this.sortOrder = sortOrder;
-       }
-       public String getStatusCode() {
-               return statusCode;
-       }
-       public void setStatusCode(String statusCode) {
-               this.statusCode = statusCode;
-       }
-       @Override
-       public String toString() {
-               return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation
-                               + ", allowAllUser=" + allowAllUser + "]";
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameter.java
deleted file mode 100644 (file)
index 18833f6..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-public class WidgetCatalogParameter extends DomainVo{
-       
-       private static final long serialVersionUID = 1L;
-
-       public WidgetCatalogParameter() {
-
-       }
-       private Long id;
-
-       private Long widgetId;
-
-       private Long userId;
-
-       private Long paramId;
-
-       private String user_value;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public Long getWidgetId() {
-               return widgetId;
-       }
-
-       public void setWidgetId(Long widgetId) {
-               this.widgetId = widgetId;
-       }
-
-       public String getUser_value() {
-               return user_value;
-       }
-
-       public void setUser_value(String user_value) {
-               this.user_value = user_value;
-       }
-
-       public Long getParamId() {
-               return paramId;
-       }
-
-       public void setParamId(Long paramId) {
-               this.paramId = paramId;
-       }
-
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-
-       @Override
-       public String toString() {
-               return "WidgetCatalogParameter [id=" + id + ", widgetId=" + widgetId + ", userId=" + userId + ", paramId="
-                               + paramId + ", user_value=" + user_value + "]";
-       }
-
-       
-
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetParameterResult.java
deleted file mode 100644 (file)
index 81d703f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-public class WidgetParameterResult {
-       
-       private Long param_id;
-       
-       private String param_key;
-       
-       private String user_value;
-       
-       private String default_value;
-
-       public Long getParam_id() {
-               return param_id;
-       }
-
-       public void setParam_id(Long param_id) {
-               this.param_id = param_id;
-       }
-
-       public String getParam_key() {
-               return param_key;
-       }
-
-       public void setParam_key(String param_key) {
-               this.param_key = param_key;
-       }
-
-       public String getUser_value() {
-               return user_value;
-       }
-
-       public void setUser_value(String user_value) {
-               this.user_value = user_value;
-       }
-
-       public String getDefault_value() {
-               return default_value;
-       }
-
-       public void setDefault_value(String default_value) {
-               this.default_value = default_value;
-       }
-
-       @Override
-       public String toString() {
-               return "WidgetParameterResult [param_id=" + param_id + ", param_key=" + param_key + ", user_value=" + user_value
-                               + ", default_value=" + default_value + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/domain/WidgetServiceHeaders.java
deleted file mode 100644 (file)
index 14c7799..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.nio.charset.Charset;
-
-import org.apache.commons.codec.binary.Base64;
-import org.springframework.http.HttpHeaders;
-
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-
-public class WidgetServiceHeaders {
-       
-       private static HttpHeaders widgetHeaders;
-       
-       private WidgetServiceHeaders(){}
-       
-       public static HttpHeaders getInstance() throws Exception{
-               if(null == widgetHeaders){
-                  return new HttpHeaders(){{
-                               
-                                   String username = EcompPortalUtils.getPropertyOrDefault("microservices.widget.username", "widget_user");
-                                   String password = CipherUtil.decrypt(EcompPortalUtils.getPropertyOrDefault("microservices.widget.password", "widget_password"));
-                               String auth = username + ":" + password;
-                               byte[] encodedAuth = Base64.encodeBase64( 
-                                  auth.getBytes(Charset.forName("US-ASCII")) );
-                               String authHeader = "Basic " + new String( encodedAuth );
-                               set( "Authorization", authHeader );
-                             }
-                          };
-               }
-               else 
-                       return widgetHeaders;
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java
deleted file mode 100644 (file)
index 1279004..0000000
+++ /dev/null
@@ -1,276 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-/**
- * This model of an application catalog entry has some EPApp fields plus
- * additional fields to indicate access(ible) and select(ed) statuses.
- */
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AppCatalogItem extends DomainVo {
-
-       private static final long serialVersionUID = 6619663784935017846L;
-
-       @Id
-       private Long id;
-       private String name;
-       private String mlAppName;
-       private String imageUrl;
-       private String description;
-       private String notes;
-       private String url;
-       private String alternateUrl;
-       private Boolean restricted;
-       private Boolean open;
-       private Boolean access;
-       private Boolean select;
-       private Boolean pending;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getMlAppName() {
-               return mlAppName;
-       }
-
-       public void setMlAppName(String mlAppName) {
-               this.mlAppName = mlAppName;
-       }
-
-       public String getImageUrl() {
-               return imageUrl;
-       }
-
-       public void setImageUrl(String imageUrl) {
-               this.imageUrl = imageUrl;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-       public String getNotes() {
-               return notes;
-       }
-
-       public void setNotes(String notes) {
-               this.notes = notes;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getAlternateUrl() {
-               return alternateUrl;
-       }
-
-       public void setAlternateUrl(String alternateUrl) {
-               this.alternateUrl = alternateUrl;
-       }
-
-       public Boolean getRestricted() {
-               return restricted;
-       }
-
-       public void setRestricted(Boolean restricted) {
-               this.restricted = restricted;
-       }
-
-       public Boolean getOpen() {
-               return open;
-       }
-
-       public void setOpen(Boolean open) {
-               this.open = open;
-       }
-
-       public Boolean getAccess() {
-               return access;
-       }
-
-       public void setAccess(Boolean access) {
-               this.access = access;
-       }
-
-       public Boolean getSelect() {
-               return select;
-       }
-
-       public void setSelect(Boolean select) {
-               this.select = select;
-       }
-
-       public Boolean getPending() {
-               return pending;
-       }
-
-       public void setPending(Boolean pending) {
-               this.pending = pending;
-       }
-
-       public static long getSerialversionuid() {
-               return serialVersionUID;
-       }
-
-       @Override
-       public String toString() {
-               return "AppCatalogItem [id=" + id + ", name=" + name + ", access=" + access + ", select=" + select
-                               + ", pending=" + pending + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((access == null) ? 0 : access.hashCode());
-               result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode());
-               result = prime * result + ((description == null) ? 0 : description.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
-               result = prime * result + ((name == null) ? 0 : name.hashCode());
-               result = prime * result + ((notes == null) ? 0 : notes.hashCode());
-               result = prime * result + ((open == null) ? 0 : open.hashCode());
-               result = prime * result + ((pending == null) ? 0 : pending.hashCode());
-               result = prime * result + ((restricted == null) ? 0 : restricted.hashCode());
-               result = prime * result + ((select == null) ? 0 : select.hashCode());
-               result = prime * result + ((url == null) ? 0 : url.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               AppCatalogItem other = (AppCatalogItem) obj;
-               if (access == null) {
-                       if (other.access != null)
-                               return false;
-               } else if (!access.equals(other.access))
-                       return false;
-               if (alternateUrl == null) {
-                       if (other.alternateUrl != null)
-                               return false;
-               } else if (!alternateUrl.equals(other.alternateUrl))
-                       return false;
-               if (description == null) {
-                       if (other.description != null)
-                               return false;
-               } else if (!description.equals(other.description))
-                       return false;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (imageUrl == null) {
-                       if (other.imageUrl != null)
-                               return false;
-               } else if (!imageUrl.equals(other.imageUrl))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       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 (pending == null) {
-                       if (other.pending != null)
-                               return false;
-               } else if (!pending.equals(other.pending))
-                       return false;
-               if (restricted == null) {
-                       if (other.restricted != null)
-                               return false;
-               } else if (!restricted.equals(other.restricted))
-                       return false;
-               if (select == null) {
-                       if (other.select != null)
-                               return false;
-               } else if (!select.equals(other.select))
-                       return false;
-               if (url == null) {
-                       if (other.url != null)
-                               return false;
-               } else if (!url.equals(other.url))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCategoryFunctionsItem.java
deleted file mode 100644 (file)
index e09b862..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-/**
- * Carries row information for the functional table on the Contact Us page.
- */
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AppCategoryFunctionsItem extends DomainVo {
-
-       private static final long serialVersionUID = -1573834082471206458L;
-
-       @Id
-       private String rowId;
-       private String appId;
-       private String application;
-       private String category;
-       private String functions;
-
-       public String getRowId() {
-               return rowId;
-       }
-
-       public void setRowId(String rowId) {
-               this.rowId = rowId;
-       }
-
-       public String getAppId() {
-               return appId;
-       }
-       
-       public void setAppId(String appId) {
-               this.appId = appId;
-       }
-       
-       public String getApplication() {
-               return application;
-       }
-
-       public void setApplication(String appName) {
-               this.application = appName;
-       }
-
-       public String getCategory() {
-               return category;
-       }
-
-       public void setCategory(String category) {
-               this.category = category;
-       }
-
-       public String getFunctions() {
-               return functions;
-       }
-
-       public void setFunctions(String functions) {
-               this.functions = functions;
-       }
-
-       @Override
-       public String toString() {
-               return "AppCategoryFunctionsItem [rowId=" + rowId + ", appId=" + appId + ", application=" + application
-                               + ", category=" + category + ", functions=" + functions + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((application == null) ? 0 : application.hashCode());
-               result = prime * result + ((category == null) ? 0 : category.hashCode());
-               result = prime * result + ((functions == null) ? 0 : functions.hashCode());
-               result = prime * result + ((rowId == null) ? 0 : rowId.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               AppCategoryFunctionsItem other = (AppCategoryFunctionsItem) obj;
-               if (appId == null) {
-                       if (other.appId != null)
-                               return false;
-               } else if (!appId.equals(other.appId))
-                       return false;
-               if (application == null) {
-                       if (other.application != null)
-                               return false;
-               } else if (!application.equals(other.application))
-                       return false;
-               if (category == null) {
-                       if (other.category != null)
-                               return false;
-               } else if (!category.equals(other.category))
-                       return false;
-               if (functions == null) {
-                       if (other.functions != null)
-                               return false;
-               } else if (!functions.equals(other.functions))
-                       return false;
-               if (rowId == null) {
-                       if (other.rowId != null)
-                               return false;
-               } else if (!rowId.equals(other.rowId))
-                       return false;
-               return true;
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppContactUsItem.java
deleted file mode 100644 (file)
index 74adc8b..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-/**
- * An easily serializable version of row information from the fn_app_contact_us
- * table; specifically this has an app ID instead of an EPApp object.
- */
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class AppContactUsItem extends DomainVo {
-
-       private static final long serialVersionUID = 6964210807573346262L;
-
-       @Id
-       private Long appId;
-       private String appName;
-       private String description;
-       private String contactName;
-       private String contactEmail;
-       private String url;
-       private String activeYN;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-       public String getContactName() {
-               return contactName;
-       }
-
-       public void setContactName(String contactName) {
-               this.contactName = contactName;
-       }
-
-       public String getContactEmail() {
-               return contactEmail;
-       }
-
-       public void setContactEmail(String contactEmail) {
-               this.contactEmail = contactEmail;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getActiveYN() {
-               return activeYN;
-       }
-
-       public void setActiveYN(String activeYN) {
-               this.activeYN = activeYN;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((activeYN == null) ? 0 : activeYN.hashCode());
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
-               result = prime * result + ((contactEmail == null) ? 0 : contactEmail.hashCode());
-               result = prime * result + ((contactName == null) ? 0 : contactName.hashCode());
-               result = prime * result + ((description == null) ? 0 : description.hashCode());
-               result = prime * result + ((url == null) ? 0 : url.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               AppContactUsItem other = (AppContactUsItem) obj;
-               if (activeYN == null) {
-                       if (other.activeYN != null)
-                               return false;
-               } else if (!activeYN.equals(other.activeYN))
-                       return false;
-               if (appId == null) {
-                       if (other.appId != null)
-                               return false;
-               } else if (!appId.equals(other.appId))
-                       return false;
-               if (appName == null) {
-                       if (other.appName != null)
-                               return false;
-               } else if (!appName.equals(other.appName))
-                       return false;
-               if (contactEmail == null) {
-                       if (other.contactEmail != null)
-                               return false;
-               } else if (!contactEmail.equals(other.contactEmail))
-                       return false;
-               if (contactName == null) {
-                       if (other.contactName != null)
-                               return false;
-               } else if (!contactName.equals(other.contactName))
-                       return false;
-               if (description == null) {
-                       if (other.description != null)
-                               return false;
-               } else if (!description.equals(other.description))
-                       return false;
-               if (url == null) {
-                       if (other.url != null)
-                               return false;
-               } else if (!url.equals(other.url))
-                       return false;
-               return true;
-       }
-
-       @Override
-       public String toString() {
-               return "AppContactUsItem [appId=" + appId + ", appName=" + appName + ", description=" + description
-                               + ", contactName=" + contactName + ", contactEmail=" + contactEmail + ", url=" + url + ", activeYN="
-                               + activeYN + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/CommonWidgetsEnum.java
deleted file mode 100644 (file)
index 784cf3d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-public enum CommonWidgetsEnum{
-       NEWS("news"),
-       EVENTS("events"),
-       RESOURCES("resources");
-       
-       private String value;
-       private CommonWidgetsEnum(String value){
-               this.value = value;
-       }
-       
-       @Override
-    public String toString() {
-        return value;
-    }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestResponse.java
deleted file mode 100644 (file)
index 05dadca..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-public class PortalRestResponse<T> {
-       
-       private PortalRestStatusEnum status;
-       private String message;
-       
-       private T response;
-       
-       public PortalRestResponse(){};
-       
-       public PortalRestResponse(PortalRestStatusEnum status, String message, T response){
-               this.status = status;
-               this.message = message;
-               this.response = response;
-       }
-
-       public PortalRestStatusEnum getStatus() {
-               return status;
-       }
-
-       public void setStatus(PortalRestStatusEnum status) {
-               this.status = status;
-       }
-
-       public String getMessage() {
-               return message;
-       }
-
-       public void setMessage(String message) {
-               this.message = message;
-       }
-
-       public T getResponse() {
-               return response;
-       }
-
-       public void setResponse(T response) {
-               this.response = response;
-       }
-
-       @Override
-       public String toString() {
-               return "PortalRestResponse [status=" + status + ", message=" + message + ", response=" + response + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((message == null) ? 0 : message.hashCode());
-               result = prime * result + ((response == null) ? 0 : response.hashCode());
-               result = prime * result + ((status == null) ? 0 : status.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               PortalRestResponse other = (PortalRestResponse) obj;
-               if (message == null) {
-                       if (other.message != null)
-                               return false;
-               } else if (!message.equals(other.message))
-                       return false;
-               if (response == null) {
-                       if (other.response != null)
-                               return false;
-               } else if (!response.equals(other.response))
-                       return false;
-               if (status != other.status)
-                       return false;
-               return true;
-       };      
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/PortalRestStatusEnum.java
deleted file mode 100644 (file)
index 1f70da7..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-public enum PortalRestStatusEnum{
-       OK("ok"),
-       WARN("WARNING"),
-       ERROR("error");
-       
-       private String value;
-       private PortalRestStatusEnum(String value){
-               this.value = value;
-       }
-       
-       @Override
-    public String toString() {
-        return value;
-    }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/SearchResultItem.java
deleted file mode 100644 (file)
index dbd70b9..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ecomp.model;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class SearchResultItem extends DomainVo{
-
-       @Id
-       private String rowId;   
-       
-       @JsonProperty("category")
-       private String category;
-       
-       @JsonProperty("name")
-       private String name;
-       
-       @JsonProperty("target")
-       private String target;
-
-       @JsonProperty("uuid")
-       private String uuid;
-       
-       public String getUuid() {
-               return uuid;
-       }
-       public void setUuid(String uuid) {
-               this.uuid = uuid;
-       }
-       public String getRowId() {
-               return rowId;
-       }
-       public void setRowId(String rowId) {
-               this.rowId = rowId;
-       }
-       public String getCategory() {
-               return category;
-       }
-       public void setCategory(String category) {
-               this.category = category;
-       }
-       public String getName() {
-               return name;
-       }
-       public void setName(String name) {
-               this.name = name;
-       }
-       
-       public String getTarget() {
-               return target;
-       }
-       public void setTarget(String target) {
-               this.target = target;
-       }
-       @Override
-       public String toString() {
-               return "SearchResultItem [rowId=" + rowId + ", category=" + category + ", name=" + name + ", target=" + target
-                               + ", uuid=" + uuid + "]";
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/exceptions/NoHealthyServiceException.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/exceptions/NoHealthyServiceException.java
deleted file mode 100644 (file)
index b4764d8..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.exceptions;
-
-import com.ecwid.consul.ConsulException;
-
-public class NoHealthyServiceException extends ConsulException{
-
-       private static final long serialVersionUID = -7089437673127729813L;
-       
-       public NoHealthyServiceException(String message){
-               super(message);
-       }
-       
-       @Override
-       public String toString() {
-               return "NoHealthyServiceException [] " + this.getMessage();
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/interceptor/PortalResourceInterceptor.java
deleted file mode 100644 (file)
index 4514126..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.interceptor;
-
-import java.nio.charset.Charset;
-import java.util.Base64;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.sessionmgt.SessionCommunicationController;
-import org.openecomp.portalapp.portal.controller.BasicAuthenticationController;
-import org.openecomp.portalapp.portal.controller.ExternalAppsRestfulController;
-import org.openecomp.portalapp.portal.controller.SharedContextRestController;
-import org.openecomp.portalapp.portal.controller.WebAnalyticsExtAppController;
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPEELFLoggerAdvice;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.BasicAuthenticationCredentialService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.service.RemoteWebServiceCallService;
-import org.openecomp.portalapp.service.sessionmgt.ManageService;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.controller.FusionBaseController;
-import org.openecomp.portalsdk.core.exception.UrlAccessRestrictedException;
-import org.openecomp.portalsdk.core.interceptor.ResourceInterceptor;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.method.HandlerMethod;
-
-public class PortalResourceInterceptor extends ResourceInterceptor {
-       private static final String APP_KEY = "uebkey";
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalResourceInterceptor.class);
-
-       @Autowired
-       private RemoteWebServiceCallService remoteWebServiceCallService;
-
-       @Autowired
-       private ManageService manageService;
-
-       @Autowired
-       private EPEELFLoggerAdvice epAdvice;
-
-       @Autowired
-       private BasicAuthenticationCredentialService basicAuthService;
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
-                       throws Exception {
-
-               if (handler instanceof HandlerMethod) {
-                       HandlerMethod method = (HandlerMethod) handler;
-
-                       /**
-                        * These classes provide REST endpoints used by other application
-                        * servers, NOT by an end user's browser.
-                        */
-                       if (method.getBean() instanceof FusionBaseController) {
-                               FusionBaseController controller = (FusionBaseController) method.getBean();
-                               if (!controller.isAccessible()) {
-
-                                       // authorize portalApi requests by user role
-                                       String requestURI = request.getRequestURI();
-                                       if (requestURI != null) {
-                                               String[] uriArray = requestURI.split("/portalApi/");
-                                               if (uriArray.length > 1) {
-                                                       String portalApiPath = uriArray[1];
-
-                                                       Set<? extends String> roleFunctions = (Set<? extends String>) request.getSession()
-                                                                       .getAttribute(SystemProperties
-                                                                                       .getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
-                                                       Set<? extends String> allRoleFunctions = (Set<? extends String>) request.getSession()
-                                                                       .getAttribute(EPUserUtils.ALL_ROLE_FUNCTIONS);
-                                                       // Defend against code error to avoid throwing NPE
-                                                       if (roleFunctions == null || allRoleFunctions == null) {
-                                                               logger.error(EELFLoggerDelegate.errorLogger,
-                                                                               "preHandle: failed to get role functions attribute(s) from session!!");
-                                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInitializationError);
-                                                               return false;
-                                                       }
-                                                       // check to see if roleFunctions of the user is in
-                                                       // the
-                                                       // list of all role functions
-                                                       // if not, ignore to prevent restricting every
-                                                       // trivial
-                                                       // call; otherwise, if it is, then check for the
-                                                       // access
-                                                       if (matchRoleFunctions(portalApiPath, allRoleFunctions)
-                                                                       && !matchRoleFunctions(portalApiPath, roleFunctions)) {
-                                                               EPUser user = (EPUser) request.getSession().getAttribute(
-                                                                               SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
-                                                               logger.error(EELFLoggerDelegate.errorLogger,
-                                                                               "preHandle: User {} not authorized for path {} ", user.getOrgUserId(),
-                                                                               portalApiPath);
-                                                               EcompPortalUtils.setBadPermissions(user, response, portalApiPath);
-                                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError);
-                                                               return false;
-                                                       } // failed to match
-
-                                               } // is portalApi
-
-                                       } // requestURI
-                               } // instance check
-                       } // not accessible
-                       else if (method.getBean() instanceof BasicAuthenticationController) {
-                               return checkBasicAuth(request, response);
-                       }
-                       Object controllerObj = method.getBean();
-                       if (controllerObj instanceof SessionCommunicationController
-                                       || controllerObj instanceof SharedContextRestController
-                                       || controllerObj instanceof ExternalAppsRestfulController) {
-                               // check user authentication for RESTful calls
-                               String secretKey = null;
-                               try {
-                                       epAdvice.loadServletRequestBasedDefaults(request, SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
-                                       if (!remoteWebServiceCallService.verifyRESTCredential(secretKey, request.getHeader(APP_KEY),
-                                                       request.getHeader("username"), request.getHeader("password"))) {
-                                               throw new UrlAccessRestrictedException();
-                                       }
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "preHandle: failed to authenticate RESTful service",
-                                                       e);
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
-                                       throw new UrlAccessRestrictedException();
-                               }
-                       }
-
-                       if (controllerObj instanceof WebAnalyticsExtAppController) {
-                               if (!remoteWebServiceCallService.verifyAppKeyCredential(request.getHeader(APP_KEY))) {
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "preHandle: failed to verify app key for web analytics call");
-                                       throw new UrlAccessRestrictedException();
-                               }
-                       }
-               }
-
-               handleSessionUpdates(request);
-               return true;
-       }
-
-       /**
-        * Sets the status code and sends a response. Factors code out of many
-        * methods.
-        * 
-        * @param response
-        *            HttpServletResponse
-        * @param statusCode
-        *            HTTP status code like 404
-        * @param message
-        *            Message to send in a JSON error object
-        */
-       private void sendErrorResponse(HttpServletResponse response, final int statusCode, final String message)
-                       throws Exception {
-               response.setStatus(statusCode);
-               response.setContentType("application/json");
-               response.getWriter().write("{\"error\":\"" + message + "\"}");
-               response.getWriter().flush();
-       }
-
-       /**
-        * Gets HTTP basic authentication information from the request and checks
-        * whether those credentials are authorized for the request path.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param response
-        *            HttpServletResponse
-        * @return True if the request is authorized, else false
-        * @throws Exception
-        */
-       private boolean checkBasicAuth(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               String uri = request.getRequestURI().toString();
-               uri = uri.substring(uri.indexOf("/", 1));
-
-               final String authHeader = request.getHeader("Authorization");
-
-               // Unauthorized access due to missing HTTP Authorization request header
-               if (authHeader == null) {
-                       final String msg = "no authorization found";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
-                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
-                       return false;
-               }
-
-               String[] accountNamePassword = getUserNamePassword(authHeader);
-               if (accountNamePassword == null || accountNamePassword.length != 2) {
-                       final String msg = "failed to get username and password from Atuhorization header";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
-                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
-                       return false;
-               }
-
-               BasicAuthCredentials creds;
-               try {
-                       creds = basicAuthService.getBasicAuthCredentialByUsernameAndPassword(accountNamePassword[0],
-                                       encrypted(accountNamePassword[1]));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "checkBasicAuth failed to get credentials", e);
-                       final String msg = "Failed while getting basic authentication credential: " + e.toString();
-                       sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg);
-                       throw e;
-               }
-
-               // Unauthorized access due to invalid credentials (username and
-               // password)
-               if (creds == null || !creds.getUsername().equals(accountNamePassword[0])) {
-                       final String msg = "Unauthorized: Access denied";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
-                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
-                       return false;
-               }
-
-               // Unauthorized access due to inactive account
-               if (creds.getIsActive().equals("N")) {
-                       final String msg = "Unauthorized: The account is inactive";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
-                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
-                       return false;
-               }
-               boolean isAllowedEp = false;
-               for (EPEndpoint ep : creds.getEndpoints()) {
-                       if (ep.getName().equals(uri)) {
-                               isAllowedEp = true;
-                               break;
-                       }
-               }
-
-               // If user doesn't specify any endpoint, allow all endpoints for that
-               // account
-               if (creds.getEndpoints().size() == 0)
-                       isAllowedEp = true;
-
-               // Unauthorized access due to the invalid endpoints
-               if (!isAllowedEp) {
-                       final String msg = "Unauthorized: Endpoint access denied";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "checkBasicAuth: {}", msg);
-                       sendErrorResponse(response, HttpServletResponse.SC_UNAUTHORIZED, msg);
-                       return false;
-               }
-
-               // Made it to the end!
-               return true;
-       }
-
-       private String[] getUserNamePassword(String authValue) {
-               String base64Credentials = authValue.substring("Basic".length()).trim();
-               String credentials = new String(Base64.getDecoder().decode(base64Credentials), Charset.forName("UTF-8"));
-               final String[] values = credentials.split(":", 2);
-               return values;
-       }
-
-       private String decrypted(String encrypted) throws Exception {
-               String result = "";
-               if (encrypted != null & encrypted.length() > 0) {
-                       try {
-                               result = CipherUtil.decrypt(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-
-       private String encrypted(String decryptedPwd) throws Exception {
-               String result = "";
-               if (decryptedPwd != null & decryptedPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.encrypt(decryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-
-       private Boolean matchRoleFunctions(String portalApiPath, Set<? extends String> roleFunctions) {
-               for (String roleFunction : roleFunctions) {
-                       if (portalApiPath.matches(roleFunction))
-                               return true;
-               }
-               return false;
-
-       }
-
-       protected void handleSessionUpdates(HttpServletRequest request) {
-               PortalTimeoutHandler.handleSessionUpdatesNative(request, null, null, null, null, manageService);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/HealthMonitor.java
deleted file mode 100644 (file)
index 881952c..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.listener;
-
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.ueb.EPUebHelper;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class HealthMonitor {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthMonitor.class);
-
-       @Autowired
-       private SessionFactory sessionFactory;
-
-       @Autowired
-       private EPUebHelper epUebHelper;
-
-       private static boolean databaseUp;
-       private static boolean uebUp;
-       private static boolean frontEndUp;
-       private static boolean backEndUp;
-       private static boolean dbClusterStatusOk;
-       private static boolean dbPermissionsOk;
-
-       /**
-        * Read directly by external classes.
-        */
-       public static boolean isSuspended = false;
-
-       private Thread healthMonitorThread;
-
-       public HealthMonitor() {
-       }
-
-       public static boolean isDatabaseUp() {
-               return databaseUp;
-       }
-
-       public static boolean isClusterStatusOk() {
-               return dbClusterStatusOk;
-       }
-
-       public static boolean isDatabasePermissionsOk() {
-               return dbPermissionsOk;
-       }
-
-       public static boolean isUebUp() {
-               return uebUp;
-       }
-
-       public static boolean isFrontEndUp() {
-               return frontEndUp;
-       }
-
-       public static boolean isBackEndUp() {
-               return backEndUp;
-       }
-
-       private void monitorEPHealth() throws InterruptedException {
-
-               int numIntervalsDatabaseHasBeenDown = 0;
-               int numIntervalsClusterNotHealthy = 0;
-               int numIntervalsDatabasePermissionsIncorrect = 0;
-               int numIntervalsUebHasBeenDown = 0;
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "monitorEPHealth thread started");
-
-               long sleepInterval = (Long
-                               .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.HEALTH_POLL_INTERVAL_SECONDS)) * 1000);
-               long numIntervalsBetweenAlerts = Long
-                               .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.HEALTHFAIL_ALERT_EVERY_X_INTERVALS));
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "monitorEPHealth: Polling health every " + sleepInterval + " milliseconds. Alerting every "
-                                               + (sleepInterval * numIntervalsBetweenAlerts) / 1000 + " seconds when component remains down.");
-
-               while (true) {
-                       //
-                       // Get DB status. If down, signal alert once every X intervals.
-                       //
-                       databaseUp = this.checkIfDatabaseUp();
-                       if (databaseUp == false) {
-                               if ((numIntervalsDatabaseHasBeenDown % numIntervalsBetweenAlerts) == 0) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "monitorEPHealth: database down, logging to error log to trigger alert.");
-                                       // Write a Log entry that will generate an alert
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckMySqlError);
-                                       numIntervalsDatabaseHasBeenDown++;
-                               } else {
-                                       numIntervalsDatabaseHasBeenDown = 0;
-                               }
-                       }
-
-                       dbClusterStatusOk = this.checkClusterStatus();
-                       if (dbClusterStatusOk == false) {
-                               if ((numIntervalsClusterNotHealthy % numIntervalsBetweenAlerts) == 0) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "monitorEPHealth: cluster nodes down, logging to error log to trigger alert.");
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckMySqlError);
-                                       numIntervalsClusterNotHealthy++;
-                               } else {
-                                       numIntervalsClusterNotHealthy = 0;
-                               }
-                       }
-
-                       dbPermissionsOk = this.checkDatabasePermissions();
-                       if (dbPermissionsOk == false) {
-                               if ((numIntervalsDatabasePermissionsIncorrect % numIntervalsBetweenAlerts) == 0) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "monitorEPHealth: database permissions incorrect, logging to error log to trigger alert.");
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckMySqlError);
-                                       numIntervalsDatabasePermissionsIncorrect++;
-                               } else {
-                                       numIntervalsDatabasePermissionsIncorrect = 0;
-                               }
-                       }
-
-                       //
-                       // Get UEB status. Publish a bogus message to EP inbox, if 200 OK
-                       // returned, status is Up.
-                       // If down, signal alert once every X intervals.
-                       // EP will ignore this bogus message.
-                       //
-                       uebUp = this.checkIfUebUp();
-                       if (uebUp == false) {
-
-                               if ((numIntervalsUebHasBeenDown % numIntervalsBetweenAlerts) == 0) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "monitorEPHealth: UEB down, logging to error log to trigger alert");
-                                       // Write a Log entry that will generate an alert
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckUebClusterError);
-                                       numIntervalsUebHasBeenDown++;
-                               } else {
-                                       numIntervalsUebHasBeenDown = 0;
-                               }
-                       }
-
-                       // The front end should be up because the API is called through
-                       // proxy front end server.
-                       frontEndUp = true;
-
-                       // If the rest API called, the backend is always up
-                       backEndUp = true;
-
-                       //
-                       // future nice to have...get Partner status
-                       //
-                       // For all apps exposing a rest url, query one of the rest
-                       // urls(/roles?) and manage a list
-                       // of app name/status. We might not return back a non 200 OK in
-                       // health check, but we
-                       // could return information in the json content of a health check.
-                       //
-
-                       //
-                       // Get DB status. If down, signal alert once every X intervals.
-                       //
-                       if (Thread.interrupted()) {
-                               logger.info(EELFLoggerDelegate.errorLogger, "monitorEPHealth: thread interrupted");
-                               break;
-                       }
-
-                       try {
-                               Thread.sleep(sleepInterval);
-                       } catch (InterruptedException e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "monitorEPHealth: sleep interrupted", e);
-                               Thread.currentThread().interrupt();
-                       }
-               }
-       }
-
-       @PostConstruct
-       public void initHealthMonitor() {
-               healthMonitorThread = new Thread("EP HealthMonitor thread") {
-                       public void run() {
-                               try {
-                                       monitorEPHealth();
-                               } catch (InterruptedException e) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "healthMonitorThread interrupted", e);
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "healthMonitorThread failed", e);
-                               }
-                       }
-               };
-               healthMonitorThread.start();
-               
-       }
-
-       @PreDestroy
-       public void closeHealthMonitor() {
-               this.healthMonitorThread.interrupt();
-       }
-
-       /**
-        * This routine checks whether the database can be read. In June 2017 we
-        * experimented with checking if the database can be WRITTEN. Writes failed
-        * with some regularity in a MariaDB Galera cluster, and in that
-        * environment, the resulting alerts in the log triggered a health monitor
-        * cron job to shut down the Tomcat instance. The root cause of the cluster
-        * write failures was not determined.
-        * 
-        * @return true if the database can be read.
-        */
-       private boolean checkIfDatabaseUp() {
-               boolean isUp = false;
-               Session localSession = null;
-               try {
-                       localSession = sessionFactory.openSession();
-                       if (localSession != null) {
-                               String sql = "select app_name from fn_app where app_id=1";
-                               Query query = localSession.createSQLQuery(sql);
-                               @SuppressWarnings("unchecked")
-                               List<String> queryList = query.list();
-                               if (queryList != null) {
-                                       isUp = true;
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "checkIfDatabaseUp failed", e);
-                       isUp = false;
-               } finally {
-                       if (localSession != null)
-                               localSession.close();
-               }
-               return isUp;
-       }
-
-       private boolean checkClusterStatus() {
-               boolean isUp = false;
-               Session localSession = null;
-               try {
-                       localSession = sessionFactory.openSession();
-                       if (localSession != null) {
-                               // If all nodes are unhealthy in a cluster, this will throw an
-                               // exception
-                               String sql = "select * from mysql.user";
-                               Query query = localSession.createSQLQuery(sql);
-                               @SuppressWarnings("unchecked")
-                               List<String> queryList = query.list();
-                               if (queryList != null) {
-                                       isUp = true;
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "checkClusterStatus failed", e);
-                       if ((e.getCause() != null) && (e.getCause().getMessage() != null)) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "checkClusterStatus failure cause", e.getCause());
-                       }
-                       isUp = false;
-               } finally {
-                       if (localSession != null) {
-                               localSession.close();
-                       }
-               }
-               return isUp;
-       }
-
-       private boolean checkDatabasePermissions() {
-               boolean isUp = false;
-               Session localSession = null;
-               try {
-                       localSession = sessionFactory.openSession();
-                       if (localSession != null) {
-                               String sql = "SHOW GRANTS FOR CURRENT_USER";
-                               Query query = localSession.createSQLQuery(sql);
-                               @SuppressWarnings("unchecked")
-                               List<String> grantsList = query.list();
-                               for (String str : grantsList) {
-                                       if ((str.toUpperCase().contains("ALL"))
-                                                       || (str.toUpperCase().contains("DELETE") && str.toUpperCase().contains("SELECT")
-                                                                       && str.toUpperCase().contains("UPDATE") && str.toUpperCase().contains("INSERT"))) {
-                                               isUp = true;
-                                               break;
-                                       }
-                               }
-                               if (isUp == false) {
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "checkDatabasePermissions returning false.  SHOW GRANTS FOR CURRENT_USER being dumped:");
-                                       for (String str : grantsList) {
-                                               logger.error(EELFLoggerDelegate.errorLogger, "grants output item = [" + str + "]");
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "checkDatabasePermissions failed", e);
-                       if ((e.getCause() != null) && (e.getCause().getMessage() != null)) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "checkDatabasePermissions failure cause", e.getCause());
-                       }
-                       isUp = false;
-               } finally {
-                       if (localSession != null) {
-                               localSession.close();
-                       }
-               }
-               return isUp;
-       }
-
-       private boolean checkIfUebUp() {
-               boolean uebUp = false;
-               try {
-                       boolean isAvailable = epUebHelper.checkAvailability();
-                       boolean messageCanBeSent = epUebHelper.MessageCanBeSentToTopic();
-                       uebUp = (isAvailable && messageCanBeSent);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "checkIfUebUp failed", e);
-               }
-               return uebUp;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/UserContextListener.java
deleted file mode 100644 (file)
index 686bef2..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.listener;
-
-import java.util.HashMap;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.servlet.annotation.WebListener;
-
-@WebListener
-public class UserContextListener implements ServletContextListener{
-       @SuppressWarnings("rawtypes")
-       public void contextInitialized(ServletContextEvent event){
-       ServletContext context = event.getServletContext();        
-        //
-        // instanciate a map to store references to all the active
-        // sessions and bind it to context scope.
-        //
-        HashMap activeUsers = new HashMap();
-        context.setAttribute("activeUsers", activeUsers);
-    }
-
-    /**
-     * Needed for the ServletContextListener interface.
-     */
-    public void contextDestroyed(ServletContextEvent event){
-        // To overcome the problem with losing the session references
-        // during server restarts, put code here to serialize the
-        // activeUsers HashMap.  Then put code in the contextInitialized
-        // method that reads and reloads it if it exists...
-    }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/listener/UserSessionListener.java
deleted file mode 100644 (file)
index a009356..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.listener;
-
-import java.util.HashMap;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.annotation.WebListener;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.SharedContextService;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.util.StringUtils;
-
-/**
- * Listens for session-create and session-destroy events.
- */
-@WebListener
-@SuppressWarnings({ "unchecked", "rawtypes" })
-public class UserSessionListener implements HttpSessionListener {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserSessionListener.class);
-
-       /**
-        * Access to the database
-        */
-       @Autowired
-       SharedContextService sharedContextService;
-
-       public void init(ServletConfig config) {
-       }
-
-       /**
-        * Adds sessions to the context scoped HashMap when they begin.
-        */
-       public void sessionCreated(HttpSessionEvent event) {
-               HttpSession session = event.getSession();
-               ServletContext context = session.getServletContext();
-               HashMap activeUsers = (HashMap) context.getAttribute("activeUsers");
-
-               activeUsers.put(session.getId(), session);
-               context.setAttribute("activeUsers", activeUsers);
-               logger.info(EELFLoggerDelegate.debugLogger, "Session Created : " + session.getId());
-       }
-
-       /**
-        * Removes sessions from the context scoped HashMap when they expire or are
-        * invalidated.
-        */
-       public void sessionDestroyed(HttpSessionEvent event) {
-               try {
-                       HttpSession session = event.getSession();
-                       ServletContext context = session.getServletContext();
-                       HashMap activeUsers = (HashMap) context.getAttribute("activeUsers");
-                       activeUsers.remove(session.getId());
-
-                       EPUser user = (EPUser) session
-                                       .getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
-                       if (user != null && !StringUtils.isEmpty(user.getOrgUserId())) {
-                               CollaborateList.delUserName(user.getOrgUserId());
-                       }
-
-                       // Remove any shared context entries for this session.
-                       if (getSharedContextService() != null) {
-                               getSharedContextService().deleteSharedContexts(session.getId());
-
-                               // Clean the shared context each time a session is destroyed.
-                               // TODO: move the threshold to configuration file.
-                               getSharedContextService().expireSharedContexts(60 * 60 * 8);
-                       }
-
-                       logger.info(EELFLoggerDelegate.debugLogger, "Session Destroyed : " + session.getId());
-
-               } catch (Exception e) {
-                       logger.warn(EELFLoggerDelegate.errorLogger, "sessionDestroyed failed", e);
-               }
-       }
-
-       private static ApplicationContext applicationContext;
-
-       public static void setApplicationContext(ApplicationContext _applicationContext) {
-               applicationContext = _applicationContext;
-       }
-
-       public SharedContextService getSharedContextService() {
-               if (sharedContextService == null) {
-                       if (applicationContext != null)
-                               sharedContextService = (SharedContextService) applicationContext.getBean("sharedContextService");
-               }
-
-               return sharedContextService;
-       }
-
-       public void setSharedContextService(SharedContextService sharedContextService) {
-               this.sharedContextService = sharedContextService;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPAuditLog.java
deleted file mode 100644 (file)
index 7d76125..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.aop;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface EPAuditLog {
-    String value() default "";
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAdvice.java
deleted file mode 100644 (file)
index d095bbd..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.aop;
-
-import java.net.InetAddress;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.exception.SessionExpiredException;
-import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum;
-import org.openecomp.portalsdk.core.logging.format.AuditLogFormatter;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.slf4j.MDC;
-
-import com.att.eelf.configuration.Configuration;
-
-@org.springframework.context.annotation.Configuration
-public class EPEELFLoggerAdvice {
-
-       private EELFLoggerDelegate adviceLogger = EELFLoggerDelegate.getLogger(EPEELFLoggerAdvice.class);
-
-       /**
-        * DateTime Format according to the ECOMP Application Logging Guidelines.
-        */
-       private static final SimpleDateFormat ecompLogDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
-
-       /**
-        * @return Current date and time in the format specified by the ECOMP
-        *         Application Logging Guidelines.
-        */
-       public static String getCurrentDateTimeUTC() {
-               String currentDateTime = ecompLogDateFormat.format(new Date());
-               return currentDateTime;
-       }
-
-       /**
-        * Sets logging context with values from HttpServletRequest object.
-        * 
-        * @param req
-        *            HttpServletRequest
-        * @param securityEventType
-        *            SecurityEventTypeEnum
-        */
-       public void loadServletRequestBasedDefaults(HttpServletRequest req, SecurityEventTypeEnum securityEventType) {
-               try {
-                       setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, req.getServletPath());
-               } catch (Exception e) {
-                       adviceLogger.error(EELFLoggerDelegate.errorLogger, "loadServletRequestBasedDefaults failed", e);
-               }
-       }
-
-       /**
-        * 
-        * @param securityEventType
-        * @param args
-        * @param passOnArgs
-        * @return Object array
-        */
-       public Object[] before(SecurityEventTypeEnum securityEventType, Object[] args, Object[] passOnArgs) {
-               String className = "";
-               if (passOnArgs.length > 0 && passOnArgs[0] != null)
-                       className = passOnArgs[0].toString();
-               String methodName = "";
-               if (passOnArgs.length > 1 && passOnArgs[1] != null)
-                       methodName = passOnArgs[1].toString();
-
-               // Initialize Request defaults only for controller methods.
-               MDC.put(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC());
-               MDC.put(EPCommonSystemProperties.TARGET_ENTITY, EPCommonSystemProperties.ECOMP_PORTAL_BE);
-               MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, methodName);
-               if (securityEventType != null) {
-                       MDC.put(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
-                                       getCurrentDateTimeUTC());
-                       HttpServletRequest req = null;
-                       if (args.length > 0 && args[0] != null && args[0] instanceof HttpServletRequest) {
-                               req = (HttpServletRequest) args[0];
-                               this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, methodName);
-                       }
-               }
-
-               EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(className);
-               logger.debug(EELFLoggerDelegate.debugLogger, "EPEELFLoggerAdvice#before: entering {}", methodName);
-               return new Object[] { "" };
-       }
-
-       /**
-        * 
-        * @param securityEventType
-        * @param statusCode
-        * @param responseCode
-        * @param args
-        * @param returnArgs
-        * @param passOnArgs
-        */
-       public void after(SecurityEventTypeEnum securityEventType, String statusCode, String responseCode, Object[] args,
-                       Object[] returnArgs, Object[] passOnArgs) {
-               String className = "";
-               if (passOnArgs.length > 0 && passOnArgs[0] != null)
-                       className = passOnArgs[0].toString();
-               // Method Name
-               String methodName = "";
-               if (passOnArgs.length > 1 && passOnArgs[1] != null)
-                       methodName = passOnArgs[1].toString();
-
-               if (MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME) == null
-                               || MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME) == "")
-                       MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, methodName);
-
-               if (MDC.get(EPCommonSystemProperties.TARGET_ENTITY) == null
-                               || MDC.get(EPCommonSystemProperties.TARGET_ENTITY) == "")
-                       MDC.put(EPCommonSystemProperties.TARGET_ENTITY, EPCommonSystemProperties.ECOMP_PORTAL_BE);
-
-               MDC.put(EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP,
-                               MDC.get(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP));
-               MDC.put(EPCommonSystemProperties.METRICSLOG_END_TIMESTAMP, getCurrentDateTimeUTC());
-               this.calculateDateTimeDifference(MDC.get(EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP),
-                               MDC.get(EPCommonSystemProperties.METRICSLOG_END_TIMESTAMP));
-
-               // Making sure to reload the INCOMING request MDC defaults if they have
-               // been wiped out by either Outgoing or LDAP Phone book search
-               // operations.
-               if (securityEventType != null && args.length > 0 && args[0] != null && args[0] instanceof HttpServletRequest
-                               && securityEventType == SecurityEventTypeEnum.INCOMING_REST_MESSAGE
-                               && (MDC.get(EPCommonSystemProperties.FULL_URL) == null
-                                               || MDC.get(EPCommonSystemProperties.FULL_URL) == "")) {
-                       HttpServletRequest req = (HttpServletRequest) args[0];
-                       this.setHttpRequestBasedDefaultsIntoGlobalLoggingContext(req, securityEventType, methodName);
-               }
-
-               // Use external API response code in case if it resulted in an error.
-               String externalAPIResponseCode = MDC.get(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
-               if (externalAPIResponseCode == null || externalAPIResponseCode == ""
-                               || externalAPIResponseCode.trim().equalsIgnoreCase("200")) {
-                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, responseCode);
-                       MDC.put(EPCommonSystemProperties.STATUS_CODE, statusCode);
-               } else {
-                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, externalAPIResponseCode);
-                       MDC.put(EPCommonSystemProperties.STATUS_CODE, "ERROR");
-               }
-
-               EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(className);
-               logger.debug(EELFLoggerDelegate.debugLogger, "EPEELFLoggerAdvice#after: finished {}", methodName);
-               // add the metrics log
-               logger.info(EELFLoggerDelegate.metricsLogger,  methodName + " operation is completed.");
-
-               // Log security message, if necessary
-               if (securityEventType != null) {
-                       MDC.put(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP,
-                                       MDC.get(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP));
-                       MDC.put(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP, getCurrentDateTimeUTC());
-                       this.calculateDateTimeDifference(MDC.get(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP),
-                                       MDC.get(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP));
-
-                       this.logSecurityMessage(logger, securityEventType, methodName);
-
-                       // Outgoing & LDAP messages are part of Incoming requests so,
-                       // keep "RequestId", "PartnerName", "ServiceName", "LoginId" &
-                       // "ResponseCode" etc. in memory and remove it only when
-                       // finished processing the parent incoming message.
-                       if (securityEventType != SecurityEventTypeEnum.OUTGOING_REST_MESSAGE
-                                       && securityEventType != SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) {
-                               MDC.remove(Configuration.MDC_KEY_REQUEST_ID);
-                               MDC.remove(EPCommonSystemProperties.PARTNER_NAME);
-                               MDC.remove(Configuration.MDC_SERVICE_NAME);
-                               MDC.remove(EPCommonSystemProperties.MDC_LOGIN_ID);
-                               MDC.remove(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
-                       }
-
-                       // clear when finishes audit logging
-                       MDC.remove(EPCommonSystemProperties.FULL_URL);
-                       MDC.remove(EPCommonSystemProperties.PROTOCOL);
-                       MDC.remove(EPCommonSystemProperties.STATUS_CODE);
-                       MDC.remove(className + methodName + EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                       MDC.remove(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP);
-                       MDC.remove(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP);
-                       MDC.remove(EPCommonSystemProperties.RESPONSE_CODE);
-               }
-               MDC.remove(className + methodName + EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP);
-               MDC.remove(EPCommonSystemProperties.METRICSLOG_BEGIN_TIMESTAMP);
-               MDC.remove(EPCommonSystemProperties.METRICSLOG_END_TIMESTAMP);
-               MDC.remove(EPCommonSystemProperties.MDC_TIMER);
-               MDC.remove(EPCommonSystemProperties.TARGET_ENTITY);
-               MDC.remove(EPCommonSystemProperties.TARGET_SERVICE_NAME);
-       }
-
-       /**
-        * 
-        * @param logger
-        * @param securityEventType
-        * @param restMethod
-        */
-       private void logSecurityMessage(EELFLoggerDelegate logger, SecurityEventTypeEnum securityEventType,
-                       String restMethod) {
-               StringBuilder additionalInfoAppender = new StringBuilder();
-               String auditMessage = "";
-
-               if (securityEventType == SecurityEventTypeEnum.OUTGOING_REST_MESSAGE) {
-                       additionalInfoAppender.append(String.format("%s '%s' request was initiated.", restMethod,
-                                       MDC.get(EPCommonSystemProperties.TARGET_SERVICE_NAME)));
-               } else if (securityEventType == SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) {
-                       additionalInfoAppender.append("LDAP Phonebook search operation is performed.");
-               } else {
-                       additionalInfoAppender.append(String.format("%s request was received.", restMethod));
-
-                       if (securityEventType == SecurityEventTypeEnum.FE_LOGIN_ATTEMPT) {
-                               String loginId = "";
-                               String additionalMessage = " Successfully authenticated.";
-                               loginId = MDC.get(EPCommonSystemProperties.MDC_LOGIN_ID);
-                               if (loginId == null || loginId == "" || loginId == EPCommonSystemProperties.UNKNOWN) {
-                                       additionalMessage = " No cookies are found.";
-                               }
-                               additionalInfoAppender.append(additionalMessage);
-                       } else if (securityEventType == SecurityEventTypeEnum.FE_LOGOUT) {
-                               additionalInfoAppender.append(" User has been successfully logged out.");
-                       }
-               }
-
-               String fullURL = MDC.get(EPCommonSystemProperties.FULL_URL);
-               if (fullURL != null && fullURL != "") {
-                       additionalInfoAppender.append(" Request-URL:" + MDC.get(EPCommonSystemProperties.FULL_URL));
-               }
-
-               auditMessage = AuditLogFormatter.getInstance().createMessage(MDC.get(EPCommonSystemProperties.PROTOCOL),
-                               securityEventType.name(), MDC.get(EPCommonSystemProperties.MDC_LOGIN_ID),
-                               additionalInfoAppender.toString());
-
-               logger.info(EELFLoggerDelegate.auditLogger, auditMessage);
-       }
-
-       /**
-        * 
-        * @param req
-        * @param securityEventType
-        * @param restMethod
-        */
-       private void setHttpRequestBasedDefaultsIntoGlobalLoggingContext(HttpServletRequest req,
-                       SecurityEventTypeEnum securityEventType, String restMethod) {
-               /**
-                * No need to load the request based defaults for the following security
-                * messages since either they are initiated by the Portal BE or not Http
-                * request based.
-                */
-               if (req != null) {
-                       if (securityEventType != SecurityEventTypeEnum.OUTGOING_REST_MESSAGE
-                                       && securityEventType != SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH
-                                       && securityEventType != SecurityEventTypeEnum.INCOMING_UEB_MESSAGE) {
-                               // Load the RequestID (aka TrasactionId) into MDC context.
-                               String requestId = UserUtils.getRequestId(req);
-                               if (requestId == "" || requestId == null) {
-                                       requestId = UUID.randomUUID().toString();
-                               }
-                               MDC.put(Configuration.MDC_KEY_REQUEST_ID, requestId);
-
-                               // Load user agent into MDC context, if available.
-                               String accessingClient = "Unknown";
-                               accessingClient = req.getHeader(SystemProperties.USERAGENT_NAME);
-                               if (accessingClient != null && accessingClient != "" && (accessingClient.contains("Mozilla")
-                                               || accessingClient.contains("Chrome") || accessingClient.contains("Safari"))) {
-                                       accessingClient = EPCommonSystemProperties.ECOMP_PORTAL_FE;
-                               }
-                               MDC.put(EPCommonSystemProperties.PARTNER_NAME, accessingClient);
-
-                               // Load loginId into MDC context.
-                               EPUser user = null;
-                               try {
-                                       user = EPUserUtils.getUserSession(req);
-                               } catch (SessionExpiredException se) {
-                                       adviceLogger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "setHttpRequestBasedDefaultsIntoGlobalLoggingContext: No user found in session");
-                               }
-
-                               MDC.put(EPCommonSystemProperties.MDC_LOGIN_ID, (user != null ? user.getOrgUserId() : "NoUser"));
-
-                               // Rest URL & Protocol
-                               String restURL = "";
-                               MDC.put(EPCommonSystemProperties.FULL_URL, EPCommonSystemProperties.UNKNOWN);
-                               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
-                               restURL = UserUtils.getFullURL(req);
-                               if (restURL != null && restURL != "") {
-                                       MDC.put(EPCommonSystemProperties.FULL_URL, restURL);
-                                       if (restURL.toLowerCase().contains("https")) {
-                                               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
-                                       }
-                               }
-
-                               // Rest Path
-                               MDC.put(Configuration.MDC_SERVICE_NAME, restMethod);
-                               String restPath = req.getServletPath();
-                               if (restPath != null && restPath != "") {
-                                       MDC.put(Configuration.MDC_SERVICE_NAME, restPath);
-                               }
-
-                               // Client IPAddress i.e. IPAddress of the remote host who is
-                               // making this request.
-                               String clientIPAddress = "";
-                               clientIPAddress = req.getHeader("X-FORWARDED-FOR");
-                               if (clientIPAddress == null) {
-                                       clientIPAddress = req.getRemoteAddr();
-                               }
-                               MDC.put(EPCommonSystemProperties.CLIENT_IP_ADDRESS, clientIPAddress);
-                       } else if (securityEventType == SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH) {
-                               MDC.put(EPCommonSystemProperties.TARGET_ENTITY, "Phonebook");
-                               MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, "search");
-                       }
-               } else {
-                       MDC.put(Configuration.MDC_SERVICE_NAME, restMethod);
-                       MDC.put(EPCommonSystemProperties.PARTNER_NAME, EPCommonSystemProperties.ECOMP_PORTAL_FE);
-               }
-
-               MDC.put(Configuration.MDC_SERVICE_INSTANCE_ID, "");
-               MDC.put(Configuration.MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.toString());
-               try {
-                       MDC.put(Configuration.MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
-                       MDC.put(Configuration.MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
-                       MDC.put(Configuration.MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID));
-               } catch (Exception e) {
-                       adviceLogger.error(EELFLoggerDelegate.errorLogger,
-                                       "setHttpRequestBasedDefaultsIntoGlobalLoggingContext failed", e);
-               }
-       }
-
-       /**
-        * 
-        * @param beginDateTime
-        * @param endDateTime
-        */
-       private void calculateDateTimeDifference(String beginDateTime, String endDateTime) {
-               if (beginDateTime != null && endDateTime != null) {
-                       try {
-                               Date beginDate = ecompLogDateFormat.parse(beginDateTime);
-                               Date endDate = ecompLogDateFormat.parse(endDateTime);
-                               String timeDifference = String.format("%d", endDate.getTime() - beginDate.getTime());
-                               MDC.put(SystemProperties.MDC_TIMER, timeDifference);
-                       } catch (Exception e) {
-                               adviceLogger.error(EELFLoggerDelegate.errorLogger, "calculateDateTimeDifference failed", e);
-                       }
-               }
-       }
-
-       public String getInternalResponseCode() {
-               return MDC.get(EPCommonSystemProperties.RESPONSE_CODE);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPMetricsLog.java
deleted file mode 100644 (file)
index 4cd5971..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.aop;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.METHOD, ElementType.TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface EPMetricsLog {
-    String value() default "";
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/ApplicationCodes.properties
deleted file mode 100644 (file)
index 09d7308..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-###
-# ============LICENSE_START==========================================
-# ONAP Portal
-# ===================================================================
-# Copyright © 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============================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-###
-########################################################################
-#Resource key=Error Code|Message text|Resolution text |Description text
-#######
-#Newlines can be utilized to add some clarity ensuring continuing line
-#has atleast one leading space
-#ResourceKey=\
-#             ERR0000E\
-#             Sample error msg txt\
-#             Sample resolution msg\
-#             Sample description txt
-#
-######
-#Error code classification category
-#100   Permission errors
-#200   Availability errors/Timeouts
-#300   Data errors
-#400   Schema Interface type/validation errors
-#500   Business process errors
-#900   Unknown errors
-#
-########################################################################
-
-# Define Alarm Codes Specific to ECOMP Portal
-BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT= ||Reason: {0}.|\
-                                                                               An Authentication failure occurred during access to UEB server. Please check that UEB keys are configured correctly under fusion.properties file.
-
-BERESTAPIAUTHENTICATIONERROR =                 |||Please check application credentials defined in Database or portal.properties file.
-                                                                               
-INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
-                                                                               
-INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
-
-INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
-
-INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT=||Description: {0}.|Please check the logs for more information.
-
-BEHEALTHCHECKERROR=                                            |||Please check the logs for more information.
-
-BEHEALTHCHECKMYSQLERROR=                               ||Please check the logs for more information.|\
-                                                                               Check connectivity to MYSQL is configured correctly under system.properties file.
-
-BEHEALTHCHECKUEBCLUSTERERROR=                  ||Please check the logs for more information.|\
-                                                                               Check connectivity to UEB cluster which is configured under portal.properties file.
-
-FEHEALTHCHECKERROR=                                            |||Please check connectivity from this FE instance towards BE or BE Load Balancer.
-                                                                               
-BEHEALTHCHECKRECOVERY=                                 |||Please check logs for more specific information about the problem.
-
-BEHEALTHCHECKMYSQLRECOVERY=                            |||Please check logs for more specific information about the problem.
-
-BEHEALTHCHECKUEBCLUSTERRECOVERY=               |||Please check logs for more specific information about the problem.
-
-FEHEALTHCHECKRECOVERY=                                 |||Please check logs for more specific information about the problem.
-
-#UEB communication
-BEUEBCONNECTIONERROR_ONE_ARGUMENT=             ||Reason: {0}.|\
-                                                                               Please check UEB server list and keys configured under Portal.Properties file.
-                                                                               
-BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT=             ||Cannot reach host {0}.|\
-                                                                               Please check UEB server list and keys configured under Portal.Properties file.
-
-#Onboarding apps
-BEUEBREGISTERONBOARDINGAPPERROR=               ||Reason: {0}.|\
-                                                                               Please check UEB server list and keys configured under Portal.Properties file.
-
-#HTTP communication
-BEHTTPCONNECTIONERROR_ONE_ARGUMENT=            ||Reason: {0}.|Please check the logs for more information.
-
-INTERNALCONNECTIONINFO_ONE_ARGUMENT=   ||Description: {0}.|Please check the logs for more information.
-
-INTERNALCONNECTIONWARNING_ONE_ARGUMENT=        ||Description: {0}.|Please check the logs for more information.
-
-INTERNALCONNECTIONERROR_ONE_ARGUMENT=  ||Description: {0}.|Please check the logs for more information.
-
-INTERNALCONNECTIONFATAL_ONE_ARGUMENT=  ||Description: {0}.|Please check the logs for more information.
-
-BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT= ||Data not found: {0}.|\
-                                                                               An error occurred during access to UEB Server, {1} failed to either register or unregister to/from UEB topic.
-
-#Login error codes
-BEUSERMISSINGERROR_ONE_ARGUMENT=               |||\
-                                                                               User {0} must be added to the corresponding application with proper user roles.
-                                                                               
-BEUSERINACTIVEWARNING_ONE_ARGUMENT=            |||\
-                                                                               User {0} must be added to the corresponding application with proper user roles.
-                                                                               
-BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT=        |||\
-                                                                               User {0} should be given proper administrator role for the corresponding application to perform the necessary actions.
-                                                                               
-BEINVALIDJSONINPUT=                                            |||Please check error logs for more information.
-
-BEINCORRECTHTTPSTATUSERROR=                            |||Please check logs for more information.
-
-BEINITIALIZATIONERROR=                                 |||Please check logs for more information.
-
-BEUEBSYSTEMERROR=                                              ||\
-                                                                               Operation: {0}.|\
-                                                                               An error occurred in {1} distribution mechanism. Please check the logs for more information.
-                                                                               
-BEDAOSYSTEMERROR=                                              |||Please check MySQL DB health or look at the logs for more details.
-
-BESYSTEMERROR=                                                 |||Please check logs for more information.
-
-BEEXECUTEROLLBACKERROR=                                        |||Please check MYSQL DB health or look at the logs for more details.
-
-FEHTTPLOGGINGERROR=                                            |||Please check MYSQL DB health or look at the logs for more details.
-                                                                               
-FEPORTALSERVLETERROR=                                  |||Please check logs for more specific information about the problem.
-
-BEDAOCLOSESESSIONERROR=                                        |||Please check MYSQL DB health or look at the logs form more details.
-
-BERESTAPIGENERALERROR=                                 |||Please check error log for more information.
-
-FEHEALTHCHECKGENERALERROR=                             |||Please check error log for more information.
-
-INTERNALUNEXPECTEDINFO_ONE_ARGUMENT=   |||Description: {0}.
-
-INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT=        |||Description: {0}.
-
-INTERNALUNEXPECTEDERROR_ONE_ARGUMENT=  |||Description: {0}.
-
-INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT=  |||Description: {0}.
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/EPAppMessagesEnum.java
deleted file mode 100644 (file)
index 4a99eee..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.format;
-
-import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum;
-import org.openecomp.portalsdk.core.logging.format.ErrorSeverityEnum;
-import org.openecomp.portalsdk.core.logging.format.ErrorTypeEnum;
-
-/**
- * 
- * Add ECOMP Portal Specific Error Code Enums here, for generic
- * ones (ones you think are useful not only Portal but also SDK), add it
- * to the enum class AppMessagesEnum defined in SDK.
- */
-public enum EPAppMessagesEnum {
-       /*
-       100-199 Security/Permission Related 
-                                                                               - Authentication problems (from external client, to external server)
-                                                                               - Certification errors
-                                                                               - 
-                                                                                       
-       200-299 Availability/Timeout Related
-                                                                               - connectivity error
-                                                                               - connection timeout
-                                                                               
-       300-399 Data Access/Integrity Related
-                                                                               - Data in graph in invalid(E.g. no creator is found for service) 
-                                                                               - Artifact is missing in ES, but exists in graph.
-                                                                                
-       400-499 Schema Interface Type/Validation
-                                                                               - received Pay-load checksum is invalid
-                                                                               - received JSON is not valid
-                                                         
-       500-599 Business/Flow Processing Related  
-                                                                               -  check out to service is not allowed
-                                                                               -  Roll-back is done
-                                                                               -  failed to generate heat file
-                                                                                 
-
-       600-899 Reserved - do not use
-
-       900-999 Unknown Errors 
-                                                                               - Unexpected exception
-                                                                               */
-       
-       BeUebAuthenticationError(EPErrorCodesEnum.BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                               "ERR100E", "An Authentication failure occurred during access to UEB server", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
-       
-       BeRestApiAuthenticationError(EPErrorCodesEnum.BERESTAPIAUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                               "ERR101E", "Rejected an incoming REST API request due to invalid credentials", "", "Please check application credentials defined in Database or properties files."),
-       
-       InternalAuthenticationInfo(EPErrorCodesEnum.INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                               "ERR199I", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
-       
-       InternalAuthenticationWarning(EPErrorCodesEnum.INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
-                                                               "ERR199W", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
-       
-       InternalAuthenticationError(EPErrorCodesEnum.INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                               "ERR199E", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
-       
-       InternalAuthenticationFatal(EPErrorCodesEnum.INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
-                                                               "ERR199F", "Internal authentication problem", "Details: {0}.", "Please check the logs for more information."),
-       
-       BeHealthCheckError(EPErrorCodesEnum.BeHEALTHCHECKERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                               "ERR200E", "ECOMP-PORTAL Back-end probably lost connectivity to either one of the following components: MySQL DB, UEB Cluster", "", "Please check the logs for more information."),
-
-       BeHealthCheckMySqlError(EPErrorCodesEnum.BEHEALTHCHECKMYSQLERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                               "ERR201E", "ECOMP-PORTAL Back-end probably lost connectivity to MySQL DB", "", "Check connectivity to MYSQL is configured correctly under system.properties file."),
-
-       BeHealthCheckUebClusterError(EPErrorCodesEnum.BEHEALTHCHECKUEBCLUSTERERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                               "ERR203E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "", "Check connectivity to UEB cluster which is configured under portal.properties file."),
-       
-       FeHealthCheckError(EPErrorCodesEnum.FEHEALTHCHECKERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                               "ERR204E", "Unable to connect to a valid ECOMP-PORTAL Back-end Server.", "", "Please check connectivity from this FE instance towards BE or BE Load Balancer."),
-       
-       BeHealthCheckRecovery(EPErrorCodesEnum.BEHEALTHCHECKRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                               "ERR205I", "ECOMP-PORTAL Back-end Recovery to either one of the following components: MySQL DB, UEB Cluster", "", "Please check logs for more specific information about the problem."),
-       
-       BeHealthCheckMySqlRecovery(EPErrorCodesEnum.BEHEALTHCHECKMYSQLRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                               "ERR206I", "ECOMP-PORTAL Back-end connection recovery to MySQL DB", "", "Please check logs for more specific information about the problem."),
-       
-       BeHealthCheckUebClusterRecovery(EPErrorCodesEnum.BEHEALTHCHECKUEBCLUSTERRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                               "ERR208I", "ECOMP-PORTAL Back-end connection recovery to UEB Cluster", "", "Please check logs for more specific information about the problem."),
-       
-       FeHealthCheckRecovery(EPErrorCodesEnum.FEHEALTHCHECKRECOVERY, ErrorTypeEnum.RECOVERY, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                               "ERR209I", "Connectivity to ECOMP-PORTAL Front-end Server is recovered", "", "Please check logs for more specific information about the problem."),
-    
-       BeUebConnectionError(EPErrorCodesEnum.BEUEBCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR210E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
-    
-    BeUebUnkownHostError(EPErrorCodesEnum.BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR211E", "ECOMP-PORTAL Back-end probably lost connectivity to UEB Cluster", "Cannot reach host: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
-       
-    BeUebRegisterOnboardingAppError(EPErrorCodesEnum.BEUEBREGISTERONBOARDINGAPPERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR212E", "Failed to register the On-boarding application with UEB Communication server", "Details: {0}.", "Please check UEB server list and keys configured under Portal.Properties file."),
-    
-    BeHttpConnectionError(EPErrorCodesEnum.BEHTTPCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                               "ERR213E", "It could be that communication to an external application might resulted an exception or failed to reach the external application", 
-                                                               "Details: {0}.", "Please check logs for more information."),
-    
-    InternalConnectionInfo(EPErrorCodesEnum.INTERNALCONNECTIONINFO_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                               "ERR299I", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
-    
-       InternalConnectionWarning(EPErrorCodesEnum.INTERNALCONNECTIONWARNING_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
-                                                               "ERR299W", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
-    
-    InternalConnectionError(EPErrorCodesEnum.INTERNALCONNECTIONERROR_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR299E", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
-    
-    InternalConnectionFatal(EPErrorCodesEnum.INTERNALCONNECTIONFATAL_ONE_ARGUMENT, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
-                                                       "ERR299F", "Internal Connection problem", "Details: {0}.", "Please check logs for more information."),
-    
-    BeUebObjectNotFoundError(EPErrorCodesEnum.BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR303E", "Error occurred during access to U-EB Server.", "Data not found: {0}.", "An error occurred during access to UEB Server, {1} failed to either register or unregister to/from UEB topic."),
-    
-    BeUserMissingError(EPErrorCodesEnum.BEUSERMISSINGERROR_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR310E", "User is not found", "", "User {0} must be added to the corresponding application with proper user roles."),
-    
-    BeUserInactiveWarning(EPErrorCodesEnum.BEUSERINACTIVEWARNING_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
-                                                       "ERR313W", "User is found but in-active", "", "User {0} must be added to the corresponding application with proper user roles."),
-    
-    BeUserAdminPrivilegesInfo(EPErrorCodesEnum.BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
-                                                       "ERR314W", "User is found but don't have administrative privileges", "", "User {0} should be given administrator role for the corresponding application to perform the necessary actions."),
-    
-    BeInvalidJsonInput(EPErrorCodesEnum.BEINVALIDJSONINPUT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR405E", "Failed to convert JSON input to object", "", "Please check logs for more information."),
-    
-    BeIncorrectHttpStatusError(EPErrorCodesEnum.BEINCORRECTHTTPSTATUSERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR407E", "Communication to an external application is resulted in with Incorrect Http response code", "", "Please check logs for more information."),
-    
-    BeInitializationError(EPErrorCodesEnum.BEINITIALIZATIONERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                       "ERR500E", "ECOMP-PORTAL Back-end was not initialized properly", "", "Please check logs for more information."),
-    
-    BeUebSystemError(EPErrorCodesEnum.BEUEBSYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR502E", "Error occurred during access to U-EB Server", "Details: {0}.", "An error occurred in {1} distribution mechanism. Please check the logs for more information."),
-    
-    BeDaoSystemError(EPErrorCodesEnum.BEDAOSYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                       "ERR505E", "Performing DDL or DML operations on database might have failed", "", "Please check MySQL DB health or look at the logs for more details."),
-    
-    BeSystemError(EPErrorCodesEnum.BESYSTEMERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                       "ERR506E", "Unexpected error during operation", "", "Please check logs for more information."),
-    
-    BeExecuteRollbackError(EPErrorCodesEnum.BEEXECUTEROLLBACKERROR, ErrorTypeEnum.DATA_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR507E", "Roll-back operation towards database has failed", "", "Please check MYSQL DB health or look at the logs for more details."),
-    
-    FeHttpLoggingError(EPErrorCodesEnum.FEHTTPLOGGINGERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR517E", "Error when logging FE HTTP request/response", "", "Please check MYSQL DB health or look at the logs for more details."),
-    
-       FePortalServletError(EPErrorCodesEnum.FEPORTALSERVLETERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                               "ERR518E", "Error when trying to access FE Portal page.", "", "Please check logs for more information."),
-       
-    BeDaoCloseSessionError(EPErrorCodesEnum.BEDAOCLOSESESSIONERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR519E", "Close local session operation with database failed", "", "Please check MYSQL DB health or look at the logs form more details."),
-    
-    BeRestApiGeneralError(EPErrorCodesEnum.BERESTAPIGENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                       "ERR900E", "Unexpected error during ECOMP-PORTAL Back-end REST API execution", "", "Please check error log for more information."),
-    
-    FeHealthCheckGeneralError(EPErrorCodesEnum.FEHEALTHCHECKGENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.ERROR,
-                                                       "ERR901E", "General error during FE Health Check", "", "Please check error log for more information."),
-    
-    InternalUnexpectedInfo(EPErrorCodesEnum.INTERNALUNEXPECTEDINFO_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.INFORMATIONAL, ErrorSeverityEnum.INFO,
-                                                       "ERR999I", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
-    
-    InternalUnexpectedWarning(EPErrorCodesEnum.INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MINOR, ErrorSeverityEnum.WARN,
-                                                       "ERR999W", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
-    
-    InternalUnexpectedError(EPErrorCodesEnum.INTERNALUNEXPECTEDERROR_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                                                       "ERR999E", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
-    
-    InternalUnexpectedFatal(EPErrorCodesEnum.INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.CRITICAL, ErrorSeverityEnum.FATAL,
-                                                       "ERR999F", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
-    
-    ExternalAuthAccessConnectionError(EPErrorCodesEnum.EXTERNALAUTHACCESS_CONNECTIONERROR, ErrorTypeEnum.CONNECTION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                       "ERR220E", "AAF Connection problem", "Details: {0}.", "Please check logs for more information."),
-
-    ExternalAuthAccessAuthenticationError(EPErrorCodesEnum.EXTERNALAUTHACCESS_AUTHENTICATIONERROR, ErrorTypeEnum.AUTHENTICATION_PROBLEM, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                       "ERR120E", "AAF authentication problem", "Details: {0}.", "Please check logs for more information."),
-    
-    ExternalAuthAccessGeneralError(EPErrorCodesEnum.EXTERNALAUTHACCESS_GENERALERROR, ErrorTypeEnum.SYSTEM_ERROR, AlarmSeverityEnum.MAJOR, ErrorSeverityEnum.ERROR,
-                       "ERR520E", "Unexpected error", "Details: {0}.", "Please check logs for more information."),
-
-       ;
-       
-       ErrorTypeEnum eType;
-       AlarmSeverityEnum alarmSeverity;
-       EPErrorCodesEnum messageCode;
-       ErrorSeverityEnum errorSeverity;
-       String errorCode;
-       String errorDescription;
-       String details;
-       String resolution;
-       
-       EPAppMessagesEnum(EPErrorCodesEnum messageCode, ErrorTypeEnum eType, AlarmSeverityEnum alarmSeverity, ErrorSeverityEnum errorSeverity, String errorCode, String errorDescription, 
-                                               String details, String resolution) {
-               this.messageCode = messageCode;
-               this.eType = eType;
-               this.alarmSeverity = alarmSeverity;
-               this.errorSeverity = errorSeverity;
-               this.errorCode = errorCode;
-               this.errorDescription = errorDescription;
-               this.details = details;
-               this.resolution = resolution;
-       }
-       
-       public String getDetails() {
-               return this.details;
-       }
-       
-       public String getResolution() {
-               return this.resolution;
-       }
-       public String getErrorCode() {
-               return this.errorCode;
-       }
-       
-       public String getErrorDescription() {
-               return this.errorDescription;
-       }
-       
-       public ErrorSeverityEnum getErrorSeverity() {
-               return this.errorSeverity;
-       }
-       
-       public void setErrorSeverity(ErrorSeverityEnum errorSeverity) {
-               this.errorSeverity = errorSeverity;
-       }
-       
-       public EPErrorCodesEnum getMessageCode() {
-               return messageCode;
-       }
-
-       public void setMessageCode(EPErrorCodesEnum messageCode) {
-               this.messageCode = messageCode;
-       }
-       
-       public AlarmSeverityEnum getAlarmSeverity() {
-               return alarmSeverity;
-       }
-
-       public void setAlarmSeverity(AlarmSeverityEnum alarmSeverity) {
-               this.alarmSeverity = alarmSeverity;
-       }
-       
-       public ErrorTypeEnum getErrorType() {
-               return eType;
-       }
-
-       public void setErrorType(ErrorTypeEnum eType) {
-               this.eType = eType;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/format/EPErrorCodesEnum.java
deleted file mode 100644 (file)
index cdcc064..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.format;
-
-import com.att.eelf.i18n.EELFResolvableErrorEnum;
-import com.att.eelf.i18n.EELFResourceManager;
-
-/**
- * 
- * Add ECOMP Portal Specific Error Code Enums here, for generic
- * ones (ones you think are useful not only Portal but also SDK), add it
- * to the enum class AppMessagesEnum defined in SDK.
- */
-public enum EPErrorCodesEnum implements EELFResolvableErrorEnum {
-       BERESTAPIAUTHENTICATIONERROR,
-       BEHTTPCONNECTIONERROR_ONE_ARGUMENT,
-       BEUEBAUTHENTICATIONERROR_ONE_ARGUMENT,
-       
-       INTERNALAUTHENTICATIONINFO_ONE_ARGUMENT,
-       INTERNALAUTHENTICATIONWARNING_ONE_ARGUMENT,
-       INTERNALAUTHENTICATIONERROR_ONE_ARGUMENT,
-       INTERNALAUTHENTICATIONFATAL_ONE_ARGUMENT,
-       
-       BEHEALTHCHECKRECOVERY,
-       BEHEALTHCHECKMYSQLRECOVERY,
-       BEHEALTHCHECKUEBCLUSTERRECOVERY,
-       FEHEALTHCHECKRECOVERY,
-       BeHEALTHCHECKERROR,
-       
-       BEHEALTHCHECKMYSQLERROR,
-       BEHEALTHCHECKUEBCLUSTERERROR,
-       FEHEALTHCHECKERROR,
-       BEUEBCONNECTIONERROR_ONE_ARGUMENT,
-       BEUEBUNKOWNHOSTERROR_ONE_ARGUMENT,
-       BEUEBREGISTERONBOARDINGAPPERROR,
-       
-       INTERNALCONNECTIONINFO_ONE_ARGUMENT,
-       INTERNALCONNECTIONWARNING_ONE_ARGUMENT,
-       INTERNALCONNECTIONERROR_ONE_ARGUMENT,
-       INTERNALCONNECTIONFATAL_ONE_ARGUMENT,
-       
-       BEUEBOBJECTNOTFOUNDERROR_ONE_ARGUMENT,
-       BEUSERMISSINGERROR_ONE_ARGUMENT,
-       
-       BEUSERINACTIVEWARNING_ONE_ARGUMENT,
-       BEUSERADMINPRIVILEGESINFO_ONE_ARGUMENT,
-       
-       BEINVALIDJSONINPUT,
-       BEINCORRECTHTTPSTATUSERROR,
-               
-       BEINITIALIZATIONERROR,
-       BEUEBSYSTEMERROR,
-       BEDAOSYSTEMERROR,
-       BESYSTEMERROR,
-       BEEXECUTEROLLBACKERROR,
-       
-       FEHTTPLOGGINGERROR,
-       FEPORTALSERVLETERROR,
-       BEDAOCLOSESESSIONERROR,
-       
-       BERESTAPIGENERALERROR,
-       FEHEALTHCHECKGENERALERROR,
-       
-       INTERNALUNEXPECTEDINFO_ONE_ARGUMENT,
-       INTERNALUNEXPECTEDWARNING_ONE_ARGUMENT,
-       INTERNALUNEXPECTEDERROR_ONE_ARGUMENT,
-       INTERNALUNEXPECTEDFATAL_ONE_ARGUMENT,
-       
-       EXTERNALAUTHACCESS_CONNECTIONERROR,
-       EXTERNALAUTHACCESS_AUTHENTICATIONERROR,
-       EXTERNALAUTHACCESS_GENERALERROR,
-       ;
-       
-       /**
-     * Static initializer to ensure the resource bundles for this class are loaded...
-     * Here this application loads messages from three bundles
-     */
-    static {
-        EELFResourceManager.loadMessageBundle("org/openecomp/portalapp/portal/logging/format/ApplicationCodes");
-    }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/logging/logic/EPLogUtil.java
deleted file mode 100644 (file)
index 9c9137f..0000000
+++ /dev/null
@@ -1,311 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.logic;
-
-import static com.att.eelf.configuration.Configuration.MDC_ALERT_SEVERITY;
-
-import java.text.MessageFormat;
-
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum;
-import org.openecomp.portalsdk.core.logging.format.ErrorSeverityEnum;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.slf4j.MDC;
-import org.springframework.http.HttpStatus;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-public class EPLogUtil {
-
-       // This class has no logger of its own; it uses loggers passed to it.
-       private static EELFLogger errorLogger = EELFManager.getInstance().getErrorLogger();
-
-       /**
-        * Formats and writes a message to the error log with the class name and the
-        * specified parameters, using log level info, warn or error appropriate for
-        * the specified severity
-        * 
-        * @param classLogger
-        *            Logger for the class where the error occurred; the logger
-        *            carries the class name.
-        * @param epMessageEnum
-        *            Enum carrying alarm and error severity
-        * @param param
-        *            Values used to build the message.
-        */
-       public static void logEcompError(EELFLoggerDelegate classLogger, EPAppMessagesEnum epMessageEnum, String... param) {
-               logEcompError(classLogger, epMessageEnum, null, param);
-       }
-
-       /**
-        * Formats and writes a message to the error log with the class name and the
-        * specified parameters, using log level info, warn or error appropriate for
-        * the specified severity
-        * 
-        * @param epMessageEnum
-        *            Enum carrying alarm and error severity
-        * @param param
-        *            Values used to build the message.
-        */
-       public static void logEcompError(EPAppMessagesEnum epMessageEnum, String... param) {
-               try {
-                       AlarmSeverityEnum alarmSeverityEnum = epMessageEnum.getAlarmSeverity();
-                       ErrorSeverityEnum errorSeverityEnum = epMessageEnum.getErrorSeverity();
-
-                       MDC.put(MDC_ALERT_SEVERITY, alarmSeverityEnum.name());
-                       MDC.put("ErrorCode", epMessageEnum.getErrorCode());
-                       MDC.put("ErrorDescription", epMessageEnum.getErrorDescription());
-                       MDC.put("ClassName", EPLogUtil.class.getName());
-
-                       String resolution = EPLogUtil
-                                       .formatMessage(epMessageEnum.getDetails() + " " + epMessageEnum.getResolution(), (Object[]) param);
-                       if (errorSeverityEnum == ErrorSeverityEnum.WARN) {
-                               errorLogger.warn(resolution);
-                       } else if (errorSeverityEnum == ErrorSeverityEnum.INFO) {
-                               errorLogger.info(resolution);
-                       } else {
-                               errorLogger.error(resolution);
-                       }
-               } catch (Exception e) {
-                       errorLogger.error("logEcompError failed", e);
-               } finally {
-                       MDC.remove("ErrorCode");
-                       MDC.remove("ErrorDescription");
-                       MDC.remove("ClassName");
-                       MDC.remove(MDC_ALERT_SEVERITY);
-               }
-       }
-
-       /**
-        * Formats and writes a message to the error log with the class name,
-        * throwable and the specified parameters, using log level info, warn or
-        * error appropriate for the specified severity
-        * 
-        * @param classLogger
-        *            Logger for the class where the error occurred; the logger
-        *            carries the class name.
-        * @param epMessageEnum
-        *            Enum carrying alarm and error severity
-        * @param th
-        *            Throwable; ignored if null
-        * @param param
-        *            Array of Strings used to build the message.
-        */
-       @SuppressWarnings("static-access")
-       public static void logEcompError(EELFLoggerDelegate classLogger, EPAppMessagesEnum epMessageEnum, Throwable th,
-                       String... param) {
-
-               AlarmSeverityEnum alarmSeverityEnum = epMessageEnum.getAlarmSeverity();
-               ErrorSeverityEnum errorSeverityEnum = epMessageEnum.getErrorSeverity();
-
-               MDC.put(MDC_ALERT_SEVERITY, alarmSeverityEnum.name());
-               MDC.put("ErrorCode", epMessageEnum.getErrorCode());
-               MDC.put("ErrorDescription", epMessageEnum.getErrorDescription());
-
-               final String message = EPLogUtil.formatMessage(epMessageEnum.getDetails() + " " + epMessageEnum.getResolution(),
-                               (Object[]) param);
-               if (errorSeverityEnum == ErrorSeverityEnum.INFO) {
-                       if (th == null)
-                               classLogger.info(classLogger.errorLogger, message);
-                       else
-                               classLogger.info(classLogger.errorLogger, message, th);
-               } else if (errorSeverityEnum == ErrorSeverityEnum.WARN) {
-                       if (th == null)
-                               classLogger.warn(classLogger.errorLogger, message);
-                       else
-                               classLogger.warn(classLogger.errorLogger, message, th);
-               } else {
-                       if (th == null)
-                               classLogger.error(classLogger.errorLogger, message);
-                       else
-                               classLogger.error(classLogger.errorLogger, message, th);
-               }
-
-               // Clean up
-               MDC.remove(MDC_ALERT_SEVERITY);
-               MDC.remove("ErrorCode");
-               MDC.remove("ErrorDescription");
-       }
-
-       /**
-        * Builds a string using the format and parameters.
-        * 
-        * @param message
-        * @param args
-        * @return
-        */
-       private static String formatMessage(String message, Object... args) {
-               StringBuilder sbFormattedMessage = new StringBuilder();
-               if (args != null && args.length > 0 && message != null && message != "") {
-                       MessageFormat mf = new MessageFormat(message);
-                       sbFormattedMessage.append(mf.format(args));
-               } else {
-                       sbFormattedMessage.append(message);
-               }
-               return sbFormattedMessage.toString();
-       }
-
-       /**
-        * Builds a comma-separated string of values to document a user action.
-        * 
-        * @param action
-        *            String
-        * @param activity
-        *            String
-        * @param userId
-        *            String
-        * @param affectedId
-        *            String
-        * @param comment
-        *            String
-        * @return Value suitable for writing to the audit log file.
-        */
-       public static String formatAuditLogMessage(String action, String activity, String userId, String affectedId,
-                       String comment) {
-               StringBuilder auditLogMsg = new StringBuilder();
-               auditLogMsg.append("Click_A:[");
-               if (action != null && !action.equals("")) {
-                       auditLogMsg.append(" Action: ");
-                       auditLogMsg.append(action);
-               }
-
-               if (activity != null && !activity.equals("")) {
-                       auditLogMsg.append(",Activity CD: ");
-                       auditLogMsg.append(activity);
-               }
-
-               if (userId != null && !userId.equals("")) {
-                       auditLogMsg.append(",User ID: ");
-                       auditLogMsg.append(userId);
-               }
-
-               if (affectedId != null && !affectedId.equals("")) {
-                       auditLogMsg.append(",Affected ID: ");
-                       auditLogMsg.append(affectedId);
-               }
-
-               if (comment != null && !comment.equals("")) {
-                       auditLogMsg.append(",Comment: ");
-                       auditLogMsg.append(comment);
-               }
-               auditLogMsg.append("]");
-               return auditLogMsg.toString();
-       }
-
-       /**
-        * Builds a comma-separated string of values to document a user browser
-        * action.
-        * 
-        * @param orgUserId
-        *            String
-        * @param appName
-        *            String
-        * @param action
-        *            String
-        * @param activity
-        *            String
-        * @param actionLink
-        *            String
-        * @param page
-        *            String
-        * @param function
-        *            String
-        * @param type
-        *            String
-        * @return String value suitable for writing to the audit log file.
-        */
-       public static String formatStoreAnalyticsAuditLogMessage(String orgUserId, String appName, String action,
-                       String activity, String actionLink, String page, String function, String type) {
-               StringBuilder auditLogStoreAnalyticsMsg = new StringBuilder();
-               auditLogStoreAnalyticsMsg.append("Click_Analytics:[");
-               if (orgUserId != null && !orgUserId.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(" Organization User ID: ");
-                       auditLogStoreAnalyticsMsg.append(orgUserId);
-               }
-
-               if (appName != null && !appName.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",AppName: ");
-                       auditLogStoreAnalyticsMsg.append(appName);
-               }
-
-               if (action != null && !action.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",Action: ");
-                       auditLogStoreAnalyticsMsg.append(action);
-               }
-
-               if (activity != null && !activity.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",Activity: ");
-                       auditLogStoreAnalyticsMsg.append(activity);
-               }
-
-               if (actionLink != null && !actionLink.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",ActionLink: ");
-                       auditLogStoreAnalyticsMsg.append(actionLink);
-               }
-
-               if (page != null && !page.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",Page: ");
-                       auditLogStoreAnalyticsMsg.append(page);
-               }
-
-               if (function != null && !function.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",Function: ");
-                       auditLogStoreAnalyticsMsg.append(function);
-               }
-
-               if (type != null && !type.equals("")) {
-                       auditLogStoreAnalyticsMsg.append(",Type: ");
-                       auditLogStoreAnalyticsMsg.append(type);
-               }
-               auditLogStoreAnalyticsMsg.append("]");
-               return auditLogStoreAnalyticsMsg.toString();
-       }
-
-       public static void logExternalAuthAccessAlarm(EELFLoggerDelegate logger, HttpStatus res) {
-               if (res.equals(HttpStatus.UNAUTHORIZED) || res.equals(HttpStatus.FORBIDDEN)) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.ExternalAuthAccessAuthenticationError);
-               } else if (res.equals(HttpStatus.NOT_FOUND) || res.equals(HttpStatus.NOT_ACCEPTABLE)
-                               || res.equals(HttpStatus.CONFLICT) || res.equals(HttpStatus.BAD_REQUEST)) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.ExternalAuthAccessConnectionError);
-               } else if (!res.equals(HttpStatus.ACCEPTED) && !res.equals(HttpStatus.OK)) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.ExternalAuthAccessGeneralError);
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/RestObject.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/RestObject.java
deleted file mode 100644 (file)
index 354b9ef..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler;
-
-
-public class RestObject<T> {
-       
-    private T t;
-   
-    private int statusCode= 0;
-    
-    public String uuid;
-    
-    public void set(T t) { this.t = t; }
-    
-    public T get() { return t; }
-          
-    public void setStatusCode(int v) { this.statusCode = v; }
-       
-    public int getStatusCode() { return this.statusCode; }
-        
-    public void setUUID(String uuid) { this.uuid = uuid; }
-    
-    public String getUUID() { return this.uuid; }
-}
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerProperties.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerProperties.java
deleted file mode 100644 (file)
index fe6a9ac..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-public class SchedulerProperties extends SystemProperties {
-
-       public static final String SCHEDULER_USER_NAME_VAL = "scheduler.user.name";;
-
-       public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
-
-       public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
-
-       public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
-
-       public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
-
-       public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerResponseWrapper.java
deleted file mode 100644 (file)
index 731eef8..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Scheduler response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-           "status",
-           "entity",
-           "uuid"
-})
-
-public class SchedulerResponseWrapper {
-       
-       @JsonProperty("status")
-       private int status;
-
-       @JsonProperty("entity")
-       private String entity;
-       
-       @JsonProperty("uuid")
-       private String uuid;
-
-       @JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-       
-       @JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }
-       
-       @JsonProperty("uuid")
-    public String getUuid() {
-        return uuid;
-    }  
-       
-       @JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-
-       @JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-       
-       @JsonProperty("uuid")
-    public void setUuid(String v) {
-        this.uuid = v;
-    }  
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-       
-       StringBuilder b = new StringBuilder ("{ \"status\": ");
-       b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
-        return (b.toString());
-    }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInt.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInt.java
deleted file mode 100644 (file)
index 78a0b10..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class SchedulerRestInt {
-       
-       /** The logger. */
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       /** The request date format. */
-       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-       
-       public SchedulerRestInt() {
-               requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterface.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterface.java
deleted file mode 100644 (file)
index 9acfd5a..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler;
-
-import java.util.Collections;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.codec.binary.Base64;
-import org.json.simple.JSONObject;
-import org.openecomp.portalapp.portal.scheduler.client.HttpBasicClient;
-import org.openecomp.portalapp.portal.scheduler.client.HttpsBasicClient;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.stereotype.Service;
-import org.openecomp.portalapp.portal.scheduler.restobjects.RestObject;
-
-
-@Service
-public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
-
-       private static Client client = null;
-               
-       private MultivaluedHashMap<String, Object> commonHeaders;
-       
-       public SchedulerRestInterface() {
-               super();
-       }
-       
-       public void initRestClient()
-       {
-               final String methodname = "initRestClient()";
-               
-               final String username = "";//SystemProperties.getProperty(SchedulerProperties.SCHEDULER_USER_NAME_VAL);
-               //final String password = "";//SystemProperties.getProperty(SchedulerProperties.SCHEDULER_PASSWORD_VAL);
-               final String scheduler_url = "";//SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL);
-               final String decrypted_password = "";//Password.deobfuscate(password);
-               
-               String authString = username + ":" + decrypted_password;
-               
-               byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
-               String authStringEnc = new String(authEncBytes);
-
-               commonHeaders = new MultivaluedHashMap<String, Object> ();
-               commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authStringEnc)));
-               
-               boolean use_ssl = true;
-               if ( (scheduler_url != null) && ( !(scheduler_url.isEmpty()) ) ) {
-                       if ( scheduler_url.startsWith("https")) {
-                               use_ssl = true;
-                       }
-                       else {
-                               use_ssl = false;
-                       }
-               }
-               if (client == null) {
-                       
-                       try {
-                               if ( use_ssl ) { 
-                                       
-                                       client = HttpsBasicClient.getClient();
-                               }
-                               else {
-                                       
-                                       client = HttpBasicClient.getClient();
-                               }
-                       } catch (Exception e) {
-                               System.out.println(  methodname + " Unable to get the SSL client");
-                       }
-               }
-       }
-               
-       @SuppressWarnings("unchecked")
-       public <T> void Get (T t, String sourceId, String path, org.openecomp.portalapp.portal.scheduler.restobjects.RestObject<T> restObject ) throws Exception {
-               
-               String methodName = "Get";
-               String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
-               
-               
-               System.out.println( "<== URL FOR GET : " + url + "\n");
-
-        initRestClient();
-               
-               final Response cres = client.target(url)
-                        .request()
-                .accept("application/json")
-                .headers(commonHeaders)
-                .get();
-                               
-               int status = cres.getStatus();
-               restObject.setStatusCode (status);
-               
-               if (status == 200) {
-                        t = (T) cres.readEntity(t.getClass());
-                        restObject.set(t);
-                       
-                } else {
-                    throw new Exception(methodName + " with status="+ status + ", url= " + url );
-                }
-
-               return;
-       }
-               
-       @SuppressWarnings("unchecked")
-       public <T> void Post(T t, JSONObject requestDetails, String path, RestObject<T> restObject) throws Exception {
-               
-        String methodName = "Post";
-        String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
-                       
-        System.out.println( "<== URL FOR POST : " + url + "\n");
-     
-        try {
-            
-            initRestClient();    
-    
-            // Change the content length
-            final Response cres = client.target(url)
-                .request()
-                 .accept("application/json")
-                        .headers(commonHeaders)
-                 //.header("content-length", 201)
-                 //.header("X-FromAppId",  sourceID)
-                 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
-            
-            try {
-                               t = (T) cres.readEntity(t.getClass());
-                               restObject.set(t);
-            }
-            catch ( Exception e ) {
-               
-               System.out.println("<== " + methodName + " : No response entity, this is probably ok, e=" + e.getMessage());
-            }
-
-            int status = cres.getStatus();
-               restObject.setStatusCode (status);              
-                               
-               if ( status >= 200 && status <= 299 ) {
-                                               
-                       System.out.println( "<== " + methodName + " : REST api POST was successful!" + "\n");
-               
-             } else {
-                System.out.println( "<== " + methodName + " : FAILED with http status : "+status+", url = " + url + "\n");
-             }    
-   
-        } catch (Exception e)
-        {
-               System.out.println( "<== " + methodName + " : with url="+url+ ", Exception: " + e.toString() + "\n");
-               throw e;        
-        }
-    }
-       
-       @SuppressWarnings("unchecked")
-       public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject) {
-        
-               String url="";
-               Response cres = null;
-               
-               try {
-                       initRestClient();
-                       
-                       url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
-               
-                       cres = client.target(url)
-                                        .request()
-                                .accept("application/json")
-                                .headers(commonHeaders)
-                                //.entity(r)
-                                .build("DELETE", Entity.entity(requestDetails, MediaType.APPLICATION_JSON)).invoke();
-                              //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
-                                //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-                       
-                       int status = cres.getStatus();
-               restObject.setStatusCode (status);
-                               
-                       try {
-                               t = (T) cres.readEntity(t.getClass());
-                               restObject.set(t);
-            }
-            catch ( Exception e ) {
-            }
-   
-        } 
-               catch (Exception e)
-        {      
-                throw e;        
-        }
-       }
-       
-       public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
-       {
-               return clazz.newInstance();
-       }
-
-       @Override
-       public void logRequest(JSONObject requestDetails) {
-               // TODO Auto-generated method stub
-               
-       }       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterfaceFactory.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterfaceFactory.java
deleted file mode 100644 (file)
index 8aaf881..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler;
-
-public class SchedulerRestInterfaceFactory {
-
-       public static SchedulerRestInterfaceIfc getInstance() {
-               SchedulerRestInterfaceIfc obj = null;
-
-               obj = new SchedulerRestInterface();
-
-               return (obj);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterfaceIfc.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerRestInterfaceIfc.java
deleted file mode 100644 (file)
index 738f9ba..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler;
-
-import org.json.simple.JSONObject;
-import org.springframework.stereotype.Service;
-import org.openecomp.portalapp.portal.scheduler.restobjects.RestObject;
-
-@Service
-public interface SchedulerRestInterfaceIfc {
-
-       public void initRestClient();
-
-       public <T> void Get(T t, String sourceId, String path,
-                       org.openecomp.portalapp.portal.scheduler.restobjects.RestObject<T> restObject) throws Exception;
-
-       public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject)
-                       throws Exception;
-
-       public <T> void Post(T t, JSONObject r, String path, RestObject<T> restObject) throws Exception;
-
-       public void logRequest(JSONObject requestDetails);
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerUtil.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/SchedulerUtil.java
deleted file mode 100644 (file)
index 39de6b3..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalapp.portal.scheduler.restobjects.GetTimeSlotsRestObject;
-import org.openecomp.portalapp.portal.scheduler.restobjects.PostCreateNewVnfRestObject;
-import org.openecomp.portalapp.portal.scheduler.restobjects.PostSubmitVnfChangeRestObject;
-import org.openecomp.portalapp.portal.scheduler.wrapper.GetTimeSlotsWrapper;
-import org.openecomp.portalapp.portal.scheduler.wrapper.PostCreateNewVnfWrapper;
-import org.openecomp.portalapp.portal.scheduler.wrapper.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class SchedulerUtil {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerUtil.class);
-
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-       public static GetTimeSlotsWrapper getTimeSlotsWrapResponse(GetTimeSlotsRestObject<String> rs) {
-
-               String resp_str = "";
-               int status = 0;
-
-               if (rs != null) {
-                       resp_str = rs.get();
-                       status = rs.getStatusCode();
-               }
-
-               GetTimeSlotsWrapper w = new GetTimeSlotsWrapper();
-
-               w.setEntity(resp_str);
-               w.setStatus(status);
-
-               return (w);
-       }
-
-       public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse(
-                       PostSubmitVnfChangeRestObject<String> rs) {
-
-               String resp_str = "";
-               int status = 0;
-               String uuid = "";
-
-               if (rs != null) {
-                       resp_str = rs.get();
-                       status = rs.getStatusCode();
-                       uuid = rs.getUUID();
-               }
-
-               PostSubmitVnfChangeTimeSlotsWrapper w = new PostSubmitVnfChangeTimeSlotsWrapper();
-
-               w.setEntity(resp_str);
-               w.setStatus(status);
-               w.setUuid(uuid);
-
-               return (w);
-       }
-
-       public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse(PostCreateNewVnfRestObject<String> rs) {
-
-               String resp_str = "";
-               int status = 0;
-               String uuid = "";
-
-               if (rs != null) {
-                       resp_str = rs.get();
-                       status = rs.getStatusCode();
-                       uuid = rs.getUUID();
-               }
-
-               PostCreateNewVnfWrapper w = new PostCreateNewVnfWrapper();
-
-               w.setEntity(resp_str);
-               w.setStatus(status);
-               w.setUuid(uuid);
-
-               return (w);
-       }
-
-       public static <T> String convertPojoToString(T t) throws com.fasterxml.jackson.core.JsonProcessingException {
-
-               String methodName = "convertPojoToString";
-               ObjectMapper mapper = new ObjectMapper();
-               String r_json_str = "";
-               if (t != null) {
-                       try {
-                               r_json_str = mapper.writeValueAsString(t);
-                       } catch (com.fasterxml.jackson.core.JsonProcessingException j) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json");
-                       }
-               }
-               return (r_json_str);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/client/HttpBasicClient.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/client/HttpBasicClient.java
deleted file mode 100644 (file)
index 2059cae..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.client;
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.openecomp.portalapp.portal.scheduler.util.CustomJacksonJaxBJsonProvider;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- *  General HTTP client.
- */
-
-public class HttpBasicClient{
-       
-       /** The servlet context. */
-       @Autowired 
-       private ServletContext servletContext;
-       
-       /** The logger. */
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       /**
-        * Obtain a basic HTTP client .
-        *
-        * @return Client client object
-        * @throws Exception the exception
-        */
-       public static Client getClient() throws Exception {
-               
-               ClientConfig config = new ClientConfig();
-               config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-               
-               return ClientBuilder.newClient(config)
-                               .register(CustomJacksonJaxBJsonProvider.class);
-       }       
-}  
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/client/HttpsBasicClient.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/client/HttpsBasicClient.java
deleted file mode 100644 (file)
index 2eb3ac7..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.client;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.eclipse.jetty.util.security.Password;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.openecomp.portalapp.portal.scheduler.properties.VidProperties;
-import org.openecomp.portalapp.portal.scheduler.util.CustomJacksonJaxBJsonProvider;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
- /**
-  *  General SSL client using the VID tomcat keystore. It doesn't use client certificates.
-  */
-public class HttpsBasicClient{
-       
-       /** The logger. */
-       static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsBasicClient.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       /**
-        * Retrieve an SSL client.
-        *
-        * @return Client The SSL client
-        * @throws Exception the exception
-        */
-       public static Client getClient() throws Exception {
-               String methodName = "getClient";
-               ClientConfig config = new ClientConfig();
-               //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
-               //config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-       
-               SSLContext ctx = null;
-               
-               try {
-                       
-                       config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-                       
-                       String truststore_path = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_FILENAME);
-                       logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " truststore_path=" + truststore_path);
-                       String truststore_password = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_PASSWD_X);
-                       
-                       
-                       String decrypted_truststore_password = Password.deobfuscate(truststore_password);
-                       //logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
-                       
-                       File tr = new File (truststore_path);
-                       logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute truststore path=" + tr.getAbsolutePath());
-                       
-                       //String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
-                       //String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
-                       //String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
-                       
-                   System.setProperty("javax.net.ssl.trustStore", truststore_path);
-                   System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
-                       HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
-                           public boolean verify(String string,SSLSession ssls) {
-                               return true;
-                           }
-                       });
-       
-                       //May need to make the algorithm a parameter. MSO requires TLSv1.1      or TLSv1.2
-                       ctx = SSLContext.getInstance("TLSv1.2");
-                       
-                       /* 
-                       KeyManagerFactory kmf = null;
-                       try {
-                               kmf = KeyManagerFactory.getInstance("SunX509");
-                               FileInputStream fin = new FileInputStream(keystore_path);
-                               KeyStore ks = KeyStore.getInstance("PKCS12");
-                               char[] pwd = decrypted_keystore_password.toCharArray();
-                               ks.load(fin, pwd);
-                               kmf.init(ks, pwd);
-                       } catch (Exception e) {
-                               System.out.println("Error setting up kmf: exiting");
-                               e.printStackTrace();
-                               System.exit(1);
-                       }
-
-                       ctx.init(kmf.getKeyManagers(), null, null);
-                       */
-                       ctx.init(null, null, null);
-                       //config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, 
-                       //                                                      new HTTPSProperties( , ctx));
-                       
-                       return ClientBuilder.newBuilder()
-                               .sslContext(ctx)
-                               .hostnameVerifier(new HostnameVerifier() {
-                                       @Override
-                                       public boolean verify( String s, SSLSession sslSession ) {
-                                               return true;
-                                       }
-                               }).withConfig(config)
-                               .build()
-                               .register(CustomJacksonJaxBJsonProvider.class);
-                       
-               } catch (Exception e) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
-                       //System.out.println("Error setting up config: exiting");
-                       e.printStackTrace();
-                       return null;
-               }
-                       
-               //Client client = ClientBuilder.newClient(config);
-               // uncomment this line to get more logging for the request/response
-               // client.addFilter(new LoggingFilter(System.out));
-               
-               //return client;
-       }
-}  
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyProperties.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyProperties.java
deleted file mode 100644 (file)
index a89b5d6..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-
-public class PolicyProperties extends SystemProperties {
-       
-       public static final String POLICY_CLIENTAUTH_VAL =  "policy.ClientAuth";
-       
-       public static final String POLICY_CLIENT_MECHID_VAL =  "policy.client.mechId";
-       
-       public static final String POLICY_CLIENT_PASSWORD_VAL =  "policy.client.password";
-       
-       public static final String POLICY_USERNAME_VAL =  "policy.username";
-       
-       public static final String POLICY_PASSWORD_VAL =  "policy.password";
-       
-       public static final String POLICY_AUTHORIZATION_VAL = "policy.Authorization";
-       
-       public static final String POLICY_SERVER_URL_VAL = "policy.server.url";
-       
-       public static final String POLICY_ENVIRONMENT_VAL = "policy.environment";
-       
-       public static final String POLICY_GET_CONFIG_VAL = "policy.get.config"; 
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyResponseWrapper.java
deleted file mode 100644 (file)
index 276af52..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Policy response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-           "status",
-           "entity"
-})
-
-public class PolicyResponseWrapper {
-       
-       @JsonProperty("status")
-       private int status;
-
-       @JsonProperty("entity")
-       private String entity;
-
-       @JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-       
-       @JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }  
-       
-       @JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-
-       @JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-       
-       StringBuilder b = new StringBuilder ("{ \"status\": ");
-        b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
-        return (b.toString());
-    }
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInt.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInt.java
deleted file mode 100644 (file)
index 14c4db7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalapp.portal.scheduler.policy.rest.RequestDetails;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class PolicyRestInt {
-       
-       /** The logger. */
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       /** The request date format. */
-       public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-       
-       public PolicyRestInt() {
-               requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
-       }
-
-       /**
-        * Log request.
-        *
-        * @param r the r
-        */
-       public void logRequest ( RequestDetails r ) {
-       String methodName = "logRequest";
-           ObjectMapper mapper = new ObjectMapper();
-           String r_json_str = "";
-           if ( r != null ) {
-               r_json_str = r.toString();
-                   try {
-                       r_json_str = mapper.writeValueAsString(r);
-                   }
-                   catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse request as json");
-                   }
-           }
-           logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Request=(" + r_json_str + ")");  
-    }
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterface.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterface.java
deleted file mode 100644 (file)
index e14dd10..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.json.simple.JSONObject;
-import org.openecomp.portalapp.portal.scheduler.client.HttpBasicClient;
-import org.openecomp.portalapp.portal.scheduler.policy.rest.RequestDetails;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-
-public class PolicyRestInterface extends PolicyRestInt implements PolicyRestInterfaceIfc {
-
-       /** The logger. */
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
-       
-       /** The Constant dateFormat. */
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       /** The client. */
-       private static Client client = null;
-       
-       /** The common headers. */
-       private MultivaluedHashMap<String, Object> commonHeaders;
-       
-       public PolicyRestInterface() {
-               super();
-       }
-       
-       public void initRestClient()
-       {
-               final String methodname = "initRestClient()";
-               
-               //final String clientAuth = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENTAUTH_VAL);
-               //final String authorization = SystemProperties.getProperty(PolicyProperties.POLICY_AUTHORIZATION_VAL);
-               final String mechId = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_MECHID_VAL);
-               final String clientPassword = SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_PASSWORD_VAL);
-               final String username = SystemProperties.getProperty(PolicyProperties.POLICY_USERNAME_VAL);
-               final String password = SystemProperties.getProperty(PolicyProperties.POLICY_PASSWORD_VAL);
-               final String environment = SystemProperties.getProperty(PolicyProperties.POLICY_ENVIRONMENT_VAL);
-                               
-               final String decrypted_client_password = Password.deobfuscate(clientPassword);          
-               String mechAuthString = mechId + ":" + decrypted_client_password;               
-               byte[] mechAuthEncBytes = Base64.encodeBase64(mechAuthString.getBytes());
-               String clientAuth = new String(mechAuthEncBytes);
-               
-               final String decrypted_password = Password.deobfuscate(password);               
-               String authString = username + ":" + decrypted_password;                
-               byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
-               String authorization = new String(authEncBytes);
-               
-               commonHeaders = new MultivaluedHashMap<String, Object> ();
-               commonHeaders.put("ClientAuth",  Collections.singletonList((Object) ("Basic " + clientAuth)));
-               commonHeaders.put("Authorization",  Collections.singletonList((Object) ("Basic " + authorization)));
-               commonHeaders.put("Environment",  Collections.singletonList((Object) (environment)));
-               
-               if (client == null) {
-                       
-                       try {
-                               client = HttpBasicClient.getClient();
-                       } catch (Exception e) {
-                               System.out.println(  methodname + " Unable to get the SSL client");
-                       }
-               }
-       }
-       
-       @SuppressWarnings("unchecked")
-       public <T> void  Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
-               String methodName = "Get";
-               
-               logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
-               
-               String url="";
-               restObject.set(t);
-               
-               url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
-        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " +  methodName + " sending request to url= " + url);
-               
-        initRestClient();
-               
-               final Response cres = client.target(url)
-                        .request()
-                .accept("application/json")
-                .headers(commonHeaders)
-                .get();
-               
-               int status = cres.getStatus();
-               restObject.setStatusCode (status);
-               
-               if (status == 200) {
-                        t = (T) cres.readEntity(t.getClass());
-                        restObject.set(t);
-                        logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
-                   
-                } else {
-                    throw new Exception(methodName + " with status="+ status + ", url= " + url );
-                }
-
-               logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
-               
-               return;
-       }
-   
-   @SuppressWarnings("unchecked")
-       public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
-        
-               String methodName = "Delete";
-               String url="";
-               Response cres = null;
-               
-               logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " start");
-               logRequest (r);
-
-               try {
-                       initRestClient();
-                       
-                       url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
-                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
-       
-                       cres = client.target(url)
-                                        .request()
-                                .accept("application/json")
-                                .headers(commonHeaders)
-                                //.entity(r)
-                                .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
-                              //  .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
-                                //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-                       
-                       int status = cres.getStatus();
-               restObject.setStatusCode (status);
-               
-                       if (status == 404) { // resource not found
-                               String msg = "Resource does not exist...: " + cres.getStatus();
-                               logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-                       } else if (status == 200  || status == 204){
-                               logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
-                       } else if (status == 202) {
-                               String msg = "Delete in progress: " + status;
-                               logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-                       }
-                       else {
-                               String msg = "Deleting Resource failed: " + status;
-                                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
-                       }
-                       
-                       try {
-                               t = (T) cres.readEntity(t.getClass());
-                               restObject.set(t);
-            }
-            catch ( Exception e ) {
-               logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
-                               + e.getMessage());
-            }
-   
-        } 
-               catch (Exception e)
-        {
-                logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-                throw e;
-        
-        }
-       }
-       
-       @SuppressWarnings("unchecked")
-       public <T> void Post(T t, JSONObject requestDetails, String uuid, String path, RestObject<T> restObject) throws Exception {
-               
-        String methodName = "Post";
-        String url="";
-
-        System.out.println( "POST policy rest interface");
-       
-     //   logRequest (requestDetails);
-        try {
-            
-            initRestClient();    
-    
-            url = SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL) + path;
-            System.out.println( "<== " +  methodName + " sending request to url= " + url);
-            // Change the content length
-            final Response cres = client.target(url)
-                .request()
-                 .accept("application/json")
-                        .headers(commonHeaders)
-                 //.header("content-length", 201)
-                 //.header("X-FromAppId",  sourceID)
-                 .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
-            
-            try {
-                               t = (T) cres.readEntity(t.getClass());
-                               restObject.set(t);
-            }
-            catch ( Exception e ) {
-               
-               System.out.println("<== " + methodName + " No response entity, this is probably ok, e=" + e.getMessage());
-            }
-
-            int status = cres.getStatus();
-               restObject.setStatusCode (status);
-               
-               if ( status >= 200 && status <= 299 ) {
-                       System.out.println( "<== " + methodName + " REST api POST was successful!");
-               
-             } else {
-                System.out.println( "<== " + methodName + " with status="+status+", url="+url);
-             }    
-   
-        } catch (Exception e)
-        {
-               System.out.println( "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
-                throw e;
-        
-        }
-    }
-       
-       public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
-       {
-               return clazz.newInstance();
-       }
-
-       @Override
-       public void logRequest(RequestDetails r) {
-               // TODO Auto-generated method stub
-       }       
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterfaceFactory.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterfaceFactory.java
deleted file mode 100644 (file)
index 2672654..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-public class PolicyRestInterfaceFactory {
-
-       public static PolicyRestInterfaceIfc getInstance() {
-               PolicyRestInterfaceIfc obj = null;
-
-               obj = new PolicyRestInterface();
-
-               return (obj);
-       }
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterfaceIfc.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyRestInterfaceIfc.java
deleted file mode 100644 (file)
index 4e3d08e..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-import org.json.simple.JSONObject;
-import org.openecomp.portalapp.portal.scheduler.policy.rest.RequestDetails;
-
-public interface PolicyRestInterfaceIfc {
-       /**
-        * Inits the rest client.
-        */
-       public void initRestClient();
-
-       /**
-        * Gets the.
-        *
-        * @param <T>
-        *            the generic type
-        * @param t
-        *            the t
-        * @param sourceId
-        *            the source id
-        * @param path
-        *            the path
-        * @param restObject
-        *            the rest object
-        * @throws Exception
-        *             the exception
-        */
-       public <T> void Get(T t, String sourceId, String path, RestObject<T> restObject) throws Exception;
-
-       /**
-        * Delete.
-        *
-        * @param <T>
-        *            the generic type
-        * @param t
-        *            the t
-        * @param r
-        *            the r
-        * @param sourceID
-        *            the source ID
-        * @param path
-        *            the path
-        * @param restObject
-        *            the rest object
-        * @throws Exception
-        *             the exception
-        */
-       public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject)
-                       throws Exception;
-
-       /**
-        * Post.
-        *
-        * @param <T>
-        *            the generic type
-        * @param t
-        *            the t
-        * @param r
-        *            the r
-        * @param sourceID
-        *            the source ID
-        * @param path
-        *            the path
-        * @param restObject
-        *            the rest object
-        * @throws Exception
-        *             the exception
-        */
-       public <T> void Post(T t, JSONObject r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
-       /***
-        * Log request.
-        *
-        * @param r
-        *            the r
-        */
-       public void logRequest(RequestDetails r);
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyUtil.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/PolicyUtil.java
deleted file mode 100644 (file)
index 3e1c941..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.glassfish.jersey.client.ClientResponse;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-/*import org.openecomp.vid.policy.PolicyResponseWrapper;
-import org.openecomp.vid.policy.PolicyUtil;
-import org.openecomp.vid.policy.RestObject;*/
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class PolicyUtil {
-       
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyUtil.class);
-       
-       final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       
-       public static PolicyResponseWrapper wrapResponse ( String body, int statusCode ) {
-               
-               PolicyResponseWrapper w = new PolicyResponseWrapper();
-               w.setStatus (statusCode);
-               w.setEntity(body);
-               
-               return w;
-       }
-       
-       public static PolicyResponseWrapper wrapResponse (ClientResponse cres) {        
-               String resp_str = "";
-               int statuscode = 0;
-               if ( cres != null ) {
-                       resp_str = cres.readEntity(String.class);
-                       statuscode = cres.getStatus();
-               }
-               
-               
-               PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, statuscode );
-               return (w);
-       }
-       
-       public static PolicyResponseWrapper wrapResponse (RestObject<String> rs) {      
-               String resp_str = "";
-               int status = 0;
-               if ( rs != null ) {
-                       resp_str = rs.get();
-                       status = rs.getStatusCode();
-               }
-               PolicyResponseWrapper w = PolicyUtil.wrapResponse ( resp_str, status );
-               return (w);
-       }
-       
-       public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-               
-               String methodName = "convertPojoToString";
-               ObjectMapper mapper = new ObjectMapper();
-               String r_json_str = "";
-           if ( t != null ) {
-                   try {
-                       r_json_str = mapper.writeValueAsString(t);
-                   }
-                   catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " +  methodName + " Unable to parse object as json");
-                   }
-           }
-           return (r_json_str);
-       }
-       
-       
-       public static void main(String[] args) {
-               // TODO Auto-generated method stub              
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/RestObject.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/RestObject.java
deleted file mode 100644 (file)
index efe2de0..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.policy;
-
-/**
- * The Class RestObject.
- *
- * @param <T> the generic type
- */
-public class RestObject<T> {
-
-       /**
-        * Generic version of the RestObject class.
-        *
-        */
-    // T stands for "Type"
-    private T t;
-    
-    /** The status code. */
-    private int statusCode= 0;
-    
-    /**
-     * Sets the.
-     *
-     * @param t the t
-     */
-    public void set(T t) { this.t = t; }
-    
-    /**
-     * Gets the.
-     *
-     * @return the t
-     */
-    public T get() { return t; }
-       
-    /**
-     * Sets the status code.
-     *
-     * @param v the new status code
-     */
-    public void setStatusCode(int v) { this.statusCode = v; }
-    
-    /**
-     * Gets the status code.
-     *
-     * @return the status code
-     */
-    public int getStatusCode() { return this.statusCode; }
-    
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/rest/RequestDetails.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/policy/rest/RequestDetails.java
deleted file mode 100644 (file)
index a7759cb..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.policy.rest;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-/*
-       [
-         {
-           "policyConfigMessage": "Config Retrieved! ",
-           "policyConfigStatus": "CONFIG_RETRIEVED",
-           "type": "JSON",
-           "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_zone_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_zone\"}}",
-           "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
-           "policyVersion": "1",
-           "matchingConditions": {
-             "ECOMPName": "SNIRO-Placement",
-             "ConfigName": "",
-             "service": "TimeLimitAndVerticalTopology",
-             "uuid": "",
-             "Location": ""
-           },
-           "responseAttributes": {},
-           "property": null
-         },
-         {
-           "policyConfigMessage": "Config Retrieved! ",
-           "policyConfigStatus": "CONFIG_RETRIEVED",
-           "type": "JSON",
-           "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_pserver_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf_pserver\"}}",
-           "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_pserver_localTime.1.xml",
-           "policyVersion": "1",
-           "matchingConditions": {
-             "ECOMPName": "SNIRO-Placement",
-             "ConfigName": "",
-             "service": "TimeLimitAndVerticalTopology",
-             "uuid": "",
-             "Location": ""
-           },
-           "responseAttributes": {},
-           "property": null
-         },
-         {
-           "policyConfigMessage": "Config Retrieved! ",
-           "policyConfigStatus": "CONFIG_RETRIEVED",
-           "type": "JSON",
-           "config": "{\"service\":\"TimeLimitAndVerticalTopology\",\"policyName\":\"SNIRO_CM_1707.Demo_TimeLimitAndVerticalTopology_vnf_localTime\",\"description\":\"dev instance\",\"templateVersion\":\"1702.03\",\"version\":\"1707\",\"priority\":\"4\",\"riskType\":\"test\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"serviceType\":\"networkOnDemand\",\"identity\":\"vnf_upgrade_policy\",\"policyScope\":{\"serviceType\":[\"networkOnDemand\"],\"aicZone\":[\" \"],\"entityType\":[\"vnf\"]},\"timeSchedule\":{\"allowedPeriodicTime\":[{\"day\":\"weekday\",\"timeRange\":[{\"start_time\":\"04:00:00\",\"end_time\":\"13:00:00\"}]}]},\"nodeType\":[\"vnf\"],\"type\":\"timeLimitAndVerticalTopology\",\"conflictScope\":\"vnf\"}}",
-           "policyName": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_vnf_localTime.1.xml",
-           "policyVersion": "1",
-           "matchingConditions": {
-             "ECOMPName": "SNIRO-Placement",
-             "ConfigName": "",
-             "service": "TimeLimitAndVerticalTopology",
-             "uuid": "",
-             "Location": ""
-           },
-           "responseAttributes": {},
-           "property": null
-         }
-       ]
-*/
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-    "policyConfigMessage",
-    "policyConfigStatus",
-    "type",
-    "config",
-    "policyName",
-    "policyVersion",
-    "matchingConditions"
-})
-public class RequestDetails {
-       
-       @JsonProperty("policyName")
-    private String policyName;  
-    
-       @JsonProperty("policyName")
-    public String getPolicyName() {
-        return policyName;
-    }
-
-    @JsonProperty("policyName")
-    public void setPolicyName(String policyName) {
-        this.policyName = policyName;
-    }
-    
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/properties/VidProperties.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/properties/VidProperties.java
deleted file mode 100644 (file)
index e18f43f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.properties;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-/**
- * The Class VidProperties.
- */
-public class VidProperties extends SystemProperties {
-
-       //VID General Properties
-       
-       /** The Constant VID_TRUSTSTORE_FILENAME. */
-       public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
-       
-       /** The Constant VID_TRUSTSTORE_PASSWD_X. */
-       public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
-       
-       /** The Constant FILESEPARATOR. */
-       public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/GetTimeSlotsRestObject.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/GetTimeSlotsRestObject.java
deleted file mode 100644 (file)
index 9749c83..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.restobjects;
-
-public class GetTimeSlotsRestObject<T> extends RestObject<T> {
-
-       public String uuid;
-       
-       public void setUUID(String uuid) { this.uuid = uuid; }
-           
-       public String getUUID() { return this.uuid; }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/PostCreateNewVnfRestObject.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/PostCreateNewVnfRestObject.java
deleted file mode 100644 (file)
index 94b6682..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.restobjects;
-
-public class PostCreateNewVnfRestObject<T> extends RestObject<T> {
-       
-       public String uuid;
-       
-       public void setUUID(String uuid) { this.uuid = uuid; }
-           
-       public String getUUID() { return this.uuid; }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/PostSubmitVnfChangeRestObject.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/PostSubmitVnfChangeRestObject.java
deleted file mode 100644 (file)
index 4f78fd7..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.restobjects;
-
-public class PostSubmitVnfChangeRestObject<T> extends RestObject<T> {
-       
-       public String uuid;
-       
-       public void setUUID(String uuid) { this.uuid = uuid; }
-           
-       public String getUUID() { return this.uuid; }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/RestObject.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/restobjects/RestObject.java
deleted file mode 100644 (file)
index a8636ad..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.restobjects;
-
-
-public class RestObject<T> {
-       
-    private T t;
-   
-    private int statusCode= 0;
-        
-    public void set(T t) { this.t = t; }
-    
-    public T get() { return t; }
-          
-    public void setStatusCode(int v) { this.statusCode = v; }
-       
-    public int getStatusCode() { return this.statusCode; }
-        
-}
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/util/CustomJacksonJaxBJsonProvider.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/util/CustomJacksonJaxBJsonProvider.java
deleted file mode 100644 (file)
index d9792b3..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.scheduler.util;
-
-
-import javax.ws.rs.ext.Provider;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
-import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
-
-/**
- * The Class CustomJacksonJaxBJsonProvider.
- */
-@Provider
-public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider {
-
-           /** The common mapper. */
-       private static ObjectMapper commonMapper = null;
-
-           /**
-        * Instantiates a new custom jackson jax B json provider.
-        */
-       public CustomJacksonJaxBJsonProvider() {
-               if (commonMapper == null) {
-                   ObjectMapper mapper = new ObjectMapper();
-
-                   mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-                   
-                   mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
-                   mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
-                   mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
-
-                   mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-                   mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
-
-                   mapper.registerModule(new JaxbAnnotationModule());
-
-                   commonMapper = mapper;
-               }
-               super.setMapper(commonMapper);
-           }
-           
-           /**
-        * Gets the mapper.
-        *
-        * @return the mapper
-        */
-       public ObjectMapper getMapper() {
-               return commonMapper;
-           }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/GetTimeSlotsWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/GetTimeSlotsWrapper.java
deleted file mode 100644 (file)
index 69b6b36..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.wrapper;
-
-public class GetTimeSlotsWrapper extends SchedulerResponseWrapper {
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/PostCreateNewVnfWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/PostCreateNewVnfWrapper.java
deleted file mode 100644 (file)
index 41f07f3..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.wrapper;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-           "uuid"
-})
-public class PostCreateNewVnfWrapper extends SchedulerResponseWrapper {
-
-       @JsonProperty("uuid")
-       private String uuid;
-       
-       @JsonProperty("uuid")
-    public String getUuid() {
-        return uuid;
-    }
-       
-       @JsonProperty("uuid")
-    public void setUuid(String v) {
-        this.uuid = v;
-    }
-       
-       @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-       
-       StringBuilder b = new StringBuilder ("{ \"status\": ");
-       b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
-       return (b.toString());
-    }  
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/PostSubmitVnfChangeTimeSlotsWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/PostSubmitVnfChangeTimeSlotsWrapper.java
deleted file mode 100644 (file)
index c0f2403..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.wrapper;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-           "uuid"
-})
-public class PostSubmitVnfChangeTimeSlotsWrapper extends SchedulerResponseWrapper  {
-       @JsonProperty("uuid")
-       private String uuid;
-       
-       @JsonProperty("uuid")
-    public String getUuid() {
-        return uuid;
-    }
-       
-       @JsonProperty("uuid")
-    public void setUuid(String v) {
-        this.uuid = v;
-    }
-       
-       @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-       
-       StringBuilder b = new StringBuilder ("{ \"status\": ");
-       b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
-       return (b.toString());
-    }  
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/SchedulerResponseWrapper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/scheduler/wrapper/SchedulerResponseWrapper.java
deleted file mode 100644 (file)
index 3a55b4f..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.scheduler.wrapper;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Scheduler response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-           "status",
-           "entity"
-})
-
-public class SchedulerResponseWrapper {
-       
-       @JsonProperty("status")
-       private int status;
-
-       @JsonProperty("entity")
-       private String entity;
-
-       @JsonProperty("entity")
-    public String getEntity() {
-        return entity;
-    }
-       
-       @JsonProperty("status")
-    public int getStatus() {
-        return status;
-    }
-       
-       @JsonProperty("status")
-    public void setStatus(int v) {
-        this.status = v;
-    }
-
-       @JsonProperty("entity")
-    public void setEntity(String v) {
-        this.entity = v;
-    }
-       
-    @Override
-    public String toString() {
-        return ToStringBuilder.reflectionToString(this);
-    }
-
-    public String getResponse () {
-       
-       StringBuilder b = new StringBuilder ("{ \"status\": ");
-    
-       b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
-        return (b.toString());
-    }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesService.java
deleted file mode 100644 (file)
index 020ed6f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-
-public interface AdminRolesService {
-
-       public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(String orgUserId);
-
-       public boolean setAppsWithAdminRoleStateForUser(AppsListWithAdminRole newAppsListWithAdminRoles);
-
-       /**
-        * Attention! User roles in ECOMP PORTAL cannot be managed by this function.
-        * @param user
-        * @return 'true' if user has Super Administrator role SYS_ADMIN_ROLE_ID (1 for now) in ECOMP PORTAL, 'false' otherwise
-        */
-       public boolean isSuperAdmin(EPUser user);
-       
-       /**
-        * Attention! User roles in ECOMP PORTAL cannot be managed by this function.
-        * @param user
-        * @return 'true' if user has Account Administrator role ACCOUNT_ADMIN_ROLE_ID (999 for now) for any application except ECOMP Portal, 'false' otherwise
-        */
-       public boolean isAccountAdmin(EPUser user);
-
-       /**
-        * Attention! User roles in ECOMP PORTAL cannot be managed by this function.
-        * @param user
-        * @return 'true' if user has any remote(!) role within any application (ECOMP Portal roles are not included), 'false' otherwise
-        */
-       public boolean isUser(EPUser user);
-
-       List<EPRole> getRolesByApp(EPUser user, Long appId);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AdminRolesServiceImpl.java
deleted file mode 100644 (file)
index e9ca4e9..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-
-import org.apache.cxf.common.util.StringUtils;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.UserIdRoleId;
-import org.openecomp.portalapp.portal.domain.UserRole;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUser;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.client.RestTemplate;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Service("adminRolesService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-
-public class AdminRolesServiceImpl implements AdminRolesService {
-
-       private Long SYS_ADMIN_ROLE_ID = 1L;
-       private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
-       private Long ECOMP_APP_ID = 1L;
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AdminRolesServiceImpl.class);
-
-       @Autowired
-       private SessionFactory sessionFactory;
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       private SearchService searchService;
-       @Autowired
-       private EPAppService appsService;
-
-       private RestTemplate template = new RestTemplate();
-
-       @PostConstruct
-       private void init() {
-               try {
-                       SYS_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.SYS_ADMIN_ROLE_ID));
-                       ACCOUNT_ADMIN_ROLE_ID = Long
-                                       .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
-                       ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
-               }
-       }
-
-       @Override
-       @EPMetricsLog
-       @SuppressWarnings("unchecked")
-       public AppsListWithAdminRole getAppsWithAdminRoleStateForUser(String orgUserId) {
-               AppsListWithAdminRole appsListWithAdminRole = null;
-
-               try {
-                       List<EPUser> userList = dataAccessService.getList(EPUser.class, " where orgUserId = '" + orgUserId + "'",
-                                       null, null);
-                       HashMap<Long, Long> appsUserAdmin = new HashMap<Long, Long>();
-                       if (userList.size() > 0) {
-                               EPUser user = userList.get(0);
-                               List<EPUserApp> userAppList = null;
-                               try {
-                                       userAppList = dataAccessService.getList(EPUserApp.class,
-                                                       " where userId = " + user.getId() + " and role.id = " + ACCOUNT_ADMIN_ROLE_ID, null, null);
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 1 failed", e);
-                                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError);
-                               }
-                               for (EPUserApp userApp : userAppList) {
-                                       appsUserAdmin.put(userApp.getAppId(), userApp.getUserId());
-                               }
-                       }
-
-                       appsListWithAdminRole = new AppsListWithAdminRole();
-                       appsListWithAdminRole.orgUserId = orgUserId;
-                       List<EPApp> appsList = null;
-                       try {
-                               appsList = dataAccessService.getList(EPApp.class,
-                                               "  where ( enabled = 'Y' or id = " + ECOMP_APP_ID + ")", null, null);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 2 failed", e);
-                               EPLogUtil.logEcompError(EPAppMessagesEnum.BeDaoSystemError);
-                       }
-                       for (EPApp app : appsList) {
-                               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
-                               appNameIdIsAdmin.id = app.getId();
-                               appNameIdIsAdmin.appName = app.getName();
-                               appNameIdIsAdmin.isAdmin = new Boolean(appsUserAdmin.containsKey(app.getId()));
-                               appNameIdIsAdmin.restrictedApp = app.isRestrictedApp();
-                               appsListWithAdminRole.appsRoles.add(appNameIdIsAdmin);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsWithAdminRoleStateForUser 3 failed", e);
-               }
-
-               return appsListWithAdminRole;
-       }
-
-       private static final Object syncRests = new Object();
-
-       @Override
-       @EPMetricsLog
-       @SuppressWarnings("unchecked")
-       public boolean setAppsWithAdminRoleStateForUser(AppsListWithAdminRole newAppsListWithAdminRoles) {
-               boolean result = false;
-               // No changes if no new roles list or no userId.
-               if (!StringUtils.isEmpty(newAppsListWithAdminRoles.orgUserId) && newAppsListWithAdminRoles.appsRoles != null) {
-                       synchronized (syncRests) {
-                               List<EPApp> apps = appsService.getAppsFullList();
-                               HashMap<Long, EPApp> enabledApps = new HashMap<Long, EPApp>();
-                               for (EPApp app : apps) {
-                                       if (app.getEnabled().booleanValue() || app.getId() == ECOMP_APP_ID) {
-                                               enabledApps.put(app.getId(), app);
-                                       }
-                               }
-                               List<AppNameIdIsAdmin> newAppsWhereUserIsAdmin = new ArrayList<AppNameIdIsAdmin>();
-                               for (AppNameIdIsAdmin adminRole : newAppsListWithAdminRoles.appsRoles) {
-                                       // user Admin role may be added only for enabled apps
-                                       if (adminRole.isAdmin.booleanValue() && enabledApps.containsKey(adminRole.id)) {
-                                               newAppsWhereUserIsAdmin.add(adminRole);
-                                       }
-                               }
-                               EPUser user = null;
-                               boolean createNewUser = false;
-                               String orgUserId = newAppsListWithAdminRoles.orgUserId.trim();
-                               List<EPUser> localUserList = dataAccessService.getList(EPUser.class,
-                                               " where org_user_id='" + orgUserId + "'", null, null);
-                               List<EPUserApp> oldAppsWhereUserIsAdmin = new ArrayList<EPUserApp>();
-                               if (localUserList.size() > 0) {
-                                       EPUser tmpUser = localUserList.get(0);
-                                       oldAppsWhereUserIsAdmin = dataAccessService.getList(EPUserApp.class,
-                                                       " where userId = " + tmpUser.getId() + " and role.id = " + ACCOUNT_ADMIN_ROLE_ID, null,
-                                                       null);
-                                       if (oldAppsWhereUserIsAdmin.size() > 0 || newAppsWhereUserIsAdmin.size() > 0) {
-                                               user = tmpUser;
-                                       }
-                               } else if (newAppsWhereUserIsAdmin.size() > 0) {
-                                       // we create new user only if he has Admin Role for any App
-                                       createNewUser = true;
-                               }
-                               if (user != null || createNewUser) {
-                                       Session localSession = null;
-                                       Transaction transaction = null;
-                                       try {
-                                               localSession = sessionFactory.openSession();
-                                               transaction = localSession.beginTransaction();
-                                               if (createNewUser) {
-                                                       user = this.searchService.searchUserByUserId(orgUserId);
-                                                       if (user != null) {
-                                                               // insert the user with active true in order to
-                                                               // pass login phase.
-                                                               user.setActive(true);
-                                                               localSession.save(EPUser.class.getName(), user);
-                                                       }
-                                               }
-                                               for (EPUserApp oldUserApp : oldAppsWhereUserIsAdmin) {
-                                                       // user Admin role may be deleted only for enabled
-                                                       // apps
-                                                       if (enabledApps.containsKey(oldUserApp.getAppId())) {
-                                                               localSession.delete(oldUserApp);
-                                                       }
-                                               }
-                                               for (AppNameIdIsAdmin appNameIdIsAdmin : newAppsWhereUserIsAdmin) {
-                                                       EPApp app = (EPApp) localSession.get(EPApp.class, appNameIdIsAdmin.id);
-                                                       EPRole role = (EPRole) localSession.get(EPRole.class, new Long(ACCOUNT_ADMIN_ROLE_ID));
-                                                       EPUserApp newUserApp = new EPUserApp();
-                                                       newUserApp.setUserId(user.getId());
-                                                       newUserApp.setApp(app);
-                                                       newUserApp.setRole(role);
-                                                       localSession.save(EPUserApp.class.getName(), newUserApp);
-                                               }
-                                               transaction.commit();
-
-                                               // Add user admin role for list of centralized applications in external system
-                                               result = addAdminRoleInExternalSystem(user, localSession, newAppsWhereUserIsAdmin);
-                                       } catch (Exception e) {
-                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                                               logger.error(EELFLoggerDelegate.errorLogger,
-                                                               "setAppsWithAdminRoleStateForUser: exception in point 2", e);
-                                               try {
-                                                       if(transaction!=null)
-                                                               transaction.rollback();
-                                                       else
-                                                               logger.error(EELFLoggerDelegate.errorLogger, "setAppsWithAdminRoleStateForUser: transaction is null cannot rollback");
-                                               } catch (Exception ex) {
-                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeExecuteRollbackError, e);
-                                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                                       "setAppsWithAdminRoleStateForUser: exception in point 3", ex);
-                                               }
-                                       } finally {
-                                               try {
-                                                       localSession.close();
-                                               } catch (Exception e) {
-                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoCloseSessionError, e);
-                                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                                       "setAppsWithAdminRoleStateForUser: exception in point 4", e);
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               return result;
-       }
-
-       @SuppressWarnings("unchecked")
-       private boolean addAdminRoleInExternalSystem(EPUser user, Session localSession,
-                       List<AppNameIdIsAdmin> newAppsWhereUserIsAdmin) {
-               boolean result = false;
-               try {
-                       // Reset All admin role for centralized applications
-                       List<EPApp> appList = dataAccessService.executeNamedQuery("getCentralizedApps", null, null);
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       for (EPApp app : appList) {
-                               String name = "";
-                               if (EPCommonSystemProperties
-                                               .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
-                                       name = user.getOrgUserId() + SystemProperties
-                                                       .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
-                               }
-                               String extRole = app.getNameSpace() + "." + PortalConstants.ADMIN_ROLE.replaceAll(" ", "_");
-                               HttpEntity<String> entity = new HttpEntity<>(headers);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Connecting to External Access system");
-                               try {
-                                       ResponseEntity<String> getResponse = template
-                                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                       + "roles/" + extRole, HttpMethod.GET, entity, String.class);
-
-                                       if (getResponse.getBody().equals("{}")) {
-                                               String addDesc = "{\"name\":\"" + extRole + "\"}";
-                                               HttpEntity<String> roleEntity = new HttpEntity<>(addDesc, headers);
-                                               template.exchange(
-                                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                               + "role",
-                                                               HttpMethod.POST, roleEntity, String.class);
-                                       } else {
-                                               try {
-                                                       HttpEntity<String> deleteUserRole = new HttpEntity<>(headers);
-                                                       template.exchange(
-                                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                                       + "userRole/" + name + "/" + extRole,
-                                                                       HttpMethod.DELETE, deleteUserRole, String.class);
-                                               } catch (Exception e) {
-                                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                                       " Role not found for this user may be it gets deleted before", e);
-                                               }
-                                       }
-                               } catch (Exception e) {
-                                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
-                                               logger.debug(EELFLoggerDelegate.debugLogger, "Application Not found for app {}",
-                                                               app.getNameSpace(), e.getMessage());
-                                       } else {
-                                               logger.error(EELFLoggerDelegate.errorLogger, "Application Not found for app {}",
-                                                               app.getNameSpace(), e);
-                                       }
-                               }
-                       }
-                       // Add admin role in external application
-                       // application
-                       for (AppNameIdIsAdmin appNameIdIsAdmin : newAppsWhereUserIsAdmin) {
-                               EPApp app = (EPApp) localSession.get(EPApp.class, appNameIdIsAdmin.id);
-                               try {
-                                       if (app.getCentralAuth()) {
-                                               String extRole = app.getNameSpace() + "." + PortalConstants.ADMIN_ROLE.replaceAll(" ", "_");
-                                               HttpEntity<String> entity = new HttpEntity<>(headers);
-                                               String name = "";
-                                               if (EPCommonSystemProperties
-                                                               .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
-                                                       name = user.getOrgUserId() + SystemProperties
-                                                                       .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
-                                               }
-                                               logger.debug(EELFLoggerDelegate.debugLogger, "Connecting to External Access system");
-                                               ResponseEntity<String> getUserRolesResponse = template.exchange(
-                                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                               + "userRoles/user/" + name,
-                                                               HttpMethod.GET, entity, String.class);
-                                               logger.debug(EELFLoggerDelegate.debugLogger, "Connected to External Access system");
-                                               if (!getUserRolesResponse.getBody().equals("{}")) {
-                                                       JSONObject jsonObj = new JSONObject(getUserRolesResponse.getBody());
-                                                       JSONArray extRoles = jsonObj.getJSONArray("userRole");
-                                                       final Map<String, JSONObject> extUserRoles = new HashMap<>();
-                                                       for (int i = 0; i < extRoles.length(); i++) {
-                                                               String userRole = extRoles.getJSONObject(i).getString("role");
-                                                               if (userRole.startsWith(app.getNameSpace() + ".")
-                                                                               && !userRole.equals(app.getNameSpace() + ".admin")
-                                                                               && !userRole.equals(app.getNameSpace() + ".owner")) {
-
-                                                                       extUserRoles.put(userRole, extRoles.getJSONObject(i));
-                                                               }
-                                                       }
-                                                       if (!extUserRoles.containsKey(extRole)) {
-                                                               // Assign with new apps user admin
-                                                               try {
-                                                                       ExternalAccessUser extUser = new ExternalAccessUser(name, extRole);
-                                                                       // Assign user role for an application in external access system
-                                                                       ObjectMapper addUserRoleMapper = new ObjectMapper();
-                                                                       String userRole = addUserRoleMapper.writeValueAsString(extUser);
-                                                                       HttpEntity<String> addUserRole = new HttpEntity<>(userRole, headers);
-                                                                       template.exchange(
-                                                                                       SystemProperties.getProperty(
-                                                                                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "userRole",
-                                                                                       HttpMethod.POST, addUserRole, String.class);
-                                                               } catch (Exception e) {
-                                                                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to add user admin role", e);
-                                                               }
-
-                                                       }
-                                               }
-                                       }
-                                       result = true;
-                               } catch (Exception e) {
-                                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
-                                               logger.debug(EELFLoggerDelegate.errorLogger,
-                                                               "Application name space not found in External system for app {} due to bad rquest name space ",
-                                                               app.getNameSpace(), e.getMessage());
-                                       } else {
-                                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to assign admin role for application {}",
-                                                               app.getNameSpace(), e);
-                                               result = false;
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       result = false;
-                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to assign admin roles operation", e);
-               }
-               return result;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public boolean isSuperAdmin(EPUser user) {
-               if ((user != null) /* && (user.getId() == null) */ && (user.getOrgUserId() != null)) {
-                       String sql = "SELECT user.USER_ID, user.org_user_id, userrole.ROLE_ID, userrole.APP_ID FROM fn_user_role userrole "
-                                       + "INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID " + "WHERE user.org_user_id = '"
-                                       + user.getOrgUserId() + "' " + "AND userrole.ROLE_ID = '" + SYS_ADMIN_ROLE_ID + "' "
-                                       + "AND userrole.APP_ID = '" + ECOMP_APP_ID + "';";
-                       try {
-                               List<UserRole> userRoleList = dataAccessService.executeSQLQuery(sql, UserIdRoleId.class, null);
-                               if (userRoleList != null && userRoleList.size() > 0) {
-                                       return true;
-                               }
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Exception occurred while executing isSuperAdmin operation", e);
-                       }
-               }
-               // else
-               // {
-               // User currentUser = user != null ? (User)
-               // dataAccessService.getDomainObject(User.class, user.getId(), null) :
-               // null;
-               // if (currentUser != null && currentUser.getId() != null) {
-               // for (UserApp userApp : currentUser.getUserApps()) {
-               // if (userApp.getApp().getId().equals(ECOMP_APP_ID) &&
-               // userApp.getRole().getId().equals(SYS_ADMIN_ROLE_ID)) {
-               // // Super Administrator role is global, no need to keep iterating
-               // return true;
-               // }
-               // }
-               // }
-               // }
-               return false;
-       }
-
-       public boolean isAccountAdmin(EPUser user) {
-               try {
-                       EPUser currentUser = user != null
-                                       ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null)
-                                       : null;
-                       if (currentUser != null && currentUser.getId() != null) {
-                               for (EPUserApp userApp : currentUser.getEPUserApps()) {
-                                       if (// !userApp.getApp().getId().equals(ECOMP_APP_ID)
-                                               // &&
-                                       userApp.getRole().getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
-                                               // Account Administrator sees only the applications
-                                               // he/she is Administrator
-                                               return true;
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isAccountAdmin operation",
-                                       e);
-               }
-               return false;
-       }
-
-       public boolean isUser(EPUser user) {
-               try {
-                       EPUser currentUser = user != null
-                                       ? (EPUser) dataAccessService.getDomainObject(EPUser.class, user.getId(), null)
-                                       : null;
-                       if (currentUser != null && currentUser.getId() != null) {
-                               for (EPUserApp userApp : currentUser.getEPUserApps()) {
-                                       if (!userApp.getApp().getId().equals(ECOMP_APP_ID)) {
-                                               EPRole role = userApp.getRole();
-                                               if (!role.getId().equals(SYS_ADMIN_ROLE_ID) && !role.getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
-                                                       if (role.getActive()) {
-                                                               return true;
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while executing isUser operation", e);
-               }
-               return false;
-       }
-
-       @Override
-       @EPMetricsLog
-       public List<EPRole> getRolesByApp(EPUser user, Long appId) {
-               List<EPRole> list = new ArrayList<>();
-               String sql = "SELECT * FROM FN_ROLE WHERE UPPER(ACTIVE_YN) = 'Y' AND APP_ID = " + appId;
-               @SuppressWarnings("unchecked")
-               List<EPRole> roles = dataAccessService.executeSQLQuery(sql, EPRole.class, null);
-               for (EPRole role : roles) {
-                       list.add(role);
-               }
-               return list;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsService.java
deleted file mode 100644 (file)
index da33293..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-
-public interface AppContactUsService {
-       
-       /**
-        * Gets a list of contact-us information for all entries in
-        * the fn_app_contact_us table, sorted by app name.  If an application is active but has no fn_app_contact_us entry, it will have no entry in this result.
-       * 
-        * @return List of AppContactUsItem, one for each item in fn_app_contact_us table.
-        * @throws Exception
-        */
-       public List<AppContactUsItem> getAppContactUs() throws Exception;
-
-       /**
-        * Gets a list of contact-us information for all applications
-        * in the fn_app table, extended with any information in the fn_app_contact_us table.
-        * 
-        * @return List of AppContactUsItem, one for each item in fn_app table.
-        * @throws Exception
-        */
-       public List<AppContactUsItem> getAppsAndContacts() throws Exception;
-       
-       public List<AppCategoryFunctionsItem> getAppCategoryFunctions() throws Exception;
-       
-       public String saveAppContactUs(List<AppContactUsItem> contactUs) throws Exception;
-       
-       public String saveAppContactUs(AppContactUsItem contactUs) throws Exception;
-
-       public String deleteContactUs(Long id) throws Exception;
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImpl.java
deleted file mode 100644 (file)
index 2f98707..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.AppContactUs;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-
-/**
- * Provides database access for the contact-us page controllers.
- */
-@Transactional
-@org.springframework.context.annotation.Configuration
-public class AppContactUsServiceImpl implements AppContactUsService {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppContactUsServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.AppContactUsService#
-        * getAppContactUs()
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<AppContactUsItem> getAppContactUs() throws Exception {
-               List<AppContactUsItem> contactUsItemList = (List<AppContactUsItem>) getDataAccessService()
-                               .executeNamedQuery("getAppContactUsItems", null, null);
-               Collections.sort(contactUsItemList, new AppContactUsItemCompare());
-               return contactUsItemList;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.AppContactUsService#
-        * getAllAppsAndContacts()
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<AppContactUsItem> getAppsAndContacts() throws Exception {
-               List<AppContactUsItem> contactUsItemList = (List<AppContactUsItem>) getDataAccessService()
-                               .executeNamedQuery("getAppsAndContacts", null, null);
-               Collections.sort(contactUsItemList, new AppContactUsItemCompare());
-               return contactUsItemList;
-       }
-
-       /**
-        * Assists in sorting app-contact-us items by application name.
-        */
-       class AppContactUsItemCompare implements Comparator<AppContactUsItem> {
-               @Override
-               public int compare(AppContactUsItem o1, AppContactUsItem o2) {
-                       return o1.getAppName().compareTo(o2.getAppName());
-               }
-       }
-
-       /**
-        * Gets a table of category and function details for apps that participate
-        * in the functional menu.
-        */
-       @Override
-       public List<AppCategoryFunctionsItem> getAppCategoryFunctions() throws Exception {
-               @SuppressWarnings("unchecked")
-               // This named query requires no parameters.
-               List<AppCategoryFunctionsItem> list = (List<AppCategoryFunctionsItem>) dataAccessService
-                               .executeNamedQuery("getAppCategoryFunctions", null, null);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getAppCategoryFunctions: result list size is " + list.size());
-               return list;
-       }
-
-       /**
-        * Saves the list of contact-us objects to the database.
-        */
-       @Override
-       @Transactional(rollbackFor = Exception.class)
-       public String saveAppContactUs(List<AppContactUsItem> contactUsModelList) throws Exception {
-               try {
-                       for (AppContactUsItem contactUs : contactUsModelList) {
-                               String status = saveAppContactUs(contactUs);
-                               if (!status.equals("success"))
-                                       throw new Exception("saveAppContaatUsFailed: service returned " + status);
-                       }
-                       return "success";
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "", e);
-                       throw new Exception(e);
-               }
-
-       }
-
-       /**
-        * Saves a single contact-us object to the database, either creating a new
-        * row or updating if the argument has the ID of an existing row.
-        */
-       @Override
-       @Transactional(rollbackFor = Exception.class)
-       public String saveAppContactUs(AppContactUsItem contactUsModel) throws Exception {
-               try {
-                       HashMap<String, Object> map = new HashMap<String, Object>();
-                       AppContactUs contactUs = null;
-                       try {
-                               contactUs = (AppContactUs) getDataAccessService().getDomainObject(AppContactUs.class,
-                                               contactUsModel.getAppId(), map);
-                       } catch (Exception e) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "saveAppContactUs: not found for App {}, adding new entry",
-                                               contactUsModel.getAppName());
-                               contactUs = new AppContactUs();
-                       }
-
-                       // Populate the AppContactUs model for the database.
-                       EPApp app = (EPApp) getDataAccessService().getDomainObject(EPApp.class, contactUsModel.getAppId(), map);
-                       if (app == null || app.getId() == null)
-                               throw new Exception("saveAppContactus: App not found for Id " + contactUsModel.getAppId());
-                       contactUs.setApp(app);
-                       contactUs.setDescription(contactUsModel.getDescription());
-                       contactUs.setContactName(contactUsModel.getContactName());
-                       contactUs.setContactEmail(contactUsModel.getContactEmail());
-                       contactUs.setActiveYN(contactUsModel.getActiveYN());
-                       contactUs.setUrl(contactUsModel.getUrl());
-                       getDataAccessService().saveDomainObject(contactUs, map);
-                       return "success";
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveAppContactUs failed", e);
-                       throw e;
-                       // return "failure";
-               }
-       }
-
-       /**
-        * Deletes the row from the app contact us table with the specified ID.
-        */
-       @Override
-       public String deleteContactUs(Long id) throws Exception {
-               try {
-                       HashMap<String, Object> map = new HashMap<String, Object>();
-                       AppContactUs contactUs = (AppContactUs) getDataAccessService().getDomainObject(AppContactUs.class, id, map);
-                       if (contactUs.getApp() == null)
-                               throw new Exception("Delete unsuccessful for Id " + id);
-                       getDataAccessService().deleteDomainObject(contactUs, map);
-                       return "success";
-               } catch (Exception e) {
-
-                       logger.info(EELFLoggerDelegate.errorLogger, "", e);
-                       throw e;
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientService.java
deleted file mode 100644 (file)
index a8d79ae..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.apache.cxf.transport.http.HTTPException;
-import org.openecomp.portalapp.util.SystemType;
-
-public interface ApplicationsRestClientService {
-       public <T> T get(Class<T> clazz, long app, String restPath) throws HTTPException;
-       public String getIncomingJsonString(long appId, String restPath) throws HTTPException;
-
-       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException;
-       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath, SystemType type) throws HTTPException;
-
-       public <T> T put(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException;
-
-       /**
-        * Sends a GET request to the specified application at the specified path.
-        * This is a workaround for a problem triggered by a superclass/subclass
-        * with identical field names.
-        * 
-        * @param clazz
-        *            Expected response type
-        * @param appId
-        *            Application ID
-        * @param restPath
-        *            Path at the remote application
-        * @param useJacksonMapper
-        *            If true, uses a com.fasterxml.jackson.databind.ObjectMapper to
-        *            translate the remote application response from JSON to an
-        *            object. Otherwise, uses a com.google.gson.Gson.
-        * @return Instance of the specified class
-        * @throws HTTPException
-        */
-       public <T> T get(Class<T> clazz, long appId, String restPath, boolean useJacksonMapper) throws HTTPException;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
deleted file mode 100644 (file)
index ae11a91..0000000
+++ /dev/null
@@ -1,426 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal SDK
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
-
-import java.lang.reflect.Type;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Base64;
-import java.util.Date;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.cxf.transport.http.HTTPException;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.SystemType;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonDeserializationContext;
-import com.google.gson.JsonDeserializer;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonParseException;
-
-@Service("applicationsRestClientService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class ApplicationsRestClientServiceImpl implements ApplicationsRestClientService {
-
-       private static final String PASSWORD_HEADER = "password";
-
-       private static final String APP_USERNAME_HEADER = "username";
-
-       private static final String BASIC_AUTHENTICATION_HEADER = "Authorization";
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ApplicationsRestClientServiceImpl.class);
-
-       @Autowired
-       private AppsCacheService appsCacheService;
-
-       Gson gson = null;
-
-       private final ObjectMapper mapper = new ObjectMapper();
-
-       @PostConstruct
-       private void init() {
-               logger.debug(EELFLoggerDelegate.debugLogger, "initializing");
-               GsonBuilder builder = new GsonBuilder();
-
-               // Register an adapter to manage the date types as long values
-               builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
-                       public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
-                                       throws JsonParseException {
-                               return new Date(json.getAsJsonPrimitive().getAsLong());
-                       }
-               });
-
-               gson = builder.create();
-       }
-
-       // TODO: do we need to do additional logging for remote API calls?
-       private static WebClient createClientForPath(String baseUri, String path) {
-               logger.info(EELFLoggerDelegate.debugLogger, "Creating web client for " + baseUri + "   +   " + path);
-               WebClient client = WebClient.create(baseUri);
-               client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);
-               client.path(path);
-               return client;
-       }
-
-       @EPMetricsLog
-       private void verifyResponse(Response response) throws HTTPException {
-               int status = response.getStatus();
-               logger.debug(EELFLoggerDelegate.debugLogger, "http response status=" + status);
-               MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, Integer.toString(status));
-               if (!isHttpSuccess(status)) {
-                       String errMsg = "Failed. Status=" + status + "; [" + response.getStatusInfo().getReasonPhrase().toString()
-                                       + "]";
-                       URL url = null;
-                       try {
-                               // must not be null to avoid NPE in HTTPException constructor
-                               url = new URL("http://null");
-                               if (response.getLocation() != null)
-                                       url = response.getLocation().toURL();
-                       } catch (MalformedURLException e) {
-                               // never mind. it is only for the debug message.
-                               logger.warn(EELFLoggerDelegate.errorLogger, "Failed to build URL", e);
-                       }
-                       logger.error(EELFLoggerDelegate.errorLogger, "http response failed. " + errMsg + "; url=" + url);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeIncorrectHttpStatusError);
-                       throw new HTTPException(status, errMsg, url);
-               }
-       }
-
-       private static boolean isHttpSuccess(int status) {
-               return status / 100 == 2;
-       }
-       
-       
-       private WebClient createClientForApp(long appId, String restPath) {
-               return createClientFor(appId, restPath, SystemType.APPLICATION);
-       }
-
-       //TODO Need to implement the mylogins once the endpoint is confirmed
-       @EPMetricsLog
-       private WebClient createClientFor(long appSystemId, String restPath, SystemType type) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "creating client for appId=" + appSystemId + "; restPath=" + restPath);
-               EPApp externalApp = null;
-               
-               if(type == SystemType.APPLICATION){
-               externalApp = appsCacheService.getApp(appSystemId);
-               }else{
-                       // TO DO 
-               }
-               
-               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 appName = (type == SystemType.APPLICATION) ? externalApp.getName(): "";
-                       String decreptedAppPwd = "";
-
-                       // Set local context
-                       MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
-                       if (appBaseUri != null && appBaseUri.contains("https")) {
-                               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
-                       }
-                       MDC.put(EPCommonSystemProperties.FULL_URL, appBaseUri + restPath);
-                       MDC.put(EPCommonSystemProperties.TARGET_ENTITY, appName);
-                       MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath);
-
-                       try {
-                               decreptedAppPwd = CipherUtil.decrypt(encriptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "createClientFor failed to decrypt", e);
-                       }
-                       
-                       WebClient client = createClientForPath(appBaseUri, restPath);
-
-                       // support basic authentication for some partners
-                       String encoding = Base64.getEncoder().encodeToString((username + ":" + decreptedAppPwd).getBytes());
-                       String encodingStr = "Basic " + encoding;
-                       client.header(BASIC_AUTHENTICATION_HEADER, encodingStr);
-
-                       // But still keep code downward compatible for non compliant apps
-                       client.header(APP_USERNAME_HEADER, username);
-                       client.header(PASSWORD_HEADER, decreptedAppPwd);
-
-                       client.header(SystemProperties.ECOMP_REQUEST_ID, MDC.get(MDC_KEY_REQUEST_ID));
-                       client.header(SystemProperties.USERAGENT_NAME, EPCommonSystemProperties.ECOMP_PORTAL_BE);
-                       
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       String.format("App %d found, baseUri=[%s], Headers: [%s=%s, %s=%s, %s=%s]", appSystemId, appBaseUri,
-                                                       APP_USERNAME_HEADER, username, PASSWORD_HEADER, encriptedPwd, BASIC_AUTHENTICATION_HEADER, encodingStr));
-
-                       return client;
-               }
-               return null;
-       }
-
-       @Override
-       public <T> T get(Class<T> clazz, long appId, String restPath) throws HTTPException {
-               T t = null;
-               Response response = getResponse(appId, restPath);
-
-               if (response != null) {
-                       verifyResponse(response);
-                       String str = response.readEntity(String.class);
-                       EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
-                       try {
-                               t = gson.fromJson(str, clazz);
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-                       }
-               }
-
-               return t;
-       }
-       
-       @Override
-       public String getIncomingJsonString(long appId, String restPath) throws HTTPException {
-               Response response = getResponse(appId, restPath);
-
-               if (response != null) {
-                       verifyResponse(response);
-                       String incomingJson = response.readEntity(String.class);
-                       return incomingJson;
-               }
-               
-               return "";
-       }
-
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.openecomp.portalapp.portal.service.ApplicationsRestClientService#get(
-        * java.lang.Class, long, java.lang.String, boolean)
-        */
-       @Override
-       public <T> T get(Class<T> clazz, long appId, String restPath, boolean useJacksonMapper) throws HTTPException {
-
-               if (!useJacksonMapper)
-                       return get(clazz, appId, restPath);
-
-               T t = null;
-               Response response = getResponse(appId, restPath);
-
-               if (response != null) {
-                       verifyResponse(response);
-                       String str = response.readEntity(String.class);
-                       EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
-
-                       try {
-                               t = mapper.readValue(str, clazz);
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-                       }
-               }
-
-               return t;
-       }
-
-       protected Response getResponse(long appId, String restPath) {
-               WebClient webClient = null;
-               Response response = null;
-
-               webClient = createClientForApp(appId, restPath);
-               EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET request =", "no-payload");
-
-               try {
-                       if (webClient != null) {
-                               response = webClient.get();
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
-                       }
-               } catch (Exception e) {
-                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
-                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the GET REST API call", e);
-               }
-               return response;
-       }
-       
-       
-       @Override
-       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath, SystemType type) throws HTTPException {
-               WebClient client = null;
-               Response response = null;
-               T t = null;
-
-               client = createClientFor(appId, restPath, type);
-               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST request =", payload);
-
-               try {
-                       if (client != null) {
-                               response = client.post(payload);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
-                       }
-               } catch (Exception e) {
-                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
-                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call", e);
-               }
-
-               if (response != null) {
-                       verifyResponse(response);
-
-                       // String contentType = response.getHeaderString("Content-Type");
-                       if (clazz != null) {
-                               String str = response.readEntity(String.class);
-                               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
-                               try {
-                                       t = gson.fromJson(str, clazz);
-                               } catch (Exception e) {
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-                               }
-                       }
-               }
-               return t;
-       }
-
-       @Override
-       public <T> T post(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException {
-               return post( clazz, appId, payload, restPath, SystemType.APPLICATION);
-       }
-
-       //@Override
-       public <T> T postForClass(Class<T> clazz, long appId, Object payload, String restPath, Class<T> forClass) throws HTTPException {
-               WebClient client = null;
-               Response response = null;
-               T t = null;
-
-               client = createClientForApp(appId, restPath);
-               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST request =", payload);
-
-               try {
-                       if (client != null) {
-                               response = client.post(payload);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
-                       }
-               } catch (Exception e) {
-                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
-                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call", e);
-               }
-
-               if (response != null) {
-                       verifyResponse(response);
-
-                       // String contentType = response.getHeaderString("Content-Type");
-                       if (clazz != null) {
-                               String str = response.readEntity(String.class);
-                               EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
-                               try {
-                                       t = gson.fromJson(str, clazz);
-                               } catch (Exception e) {
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-                               }
-                       }
-               }
-               return t;
-       }
-
-       
-       @Override
-       public <T> T put(Class<T> clazz, long appId, Object payload, String restPath) throws HTTPException {
-               WebClient client = null;
-               Response response = null;
-               T t = null;
-
-               client = createClientForApp(appId, restPath);
-               EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT request =", payload);
-
-               try {
-                       if (client != null) {
-                               response = client.put(payload);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Unable to create the Webclient to make the '" + restPath + "' API call.");
-                       }
-               } catch (Exception e) {
-                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE,
-                                       Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the PUT REST API call", e);
-               }
-
-               if (response != null) {
-                       verifyResponse(response);
-                       String str = response.readEntity(String.class);
-                       EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT result =", str);
-                       try {
-                               t = gson.fromJson(str, clazz);
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-                       }
-               }
-               return t;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java
deleted file mode 100644 (file)
index 4ffccd1..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-
-public interface AppsCacheService {
-       
-       /**
-        * returns an app by id from the cache
-        * @param appId
-        * @return corresponding App
-        */
-       EPApp getApp(Long appId);
-       
-       /**
-        * returns the corresponding application endpoint
-        * @param appId
-        * @return if appId exists in cache, then return corresponding application endpoint, null otherwise.
-        */
-       String getAppEndpoint(Long appId);
-
-       EPApp getAppForAnalytics(String appKey);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java
deleted file mode 100644 (file)
index f56cdef..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-@Service("appsCacheService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class AppsCacheServiceImple implements AppsCacheService {
-       @Autowired
-       EPAppService appsService;
-       
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsCacheServiceImple.class);
-       
-       final class CacheConfiguration {
-               
-               private long updateTime = 0;
-               private int updateInterval = 10;
-               
-               public CacheConfiguration (long _updateTime, int _updateInterval) {
-                       updateTime = _updateTime;
-                       updateInterval = _updateInterval;
-               }
-       }
-       
-       CacheConfiguration appConf = null;
-       CacheConfiguration analyticsAppConf = null;
-       
-       
-       private static volatile Map<Long, EPApp> appsMap;
-       private static volatile Map<String, EPApp> anlyticsAppsMap;
-       
-       @PostConstruct
-       public void init() {
-               appConf = new CacheConfiguration(0, 10);
-               analyticsAppConf = new CacheConfiguration(0, 3600);
-               
-               this.refreshAppsMap(appConf);
-       }
-
-       private Map<Long, EPApp> refreshAppsMap(CacheConfiguration conf) {
-               long now = System.currentTimeMillis();
-               
-               if(noNeedToUpdate(now, conf))
-                       return null;
-               
-               synchronized (this) {
-                       if(noNeedToUpdate(now, conf))
-                               return null;
-                       List<EPApp> allApps = appsService.getAppsFullList();
-                       Map<Long, EPApp> newAppsMap = new HashMap<Long, EPApp>();
-                       for (EPApp app : allApps) {
-                               newAppsMap.put(app.getId(), app);
-                       }
-                       
-                       Map<String, EPApp> newAnalyticsAppsMap = new HashMap<String, EPApp>();
-                       for (EPApp app : allApps) {
-                               newAnalyticsAppsMap.put(app.getUebKey(), app);
-                       }
-                       // Switch cache with the new one.
-                       appsMap = newAppsMap;
-                       anlyticsAppsMap = newAnalyticsAppsMap;
-                       conf.updateTime = now;
-               }
-               
-               return appsMap;
-       }
-
-       private boolean noNeedToUpdate(long now, CacheConfiguration conf) {
-               long secondsPassed = (now - conf.updateTime)/1000;
-               if(secondsPassed < conf.updateInterval){
-                       logger.debug(EELFLoggerDelegate.debugLogger, "no need to refresh yet, seconds since last refresh: " + secondsPassed + ", refresh interval (sec) = " + conf.updateInterval);
-                       return true; // no need to update cache
-               }
-               return false; // its time to update
-       }
-
-       @Override
-       public String getAppEndpoint(Long appId) {
-               refreshAppsMap(appConf);
-               EPApp app = appsMap.get(appId);
-               if(app != null)
-                       return app.getAppRestEndpoint();
-               return null;
-       }
-       
-       @Override
-       public EPApp getApp(Long appId) {
-               refreshAppsMap(appConf);
-               EPApp app = appsMap.get(appId);
-               if(app != null)
-                       return app;
-               return null;            
-       }
-       
-       @Override
-       public EPApp getAppForAnalytics(String appKey) {
-               refreshAppsMap(analyticsAppConf);
-               EPApp app = anlyticsAppsMap.get(appKey);
-               if(app != null)
-                       return app;
-               return null;            
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthAccountService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthAccountService.java
deleted file mode 100644 (file)
index 0f18b6f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-
-public interface BasicAuthAccountService {
-
-       /**
-        * Saves Basic Authentication account for external systems
-        * 
-        * @param newCredential
-        *            BasicAuthCredentials
-        * @return Id of the newly created account
-        * @throws Exception
-        */
-       Long saveBasicAuthAccount(BasicAuthCredentials newCredential) throws Exception;
-
-       /**
-        * Saves Endpoint associated with a Basic Auth account
-        * 
-        * @param endpoint
-        *            EPEndpoint
-        * @return Id of the newly created endpoint
-        * @throws Exception
-        */
-       Long saveEndpoints(EPEndpoint endpoint) throws Exception;
-
-       /**
-        * Saves Endpoint associated with a Basic Auth account
-        * 
-        * @param accountId
-        * @param endpointId
-        * @throws Exception
-        */
-       void saveEndpointAccount(Long accountId, Long endpointId) throws Exception;
-
-       /**
-        * Returns list of all BasicAuthCredentials in the sytem
-        * 
-        * @return List<BasicAuthCredentials>
-        * @throws Exception
-        */
-       List<BasicAuthCredentials> getAccountData() throws Exception;
-
-       /**
-        * Deletes BasicAuthenticationAccount
-        * 
-        * @param accountId
-        * @throws Exception
-        */
-       void deleteEndpointAccout(Long accountId) throws Exception;
-
-       /**
-        * Updates BasicAuthenticationAccount
-        * 
-        * @param accountId
-        * @param newCredential
-        *            BasicAuthCredentials
-        * @throws Exception
-        */
-       void updateBasicAuthAccount(Long accountId, BasicAuthCredentials newCredential) throws Exception;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthAccountServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthAccountServiceImpl.java
deleted file mode 100644 (file)
index 1c353d0..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.hibernate.criterion.Criterion;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-import org.openecomp.portalapp.portal.domain.EPEndpointAccount;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("basicAuthAccountService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class BasicAuthAccountServiceImpl implements BasicAuthAccountService{
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @Override
-       public Long saveBasicAuthAccount(BasicAuthCredentials newCredential) throws Exception {
-               if (newCredential.getPassword() != null)
-                       newCredential.setPassword(encryptedPassword(newCredential.getPassword()));
-               try{
-                       getDataAccessService().saveDomainObject(newCredential, null);
-               }catch(Exception e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveBasicAuthAccount() failed", e);
-                       throw e;
-               }
-               return newCredential.getId();
-       }
-       
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public Long saveEndpoints(EPEndpoint endpoint) throws Exception {
-               
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion NameCrit = Restrictions.eq("name", endpoint.getName());
-               restrictionsList.add(NameCrit);
-
-               List<EPEndpoint> tempList = (List<EPEndpoint>) dataAccessService.getList(EPEndpoint.class, null,
-                               restrictionsList, null);
-               if (tempList.size() != 0) {
-                       return tempList.get(0).getId();
-               } else {
-                       getDataAccessService().saveDomainObject(endpoint, null);
-                       return endpoint.getId();
-               }
-               
-       }
-       
-       @Override
-       public void saveEndpointAccount(Long accountId, Long endpointId) throws Exception {
-               EPEndpointAccount record = new EPEndpointAccount();
-               record.setAccount_id(accountId);
-               record.setEp_id(endpointId);
-               try {
-                       getDataAccessService().saveDomainObject(record, null);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveEndpointAccount() failed", e);
-                       throw e;
-               }
-
-       }
-       
-       @Override
-       @SuppressWarnings("unchecked")
-       public void updateBasicAuthAccount(Long accountId, BasicAuthCredentials newCredential) throws Exception {
-               try {
-                       newCredential.setId(accountId);
-                       if (newCredential.getPassword() != null)
-                               newCredential.setPassword(encryptedPassword(newCredential.getPassword()));
-                       getDataAccessService().saveDomainObject(newCredential, null);
-                       
-                       List<EPEndpoint> endpoints = newCredential.getEndpoints();
-                       List<EPEndpoint> orig_points = getEPEndpoints(accountId);
-                       
-                       for(EPEndpoint temp_ep: orig_points){
-                               boolean flag = false;
-                               for(EPEndpoint temp_ep2: endpoints){
-                                       if(temp_ep2.getId() == temp_ep.getId())
-                                               flag = true;
-                               }
-                               if(!flag){
-                                       Map<String, String> params = new HashMap<String, String>();
-                                       params.put("accountId", Long.toString(accountId));
-                                       params.put("epId", Long.toString(temp_ep.getId()));
-                                       dataAccessService.executeNamedQuery("deleteAccountEndpointRecord", params, null);
-                               }
-                       }
-                       
-                       
-                       for(int i = 0; i < endpoints.size(); i++){
-                               
-                               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-                               Criterion IdCrit = Restrictions.eq("id", endpoints.get(i).getId());
-                               restrictionsList.add(IdCrit);
-                               Criterion NameCrit = Restrictions.eq("name", endpoints.get(i).getName());
-                               restrictionsList.add(NameCrit);
-                               List<EPEndpoint> tempList = (List<EPEndpoint>) dataAccessService
-                                               .getList(EPEndpoint.class, null, restrictionsList, null);
-                               if(tempList.size() == 0){
-                                       if(endpoints.get(i).getId() != null){
-                                               //delete the record endpoints.get(i).getId(), accountId                                         
-                                               Map<String, String> params = new HashMap<String, String>();
-                                               params.put("accountId", Long.toString(accountId));
-                                               params.put("epId", Long.toString(endpoints.get(i).getId()));
-                                               dataAccessService.executeNamedQuery("deleteAccountEndpointRecord", params, null);
-                                               endpoints.get(i).setId(null);
-                                       }
-                                       //create a new endpoint
-                                       Long ep_id = saveEndpoints(endpoints.get(i));
-                                       saveEndpointAccount(accountId, ep_id);                                           
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "updateBasicAuthAccount() failed", e);
-                       throw e;
-               }
-       }
-
-       @Override
-       public List<BasicAuthCredentials> getAccountData() throws Exception {
-               @SuppressWarnings("unchecked")
-               List<BasicAuthCredentials> list = (List<BasicAuthCredentials>) dataAccessService.getList(BasicAuthCredentials.class, null);
-               for (int i = 0; i < list.size(); i++) {
-                       if (list.get(i).getPassword() != null)
-                               list.get(i).setPassword(decryptedPassword(list.get(i).getPassword()));
-                       list.get(i).setEndpoints(getEPEndpoints(list.get(i).getId()));
-               }
-               return list;
-       }
-       
-       @SuppressWarnings("unchecked")
-       private List<EPEndpoint> getEPEndpoints(long accountId) {
-               List<EPEndpoint> result = new ArrayList<>();
-               List<EPEndpointAccount> list = (List<EPEndpointAccount>) dataAccessService
-                               .getList(EPEndpointAccount.class, " where account_id = '" + accountId + "'", null, null);
-               for(int i = 0; i < list.size(); i++){
-                       result.add((EPEndpoint) dataAccessService.getDomainObject(EPEndpoint.class, list.get(i).getEp_id(), null));
-               }
-               return result;
-       }
-       
-       @Override
-       public void deleteEndpointAccout(Long accountId) throws Exception {
-               try{
-                       Map<String, String> params = new HashMap<String, String>();
-                       params.put("accountId", Long.toString(accountId));
-                       
-                       dataAccessService.executeNamedQuery("deleteAccountEndpoint", params, null);
-                       dataAccessService.executeNamedQuery("deleteBasicAuthAccount", params, null);
-                       
-               }catch(Exception e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteEndpointAccout() failed", e);
-                       throw e;
-               }
-       }
-       
-       private String decryptedPassword(String encryptedPwd) throws Exception {
-               String result = "";
-               if (encryptedPwd != null & encryptedPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.decrypt(encryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword() failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-
-       private String encryptedPassword(String decryptedPwd) throws Exception {
-               String result = "";
-               if (decryptedPwd != null & decryptedPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.encrypt(decryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword() failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-       
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthenticationCredentialService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthenticationCredentialService.java
deleted file mode 100644 (file)
index c16ae40..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-
-public interface BasicAuthenticationCredentialService {
-       /**
-        * Gets the basic authentication credential for the specified appName from
-        * table ep_basic_auth_account
-        * 
-        * @param username
-        *            External user name
-        * @return BasicAuthCredentials for the specified app; null if the username
-        *         is not known.
-        */
-       public BasicAuthCredentials getBasicAuthCredentialByUsernameAndPassword(String username, String password);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/BasicAuthenticationCredentialServiceImpl.java
deleted file mode 100644 (file)
index 49f6f58..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.hibernate.criterion.Criterion;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-import org.openecomp.portalapp.portal.domain.EPEndpointAccount;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("basicAuthenticationCredentialService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class BasicAuthenticationCredentialServiceImpl implements BasicAuthenticationCredentialService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BasicAuthenticationCredentialServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @Override
-       public BasicAuthCredentials getBasicAuthCredentialByUsernameAndPassword(String username, String password) {
-
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion contextUserNameCrit = Restrictions.eq("username", username);
-               restrictionsList.add(contextUserNameCrit);
-               Criterion contextPasswordCrit = Restrictions.eq("password", password);
-               restrictionsList.add(contextPasswordCrit);
-
-               @SuppressWarnings("unchecked")
-               List<BasicAuthCredentials> credList = (List<BasicAuthCredentials>) dataAccessService
-                               .getList(BasicAuthCredentials.class, null, restrictionsList, null);
-               if (credList == null || credList.size() == 0) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "getBasicAuthCredentialByAppName: no credential(s) for " + username);
-                       return null;
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "getBasicAuthCredentialByAppName: cred list size: " + credList.size());
-               BasicAuthCredentials cred = (BasicAuthCredentials) credList.get(0);
-               cred.setEndpoints(getEndpointsByAccountId(cred.getId()));
-               return cred;
-       }
-
-       private List<EPEndpoint> getEndpointsByAccountId(long id) {
-               List<EPEndpoint> list = new ArrayList<>();
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion contextIdCrit = Restrictions.eq("account_id", id);
-               restrictionsList.add(contextIdCrit);
-               @SuppressWarnings("unchecked")
-               List<EPEndpointAccount> epList = (List<EPEndpointAccount>) dataAccessService.getList(EPEndpointAccount.class,
-                               null, restrictionsList, null);
-               for (EPEndpointAccount ep : epList) {
-                       list.add((EPEndpoint) dataAccessService.getDomainObject(EPEndpoint.class, ep.getEp_id(), null));
-               }
-               return list;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthService.java
deleted file mode 100644 (file)
index 6742a4c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.exceptions.NoHealthyServiceException;
-import com.ecwid.consul.ConsulException;
-import com.orbitz.consul.model.health.ServiceHealth;
-
-public interface ConsulHealthService {
-       /**
-        * This method returns the location of one healthy node if found in Consul -
-        * If not found in / by Consul, it falls back to 'localhost'
-        * 
-        * @param service
-        * @param fallbackPortOnLocalhost
-        *            value provided by the calling service
-        * @return Service location
-        */
-       public String getServiceLocation(String service, String fallbackPortOnLocalhost) throws NoHealthyServiceException;
-
-       public List<ServiceHealth> getAllHealthyNodes(String service) throws ConsulException;
-
-       public List<ServiceHealth> getAllNodes(String service) throws ConsulException;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ConsulHealthServiceImpl.java
deleted file mode 100644 (file)
index d3ca745..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.stereotype.Component;
-
-import com.ecwid.consul.ConsulException;
-import com.orbitz.consul.Consul;
-import com.orbitz.consul.HealthClient;
-import com.orbitz.consul.model.health.ServiceHealth;
-
-@Component
-public class ConsulHealthServiceImpl implements ConsulHealthService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ConsulHealthServiceImpl.class);
-
-       @Override
-       public String getServiceLocation(String service, String fallbackPortOnLocalHost) {
-
-               List<ServiceHealth> nodes = null;
-
-               try {
-                       Consul consul = Consul.builder().build();
-                       HealthClient healthClient = consul.healthClient();
-                       nodes = healthClient.getHealthyServiceInstances(service).getResponse();
-               } catch (Exception e) {
-                       String localFallbackServiceLocation = EcompPortalUtils.localOrDockerHost() + ":" + fallbackPortOnLocalHost;
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       " problem getting nodes for service {1}. Defaulting to {2}. Exception: {3}", service,
-                                       localFallbackServiceLocation, e.getMessage());
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       " problem getting nodes for service {1}. Defaulting to {2}. Exception: {3}", service,
-                                       localFallbackServiceLocation, e);
-                       return localFallbackServiceLocation;
-               }
-
-               if (nodes == null || nodes.size() == 0) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "No healthy node found in the consul cluster running service " + service
-                                       + ". Defaulting to localhost");
-                       return EcompPortalUtils.localOrDockerHost() + ":" + fallbackPortOnLocalHost;
-               } else {
-                       String locationFromConsul;
-                       ServiceHealth node = nodes.get(0);
-                       locationFromConsul = node.getNode().getNode() + ":" + node.getService().getPort();
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "Found healthy service location using consul - returning location " + locationFromConsul);
-
-                       // if locationFromConsul is null for some reason (very unlikely at
-                       // this point), default to localhost
-                       if (null == locationFromConsul || "".equals(locationFromConsul)) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "Couldn't get location from consul for service " + service + ". Defaulting to localhost");
-                               return "localhost:" + fallbackPortOnLocalHost;
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Found service location from consul for service " + service
-                                               + ". Location is " + locationFromConsul);
-                               return locationFromConsul;
-                       }
-               }
-       }
-
-       @Override
-       public List<ServiceHealth> getAllHealthyNodes(String service) throws ConsulException {
-               Consul consul = Consul.builder().build();
-               HealthClient healthClient = consul.healthClient();
-               return healthClient.getHealthyServiceInstances(service).getResponse();
-       }
-
-       @Override
-       public List<ServiceHealth> getAllNodes(String service) {
-               Consul consul = Consul.builder().build();
-               HealthClient healthClient = consul.healthClient();
-               return healthClient.getAllServiceInstances(service).getResponse();
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchService.java
deleted file mode 100644 (file)
index 87d557c..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-import java.util.Map;
-
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-
-public interface DashboardSearchService {
-       public Map<String, List<SearchResultItem>> searchResults(String userId, String searchString);
-       public List<String> getRelatedUsers(String userId);
-       
-       public CommonWidgetMeta getWidgetData(String resourceType);
-       public String saveWidgetDataBulk(CommonWidgetMeta commonWidgetMetaData);
-       public String saveWidgetData(CommonWidget commonWidgetData);
-       public String deleteWidgetData(CommonWidget eventWidget);       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImpl.java
deleted file mode 100644 (file)
index f08011f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-
-@Component
-public class DashboardSearchServiceImpl implements DashboardSearchService {
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       public Map<String, List<SearchResultItem>> searchResults(String userId, String searchString) {
-               Map<String, String> params = new HashMap<>();
-               params.put("userId", userId);
-               params.put("searchQuery", searchString);
-               // Named query is stored in a *.hbm.xml file, mapped to SearchResultItem
-               @SuppressWarnings("unchecked")
-               List<SearchResultItem> list = dataAccessService.executeNamedQuery("searchPortal", params, null);
-               Map<String, List<SearchResultItem>> finalJson = null;
-               if (list.size() > 0) {
-                       finalJson = new HashMap<String, List<SearchResultItem>>();
-                       for (SearchResultItem thisResult : list) {
-                               List<SearchResultItem> thisList = finalJson.get(thisResult.getCategory().toLowerCase());
-                               if (thisList == null)
-                                       thisList = new ArrayList<SearchResultItem>();
-                               thisList.add(thisResult);
-                               finalJson.put(thisResult.getCategory().toLowerCase(), thisList);
-                       }
-               }
-               return finalJson;
-       }
-
-       @Override
-       public List<String> getRelatedUsers(String userId) {
-               Map<String, String> params = new HashMap<>();
-               params.put("userId", userId);
-               @SuppressWarnings("unchecked")
-               List<String> activeUsers = dataAccessService.executeNamedQuery("relatedUsers", params, null);
-               return activeUsers;
-       }
-
-       @Override
-       public CommonWidgetMeta getWidgetData(String resourceType) {
-               Map<String, String> params = new HashMap<>();
-               params.put("cat", resourceType);
-               @SuppressWarnings("unchecked")
-               List<CommonWidget> widgetItems = (List<CommonWidget>) dataAccessService.executeNamedQuery("getCommonWidgetItem", params, null);
-               return new CommonWidgetMeta(resourceType, widgetItems);
-       }
-
-       @Override
-       public String saveWidgetDataBulk(CommonWidgetMeta commonMetaWidgetData) {
-               for (CommonWidget widgetData : commonMetaWidgetData.getItems()) {
-                       widgetData.setCategory(commonMetaWidgetData.getCategory());
-                       dataAccessService.saveDomainObject(widgetData, null);
-               }
-               return "success";
-       }
-
-       @Override
-       public String saveWidgetData(CommonWidget commonWidgetData) {
-               dataAccessService.saveDomainObject(commonWidgetData, null);
-               return "success";
-       }
-
-       @Override
-       public String deleteWidgetData(CommonWidget eventWidget) {
-               dataAccessService.deleteDomainObject(eventWidget, null);
-               return "success";
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAppCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAppCommonServiceImpl.java
deleted file mode 100644 (file)
index 2fc0f50..0000000
+++ /dev/null
@@ -1,1515 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.io.IOException;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang.StringUtils;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.openecomp.portalapp.portal.domain.AdminUserApp;
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
-import org.openecomp.portalapp.portal.domain.AppsResponse;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequestDetail;
-import org.openecomp.portalapp.portal.domain.EPUserAppsManualSortPreference;
-import org.openecomp.portalapp.portal.domain.EPUserAppsSortPreference;
-import org.openecomp.portalapp.portal.domain.EPWidgetsManualSortPreference;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.domain.UserRole;
-import org.openecomp.portalapp.portal.domain.UserRoles;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.LocalRole;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.ueb.EPUebHelper;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.Helper;
-import org.openecomp.portalsdk.core.onboarding.ueb.TopicManager;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import com.att.nsa.apiClient.http.HttpException;
-import com.att.nsa.cambria.client.CambriaClient.CambriaApiException;
-import com.att.nsa.cambria.client.CambriaClientBuilders;
-import com.att.nsa.cambria.client.CambriaIdentityManager;
-import com.att.nsa.cambria.client.CambriaTopicManager;
-import com.google.common.primitives.Ints;
-
-public class EPAppCommonServiceImpl implements EPAppService {
-
-       protected String ECOMP_APP_ID = "1";
-       protected String SUPER_ADMIN_ROLE_ID = "1";
-       protected String ACCOUNT_ADMIN_ROLE_ID = "999";
-       protected String RESTRICTED_APP_ROLE_ID = "900";
-
-       private static final String urlField = "url";
-       private static final String nameField = "name";
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAppCommonServiceImpl.class);
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-       @Autowired
-       protected SessionFactory sessionFactory;
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       private EPUebHelper epUebHelper;
-
-       @PostConstruct
-       private void init() {
-               SUPER_ADMIN_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.SYS_ADMIN_ROLE_ID);
-               ACCOUNT_ADMIN_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID);
-               ECOMP_APP_ID = SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID);
-               RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.RESTRICTED_APP_ROLE_ID);
-       }
-
-       @Override
-       public List<EPApp> getUserAsAdminApps(EPUser user) {
-               if (adminRolesService.isAccountAdmin(user)) {
-                       String sql = "SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID=FN_APP.APP_ID where "
-                                       + "FN_USER_ROLE.USER_ID=" + user.getId() + " AND FN_USER_ROLE.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
-                                       + " AND FN_APP.ENABLED = 'Y'";
-                       logQuery(sql);
-                       try {
-                               @SuppressWarnings("unchecked")
-                               List<EPApp> adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null);
-                               return adminApps;
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                               return null;
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "getUserAsAdminApps: only Account Admin may invoke this function!");
-                       return new ArrayList<EPApp>();
-               }
-       }
-
-       @Override
-       public List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId) {
-               String format = "SELECT * FROM FN_APP app INNER JOIN FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
-                               + "INNER JOIN FN_USER user on user.USER_ID = userrole.USER_ID "
-                               + "WHERE user.org_user_id = '%s' AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
-                               + " AND FN_APP.ENABLED = 'Y'";
-
-               String sql = String.format(format, orgUserId);
-               logQuery(sql);
-
-               try {
-                       @SuppressWarnings("unchecked")
-                       List<EPApp> adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null);
-                       return adminApps;
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       return null;
-               }
-       }
-
-       @Override
-       public List<EPApp> getAppsFullList() {
-               @SuppressWarnings("unchecked")
-               List<EPApp> apps = dataAccessService.getList(EPApp.class, null);
-               return apps;
-       }
-
-       @Override
-       public List<EcompApp> getEcompAppAppsFullList() {
-               return transformAppsToEcompApps(getAppsFullList());
-       }
-
-       @Override
-       public List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList) {
-               List<EcompApp> ecompAppList = new ArrayList<EcompApp>();
-               for (EPApp app : appsList) {
-                       EcompApp ecompApp = new EcompApp();
-                       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.setUebTopicName(app.getUebTopicName());
-                       ecompApp.setUebKey(app.getUebKey());
-                       ecompApp.setUebSecret(app.getUebSecret());
-                       ecompApp.setEnabled(app.getEnabled());
-                       ecompApp.setCentralAuth(app.getCentralAuth());
-                       ecompApp.setNameSpace(app.getNameSpace());
-                       ecompApp.setRestrictedApp(app.isRestrictedApp());
-                       ecompAppList.add(ecompApp);
-               }
-               return ecompAppList;
-       }
-
-       @Override
-       public EPApp getApp(Long appId) {
-               try {
-                       @SuppressWarnings("unchecked")
-                       List<EPApp> apps = dataAccessService.getList(EPApp.class, " where id = " + appId, null, null);
-                       return (apps.size() > 0) ? apps.get(0) : null;
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       return null;
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<AppIdAndNameTransportModel> getAdminApps(EPUser user) {
-               if (adminRolesService.isAccountAdmin(user)) {
-                       String format = "SELECT app.APP_ID, app.APP_NAME, app.APP_TYPE FROM FN_APP app inner join FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
-                                       + "where userrole.USER_ID = %d AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
-                                       + " AND (app.ENABLED = 'Y' OR app.APP_ID=1)";
-                       String sql = String.format(format, user.getId());
-                       // sql += " AND app.APP_REST_ENDPOINT IS NOT NULL AND
-                       // app.APP_REST_ENDPOINT <> ''";
-                       logQuery(sql);
-                       try {
-                               return dataAccessService.executeSQLQuery(sql, AppIdAndNameTransportModel.class, null);
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Exception occurred while fetching the adminApps for user " + user.getLoginId(), e);
-                       }
-               }
-               return new ArrayList<AppIdAndNameTransportModel>();
-       }
-
-       @Override
-       public EPApp getAppDetail(String appName) {
-               final Map<String, String> params = new HashMap<String, String>();
-               try {
-                       params.put("appName", appName);
-                       @SuppressWarnings("unchecked")
-                       List<EPApp> apps = (List<EPApp>) dataAccessService.executeNamedQuery("getMyloginAppDetails", params, null);
-                       return (apps.size() > 0) ? apps.get(0) : null;
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       return null;
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user) {
-               if (adminRolesService.isSuperAdmin(user) || adminRolesService.isAccountAdmin(user)) {
-                       String format = "";
-                       String sql = "";
-                       if (adminRolesService.isSuperAdmin(user)) {
-                               format = "SELECT app.APP_ID, app.APP_NAME, app.APP_TYPE FROM FN_APP app "
-                                               + "where app.ENABLED = 'Y' AND app.app_type = 1";
-                       } else {
-                               format = "SELECT app.APP_ID, app.APP_NAME, APP_TYPE FROM FN_APP app inner join FN_USER_ROLE userrole ON userrole.APP_ID=app.APP_ID "
-                                               + "where userrole.USER_ID = %d AND userrole.ROLE_ID=" + ACCOUNT_ADMIN_ROLE_ID
-                                               + " AND app.ENABLED = 'Y' AND app.app_type = 1";
-                       }
-                       sql = String.format(format, user.getId());
-                       // sql += " AND app.APP_REST_ENDPOINT IS NOT NULL AND
-                       // app.APP_REST_ENDPOINT <> ''";
-                       logQuery(sql);
-                       try {
-                               return dataAccessService.executeSQLQuery(sql, AppIdAndNameTransportModel.class, null);
-                       } catch (Exception e) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Exception occurred while fetching the adminApps for user " + user.getLoginId(), e);
-                       }
-               }
-               return new ArrayList<AppIdAndNameTransportModel>();
-       }
-
-       protected void logQuery(String sql) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "logQuery: " + sql);
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<AdminUserApplications> getAppsAdmins() {
-               try {
-                       Map<String, String> params = new HashMap<>();
-                       params.put("accountAdminRoleId", ACCOUNT_ADMIN_ROLE_ID);
-                       List<AdminUserApp> adminApps = (List<AdminUserApp>) dataAccessService.executeNamedQuery("getAppsAdmins",
-                                       params, null);
-                       return aggregateRowsResultsByUserId(adminApps);
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       return null;
-               }
-       }
-
-       private List<AdminUserApplications> aggregateRowsResultsByUserId(List<AdminUserApp> adminApps) {
-               HashMap<Long, AdminUserApplications> adminUserApplications = new HashMap<Long, AdminUserApplications>();
-               for (AdminUserApp app : adminApps) {
-                       Long userId = app.getUser_Id();
-                       if (adminUserApplications.get(userId) == null)
-                               adminUserApplications.put(userId, new AdminUserApplications(app));
-                       else
-                               adminUserApplications.get(userId).addApp(app.getAppId(), app.getAppName());
-               }
-               return new ArrayList<AdminUserApplications>(adminUserApplications.values());
-       }
-
-       @Override
-       public List<AppsResponse> getAllApps(Boolean all) {
-               // If all is true, return both active and inactive apps. Otherwise, just
-               // active apps.
-               @SuppressWarnings("unchecked")
-               // Sort the list by application name so the drop-down looks pretty.
-               List<EPApp> apps = all
-                               ? (List<EPApp>) dataAccessService.getList(EPApp.class, " where id != " + ECOMP_APP_ID, "name", null)
-                               : (List<EPApp>) dataAccessService.getList(EPApp.class,
-                                               " where ( enabled = 'Y' or id = " + ECOMP_APP_ID + ")", "name", null);
-
-               List<AppsResponse> appsModified = new ArrayList<AppsResponse>();
-               for (EPApp app : apps) {
-                       appsModified.add(new AppsResponse(app.getId(), app.getName(), app.isRestrictedApp(), app.getEnabled()));
-               }
-               return appsModified;
-       }
-
-       @Override
-       public UserRoles getUserProfile(String loginId) {
-               final Map<String, String> params = new HashMap<>();
-               params.put("org_user_id", loginId);
-               @SuppressWarnings("unchecked")
-               List<UserRole> userRoleList = dataAccessService.executeNamedQuery( "getUserRoles", params, null);
-               ArrayList<UserRoles> usersRolesList = aggregateUserProfileRowsResultsByRole(userRoleList);
-               if (usersRolesList == null || usersRolesList.size() < 1)
-                       return null;
-
-               return usersRolesList.get(0);
-       }
-
-       @Override
-       public UserRoles getUserProfileNormalized(EPUser user) {
-               // Check database.
-               UserRoles userAndRoles = getUserProfile(user.getLoginId());
-               // If no roles are defined, treat this user as a guest.
-               if (user.isGuest() || userAndRoles == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "getUserProfile: treating user {} as guest",
-                                       user.getLoginId());
-                       UserRole userRole = new UserRole();
-                       userRole.setUser_Id(user.getId());
-                       userRole.setOrgUserId(user.getLoginId());
-                       userRole.setFirstName(user.getFirstName());
-                       userRole.setLastName(user.getLastName());
-                       userRole.setRoleId(-1L);
-                       userRole.setRoleName("Guest");
-                       userRole.setUser_Id(-1L);
-                       userAndRoles = new UserRoles(userRole);
-               }
-
-               return userAndRoles;
-       }
-
-       protected ArrayList<UserRoles> aggregateUserProfileRowsResultsByRole(List<UserRole> userRoleList) {
-               HashMap<String, UserRoles> userRoles = new HashMap<String, UserRoles>();
-               for (UserRole user : userRoleList) {
-                       String orgUserId = user.getOrgUserId();
-                       if (userRoles.get(orgUserId) == null)
-                               userRoles.put(orgUserId, new UserRoles(user));
-                       else
-                               userRoles.get(orgUserId).addRole(user.getRoleName());
-               }
-               return new ArrayList<UserRoles>(userRoles.values());
-       }
-
-       private boolean isRestrictedApp(Long appId) {
-               EPApp app = getApp(appId);
-               return app.isRestrictedApp();
-       }
-
-       // For the functional menu edit
-       @Override
-       public List<LocalRole> getAppRoles(Long appId) {
-               String sql = "";
-               if (isRestrictedApp(appId)) {
-                       sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where UPPER(ACTIVE_YN) = 'Y' AND ROLE_ID = '" + RESTRICTED_APP_ROLE_ID + "'";
-               }else if(appId == 1){
-                       sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where UPPER(ACTIVE_YN) = 'Y' AND APP_ID IS NULL";
-               }else{
-                       sql = "SELECT ROLE_ID, ROLE_NAME from FN_ROLE where UPPER(ACTIVE_YN) = 'Y' AND APP_ID = '" + appId + "'";
-               }
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<LocalRole> appRoles = dataAccessService.executeSQLQuery(sql, LocalRole.class, null);
-               return appRoles;
-       }
-
-       protected String userAppsQuery(EPUser user) {
-               StringBuilder query = new StringBuilder();
-               if (adminRolesService.isSuperAdmin(user)) {
-                       query.append("SELECT * FROM FN_APP where FN_APP.ENABLED = 'Y' ORDER BY APP_NAME");
-               } else {
-                       query.append("SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where ");
-                       query.append(
-                                       "FN_USER_ROLE.USER_ID = " + user.getId() + " AND FN_USER_ROLE.ROLE_ID != " + SUPER_ADMIN_ROLE_ID);
-                       query.append(" AND FN_APP.ENABLED = 'Y'");
-               }
-               return query.toString();
-       }
-
-       protected FieldsValidator onboardingAppFieldsChecker(OnboardingApp onboardingApp) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               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 && onboardingApp.id.equals(ECOMP_APP_ID))
-                               // For a normal app (appType==1), these fields must be filled
-                               // in.
-                               // For a restricted app (appType==2), they will be empty.
-                               || ((!onboardingApp.restrictedApp)
-                                               && (onboardingApp.username == null || onboardingApp.username.length() == 0
-                                                               || onboardingApp.appPassword == null || onboardingApp.appPassword.length() == 0))) {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-               }
-               return fieldsValidator;
-       }
-
-       @Override
-       public List<EPApp> getUserApps(EPUser user) {
-               List<EPApp> openApps = getOpenApps();
-
-               if (user.isGuest()) {
-                       return openApps;
-               } else {
-                       String sql = userAppsQuery(user);
-                       logQuery(sql);
-
-                       // TreeSet<EPApp> distinctApps = new TreeSet<EPApp>();
-                       List<EPApp> appsList = new ArrayList<>();
-                       @SuppressWarnings("unchecked")
-                       List<EPApp> adminApps = dataAccessService.executeSQLQuery(sql, EPApp.class, null);
-                       HashSet<EPApp> appSet = new HashSet<>();
-                       for (EPApp app : adminApps) {
-                               appSet.add(app);
-                               appsList.add(app);
-                       }
-
-                       for (EPApp app : openApps) {
-                               if (!appSet.contains(app))
-                                       appsList.add(app);
-                       }
-
-                       return appsList;
-               }
-       }
-
-       @Override
-       public List<EPApp> getPersAdminApps(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               params.put("userId", user.getId());
-               // Named query is stored in EP.hbm.xml, mapped to EPApp
-               @SuppressWarnings("unchecked")
-               List<EPApp> list = dataAccessService.executeNamedQuery("getPersAdminApps", params, null);
-               return list;
-       }
-
-       @Override
-       public List<EPApp> getPersUserApps(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               params.put("userId", user.getId());
-               // Named query is stored in EP.hbm.xml, mapped to EPApp
-               @SuppressWarnings("unchecked")
-               List<EPApp> list = dataAccessService.executeNamedQuery("getPersUserApps", params, null);
-               return list;
-       }
-
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * org.openecomp.portalapp.portal.service.EPAppService#getAppCatalog(
-        * org.openecomp.portalapp.portal.domain.EPUser)
-        */
-       @Override
-       public List<AppCatalogItem> getUserAppCatalog(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               params.put("userId", user.getId());
-               // Named query is stored in EP.hbm.xml, mapped to AppCatalogItem
-               @SuppressWarnings("unchecked")
-               List<AppCatalogItem> list = dataAccessService.executeNamedQuery("getUserAppCatalog", params, null);
-               return list;
-       }
-
-       /*
-        * (non-Javadoc)
-        *
-        * @see
-        * org.openecomp.portalapp.portal.service.EPAppService#getAdminAppCatalog(
-        * org.openecomp.portalapp.portal.domain.EPUser)
-        */
-       @Override
-       public List<AppCatalogItem> getAdminAppCatalog(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               params.put("userId", user.getId());
-               // Named query is stored in EP.hbm.xml, mapped to AppCatalogItem
-               @SuppressWarnings("unchecked")
-               List<AppCatalogItem> list = dataAccessService.executeNamedQuery("getAdminAppCatalog", params, null);
-               return list;
-       }
-
-       private List<EPApp> getOpenApps() {
-               @SuppressWarnings("unchecked")
-               List<EPApp> openApps = dataAccessService.getList(EPApp.class, " where open='Y' and enabled='Y'", null, null);
-               return openApps;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPApp> getAppsOrderByName(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               List<EPApp> sortedAppsByName = null;
-               try {
-                       if (adminRolesService.isSuperAdmin(user)) {
-                               params.put("userId", user.getId());
-                               sortedAppsByName = dataAccessService.executeNamedQuery("getPersAdminAppsOrderByName", params, null);
-                       } else {
-                               params.put("userId", user.getId());
-                               sortedAppsByName = dataAccessService.executeNamedQuery("getPersUserAppsOrderByName", params, null);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByName failed", e);
-               }
-               return sortedAppsByName;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPApp> getAppsOrderByLastUsed(EPUser user) {
-
-               final Map<String, Long> params = new HashMap<>();
-               List<EPApp> sortedAppsByLastUsed = new ArrayList<EPApp>();
-               List<EPApp> finalsortedAppsByLastUsed = new ArrayList<EPApp>();
-               try {
-                       if (adminRolesService.isSuperAdmin(user)) {
-                               params.put("userId", user.getId());
-                               sortedAppsByLastUsed = dataAccessService.executeNamedQuery("getAdminAppsOrderByLastUsed", params, null);
-                       } else {
-                               params.put("userId", user.getId());
-                               sortedAppsByLastUsed = dataAccessService.executeNamedQuery("getUserAppsOrderByLastUsed", params, null);
-                       }
-                       Set<String> epAppSet = new HashSet<String>();
-                       for (EPApp eapp : sortedAppsByLastUsed)
-                               if (!epAppSet.contains(eapp.getName())) {
-                                       finalsortedAppsByLastUsed.add(eapp);
-                                       epAppSet.add(eapp.getName());
-                               }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByLastUsed failed", e);
-               }
-               return finalsortedAppsByLastUsed;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPApp> getAppsOrderByMostUsed(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               List<EPApp> sortedAppsByMostUsed = new ArrayList<EPApp>();
-               List<EPApp> finalsortedAppsByMostUsed = new ArrayList<EPApp>();
-               try {
-                       if (adminRolesService.isSuperAdmin(user)) {
-                               params.put("userId", user.getId());
-                               sortedAppsByMostUsed = dataAccessService.executeNamedQuery("getAdminAppsOrderByMostUsed", params, null);
-                       } else {
-                               params.put("userId", user.getId());
-                               sortedAppsByMostUsed = dataAccessService.executeNamedQuery("getUserAppsOrderByMostUsed", params, null);
-                       }
-                       Set<String> epAppSet = new HashSet<String>();
-
-                       for (EPApp eapp : sortedAppsByMostUsed) {
-                               if (!epAppSet.contains(eapp.getName())) {
-                                       finalsortedAppsByMostUsed.add(eapp);
-                                       epAppSet.add(eapp.getName());
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByMostUsed failed", e);
-               }
-
-               return finalsortedAppsByMostUsed;
-       }
-
-       /*
-        * This Method retrieves the User Apps by Sort Manual Preference
-        *
-        * @param: user--contains LoggedIn User Data
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPApp> getAppsOrderByManual(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               List<EPApp> sortedAppsByManual = new ArrayList<EPApp>();
-               List<EPApp> finalsortedAppsByManual = new ArrayList<EPApp>();
-               try {
-                       if (adminRolesService.isSuperAdmin(user)) {
-                               params.put("userId", user.getId());
-                               sortedAppsByManual = dataAccessService.executeNamedQuery("getAdminAppsOrderByManual", params, null);
-                       } else {
-                               params.put("userId", user.getId());
-                               sortedAppsByManual = dataAccessService.executeNamedQuery("getUserAppsOrderByManual", params, null);
-                       }
-                       Set<String> epAppSet = new HashSet<String>();
-
-                       for (EPApp eapp : sortedAppsByManual) {
-                               if (!epAppSet.contains(eapp.getName())) {
-                                       finalsortedAppsByManual.add(eapp);
-                                       epAppSet.add(eapp.getName());
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppsOrderByManual failed", e);
-               }
-               return finalsortedAppsByManual;
-       }
-
-       @Override
-       public List<OnboardingApp> getOnboardingApps() {
-               @SuppressWarnings("unchecked")
-               List<EPApp> apps = dataAccessService.getList(EPApp.class, " where id!=" + ECOMP_APP_ID, null, null);
-               List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
-               for (EPApp app : apps) {
-                       OnboardingApp onboardingApp = new OnboardingApp();
-                       createOnboardingFromApp(app, onboardingApp);
-                       onboardingAppsList.add(onboardingApp);
-               }
-               return onboardingAppsList;
-       }
-
-       @Override
-       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);
-               List<OnboardingApp> onboardingAppsList = new ArrayList<OnboardingApp>();
-               for (EPApp app : apps) {
-                       OnboardingApp onboardingApp = new OnboardingApp();
-                       createOnboardingFromApp(app, onboardingApp);
-                       onboardingAppsList.add(onboardingApp);
-               }
-               return onboardingAppsList;
-       }
-
-       @SuppressWarnings("unchecked")
-       private void validateOnboardingApp(OnboardingApp onboardingApp, FieldsValidator fieldsValidator) {
-               boolean duplicatedUrl = false;
-               boolean duplicatedName = false;
-               List<EPApp> apps;
-               if (onboardingApp.id == null) {
-                       apps = dataAccessService.getList(EPApp.class,
-                                       " where url = '" + onboardingApp.url + "' or name = '" + onboardingApp.name + "'", null, null);
-               } else {
-                       apps = dataAccessService.getList(EPApp.class, " where id = " + onboardingApp.id + " or url = '"
-                                       + onboardingApp.url + "' or name = '" + onboardingApp.name + "'", null, null);
-               }
-               for (EPApp app : apps) {
-                       if (onboardingApp.id != null && onboardingApp.id.equals(app.getId())) {
-                               continue;
-                       }
-                       if (!duplicatedUrl && app.getUrl().equalsIgnoreCase(onboardingApp.url)) {
-                               duplicatedUrl = true;
-                               if (duplicatedName) {
-                                       break;
-                               }
-                       }
-                       if (!duplicatedName && app.getName().equalsIgnoreCase(onboardingApp.name)) {
-                               duplicatedName = true;
-                               if (duplicatedUrl) {
-                                       break;
-                               }
-                       }
-               }
-               if (duplicatedUrl || duplicatedName) {
-                       if (duplicatedUrl) {
-                               fieldsValidator.addProblematicFieldName(urlField);
-                       }
-                       if (duplicatedName) {
-                               fieldsValidator.addProblematicFieldName(nameField);
-                       }
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
-                       fieldsValidator.errorCode = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
-               }
-       }
-
-       @Override
-       public FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "LR: entering modifyOnboardingApp");
-               FieldsValidator fieldsValidator = onboardingAppFieldsChecker(modifiedOnboardingApp);
-               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                       validateOnboardingApp(modifiedOnboardingApp, fieldsValidator);
-               }
-               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                       if (modifiedOnboardingApp.id != null) {
-                               updateApp(modifiedOnboardingApp.id, modifiedOnboardingApp, fieldsValidator, user);
-                       } else {
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-                       }
-               }
-               return fieldsValidator;
-       }
-
-       @Override
-       public FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user) {
-               FieldsValidator fieldsValidator = onboardingAppFieldsChecker(newOnboardingApp);
-               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                       validateOnboardingApp(newOnboardingApp, fieldsValidator);
-               }
-               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                       if (newOnboardingApp.id == null) {
-                               updateApp(null, newOnboardingApp, fieldsValidator, user);
-                       } else {
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-                       }
-               }
-               return fieldsValidator;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public FieldsValidator deleteOnboardingApp(EPUser user, Long appid) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_FORBIDDEN);
-                       return fieldsValidator;
-               }
-               final Map<String, Long> params = new HashMap<>();
-               params.put("app_id", appid);
-               List<EPUserAppRolesRequest> EPUserAppRolesRequestList= new ArrayList<>();
-               EPUserAppRolesRequestList = dataAccessService.executeNamedQuery( "getRequestIdsForApp", params, null);
-           for(int i=0;i<EPUserAppRolesRequestList.size();i++)
-           {
-            dataAccessService.deleteDomainObjects(EPUserAppRolesRequestDetail.class , "req_id=" + EPUserAppRolesRequestList.get(i).getId(),null);
-               
-           }
-               
-               Boolean result = false;
-               Session localSession = null;
-               Transaction transaction = null;
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-
-                       // 1) Remove the URL for any functional menu item associated with
-                       // this app
-                       String sql = "UPDATE fn_menu_functional m, fn_menu_functional_roles mr SET m.url='' "
-                                       + " WHERE m.menu_id=mr.menu_id " + " AND mr.app_id='" + appid + "'";
-                       logQuery(sql);
-                       Query query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove any favorites associated with a menu item that is
-                       // associated with this app
-                       sql = "Delete from fn_menu_favorites " + " using fn_menu_favorites inner join fn_menu_functional_roles "
-                                       + " where fn_menu_functional_roles.app_id='" + appid + "' "
-                                       + " AND fn_menu_functional_roles.menu_id=fn_menu_favorites.menu_id";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove all role, appid records from fn_menu_functional_role
-                       // that are associated with this app
-                       sql = "delete from fn_menu_functional_roles where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       
-                       
-                       // Remove all roles, rolefunctions, appid records from ep_app_role_function
-                       // that are associated with this app
-                   sql = "DELETE FROM ep_app_role_function WHERE app_id='" + appid + "'";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                        query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       
-                       //Remove all rolefunctions, appid records from ep_app_function
-                       // that are associated with this app
-                       sql = "DELETE FROM ep_app_function WHERE app_id='" + appid + "'";
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove all records from fn_user_role associated with this app
-                       sql = "delete from fn_user_role where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove any widgets associated with this app
-                       sql = "delete from ep_widget_catalog_role where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove any roles associated with this app
-                       sql = "delete from ep_role_notification " + " using ep_role_notification inner join fn_role "
-                                       + " where fn_role.app_id='" + appid + "' " + " and ep_role_notification.role_id= fn_role.role_id";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove all records from fn_role associated with this app
-                       sql = "delete from fn_role where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove app contact us entries
-                       sql = "delete from fn_app_contact_us where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove rows in the app personalization selection table
-                       sql = "delete from fn_pers_user_app_sel where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove rows in the app personalization sort table
-                       sql = "delete from ep_pers_user_app_man_sort where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove rows in the app personalization sort table
-                       sql = "delete from ep_user_roles_request where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Remove rows in the app personalization sort table
-                       sql = "delete from ep_web_analytics_source where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Delete the app
-                       sql = "delete from fn_app where app_id='" + appid + "'";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       transaction.commit();
-                       result = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteOnboardingApp failed", e);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError);
-                       EcompPortalUtils.rollbackTransaction(transaction, "deleteOnboardingApp rollback, exception = " + e);
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "deleteOnboardingApp");
-               }
-               if (!result) {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       private static Object syncRests = new Object();
-
-       // An app has been enabled/disabled. Must enable/disable all associated
-       // functional menu items.
-       protected void setFunctionalMenuItemsEnabled(Session localSession, Boolean enabled, Long appId) {
-               String active_yn = enabled ? "Y" : "N";
-               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 = '" + appId + "' ";
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-               for (FunctionalMenuItem menuItem : menuItems) {
-                       FunctionalMenuItem myMenuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class,
-                                       menuItem.menuId);
-                       myMenuItem.active_yn = active_yn;
-                       localSession.save(myMenuItem);
-               }
-       }
-
-       // Attention! If (appId == null) we use this function to create application
-       // otherwise we use it to modify existing application
-       protected void updateApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator, EPUser user) {
-               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) {
-                       boolean result = false;
-                       Session localSession = null;
-                       Transaction transaction = null;
-                       try {
-                               localSession = sessionFactory.openSession();
-                               transaction = localSession.beginTransaction();
-                               EPApp app;
-                               if (appId == null) {
-                                       app = new EPApp();
-                               } else {
-                                       app = (EPApp) localSession.get(EPApp.class, appId);
-                                       if (app == null || app.getId() == null) { // App is already
-                                               // deleted!
-                                               transaction.commit();
-                                               localSession.close();
-                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
-                                               return;
-                                       }
-                               }
-                               createAppFromOnboarding(app, onboardingApp, localSession);
-                               localSession.saveOrUpdate(app);
-                               // Enable or disable all menu items associated with this app
-                               setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
-                               transaction.commit();
-                               result = true;
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "updateApp failed", e);
-                               EcompPortalUtils.rollbackTransaction(transaction,
-                                               "updateApp rollback, exception = " + e.toString());
-                       } finally {
-                               EcompPortalUtils.closeLocalSession(localSession, "updateApp");
-                       }
-                       if (!result) {
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       }
-
-               } else {
-                       updateRestrictedApp(appId, onboardingApp, fieldsValidator, user);
-                       
-               }
-       }
-
-       protected void updateRestrictedApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator,
-                       EPUser user) {
-               synchronized (syncRests) {
-                       boolean result = false;
-                       Session localSession = null;
-                       Transaction transaction = null;
-                       try {
-                               localSession = sessionFactory.openSession();
-                               transaction = localSession.beginTransaction();
-                               EPApp app;
-                               if (appId == null) {
-                                       app = new EPApp();
-                                       // -------------------------------------------------------------------------------------------
-                                       // Register this App with the UEB communication server.
-                                       // Save
-                                       // the App's unique mailbox/topic
-                                       // name and keys to the FN_APP table. The App's mailbox
-                                       // and
-                                       // keys will be visible to the
-                                       // admin on the ECOMP portal.
-                                       // -------------------------------------------------------------------------------------------
-                                       TopicManager topicManager = new TopicManager() {
-
-                                               EPAppCommonServiceImpl service;
-
-                                               public void init(EPAppCommonServiceImpl _service) {
-                                                       service = _service;
-                                               }
-
-                                               public void createTopic(String key, String secret, String topicName,
-                                                               String topicDescription) throws HttpException, CambriaApiException, IOException {
-
-                                                       init(EPAppCommonServiceImpl.this);
-                                                       final LinkedList<String> urlList = Helper.uebUrlList();
-                                                       if (logger.isInfoEnabled()) {
-                                                               logger.info("==> createTopic");
-                                                               logger.info("topicName: " + topicName);
-                                                               logger.info("topicDescription: " + topicDescription);
-                                                       }
-                                                       CambriaTopicManager tm = null;
-                                                       try {
-                                                               tm = service.getTopicManager(urlList, key, secret);
-                                                       } catch (Exception e) {
-                                                               logger.error("pub.build Exception ", e);
-                                                               throw new CambriaApiException(topicName);
-                                                       }
-                                                       tm.createTopic(topicName, topicDescription, 1, 1);
-                                               }
-
-                                               public void addPublisher(String topicOwnerKey, String topicOwnerSecret, String publisherKey,
-                                                               String topicName) throws HttpException, CambriaApiException, IOException {
-                                                       logger.info("==> addPublisher to topic " + topicName);
-                                                       final LinkedList<String> urlList = Helper.uebUrlList();
-                                                       CambriaTopicManager tm = null;
-                                                       try {
-                                                               tm = service.getTopicManager(urlList, topicOwnerKey, topicOwnerSecret);
-                                                       } catch (Exception e) {
-                                                               logger.error("pub.build Exception ", e);
-                                                               throw new CambriaApiException(topicName);
-                                                       }
-                                                       tm.allowProducer(topicName, publisherKey);
-                                               }
-
-                                       };
-                                       final CambriaIdentityManager im = new CambriaClientBuilders.IdentityManagerBuilder()
-                                                       .usingHosts(Helper.uebUrlList()).build();
-                                       com.att.nsa.apiClient.credentials.ApiCredential credential = im.createApiKey(user.getEmail(),
-                                                       "ECOMP Portal Owner");
-                                       String appKey = credential.getApiKey();
-                                       String appSecret = credential.getApiSecret();
-                                       String appMailboxName = null;
-
-                                       int maxNumAttemptsToCreateATopic = 3;
-                                       boolean successfullyCreatedMailbox = false;
-                                       for (int i = 0; i < maxNumAttemptsToCreateATopic; i++) {
-                                               appMailboxName = "ECOMP-PORTAL-OUTBOX-" + (int) (Math.random() * 100000.0);
-
-                                               try {
-                                                       topicManager.createTopic(
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
-                                                                       appMailboxName, "ECOMP outbox for app" + onboardingApp.name);
-                                                       successfullyCreatedMailbox = true;
-                                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                                       "Successfully created " + appMailboxName + " for App " + onboardingApp.name);
-                                                       logger.debug(EELFLoggerDelegate.debugLogger, "    Key = " + appKey + " Secret = "
-                                                                       + appSecret + " generated using = " + user.getEmail());
-                                                       break;
-                                               } catch (HttpException e) {
-                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, e);
-                                                       if (e.getStatusCode() == 409) {
-                                                               logger.error(EELFLoggerDelegate.errorLogger, "Topic/mailbox " + appMailboxName
-                                                                               + " already exists. Will try using a different name", e);
-                                                       } else {
-                                                               logger.error(EELFLoggerDelegate.errorLogger, "HttpException when onboarding App: ",
-                                                                               e);
-                                                       }
-                                               }
-                                       }
-
-                                       if (successfullyCreatedMailbox) {
-                                               onboardingApp.setUebTopicName(appMailboxName);
-                                               onboardingApp.setUebKey(appKey);
-                                               onboardingApp.setUebSecret(appSecret);
-
-                                               try {
-                                                       /*
-                                                        * EP is a publisher to this App's new mailbox
-                                                        */
-                                                       topicManager.addPublisher(
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
-                                                                       appMailboxName);
-
-                                                       /*
-                                                        * This App is a subscriber of its own mailbox
-                                                        */
-                                                       topicManager.addSubscriber(
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), appKey,
-                                                                       appMailboxName);
-
-                                                       /*
-                                                        * This App is a publisher to EP
-                                                        */
-                                                       topicManager.addPublisher(
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), appKey,
-                                                                       PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
-                                               } catch (HttpException | CambriaApiException | IOException e) {
-                                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
-                                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                                       "Error when configuring Publisher/Subscriber for App's new mailbox", e);
-                                                       transaction.commit();
-                                                       localSession.close();
-                                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
-                                                       return;
-                                               }
-                                       } else {
-                                               transaction.commit();
-                                               localSession.close();
-                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
-                                               return;
-                                       }
-                               } else {
-                                       app = (EPApp) localSession.get(EPApp.class, appId);
-                                       if (app == null || app.getId() == null) {
-                                               // App is already deleted!
-                                               transaction.commit();
-                                               localSession.close();
-                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
-                                               return;
-                                       }
-                               }
-                               logger.debug(EELFLoggerDelegate.debugLogger, "LR: about to call createAppFromOnboarding");
-                               createAppFromOnboarding(app, onboardingApp, localSession);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "LR: updateApp: finished calling createAppFromOnboarding");
-                               localSession.saveOrUpdate(app);
-                               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);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "LR: updateApp: finished calling setFunctionalMenuItemsEnabled");
-                               transaction.commit();
-                               logger.debug(EELFLoggerDelegate.debugLogger, "LR: updateApp: finished calling transaction.commit");
-                               epUebHelper.addPublisher(app);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "LR: updateApp: finished calling epUebHelper.addPublisher");
-                               result = true;
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "updateApp failed", e);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                               EcompPortalUtils.rollbackTransaction(transaction,
-                                               "updateApp rollback, exception = " + e.toString());
-                       } finally {
-                               EcompPortalUtils.closeLocalSession(localSession, "updateApp");
-                       }
-                       if (!result) {
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       }
-               }
-
-       }
-
-       public CambriaTopicManager getTopicManager(List<String> urlList, String key, String secret)
-                       throws GeneralSecurityException, Exception {
-               throw new Exception("This method can only be invoked from child class");
-       }
-
-       /**
-        * Populates a transport model of the application from a database row model.
-        * Leaves out the thumbnail because the FE fetches images via a different
-        * API.
-        * 
-        * @param app
-        *            Model of database row
-        * @param onboardingApp
-        *            Model for transport as JSON
-        */
-       @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 = 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.setRestrictedApp(app.isRestrictedApp());
-               // if (app.getThumbnail() != null)
-               // onboardingApp.thumbnail = new
-               // String(Base64.getEncoder().encode(app.getThumbnail()));
-       }
-
-       /**
-        * Creates a database object for an application from an uploaded transport
-        * model. Must decode the thumbnail, if any.
-        * 
-        * @param app
-        * @param onboardingApp
-        * @param localSession
-        * @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);
-               app.setAppPassword(this.encryptedPassword(onboardingApp.appPassword, 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)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: onboarding thumbnail is NOT empty");
-                       String[] splitBase64Thumbnail = onboardingApp.thumbnail.split("base64,");
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "createAppFromOnboarding: length of splitBase64Thumbnail: " + splitBase64Thumbnail.length);
-                       if (splitBase64Thumbnail.length > 1) {
-                               // This occurs when we have a new image, not an existing image
-                               byte[] decodedImage = Base64.getDecoder().decode(splitBase64Thumbnail[1].getBytes());
-                               logger.debug(EELFLoggerDelegate.debugLogger, "createAppFromOnboarding: finished calling decode");
-                               // This is basically a boolean indicator that an image is
-                               // present.
-                               app.setImageUrl(constructImageName(onboardingApp));
-                               app.setThumbnail(decodedImage);
-                       }
-               } else if (app.getThumbnail() != null && onboardingApp.imageLink == null) {
-                       // The thumbnail that came in from the json is empty; the previous
-                       // thumbnail is NOT empty. Must delete it.
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "createAppFromOnboarding: onboarding thumbnail is empty; db thumbnail is NOT null");
-                       app.setImageUrl(null);
-                       app.setThumbnail(null);
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "createAppFromOnboarding: making no changes to thumbnail as imageLink is not null");
-               }
-               return app;
-       }
-
-       protected String constructImageName(OnboardingApp onboardingApp) {
-               return "portal_" + String.valueOf(onboardingApp.url.hashCode() + "_" + (int) (Math.random() * 100000.0))
-                               + ".png";
-       }
-
-       // Don't encrypt or decrypt the password if it is null or the empty string
-       private String decryptedPassword(String encryptedAppPwd, EPApp app) {
-               String result = "";
-               if (encryptedAppPwd != null & encryptedAppPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.decrypt(encryptedAppPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed for app " + app.getName(), e);
-                       }
-               }
-               return result;
-       }
-
-       protected String encryptedPassword(String decryptedAppPwd, EPApp app) {
-               String result = "";
-               if (decryptedAppPwd != null & decryptedAppPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.encrypt(decryptedAppPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed for app " + app.getName(), e);
-                       }
-               }
-               return result;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               final Map<String, Long> params = new HashMap<>();
-               List<EPWidgetsManualSortPreference> epManualWidgets = new ArrayList<EPWidgetsManualSortPreference>();
-
-               try {
-                       params.put("userId", user.getId());
-                       epManualWidgets = dataAccessService.executeNamedQuery("userWidgetManualSortPrfQuery", params, null);
-                       Map<Long, EPWidgetsManualSortPreference> existingWidgetsIds = new HashMap<Long, EPWidgetsManualSortPreference>();
-                       for (EPWidgetsManualSortPreference userWidgetManualPref : epManualWidgets) {
-                               existingWidgetsIds.put(userWidgetManualPref.getWidgetId(), userWidgetManualPref);
-                       }
-                       for (EPWidgetsSortPreference epWidgetsManPref : widgetsSortManual) {
-                               if (epWidgetsManPref.getWidgetid() != null) {
-                                       Long widgetid = epWidgetsManPref.getWidgetid();
-                                       if (existingWidgetsIds.containsKey(widgetid)) {
-                                               EPWidgetsManualSortPreference epWidgetsManualSort = existingWidgetsIds.get(widgetid);
-                                               epWidgetsManualSort.setWidgetRow(epWidgetsManPref.getRow());
-                                               epWidgetsManualSort.setWidgetCol(epWidgetsManPref.getCol());
-                                               epWidgetsManualSort.setWidgetWidth(epWidgetsManPref.getSizeX());
-                                               epWidgetsManualSort.setWidgetHeight(epWidgetsManPref.getSizeY());
-                                               HashMap<String, Integer> additionalUpdateParam = new HashMap<String, Integer>();
-                                               additionalUpdateParam.put("userId", epWidgetsManualSort.getUserId());
-                                               dataAccessService.saveDomainObject(epWidgetsManualSort, additionalUpdateParam);
-                                       } else {
-                                               EPWidgetsManualSortPreference epWidgetsManualSort = new EPWidgetsManualSortPreference();
-                                               epWidgetsManualSort.setWidgetId(epWidgetsManPref.getWidgetid());
-                                               epWidgetsManualSort.setWidgetRow(epWidgetsManPref.getRow());
-                                               epWidgetsManualSort.setWidgetCol(epWidgetsManPref.getCol());
-                                               epWidgetsManualSort.setWidgetWidth(epWidgetsManPref.getSizeX());
-                                               epWidgetsManualSort.setWidgetHeight(epWidgetsManPref.getSizeY());
-                                               epWidgetsManualSort.setUserId(Ints.checkedCast(user.getId()));
-                                               dataAccessService.saveDomainObject(epWidgetsManualSort, null);
-                                       }
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveWidgetsSortManual failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               final Map<String, Long> params = new HashMap<>();
-               List<EPWidgetsManualSortPreference> epWidgets = new ArrayList<EPWidgetsManualSortPreference>();
-               try {
-                       params.put("userId", user.getId());
-                       epWidgets = dataAccessService.executeNamedQuery("userWidgetManualSortPrfQuery", params, null);
-                       Map<Long, EPWidgetsManualSortPreference> existingWidgetIds = new HashMap<Long, EPWidgetsManualSortPreference>();
-                       for (EPWidgetsManualSortPreference userWidgetSortPref : epWidgets) {
-                               existingWidgetIds.put(userWidgetSortPref.getWidgetId(), userWidgetSortPref);
-                       }
-                       for (EPWidgetsSortPreference delEpWidgetsManPref : delWidgetSortPref) {
-                               if (delEpWidgetsManPref.getWidgetid() != null) {
-                                       Long widgetId = delEpWidgetsManPref.getWidgetid();
-                                       if (existingWidgetIds.containsKey(widgetId)) {
-                                               dataAccessService.deleteDomainObjects(EPWidgetsManualSortPreference.class,
-                                                               "widget_id=" + widgetId + " AND user_id=" + user.getId(), null);
-                                       }
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserWidgetSortPref failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       /*
-        * This Method Stores the Sort Order of User Apps by Sort Manual Preference
-        *
-        * @param: appsSortManual--contains User Apps Data
-        *
-        * @param: user--contains LoggedIn User Data
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               final Map<String, Long> params = new HashMap<>();
-               List<EPUserAppsManualSortPreference> epManualApps = new ArrayList<EPUserAppsManualSortPreference>();
-
-               try {
-                       params.put("userId", user.getId());
-                       epManualApps = dataAccessService.executeNamedQuery("userAppsManualSortPrfQuery", params, null);
-                       Map<Long, EPUserAppsManualSortPreference> existingAppIds = new HashMap<Long, EPUserAppsManualSortPreference>();
-                       for (EPUserAppsManualSortPreference userAppManualPref : epManualApps) {
-                               existingAppIds.put(userAppManualPref.getAppId(), userAppManualPref);
-                       }
-                       for (EPAppsManualPreference epAppsManPref : appsSortManual) {
-                               if (epAppsManPref.getAppid() != null) {
-                                       Long appid = epAppsManPref.getAppid();
-                                       if (existingAppIds.containsKey(appid)) {
-                                               EPUserAppsManualSortPreference epAppsManualSort = existingAppIds.get(appid);
-                                               epAppsManualSort
-                                                               .setAppManualSortOrder((epAppsManPref.getCol() + (6 * epAppsManPref.getRow())) + 1);
-                                               HashMap<String, Integer> additionalUpdateParam = new HashMap<String, Integer>();
-                                               additionalUpdateParam.put("userId", epAppsManualSort.getUserId());
-                                               dataAccessService.saveDomainObject(epAppsManualSort, additionalUpdateParam);
-                                       } else {
-                                               EPUserAppsManualSortPreference epAppsManualSort = new EPUserAppsManualSortPreference();
-                                               epAppsManualSort.setAppId(epAppsManPref.getAppid());
-                                               epAppsManualSort
-                                                               .setAppManualSortOrder((epAppsManPref.getCol() + (6 * epAppsManPref.getRow())) + 1);
-                                               epAppsManualSort.setUserId(Ints.checkedCast(user.getId()));
-                                               dataAccessService.saveDomainObject(epAppsManualSort, null);
-                                       }
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveAppsSortManual failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       /*
-        * (non-Javadoc)
-        *
-        * @see org.openecomp.portalapp.portal.service.EPAppService#
-        * deleteUserAppSortManual(java.lang.String,
-        * org.openecomp.portalapp.portal.domain.EPUser)
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               final Map<String, Long> params = new HashMap<>();
-               List<EPUserAppsManualSortPreference> epManualApps = new ArrayList<EPUserAppsManualSortPreference>();
-               try {
-                       params.put("userId", user.getId());
-                       epManualApps = dataAccessService.executeNamedQuery("userAppsManualSortPrfQuery", params, null);
-                       Map<Long, EPUserAppsManualSortPreference> existingAppIds = new HashMap<Long, EPUserAppsManualSortPreference>();
-                       for (EPUserAppsManualSortPreference userAppPref : epManualApps) {
-                               existingAppIds.put(userAppPref.getAppId(), userAppPref);
-                       }
-                       if (existingAppIds.containsKey(delAppSortManual.getAppId()) && !delAppSortManual.isSelect()) {
-                               dataAccessService.deleteDomainObjects(EPUserAppsManualSortPreference.class,
-                                               "app_id=" + delAppSortManual.getAppId() + " AND user_id=" + user.getId(), null);
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteUserAppSortManual failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               final Map<String, Long> params = new HashMap<>();
-               List<EPUserAppsSortPreference> epSortTypes = new ArrayList<EPUserAppsSortPreference>();
-               EPUserAppsSortPreference usrSortPr = null;
-               try {
-                       params.put("userId", user.getId());
-                       epSortTypes = dataAccessService.executeNamedQuery("userAppsSortPreferenceQuery", params, null);
-                       if (epSortTypes.size() == 0) {
-                               usrSortPr = new EPUserAppsSortPreference();
-                               usrSortPr.setUserId(Ints.checkedCast(user.getId()));
-                               usrSortPr.setSortPref(appsSortPreference.getValue());
-                               dataAccessService.saveDomainObject(usrSortPr, null);
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-                       } else {
-                               usrSortPr = epSortTypes.get(0);
-                               usrSortPr.setSortPref(appsSortPreference.getValue());
-                               HashMap<String, Integer> additionalUpdateParam = new HashMap<String, Integer>();
-                               additionalUpdateParam.put("userId", usrSortPr.getUserId());
-                               dataAccessService.saveDomainObject(usrSortPr, additionalUpdateParam);
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveAppsSortPreference failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public String getUserAppsSortTypePreference(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               List<EPUserAppsSortPreference> userSortPrefs = new ArrayList<EPUserAppsSortPreference>();
-               try {
-                       params.put("userId", user.getId());
-                       userSortPrefs = dataAccessService.executeNamedQuery("userAppsSortPreferenceQuery", params, null);
-                       if (userSortPrefs.size() > 0)
-                               return userSortPrefs.get(0).getSortPref();
-                       else
-                               return null;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppsSortTypePreference failed", e);
-               }
-               return null;
-
-       }
-
-       @Override
-       public List<EPApp> getUserRemoteApps(String id) {
-               throw new RuntimeException(" Cannot be called from parent class");
-       }
-       
-       @Override
-       public UserRoles getUserProfileForLeftMenu(String loginId) {
-               final Map<String, String> params = new HashMap<>();
-               params.put("org_user_id", loginId);
-               @SuppressWarnings("unchecked")
-               List<UserRole> userRoleList = dataAccessService.executeNamedQuery( "getUserRolesForLeftMenu", params, null);
-               ArrayList<UserRoles> usersRolesList = aggregateUserProfileRowsResultsByRole(userRoleList);
-               if (usersRolesList == null || usersRolesList.size() < 1)
-                       return null;
-
-               return usersRolesList.get(0);
-       }
-       
-       
-       @Override
-       public UserRoles getUserProfileNormalizedForLeftMenu(EPUser user) {
-               // Check database.
-               UserRoles userAndRoles = getUserProfileForLeftMenu(user.getLoginId());
-               // If no roles are defined, treat this user as a guest.
-               if (user.isGuest() || userAndRoles == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "getUserProfileForLeftMenu: treating user {} as guest",
-                                       user.getLoginId());
-                       UserRole userRole = new UserRole();
-                       userRole.setUser_Id(user.getId());
-                       userRole.setOrgUserId(user.getLoginId());
-                       userRole.setFirstName(user.getFirstName());
-                       userRole.setLastName(user.getLastName());
-                       userRole.setRoleId(-1L);
-                       userRole.setRoleName("Guest");
-                       userRole.setUser_Id(-1L);
-                       userAndRoles = new UserRoles(userRole);
-               }
-
-               return userAndRoles;
-       }
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAppService.java
deleted file mode 100644 (file)
index c4a3190..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
-import org.openecomp.portalapp.portal.domain.AppsResponse;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.domain.UserRoles;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.LocalRole;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-
-public interface EPAppService {
-
-       /**
-        * Get all applications adminId is an admin
-        * 
-        * @param user
-        *            the admin user
-        * @return the admin's applications
-        */
-       List<EPApp> getUserAsAdminApps(EPUser user);
-
-       List<EPApp> getUserByOrgUserIdAsAdminApps(String orgUserId);
-
-       /**
-        * Gets all rows and all fields from the fn_app table.
-        * 
-        * @return list of EPApp objects
-        */
-       List<EPApp> getAppsFullList();
-
-       /**
-        * Gets all rows and most fields from the fn_app table.
-        * 
-        * @return list of EcompApp objects.
-        */
-       List<EcompApp> getEcompAppAppsFullList();
-
-       /**
-        * Get apps with app app admins
-        * 
-        * @return List of AdminUserApplications
-        */
-       List<AdminUserApplications> getAppsAdmins();
-
-       /**
-        * Get all apps from fn_app table (index, name, title only).
-        * 
-        * @param all
-        *            If all is true, returns active and inactive apps; otherwise,
-        *            just active apps.
-        * @return List of AppsResponse objects.
-        */
-       List<AppsResponse> getAllApps(Boolean all);
-
-       UserRoles getUserProfile(String loginId);
-
-       UserRoles getUserProfileNormalized(EPUser user);
-
-       List<LocalRole> getAppRoles(Long appId);
-
-       List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
-
-       List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
-
-       /**
-        * Gets the applications accessible to the specified user, which includes
-        * all enabled open applications, plus all enabled applications for which
-        * the user has a defined role for that app.
-        * 
-        * @param user
-        *            EPUser object with the user's Org User ID
-        * @return the user's list of applications, which may be empty.
-        */
-       List<EPApp> getUserApps(EPUser user);
-
-       /**
-        * Gets the user-personalized list of applications for the Portal (super)
-        * admin, which includes enabled open applications, enabled applications for
-        * which the user has a defined role for that app, and/or enabled
-        * applications which the user has chosen to show.
-        * 
-        * @param user
-        *            EPUser object with the user's Org User ID
-        * @return the user's personalized list of applications, which may be empty.
-        */
-       List<EPApp> getPersAdminApps(EPUser user);
-
-       /**
-        * Gets the user-personalized list of accessible applications, which
-        * includes enabled open applications and/or enabled applications for which
-        * the user has a defined role for that app. Personalization means the user
-        * can indicate an accessible application should be excluded from this
-        * result.
-        * 
-        * @param user
-        *            EPUser object with the user's Org User ID
-        * @return the user's personalized list of applications, which may be empty.
-        */
-       List<EPApp> getPersUserApps(EPUser user);
-
-       /**
-        * Gets the application catalog for the specified user who is a super admin.
-        * This includes all enabled applications. Each item indicates whether the
-        * user has access (open or via a role), and whether the application is
-        * selected for showing in the user's home (applications) page. Admin sees
-        * slightly different behavior - can force an app onto the home page using
-        * the personalization feature (user-app-selection table).
-        * 
-        * @param user
-        * @return list of all enabled applications, which may be empty
-        */
-       List<AppCatalogItem> getAdminAppCatalog(EPUser user);
-
-       /**
-        * Gets the application catalog for the specified user, who is a regular
-        * user. This includes all enabled applications. Each item indicates whether
-        * the user has access (open or via a role), and whether the application is
-        * selected for showing in the user's home (applications) page.
-        * 
-        * @param user
-        * @return list of all enabled applications, which may be empty
-        */
-       List<AppCatalogItem> getUserAppCatalog(EPUser user);
-
-       List<OnboardingApp> getOnboardingApps();
-
-       List<OnboardingApp> getEnabledNonOpenOnboardingApps();
-
-       FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
-
-       FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
-
-       /**
-        * Deletes the specified application from all tables where the app_id is
-        * used, and ultimately from the fn_app table.
-        * 
-        * @param user
-        *            Must be Portal (super) administrator
-        * @param onboardingAppId
-        *            ID of application to be deleted
-        * @return Status code
-        */
-       FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
-
-       List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
-
-       EPApp getApp(Long appId);
-
-       EPApp getAppDetail(String appName);
-
-       List<EPApp> getAppsOrderByName(EPUser user);
-
-       FieldsValidator saveAppsSortPreference(EPAppsSortPreference appsSortPreference, EPUser user);
-
-       FieldsValidator saveAppsSortManual(List<EPAppsManualPreference> appsSortManual, EPUser user);
-
-       FieldsValidator saveWidgetsSortManual(List<EPWidgetsSortPreference> widgetsSortManual, EPUser user);
-
-       /**
-        * Deletes the sort order of user apps by sort manual preference
-        * 
-        * @param delAppSortManual
-        *            User Apps Data
-        * @param user
-        *            LoggedIn User Data
-        * @return FieldsValidator
-        */
-       FieldsValidator deleteUserAppSortManual(EPDeleteAppsManualSortPref delAppSortManual, EPUser user);
-
-       FieldsValidator deleteUserWidgetSortPref(List<EPWidgetsSortPreference> delWidgetSortPref, EPUser user);
-
-       String getUserAppsSortTypePreference(EPUser user);
-
-       List<EPApp> getAppsOrderByLastUsed(EPUser user);
-
-       List<EPApp> getAppsOrderByMostUsed(EPUser user);
-
-       List<EPApp> getAppsOrderByManual(EPUser user);
-
-       List<EPApp> getUserRemoteApps(String id);
-
-       void createOnboardingFromApp(EPApp app, OnboardingApp onboardingApp);
-
-       UserRoles getUserProfileNormalizedForLeftMenu(EPUser user);
-
-       UserRoles getUserProfileForLeftMenu(String loginId);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAuditService.java
deleted file mode 100644 (file)
index 321b441..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.Date;
-
-public interface EPAuditService {
-       public Date getGuestLastLogin(String userId);
-       public void delAuditLogFromDay();
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPAuditServiceImpl.java
deleted file mode 100644 (file)
index 5e86c3c..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.time.LocalDate;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-
-@Service("epAuditService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class EPAuditServiceImpl implements EPAuditService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAuditServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @Override
-       /*
-        * get the guest last login time with orgUserId as param. If record not
-        * found in table, return null.
-        * 
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.openecomp.portalapp.portal.service.EPUserService#getGuestLastLogin(
-        * java.lang.String)
-        */
-       public Date getGuestLastLogin(String userId) {
-               Map<String, String> params = new HashMap<>();
-               params.put("userId", userId);
-               @SuppressWarnings("unchecked")
-               List<Date> list = getDataAccessService().executeNamedQuery("getGuestLastLogin", params, null);
-               Date date = null;
-               if (list != null) {
-                       /*
-                        * if list only contains one item, meaning this is the first time
-                        * user logs in or record not found in db
-                        */
-                       if (list.size() == 1)
-                               date = list.get(0); /* the guest's current log in time */
-                       else if (list.size() == 2)
-                               date = list.get(1); /* most recent login date from db */
-               }
-               return date;
-       }
-
-       /*
-        * Cleans all the records in fn_audit_log table that are less than defined
-        * date in system.property
-        * 
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.openecomp.portalapp.portal.service.EPAuditService#delAuditLogFromDay(
-        * )
-        */
-       @Override
-       public void delAuditLogFromDay() {
-               if (EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.AUDITLOG_DEL_DAY_FROM)) {
-                       String day = EPCommonSystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_DEL_DAY_FROM);
-                       LocalDate removeDateFrom = LocalDate.now().minusDays(Integer.valueOf(day));
-                       getDataAccessService().deleteDomainObjects(AuditLog.class, "audit_date  <'" + removeDateFrom + "'", null);
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "delAuditLogFromDay Exception = system.propertiy value is empty on"
-                                                       + EPCommonSystemProperties.AUDITLOG_DEL_DAY_FROM);
-               }
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLdapService.java
deleted file mode 100644 (file)
index e06f398..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalsdk.core.command.support.SearchResult;
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-
-public interface EPLdapService {
-
-    // search POST for users based on the criteria selected in the Request
-    SearchResult searchPost(DomainVo searchCriteria, String sortBy1, String sortBy2, String sortBy3, int pageNo, int dataSize, int userId) throws Exception;
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLdapServiceImpl.java
deleted file mode 100644 (file)
index 82e44fd..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.command.support.SearchResult;
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.support.FusionService;
-import org.openecomp.portalsdk.core.service.support.ServiceLocator;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service("epLdapService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class EPLdapServiceImpl extends FusionService implements EPLdapService {
-       @Autowired
-       private ServiceLocator serviceLocator;
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLdapServiceImpl.class);
-
-       @EPAuditLog
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       public SearchResult searchPost(DomainVo searchCriteria, String sortBy1, String sortBy2, String sortBy3, int pageNo,
-                       int dataSize, int userId) throws Exception {
-
-               String remoteHost = "";
-
-               // initialize the directory context to access POST
-               DirContext dirContext = serviceLocator.getDirContext(
-                               SystemProperties.getProperty(SystemProperties.POST_INITIAL_CONTEXT_FACTORY),
-                               SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
-                               SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
-
-               SearchResult searchResult = new SearchResult();
-
-               try {
-
-                       remoteHost = String.format("%s/%s", SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL),
-                                       SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL));
-                       MDC.put(EPCommonSystemProperties.FULL_URL, remoteHost);
-
-                       String[] postAttributes = { "nickname", "givenName", "initials", "sn", "employeeNumber", "mail",
-                                       "telephoneNumber", "departmentNumber", "a1", "street", "roomNumber", "l", "st", "postalCode",
-                                       "zip4", "physicalDeliveryOfficeName", "bc", "friendlyCountryName", "bd", "bdname", "bu", "buname",
-                                       "jtname", "mgrid", "a2", "compcode", "compdesc", "costcenter", "silo", "b2" };
-
-                       SearchControls searchControls = new SearchControls();
-                       searchControls.setTimeLimit(5000);
-                       searchControls.setReturningAttributes(postAttributes);
-
-                       StringBuffer filterClause = new StringBuffer("(&(objectClass=*)");
-
-                       EPUser user = (EPUser) searchCriteria;
-
-                       if (Utilities.nvl(user.getFirstName()).length() > 0) {
-                               filterClause.append("(givenName=").append(user.getFirstName()).append("*)");
-                       }
-                       if (Utilities.nvl(user.getLastName()).length() > 0) {
-                               filterClause.append("(sn=").append(user.getLastName()).append("*)");
-                       }
-                       if (Utilities.nvl(user.getHrid()).length() > 0) {
-                               filterClause.append("(employeeNumber=").append(user.getHrid()).append("*)");
-                       }
-                       if (Utilities.nvl(user.getOrgManagerUserId()).length() > 0) {
-                               filterClause.append("(mgrid=").append(user.getOrgManagerUserId()).append("*)");
-                       }
-                       if (Utilities.nvl(user.getOrgCode()).length() > 0) {
-                               filterClause.append("(departmentNumber=").append(user.getOrgCode()).append("*)");
-                       }
-                       if (Utilities.nvl(user.getEmail()).length() > 0) {
-                               filterClause.append("(mail=").append(user.getEmail()).append("*)");
-                       }
-                       if (Utilities.nvl(user.getOrgUserId()).length() > 0) {
-                               filterClause.append("(a1=").append(user.getOrgUserId()).append("*)");
-                       }
-                       filterClause.append("(c3=N)"); // this has been added to filter CP09 entries on the LDAP server that are
-                                                                                       // duplicates of existing individuals
-                       filterClause.append(")");
-
-                       List list = new ArrayList();
-                       if (!filterClause.toString().equals("(&(objectClass=*))")) {
-                               NamingEnumeration e = dirContext.search(
-                                               SystemProperties.getProperty(SystemProperties.POST_PROVIDER_URL) + "/"
-                                                               + SystemProperties.getProperty(SystemProperties.POST_SECURITY_PRINCIPAL),
-                                               filterClause.toString(), searchControls);
-                               list = processResults(e);
-                       }
-
-                       Collections.sort(list);
-
-                       searchResult = new SearchResult(list);
-                       searchResult.setPageNo(pageNo);
-                       if (dataSize >= 0) {
-                               searchResult.setDataSize(dataSize);
-                       } else {
-                               searchResult.setDataSize(list.size());
-                       }
-               } catch (NamingException ne) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchPost failed with naming exception", ne);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchPost failed", e);
-               } finally {
-                       dirContext.close();
-               }
-
-               return searchResult;
-       }
-
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       @EPMetricsLog
-       private ArrayList processResults(NamingEnumeration e) throws NamingException {
-               ArrayList results = new ArrayList();
-               int count = 0;
-
-               while (e.hasMore()) {
-                       javax.naming.directory.SearchResult searchResult = (javax.naming.directory.SearchResult) e.next();
-                       results.add(processAttributes(searchResult.getAttributes()));
-                       count++;
-
-                       if (count > Integer.parseInt(SystemProperties.getProperty(SystemProperties.POST_MAX_RESULT_SIZE))) {
-                               break;
-                       }
-               }
-               return results;
-       }
-
-       @SuppressWarnings("rawtypes")
-       @EPMetricsLog
-       private DomainVo processAttributes(Attributes resultAttributes) throws NamingException {
-               EPUser user = new EPUser();
-
-               try {
-                       if (resultAttributes == null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "This result has no attributes");
-                       } else {
-                               for (NamingEnumeration e = resultAttributes.getAll(); e.hasMore();) { // why the nested loop?
-                                       Attribute attribute = (Attribute) e.next();
-                                       for (NamingEnumeration ie = attribute.getAll(); ie.hasMore();) {
-                                               if (attribute.getID().equalsIgnoreCase("nickname")) {
-                                                       user.setFirstName((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("initials")) {
-                                                       user.setMiddleInitial((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("sn")) {
-                                                       user.setLastName((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("employeeNumber")) {
-                                                       user.setHrid((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("mail")) {
-                                                       user.setEmail((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("telephoneNumber")) {
-                                                       user.setPhone((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("departmentNumber")) {
-                                                       user.setOrgCode((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("a1")) {
-                                                       user.setOrgUserId((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("street")) {
-                                                       user.setAddress1((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("roomNumber")) {
-                                                       user.setAddress2((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("l")) {
-                                                       user.setCity((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("st")) {
-                                                       user.setState((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("postalCode")) {
-                                                       user.setZipCode((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("zip4")) {
-                                                       user.setZipCodeSuffix((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("physicalDeliveryOfficeName")) {
-                                                       user.setLocationClli((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("bc")) {
-                                                       user.setBusinessCountryCode((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("friendlyCountryName")) {
-                                                       user.setBusinessCountryName((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("bd")) {
-                                                       user.setDepartment((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("bdname")) {
-                                                       user.setDepartmentName((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("jtname")) {
-                                                       user.setJobTitle((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("mgrid")) {
-                                                       user.setOrgManagerUserId((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("a2")) {
-                                                       user.setCommandChain((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("compcode")) {
-                                                       user.setCompanyCode((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("compdesc")) {
-                                                       user.setCompany((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("bu")) {
-                                                       user.setBusinessUnit((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("buname")) {
-                                                       user.setBusinessUnitName((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("silo")) {
-                                                       user.setSiloStatus((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("costcenter")) {
-                                                       user.setCostCenter((String) ie.next());
-                                               } else if (attribute.getID().equalsIgnoreCase("b2")) {
-                                                       user.setFinancialLocCode((String) ie.next());
-                                               } else { // we don't care about returned attribute, let's move on
-                                                       ie.next();
-                                               }
-
-                                       }
-                               }
-                       }
-               } catch (NamingException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "processAttributes failed with naming exception", e);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "processAttributes failed", e);
-               }
-
-               return user;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLeftMenuService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLeftMenuService.java
deleted file mode 100644 (file)
index 145d4df..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.Set;
-
-import org.openecomp.portalsdk.core.domain.MenuData;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface EPLeftMenuService {
-       
-       /**
-        * Builds a JSON suitable for populating the front-end left menu from the supplied set of menu items.
-        * @param user 
-        * 
-        * @param fullMenuSet
-        * @param roleFunctionSet 
-        * @return JSON String of this form:
-        * <PRE>
-        * {"navItems":[
-        *              {"name":"Home","imageSrc":"icon-location-pin","state":"root.applicationsHome"},
-        *      ...
-        * ] }
-        * </PRE>
-        */
-       String getLeftMenuItems(EPUser user, Set<MenuData> fullMenuSet, Set<String> roleFunctionSet);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLeftMenuServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLeftMenuServiceImpl.java
deleted file mode 100644 (file)
index fe661b3..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.domain.MenuData;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.UserRoles;
-//import org.openecomp.portalapp.portal.domain.Menu;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-@Service("leftMenuService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-
-public class EPLeftMenuServiceImpl implements EPLeftMenuService {
-
-       private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLeftMenuServiceImpl.class);
-
-       @Autowired
-       private EPAppService appService;
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.openecomp.portalapp.portal.service.EPLeftMenuService#getLeftMenuItems
-        * (java.util.Set)
-        */
-       @Override
-       public String getLeftMenuItems(EPUser user, Set<MenuData> fullMenuSet, Set<String> roleFunctionSet) {
-               final Map<String, JSONObject> defaultNavMap = new LinkedHashMap<String, JSONObject>();
-
-               resetNavMap(defaultNavMap);
-
-               loadDefaultNavMap(defaultNavMap);
-
-               // Handle Account Administrator in a special way; soon this will
-               // be revised as Account Administrator may become obsolete
-               try {
-                       if (user != null) {
-                               UserRoles uRoles = appService.getUserProfileNormalizedForLeftMenu(user);
-                               if (uRoles.getRoles().contains("Account Administrator"))
-                                       loadAccAdminNavMap(defaultNavMap);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "getLeftMenuItems: failed to get roles for user " + user.getOrgUserId(), e);
-               }
-
-               loadNavMapByRole(defaultNavMap, fullMenuSet);
-
-               return convertToSideBarModel(defaultNavMap);
-       }
-
-       /**
-        * Clears the map
-        * 
-        * @param defaultNavMap
-        */
-       private void resetNavMap(Map<String, JSONObject> defaultNavMap) {
-               defaultNavMap.clear();
-       }
-
-       /**
-        * 
-        * @param defaultNavMap
-        * @param fullMenuSet
-        */
-       private void loadNavMapByRole(Map<String, JSONObject> defaultNavMap, Set<MenuData> fullMenuSet) {
-
-               class SortOrderComparator implements Comparator<MenuData> {
-                       @Override
-                       public int compare(MenuData e1, MenuData e2) {
-                               return e1.getSortOrder().compareTo(e2.getSortOrder());
-                       }
-               }
-
-               SortedSet<MenuData> sortMenuSet = new TreeSet<MenuData>(new SortOrderComparator());
-               for (MenuData mn : fullMenuSet) {
-                       sortMenuSet.add(mn);
-               }
-
-               for (MenuData mn : sortMenuSet) {
-                       JSONObject navItemsDetails = new JSONObject();
-                       navItemsDetails.put("name", mn.getLabel());
-                       navItemsDetails.put("state", mn.getAction());
-                       navItemsDetails.put("imageSrc", mn.getImageSrc());
-                       defaultNavMap.put(mn.getAction(), navItemsDetails);
-               }
-       }
-
-       /**
-        * 
-        * @param defaultNavMap
-        * @return
-        */
-       private String convertToSideBarModel(Map<String, JSONObject> defaultNavMap) {
-               JSONObject sidebarModel = new JSONObject();
-               JSONArray navItems = new JSONArray();
-               Collection<JSONObject> jsonObjs = defaultNavMap.values();
-
-               for (JSONObject navItemsDetail : jsonObjs)
-                       navItems.put(navItemsDetail);
-
-               sidebarModel.put("label", "ECOMP portal");
-               sidebarModel.put("navItems", navItems);
-               return sidebarModel.toString();
-       }
-
-       /**
-        * Loads default entries for regular user.
-        * 
-        * @param defaultNavMap
-        */
-       private void loadDefaultNavMap(Map<String, JSONObject> defaultNavMap) {
-
-               JSONObject navItemsDetails1 = new JSONObject();
-               navItemsDetails1.put("name", "Home");
-               navItemsDetails1.put("state", "root.applicationsHome");
-               navItemsDetails1.put("imageSrc", "icon-building-home");
-               defaultNavMap.put("root.applicationsHome", navItemsDetails1);
-
-               JSONObject navItemsDetails2 = new JSONObject();
-               navItemsDetails2.put("name", "Application Catalog");
-               navItemsDetails2.put("state", "root.appCatalog");
-               navItemsDetails2.put("imageSrc", "icon-apps-marketplace");
-               defaultNavMap.put("root.appCatalog", navItemsDetails2);
-
-               JSONObject navItemsDetails3 = new JSONObject();
-               navItemsDetails3.put("name", "Widget Catalog");
-               navItemsDetails3.put("state", "root.widgetCatalog");
-               navItemsDetails3.put("imageSrc", "icon-apps-marketplace");
-               defaultNavMap.put("root.widgetCatalog", navItemsDetails3);
-
-       }
-
-       /**
-        * Loads default entries for application administrator.
-        * 
-        * @param defaultNavMap
-        */
-       private void loadAccAdminNavMap(Map<String, JSONObject> defaultNavMap) {
-
-               JSONObject navItemsDetails1 = new JSONObject();
-               navItemsDetails1.put("name", "Users");
-               navItemsDetails1.put("state", "root.users");
-               navItemsDetails1.put("imageSrc", "icon-user");
-               defaultNavMap.put("root.users", navItemsDetails1);
-
-               // No more widget onboarding like this:
-               //
-               // JSONObject navItemsDetails2 = new JSONObject();
-               // navItemsDetails2.put("name", "Widget Onboarding");
-               // navItemsDetails2.put("state", "root.widgetOnboarding");
-               // navItemsDetails2.put("imageSrc", "icon-add-widget");
-               // defaultNavMap.put("root.widgetOnboarding", navItemsDetails2);
-
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLoginService.java
deleted file mode 100644 (file)
index d322494..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-
-import org.openecomp.portalapp.command.EPLoginBean;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface EPLoginService {
-
-       /**
-        * Calls {@link #findUser(EPLoginBean, String, HashMap, boolean)} with the
-        * last parameter set to true.
-        * 
-        * @param bean
-        * @param menuPropertiesFilename
-        * @param additionalParams
-        * @return EPUser object; null on error or if no match.
-        * @throws Exception
-        */
-       @SuppressWarnings("rawtypes")
-       EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams) throws Exception;
-
-       /**
-        * Searches the fn_user table for a row that matches information in the
-        * bean. Uses the bean's Organization User ID property if present; if not,
-        * uses the bean's LoginId property and (optionally, depending on
-        * matchPassword parameter) loginPwd property.
-        * 
-        * @param bean
-        *            EPLoginBean
-        * @param menuPropertiesFileName
-        *            Always ignored
-        * @param additionalParams
-        *            Used by DataAccessService when updating a matched user object
-        * @param matchPassword
-        *            If true, the search must match the password
-        * @return EPUser object; null on error or if no match.
-        * @throws Exception
-        */
-       @SuppressWarnings("rawtypes")
-       EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFileName, HashMap additionalParams,
-                       boolean matchPassword) throws Exception;
-
-       /**
-        * Searches the fn_user table for a row with a value in column login_id that
-        * matches the specified value.
-        * 
-        * @param loginId
-        *            Login name
-        * @return EPUser object; null on error or if no match.
-        */
-       public EPUser findUserWithoutPwd(String loginId);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPLoginServiceImpl.java
deleted file mode 100644 (file)
index a06d89a..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.openecomp.portalapp.command.EPLoginBean;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.menu.MenuBuilder;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.support.FusionService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service("eploginService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class EPLoginServiceImpl extends FusionService implements EPLoginService {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPLoginServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       /*
-        * (non-Javadoc)
-        * @see org.openecomp.portalapp.portal.service.EPLoginService#findUser(org.openecomp.portalapp.command.EPLoginBean, java.lang.String, java.util.HashMap)
-        */
-       @SuppressWarnings("rawtypes")
-       public EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename, HashMap additionalParams)
-                       throws Exception {
-               return findUser(bean, menuPropertiesFilename, additionalParams, true);
-       }
-
-       /*
-        * (non-Javadoc)
-        * @see org.openecomp.portalapp.portal.service.EPLoginService#findUser(org.openecomp.portalapp.command.EPLoginBean, java.lang.String, java.util.HashMap, boolean)
-        */
-       @SuppressWarnings("rawtypes")
-       public EPLoginBean findUser(EPLoginBean bean, String menuPropertiesFilename_ignored, HashMap additionalParams,
-                       boolean matchPassword) throws Exception {
-               EPUser user = null;
-               EPUser userCopy = null;
-
-               if (bean.getOrgUserId() != null) {
-                       user = (EPUser) findUser(bean);
-               } else {
-                       if (matchPassword)
-                               user = (EPUser) findUser(bean.getLoginId(), bean.getLoginPwd());
-                       else
-                               user = (EPUser) findUserWithoutPwd(bean.getLoginId());
-               }
-
-               // run this command to fetch more information from the lazily loaded
-               // object
-
-               // This is funny - commenting out the following method call
-               // 1. What are we doing with the returned values of the following two
-               // methods? Nothing.
-               // 2. Use a guest user scenario - user object will be null - clealry,
-               // NPE.
-               // 3. A check of if(user !=null) is made AFTER these bogus calls :) - If
-               // these calls WERE doing anything significat (which they are not),
-               // shouln't they have been moved inside that if check?
-
-               // user.getEPUserApps();
-
-               // Comments
-               // 1. This method is clearly doing more than 'getting roles' - Not a
-               // good name -
-               // 2. Also, there is no null check - guest user scenarios will break the
-               // code with NPE - added the check - Do not want to remove the call
-               // altogether - not sure how it will effect things.
-
-               if (user != null) {
-                       user.getEPRoles();
-
-                       // raise an error if the portal application is locked and the user
-                       // does not
-                       // have system administrator privileges
-                       if (AppUtils.isApplicationLocked()
-                                       && !EPUserUtils.hasRole(user, SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID))) {
-                               bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_APPLICATION_LOCKED);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUserAdminPrivilegesInfo, user.getLoginId());
-                       }
-
-                       // raise an error if the user is inactive
-                       if (!user.getActive()) {
-                               bean.setLoginErrorMessage(SystemProperties.MESSAGE_KEY_LOGIN_ERROR_USER_INACTIVE);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUserInactiveWarning, user.getLoginId());
-                       }
-
-                       // only login the user if no errors have occurred
-                       if (bean.getLoginErrorMessage() == null) {
-
-                               // this will be a snapshot of the user's information as
-                               // retrieved from the database
-                               userCopy = (EPUser) user.clone();
-
-                               // update the last logged in date for the user
-                               user.setLastLoginDate(new Date());
-                               getDataAccessService().saveDomainObject(user, additionalParams);
-
-                               // create the application menu based on the user's privileges
-                               MenuBuilder menuBuilder = new MenuBuilder();
-                               Set appMenu = menuBuilder.getMenu(
-                                               SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_SET_NAME), dataAccessService);
-                               bean.setMenu(appMenu != null ? appMenu : new HashSet());
-                               Set businessDirectMenu = menuBuilder.getMenu(
-                                               SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_SET_NAME),
-                                               dataAccessService);
-                               bean.setBusinessDirectMenu(businessDirectMenu != null ? businessDirectMenu : new HashSet());
-
-                               bean.setUser(userCopy);
-                       }
-
-               } else {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUserMissingError, bean.getOrgUserId());
-               }
-
-               return bean;
-       }
-
-       /**
-        * Searches the fn_user table for a row that matches the specified login_id
-        * and login_pwd values.
-        * 
-        * @param loginId
-        * @param password
-        * @return EPUser object; null on error or if no match.
-        */
-       @SuppressWarnings("rawtypes")
-       private EPUser findUser(String loginId, String password) {
-               Map<String, String> params = new HashMap<>();
-               params.put("login_id", loginId);
-               params.put("login_pwd", password);
-               List list = null;
-               try {
-                       list = dataAccessService.executeNamedQuery("getEPUserByLoginIdLoginPwd", params, new HashMap());
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "findUser failed on " + loginId, e);
-               }
-               return (list == null || list.isEmpty()) ? null : (EPUser) list.get(0);
-       }
-
-       @SuppressWarnings("rawtypes")
-       public EPUser findUserWithoutPwd(String loginId) {
-               Map<String, String> params = new HashMap<>();
-               params.put("login_id", loginId);
-               List list = null;
-               try {
-                       list = dataAccessService.executeNamedQuery("getEPUserByLoginId", params, new HashMap());
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "findUserWithoutPwd failed on " + loginId, e);
-               }
-               return (list == null || list.isEmpty()) ? null : (EPUser) list.get(0);
-       }
-
-       /**
-        * Searches the fn_user table for a row that matches the value of the bean's
-        * Organization User ID property.
-        * 
-        * @param bean
-        * @return EPUser object; null on error or if no match.
-        */
-       @SuppressWarnings("rawtypes")
-       private EPUser findUser(EPLoginBean bean) {
-               Map<String, String> params = new HashMap<>();
-               params.put("org_user_id", bean.getOrgUserId());
-               List list = null;
-               try {
-                       list = dataAccessService.executeNamedQuery("getUserByOrgUserId", params, new HashMap());
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "findUser(EPLoginBean) failed", e);
-               }
-               return (list == null || list.isEmpty()) ? null : (EPUser) list.get(0);
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionService.java
deleted file mode 100644 (file)
index 5c5b15c..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-
-public interface EPRoleFunctionService {
-       
-       /**
-        * Builds a set of role functions and sets a session attribute with it.
-        * 
-        * @return Set of role functions that was built.
-        */
-       public List<RoleFunction> getRoleFunctions();
-
-       /**
-        * Builds a set of role functions of user
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param user
-        *            EPUser
-        * @return Set of role functions that was built.
-        */
-       public Set getRoleFunctions(HttpServletRequest request, EPUser user);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceCentralizedImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceCentralizedImpl.java
deleted file mode 100644 (file)
index 814dbaf..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.hibernate.SessionFactory;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-
-@Transactional
-public class EPRoleFunctionServiceCentralizedImpl implements EPRoleFunctionService{
-
-       
-       @Autowired
-       private DataAccessService dataAccessService;
-       
-       @Autowired
-       private  SessionFactory sessionFactory;
-       
-       @SuppressWarnings({ "unchecked"})
-       @Override
-       public List<RoleFunction> getRoleFunctions() {
-               List<CentralRoleFunction> getRoleFuncList = null;
-               List<RoleFunction> getRoleFuncListOfPortal = new ArrayList<>();
-               final Map<String, Long> params = new HashMap<>();
-               params.put("appId", (long) 1);
-               //Sync all functions from external system into Ecomp portal DB
-               getRoleFuncList = dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null);
-               for(CentralRoleFunction roleFunction : getRoleFuncList)
-               {
-                       RoleFunction roleFun = new RoleFunction();
-                       roleFun.setCode(roleFunction.getCode());
-                       roleFun.setName(roleFunction.getName());
-                       getRoleFuncListOfPortal.add(roleFun);
-               }
-               return getRoleFuncListOfPortal;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public Set getRoleFunctions(HttpServletRequest request, EPUser user) {
-               HttpSession session = request.getSession();
-               String userId = user.getId().toString();
-               final Map<String, String> params = new HashMap<>();
-               params.put("userId", userId);
-               @SuppressWarnings("unchecked")
-               List getRoleFuncListOfPortal =   dataAccessService.executeNamedQuery("getRoleFunctionsOfUser", params, null);
-               Set<String> getRoleFuncListOfPortalSet = new HashSet<>(getRoleFuncListOfPortal);        
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME),
-                               getRoleFuncListOfPortalSet);
-               return getRoleFuncListOfPortalSet;
-                               
-       }
-
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceImpl.java
deleted file mode 100644 (file)
index 2049700..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-
-@Transactional
-public class EPRoleFunctionServiceImpl implements EPRoleFunctionService {
-       @Autowired
-       private DataAccessService dataAccessService;
-       
-       
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<RoleFunction> getRoleFunctions() {
-               return getDataAccessService().getList(RoleFunction.class, null);
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public Set getRoleFunctions(HttpServletRequest request, EPUser user) {
-               HashSet roleFunctions = null;
-
-               HttpSession session = request.getSession();
-               roleFunctions = (HashSet) session
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
-
-               if (roleFunctions == null) {
-                       HashMap roles = EPUserUtils.getRoles(request);
-                       roleFunctions = new HashSet();
-
-                       Iterator i = roles.keySet().iterator();
-
-                       while (i.hasNext()) {
-                               Long roleKey = (Long) i.next();
-                               EPRole role = (EPRole) roles.get(roleKey);
-
-                               Iterator j = role.getRoleFunctions().iterator();
-
-                               while (j.hasNext()) {
-                                       RoleFunction function = (RoleFunction) j.next();
-                                       roleFunctions.add(function.getCode());
-                               }
-                       }
-
-                       session.setAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME),
-                                       roleFunctions);
-               }
-
-               return roleFunctions;
-       }
-       
-       
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleService.java
deleted file mode 100644 (file)
index 85b523d..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalapp.portal.domain.EPRole;
-
-
-public interface EPRoleService {
-       
-       // Used by ECOMP. Get cached role by two columns used by ECOMP only. app id, and external app role id.
-       EPRole getRole(Long appId, Long appRoleid);
-       public void saveRole(EPRole domainRole);
-       EPRole getAppRole(String roleName, Long appId);
-       public List<RoleFunction> getRoleFunctions();
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/EPRoleServiceImpl.java
deleted file mode 100644 (file)
index e4c6714..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-
-@Service("epRoleService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class EPRoleServiceImpl implements EPRoleService {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPRoleServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @SuppressWarnings("unchecked")
-       public List<RoleFunction> getRoleFunctions() {
-               // List msgDB = getDataAccessService().getList(Profile.class, null);
-               return getDataAccessService().getList(RoleFunction.class, null);
-       }
-
-       @SuppressWarnings("unchecked")
-       public List<EPRole> getAvailableChildRoles(Long roleId) {
-               List<EPRole> availableChildRoles = (List<EPRole>) getDataAccessService().getList(EPRole.class, null);
-               if (roleId == null || roleId == 0) {
-                       return availableChildRoles;
-               }
-
-               EPRole currentRole = (EPRole) getDataAccessService().getDomainObject(EPRole.class, roleId, null);
-               Set<EPRole> allParentRoles = new TreeSet<EPRole>();
-               allParentRoles = getAllParentRolesAsList(currentRole, allParentRoles);
-
-               Iterator<EPRole> availableChildRolesIterator = availableChildRoles.iterator();
-               while (availableChildRolesIterator.hasNext()) {
-                       EPRole role = availableChildRolesIterator.next();
-                       if (!role.getActive() || allParentRoles.contains(role) || role.getId().equals(roleId)) {
-                               availableChildRolesIterator.remove();
-                       }
-               }
-               return availableChildRoles;
-       }
-
-       private Set<EPRole> getAllParentRolesAsList(EPRole role, Set<EPRole> allParentRoles) {
-               Set<EPRole> parentRoles = role.getParentRoles();
-               allParentRoles.addAll(parentRoles);
-               Iterator<EPRole> parentRolesIterator = parentRoles.iterator();
-               while (parentRolesIterator.hasNext()) {
-                       getAllParentRolesAsList(parentRolesIterator.next(), allParentRoles);
-               }
-               return allParentRoles;
-       }
-
-       public RoleFunction getRoleFunction(String code) {
-               return (RoleFunction) getDataAccessService().getDomainObject(RoleFunction.class, code, null);
-       }
-
-       public void saveRoleFunction(RoleFunction domainRoleFunction) {
-               getDataAccessService().saveDomainObject(domainRoleFunction, null);
-       }
-
-       public void deleteRoleFunction(RoleFunction domainRoleFunction) {
-               getDataAccessService().deleteDomainObject(domainRoleFunction, null);
-       }
-
-       public EPRole getRole(Long id) {
-               return (EPRole) getDataAccessService().getDomainObject(EPRole.class, id, null);
-       }
-
-       // TODO: refactor
-       private static final String getAppRoleSqlFormat = "SELECT * FROM fn_role where APP_ID = %s AND APP_ROLE_ID = %s";
-
-       @SuppressWarnings("unchecked")
-       public EPRole getRole(Long appId, Long appRoleid) {
-               if (appId == null || appRoleid == null) {
-                       logger.error(EELFLoggerDelegate.errorLogger, String.format(
-                                       "getRole does not support null appId or roleId. appRoleid=%s, appRoleid=%s", appId, appRoleid));
-                       return null;
-               }
-
-               String sql = String.format(getAppRoleSqlFormat, appId, appRoleid);
-
-               List<EPRole> roles = (List<EPRole>) dataAccessService.executeSQLQuery(sql, EPRole.class, null);
-               int resultsCount = roles.size();
-               if (resultsCount > 1) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       String.format(
-                                                       "search by appId=%s, appRoleid=%s should have returned 0 or 1 results. Got %d. This is an internal server error.",
-                                                       appId, appRoleid, resultsCount));
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar.");
-                       return roles.get(0);
-               } else if (resultsCount == 1) {
-                       return roles.get(0);
-               }
-               return null;
-       }
-
-       @SuppressWarnings("unchecked")
-       public EPRole getAppRole(String roleName, Long appId) {
-
-               final Map<String, String> params = new HashMap<String, String>();
-               final Map<String, String> portalParams = new HashMap<String, String>();
-               List<EPRole> roles = null;
-               params.put("appId", appId.toString());
-               params.put("roleName", roleName);
-               portalParams.put("appRoleName", roleName);
-               if (appId == 1 || roleName.equals(PortalConstants.ADMIN_ROLE)) {
-                       roles = (List<EPRole>) dataAccessService.executeNamedQuery("getPortalAppRoles", portalParams, null);
-               } else if (appId != 1 && !roleName.equals(PortalConstants.ADMIN_ROLE)) {
-                       roles = (List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles", params, null);
-               }
-               int resultsCount = (roles == null ? 0 : roles.size());
-               if (resultsCount > 1) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "Trying to recover from duplicates by returning the first search result. This issue should be treated, it is probably not critical because duplicate roles should be similar.");
-                       return roles.get(0);
-               } else if (resultsCount == 1) {
-                       return roles.get(0);
-               }
-               return null;
-       }
-
-       public void saveRole(EPRole domainRole) {
-               getDataAccessService().saveDomainObject(domainRole, null);
-       }
-
-       public void deleteRole(EPRole domainRole) {
-               getDataAccessService().deleteDomainObject(domainRole, null);
-       }
-
-       @SuppressWarnings("unchecked")
-       public List<EPRole> getAvailableRoles() {
-               return getDataAccessService().getList(EPRole.class, null);
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesService.java
deleted file mode 100644 (file)
index 643e228..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.hibernate.Session;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
-
-public interface ExternalAccessRolesService {
-       
-       /**
-        * It gets list of application roles 
-        * 
-        * @param appId
-        * @return List
-        * @throws Exception 
-        */
-       public List<EPRole> getAppRoles(Long appId) throws Exception;
-       
-       /**
-        * It returns single app record
-        * 
-        * @param uebkey
-        * @return List
-        * @throws Exception 
-        */             
-       public List<EPApp> getApp(String uebkey) throws Exception;
-       
-       /**
-        * Adds role in the external access system if fails throws exception
-        * 
-        * @param addRoles
-        * @param uebkey
-        * @return boolean
-        * @throws Exception
-        */
-       public boolean addRole(Role addRoles, String uebkey) throws Exception;
-
-       /**
-        * It returns complete user information
-        * 
-        * @param loginId
-        * @return EPUser object
-        * @throws Exception
-        */
-       List<EPUser> getUser(String loginId) throws Exception;
-       
-       /**
-        * It returns complete user information including application roles permissions
-        * 
-        * @param loginId
-        * @param uebkey
-        * @return String
-        * @throws Exception
-        */
-       String getUserWithRoles(String loginId, String uebkey) throws Exception;
-
-       /**
-        * It returns list of all role functions
-        * @param string 
-        * @return List
-        * @throws Exception 
-        */
-       List<CentralRoleFunction> getRoleFuncList(String string) throws Exception;
-       
-       /**
-        * It return list of role provided by the app uebkey and roleId
-        * 
-        * @param roleId
-        * @param uebkey
-        * @return CentralRole
-        * @throws Exception
-        */
-       CentralRole getRoleInfo(Long roleId, String uebkey) throws Exception;
-       
-       /**
-        *  It returns the CentralRoleFunction object 
-        *   
-        * @param functionCode
-        * @param uebkey 
-        * @return CentralRoleFunction
-        * @throws Exception 
-        */
-       public CentralRoleFunction getRoleFunction(String functionCode, String uebkey) throws Exception;
-
-       /**
-        *  It saves role function in the DB
-        *  
-        * @param domainCentralRoleFunction
-        * @param requestedApp 
-        * @return true else false
-        * @throws Exception 
-        */
-       public boolean saveCentralRoleFunction(CentralRoleFunction domainCentralRoleFunction, EPApp requestedApp) throws Exception;
-
-       /**
-        * It deletes role function in the DB
-        * 
-        * @param code
-        * @param app 
-        */
-       public boolean deleteCentralRoleFunction(String code, EPApp app);
-
-       /**
-        * It gets all roles the applications
-        * 
-        * @param uebkey
-        * @return List
-        * @throws Exception 
-        */
-       public List<CentralRole> getRolesForApp(String uebkey) throws Exception;
-       
-       /**
-        * It saves role function in the DB
-        * 
-        * @param saveRole
-        * @param uebkey
-        * @throws Exception 
-        */
-       boolean saveRoleForApplication(Role saveRole, String uebkey) throws Exception;
-
-       /**
-        *  It deletes role in the DB
-        *  
-        * @param code
-        * @param uebkey
-        * @return true else false
-        * @throws Exception 
-        */
-       boolean deleteRoleForApplication(String code, String uebkey) throws Exception;
-
-       /**
-        * It gets all active roles for single application 
-        * 
-        * @param uebkey
-        * @return List
-        * @throws Exception
-        */
-       List<CentralRole> getActiveRoles(String uebkey) throws Exception;
-       
-       /**
-        * It deletes user related roles for an application in the table
-        * @param roleId
-        * @param uebkey
-        * @param LoginId 
-        * @return true else false
-        * @throws Exception 
-        */
-       public boolean deleteDependencyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception;
-       
-       /**
-        * It sync new functions codes and names from and updates role functions from external access system
-        * 
-        * @param app
-        * @throws Exception
-        */
-       public void syncRoleFunctionFromExternalAccessSystem(EPApp app) throws Exception;
-
-       /**
-        * It uploads portal functions into external auth system
-        * @param uebkey
-        * @return
-        * @throws Exception
-        */
-       public Integer bulkUploadFunctions(String uebkey) throws Exception;
-
-       /**
-        * It uploads portal roles into external auth system
-        * @param uebkey
-        * @return
-        * @throws Exception
-        */
-       public Integer bulkUploadRoles(String uebkey) throws Exception;
-
-       /**
-        * It uploads partner application role functions into external auth system
-        * 
-        * @param uebkey
-        * @param upload
-        * @throws Exception
-        */
-       public void bulkUploadPartnerFunctions(String uebkey, List<RoleFunction> upload) throws Exception;
-
-       /** 
-        * It uploads partner application role functions into external auth system
-        * 
-        * @param uebkey
-        * @param upload
-        * @throws Exception
-        */
-       public void bulkUploadPartnerRoles(String uebkey, List<Role> upload) throws Exception;
-
-       /**
-        * It returns total no. of portal application role functions records added in external auth system 
-        * @param uebkey
-        * @return
-        * @throws Exception
-        */
-       Integer bulkUploadRolesFunctions(String uebkey) throws Exception;
-       
-       /**
-        *  It syncs the roles and rolefunctions to the ecomp DB from AAF
-        * @param app
-        * @throws Exception
-        */
-       void syncApplicationRolesWithEcompDB(EPApp app) throws Exception;
-
-       /**
-        * It uploads list of user roles of the application into external auth system 
-        * 
-        * @param uebkey
-        * @return
-        * @throws Exception
-        */
-       public Integer bulkUploadUserRoles(String uebkey) throws Exception;
-
-       /**
-        * It Uploads partner application role functions into external auth system
-        * 
-        * @param uebkey
-        * @param roleList
-        * @throws Exception
-        */
-       void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception;
-
-       /**
-        * it deletes all dependency role records 
-        * 
-        * @param localSession
-        * @param roleId
-        * @param appId
-        * @throws Exception
-        */
-       public void deleteRoleDependencyRecords(Session localSession, Long roleId, Long appId) throws Exception;
-
-       /**
-        * It returns list of applications functions along with functions associated with global role
-        * 
-        * @param uebkey
-        * @return
-        * @throws Exception
-        */
-       List<String> getMenuFunctionsList(String uebkey) throws Exception;
-       
-       /**
-        * 
-        * @param uebkey applications UebKey
-        * @return
-        * @throws Exception
-        * Method getAllUsers returns all the active users of application
-        */
-       List<EcompUser> getAllAppUsers(String uebkey) throws Exception;
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImpl.java
deleted file mode 100644 (file)
index 341a62c..0000000
+++ /dev/null
@@ -1,2338 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.stream.Collectors;
-
-import org.apache.commons.lang.StringUtils;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.ExternalRoleDetails;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.BulkUploadRoleFunction;
-import org.openecomp.portalapp.portal.transport.BulkUploadUserRoles;
-import org.openecomp.portalapp.portal.transport.CentralApp;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.transport.CentralUser;
-import org.openecomp.portalapp.portal.transport.CentralUserApp;
-import org.openecomp.portalapp.portal.transport.EcompUserRoles;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPerms;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPermsDetail;
-import org.openecomp.portalapp.portal.transport.ExternalAccessRole;
-import org.openecomp.portalapp.portal.transport.ExternalAccessRolePerms;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUser;
-import org.openecomp.portalapp.portal.transport.ExternalRoleDescription;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestTemplate;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-
-@Service("externalAccessRolesService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-@EPAuditLog
-public class ExternalAccessRolesServiceImpl implements ExternalAccessRolesService {
-
-       private static final String AND_FUNCTION_CD_EQUALS = " and function_cd = '";
-
-       private static final String OWNER = ".owner";
-
-       private static final String ADMIN = ".admin";
-
-       private static final String ACCOUNT_ADMINISTRATOR = ".Account_Administrator";
-
-       private static final String FUNCTION_CD_LIKE_CLAUSE = " and function_cd like '%";
-
-       private static final String FUNCTION_PIPE = "|";
-
-       private static final String IS_NULL_STRING = "null";
-
-       private static final String EXTERNAL_AUTH_PERMS = "perms";
-
-       private static final String EXTERNAL_AUTH_ROLE_DESCRIPTION = "description";
-
-       private static final String WHERE_APP_ID_EQUALS = " where app_id = ";
-
-       private static final String IS_EMPTY_JSON_STRING = "{}";
-
-       private static final String CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE = "Connecting to External Auth system";
-
-       private static final String WHERE_ROLE_ID_EQUALS = " where role_id = ";
-
-       private static final String APP_ROLE_ID = "appRoleId";
-
-       private static final String APP_ID = "appId";
-
-       private static final String PRIORITY = "priority";
-
-       private static final String ACTIVE = "active";
-
-       private static final String ROLE_NAME = "name";
-
-       private static final String ID = "id";
-
-       private static final String WHERE_ROLE_NAME_EQUALS = " where role_name = '";
-
-       private static final String APP_ID_EQUALS = " app_id = ";
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAccessRolesServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @Autowired
-       private SessionFactory sessionFactory;
-
-       RestTemplate template = new RestTemplate();
-
-       @SuppressWarnings("unchecked")
-       public List<EPRole> getAppRoles(Long appId) throws Exception {
-               List<EPRole> applicationRoles = null;
-               String filter = null;
-               try {
-                       if (appId == 1) {
-                               filter = " where app_id is null";
-                       } else {
-                               filter = WHERE_APP_ID_EQUALS + appId;
-                       }
-                       applicationRoles = dataAccessService.getList(EPRole.class, filter, null, null);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAppRoles: failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return applicationRoles;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPApp> getApp(String uebkey) throws Exception {
-               List<EPApp> app = null;
-               try {
-                       app = (List<EPApp>) dataAccessService.getList(EPApp.class, " where ueb_key = '" + uebkey + "'", null, null);
-                       if(!app.get(0).getEnabled() && !app.get(0).getId().equals(PortalConstants.PORTAL_APP_ID)){
-                               throw new Exception("Application:"+app.get(0).getName()+" is Unavailable");
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getApp: failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return app;
-       }
-
-       /**
-        * It returns  single application role from external auth system 
-        * @param addRole
-        * @param app
-        * @return JSON string which contains application role details
-        * @throws Exception
-        */
-       private String getSingleAppRole(String addRole, EPApp app) throws Exception {
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               HttpEntity<String> entity = new HttpEntity<>(headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getSingleAppRole: Connecting to External Auth system");
-               ResponseEntity<String> response = template
-                               .exchange(
-                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "roles/"
-                                                               + app.getNameSpace() + "." + addRole.replaceAll(" ", "_"),
-                                               HttpMethod.GET, entity, String.class);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "getSingleAppRole: Finished GET app role from External Auth system and status code: {} ", response.getStatusCode().value());
-               return response.getBody();
-       }
-
-       @Override
-       public boolean addRole(Role addRole, String uebkey) throws Exception {
-               boolean response = false;
-               ResponseEntity<String> addResponse = null;
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               EPApp app = getApp(uebkey).get(0);
-               String newRole = updateExistingRoleInExternalSystem(addRole, app);
-               HttpEntity<String> entity = new HttpEntity<>(newRole, headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "addRole: Connecting to External Auth system");
-               addResponse = template.exchange(
-                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
-                               HttpMethod.POST, entity, String.class);
-               if (addResponse.getStatusCode().value() == 201) {
-                       response = true;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "addRole: Finished adding role in the External Auth system  and response code: {} ", addResponse.getStatusCode().value());
-               }
-               if (addResponse.getStatusCode().value() == 406) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "addRole: Failed to add in the External Auth system due to {} and status code: {}", addResponse.getBody(), addResponse.getStatusCode().value());
-               }
-               return response;
-       }
-
-       /**
-        * 
-        * It deletes record in external auth system
-        * 
-        * @param delRole
-        * @return JSON String which has status code and response body 
-        * @throws Exception
-        */
-       private ResponseEntity<String> deleteRoleInExternalSystem(String delRole) throws Exception {
-               ResponseEntity<String> delResponse = null;
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               HttpEntity<String> entity = new HttpEntity<>(delRole, headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-               delResponse = template.exchange(
-                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role?force=true",
-                               HttpMethod.DELETE, entity, String.class);
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleInExternalSystem: Finished DELETE operation in the External Auth system and status code: {} ", delResponse.getStatusCode().value());
-               return delResponse;
-       }
-
-       /**
-        * It updates role in external auth system
-        * 
-        * @param updateExtRole
-        * @param app
-        * @return true if success else false
-        * @throws Exception
-        *                                      If updateRoleInExternalSystem fails we catch it in logger for detail message
-        */
-       @SuppressWarnings("unchecked")
-       private boolean updateRoleInExternalSystem(Role updateExtRole, EPApp app) throws Exception {
-               boolean response = false;
-               ObjectMapper mapper = new ObjectMapper();
-               ResponseEntity<String> deleteResponse = null;
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               ExternalAccessRolePerms extRolePerms = null;
-               ExternalAccessPerms extPerms = null;
-               List<EPRole> epRoleList = null;
-               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                       epRoleList = dataAccessService.getList(EPRole.class,
-                                       WHERE_ROLE_ID_EQUALS + updateExtRole.getId() + " and app_id is null", null, null);
-               } else {
-                       epRoleList = dataAccessService.getList(EPRole.class,
-                                       " where app_role_id = " + updateExtRole.getId() + " and app_id = " + app.getId(), null, null);
-               }               
-               String appRole = getSingleAppRole(epRoleList.get(0).getName(), app);
-               if (!appRole.equals(IS_EMPTY_JSON_STRING)) {
-                       JSONObject jsonObj = new JSONObject(appRole);
-                       JSONArray extRole = jsonObj.getJSONArray("role");
-                       if (!extRole.getJSONObject(0).has(EXTERNAL_AUTH_ROLE_DESCRIPTION)) {
-                               String roleName = extRole.getJSONObject(0).getString(ROLE_NAME);
-                               Map<String, String> delRoleKeyMapper = new HashMap<>();
-                               delRoleKeyMapper.put(ROLE_NAME, roleName);
-                               String delRoleKeyValue = mapper.writeValueAsString(delRoleKeyMapper);
-                               deleteResponse = deleteRoleInExternalSystem(delRoleKeyValue);
-                               if (deleteResponse.getStatusCode().value() != 200) {
-                                       throw new Exception(deleteResponse.getBody());
-                               }
-                               addRole(updateExtRole, app.getUebKey());
-                       } else {
-                               String desc = extRole.getJSONObject(0).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
-                               String name = extRole.getJSONObject(0).getString(ROLE_NAME);
-                               List<ExternalAccessPerms> list = null;
-                               if (extRole.getJSONObject(0).has(EXTERNAL_AUTH_PERMS)) {
-                                       JSONArray perms = extRole.getJSONObject(0).getJSONArray(EXTERNAL_AUTH_PERMS);
-                                       list = mapper.readValue(perms.toString(), TypeFactory.defaultInstance()
-                                                       .constructCollectionType(List.class, ExternalAccessPerms.class));
-                               }
-                               ExternalRoleDescription sysRoleList = mapper.readValue(desc, ExternalRoleDescription.class);
-                               // If role name or role functions are updated then delete record in External System and add new record to avoid conflicts
-                               Boolean existingRoleActive;
-                               boolean isActiveValueChanged;
-                               // check role active status
-                               existingRoleActive = new Boolean(sysRoleList.getActive());
-                               isActiveValueChanged = existingRoleActive.equals(updateExtRole.getActive());
-                               if (!sysRoleList.getName().equals(updateExtRole.getName())) {
-                                       Map<String, String> delRoleKeyMapper = new HashMap<>();
-                                       delRoleKeyMapper.put(ROLE_NAME, name);
-                                       String delRoleKeyValue = mapper.writeValueAsString(delRoleKeyMapper);   
-                                       deleteResponse = deleteRoleInExternalSystem(delRoleKeyValue);
-                                       if (deleteResponse.getStatusCode().value() != 200) {
-                                               logger.error(EELFLoggerDelegate.errorLogger, "updateRoleInExternalSystem:  Failed to delete role in external system due to {} ", deleteResponse.getBody());
-                                               throw new Exception(deleteResponse.getBody());
-                                       }
-                                       addRole(updateExtRole, app.getUebKey());
-                                       addRoleFunctionsInExternalSystem(updateExtRole, mapper, app);
-                               }
-                               boolean checkPriorityStatus = StringUtils.equals(String.valueOf(sysRoleList.getPriority()),String.valueOf(updateExtRole.getPriority()));
-                               ExternalAccessRole updateRole = new ExternalAccessRole();
-                               if (!isActiveValueChanged
-                                               || !checkPriorityStatus
-                                               || sysRoleList.getId().equals(IS_NULL_STRING)
-                                               || !sysRoleList.getId().equals(String.valueOf(epRoleList.get(0).getId()))) {
-                                       String updateDesc = "";
-                                       String appId = (app.getId().equals(PortalConstants.PORTAL_APP_ID)) ? " app_id is null"
-                                                       : APP_ID_EQUALS + app.getId();
-                                       List<EPRole> getRole = dataAccessService.getList(EPRole.class,
-                                                       WHERE_ROLE_NAME_EQUALS + updateExtRole.getName() + "' and " + appId, null, null);
-                                       Map<String, String> extSystemUpdateRoleJsonMapper = new LinkedHashMap<>();
-                                       extSystemUpdateRoleJsonMapper.put(ID, String.valueOf(getRole.get(0).getId()));
-                                       extSystemUpdateRoleJsonMapper.put(ROLE_NAME, String.valueOf(updateExtRole.getName()));
-                                       extSystemUpdateRoleJsonMapper.put(ACTIVE, String.valueOf(updateExtRole.getActive()));
-                                       extSystemUpdateRoleJsonMapper.put(PRIORITY, String.valueOf(updateExtRole.getPriority()));
-                                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                               extSystemUpdateRoleJsonMapper.put(APP_ID, "null");
-                                               extSystemUpdateRoleJsonMapper.put(APP_ROLE_ID, "null");
-                                       } else {
-                                               extSystemUpdateRoleJsonMapper.put(APP_ID, String.valueOf(app.getId()));
-                                               extSystemUpdateRoleJsonMapper.put(APP_ROLE_ID, String.valueOf(getRole.get(0).getAppRoleId()));
-
-                                       }
-                                       updateDesc = mapper.writeValueAsString(extSystemUpdateRoleJsonMapper);
-                                       updateRole.setName(app.getNameSpace() + "." + updateExtRole.getName().replaceAll(" ", "_"));
-                                       updateRole.setDescription(updateDesc);
-                                       String updateRoleDesc = mapper.writeValueAsString(updateRole);
-                                       HttpEntity<String> entity = new HttpEntity<>(updateRoleDesc, headers);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                                       ResponseEntity<String> updatePermsResponse = template.exchange(
-                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
-                                                       HttpMethod.PUT, entity, String.class);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateRoleInExternalSystem: Finished updating in External Auth system and status code: {} ",
-                                                       updatePermsResponse.getStatusCode().value());
-                               }
-                               List<RoleFunction> roleFunctionListNew = convertSetToListOfRoleFunctions(updateExtRole);
-                               Map<String, RoleFunction> updateRoleFunc = new HashMap<>();
-                               for (RoleFunction addPerm : roleFunctionListNew) {
-                                       updateRoleFunc.put(addPerm.getCode(), addPerm);
-                               }
-                               final Map<String, ExternalAccessPerms> extRolePermMap = new HashMap<>();
-                               // Update permissions in the ExternalAccess System
-                               if (list != null) {
-                                       for (ExternalAccessPerms perm : list) {
-                                               if (!updateRoleFunc.containsKey(perm.getInstance())) {
-                                                       removePermForRole(perm, mapper, name, headers);
-                                               }
-                                               extRolePermMap.put(perm.getInstance(), perm);
-                                       }
-                               }
-                               response = true;
-                               if (!roleFunctionListNew.isEmpty()) {
-                                       for (RoleFunction roleFunc : roleFunctionListNew) {
-                                               if (!extRolePermMap.containsKey(roleFunc.getCode())) {
-                                                       String checkType = roleFunc.getCode().contains("menu") ? "menu" : "url";
-                                                       extPerms = new ExternalAccessPerms(app.getNameSpace() + "." + checkType, roleFunc.getCode(),
-                                                                       "*");
-                                                       extRolePerms = new ExternalAccessRolePerms(extPerms,
-                                                                       app.getNameSpace() + "." + updateExtRole.getName().replaceAll(" ", "_"));
-                                                       String updateRolePerms = mapper.writeValueAsString(extRolePerms);
-                                                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
-                                                       logger.debug(EELFLoggerDelegate.debugLogger, "updateRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                                                       ResponseEntity<String> addResponse = template.exchange(
-                                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                                       + "role/perm",
-                                                                       HttpMethod.POST, entity, String.class);
-                                                       if (addResponse.getStatusCode().value() != 201) {
-                                                               response = false;
-                                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                                               "updateRoleInExternalSystem: Connected to External Auth system but something went wrong! due to {} and statuscode: {}",
-                                                                               addResponse.getStatusCode().getReasonPhrase(),
-                                                                               addResponse.getStatusCode().value());
-                                                       } else {
-                                                               response = true;
-                                                               logger.debug(EELFLoggerDelegate.debugLogger, "updateRoleInExternalSystem: Finished adding permissions to roles in External Auth system and status code: {} ", addResponse.getStatusCode().value());
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-               } else {
-                       // It seems like role exists in local DB but not in External Access system
-                       addRole(updateExtRole, app.getUebKey());
-                       List<RoleFunction> roleFunctionListUpdate = convertSetToListOfRoleFunctions(updateExtRole);
-                       response = true;
-                       if (!roleFunctionListUpdate.isEmpty()) {
-                               addRoleFunctionsInExternalSystem(updateExtRole, mapper, app);
-                       }
-               }
-               return response;
-       }
-       
-       /**
-        * 
-        * It adds functions to the role in external auth system 
-        * 
-        * @param updateExtRole
-        * @param addPermsMapper
-        * @param app
-        * @return true if success else false
-        * @throws Exception
-        */
-       private boolean addRoleFunctionsInExternalSystem(Role updateExtRole, ObjectMapper addPermsMapper, EPApp app)
-                       throws Exception {
-               boolean response = false;
-               ExternalAccessRolePerms extAddRolePerms = null;
-               ExternalAccessPerms extAddPerms = null;
-               List<RoleFunction> roleFunctionListAdd = convertSetToListOfRoleFunctions(updateExtRole);
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               for (RoleFunction roleFunc : roleFunctionListAdd) {
-                       String checkType = roleFunc.getCode().contains("menu") ? "menu" : "url";
-                       extAddPerms = new ExternalAccessPerms(app.getNameSpace() + "." + checkType, roleFunc.getCode(), "*");
-                       extAddRolePerms = new ExternalAccessRolePerms(extAddPerms,
-                                       app.getNameSpace() + "." + updateExtRole.getName().replaceAll(" ", "_"));
-                       String updateRolePerms = addPermsMapper.writeValueAsString(extAddRolePerms);
-                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionsInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                       ResponseEntity<String> addResponse = template.exchange(
-                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/perm",
-                                       HttpMethod.POST, entity, String.class);
-                       if (addResponse.getStatusCode().value() != 201) {
-                               response = false;
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "addRoleFunctionsInExternalSystem: While adding permission to the role in  External Auth system something went wrong! due to {} and statuscode: {}",
-                                               addResponse.getStatusCode().getReasonPhrase(), addResponse.getStatusCode().value());
-                       } else {
-                               response = true;
-                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionsInExternalSystem: Finished adding permissions to roles in External Auth system and status code: {} ", addResponse.getStatusCode().value());
-                       }
-               }
-               return response;
-       }
-
-       /**
-        * 
-        * It converts list of functions in updateExtRole parameter to the RoleFunction object
-        * 
-        * @param updateExtRole
-        * @return list of functions 
-        */
-       @SuppressWarnings("unchecked")
-       private List<RoleFunction> convertSetToListOfRoleFunctions(Role updateExtRole) {
-               Set<RoleFunction> roleFunctionSetList = updateExtRole.getRoleFunctions();
-               List<RoleFunction> roleFunctionList = new ArrayList<>();
-               ObjectMapper roleFuncMapper = new ObjectMapper();
-               Iterator<RoleFunction> itetaror = roleFunctionSetList.iterator();
-               while (itetaror.hasNext()) {
-                       Object nextValue = itetaror.next();
-                       RoleFunction roleFunction = roleFuncMapper.convertValue(nextValue, RoleFunction.class);
-                       roleFunctionList.add(roleFunction);
-               }
-               return roleFunctionList.stream().distinct().collect(Collectors.toList());
-       }
-
-       /**
-        * It delete permissions/functions in the external auth system
-        * 
-        * @param perm
-        * @param permMapper
-        * @param name
-        * @param headers
-        * @throws Exception
-        */
-       private void removePermForRole(ExternalAccessPerms perm, ObjectMapper permMapper, String name, HttpHeaders headers)
-                       throws Exception {
-               ExternalAccessRolePerms extAccessRolePerms = new ExternalAccessRolePerms(perm, name);
-               String permDetails = permMapper.writeValueAsString(extAccessRolePerms);
-               HttpEntity<String> deleteEntity = new HttpEntity<>(permDetails, headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "removePermForRole: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-               ResponseEntity<String> deletePermResponse = template
-                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/"
-                                               + name + "/perm", HttpMethod.DELETE, deleteEntity, String.class);
-               if (deletePermResponse.getStatusCode().value() != 200) {
-                       throw new Exception(deletePermResponse.getBody());
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "removePermForRole: Finished deleting permission to role in External Auth system and status code: {}",
-                               deletePermResponse.getStatusCode().value());
-       }
-
-       /**
-        * It will create new role in the External Auth System
-        * 
-        * @param newRole
-        * @param app
-        * @return true if successfully added in the system else false
-        * @throws Exception
-        *             If fails to add role in the system
-        */
-       private boolean addNewRoleInExternalSystem(List<EPRole> newRole, EPApp app) throws Exception {
-               boolean response = false;
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               ObjectMapper mapper = new ObjectMapper();
-               String addNewRole = "";
-               ExternalAccessRole extRole = new ExternalAccessRole();
-               String addDesc = null;
-               Map<String, String> extSystemJsonMapper = new LinkedHashMap<>();
-               extSystemJsonMapper.put(ID, String.valueOf(newRole.get(0).getId()));
-               extSystemJsonMapper.put(ROLE_NAME, String.valueOf(newRole.get(0).getName()));
-               extSystemJsonMapper.put(ACTIVE, String.valueOf(newRole.get(0).getActive()));
-               extSystemJsonMapper.put(PRIORITY, String.valueOf(newRole.get(0).getPriority()));
-               extSystemJsonMapper.put(APP_ID, String.valueOf(newRole.get(0).getAppId()));
-               extSystemJsonMapper.put(APP_ROLE_ID, String.valueOf(newRole.get(0).getAppRoleId()));
-               addDesc = mapper.writeValueAsString(extSystemJsonMapper);
-               extRole.setName(app.getNameSpace() + "." + newRole.get(0).getName().replaceAll(" ", "_"));
-               extRole.setDescription(addDesc);
-               addNewRole = mapper.writeValueAsString(extRole);
-               HttpEntity<String> deleteEntity = new HttpEntity<>(addNewRole, headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "addNewRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-               ResponseEntity<String> addNewRoleInExternalSystem = template.exchange(
-                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
-                               HttpMethod.POST, deleteEntity, String.class);
-               if (addNewRoleInExternalSystem.getStatusCode().value() != 201) {
-                       throw new Exception(addNewRoleInExternalSystem.getBody());
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "addNewRoleInExternalSystem: Finished adding into External Auth system and status code: {}",
-                                       addNewRoleInExternalSystem.getStatusCode().value());
-                       response = true;
-               }
-               return response;
-       }
-
-       /**
-        * 
-        * It updates existing role in the External Auth System
-        * 
-        * @param addRole
-        *            It Contains role information
-        * @param app
-        * @return string which is formatted to match with the external auth system
-        * @throws JsonProcessingException
-        */
-       @SuppressWarnings("unchecked")
-       private String updateExistingRoleInExternalSystem(Role addRole, EPApp app) throws JsonProcessingException {
-               ObjectMapper mapper = new ObjectMapper();
-               String addNewRole = "";
-               ExternalAccessRole extRole = new ExternalAccessRole();
-               List<EPRole> role = null;
-               String addDesc = null;
-               Map<String, String> extSystemUpdateRole = new LinkedHashMap<>();
-               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                       role = dataAccessService.getList(EPRole.class, WHERE_ROLE_ID_EQUALS + addRole.getId() + " and app_id is null", null, null);
-               } else {
-                       role = dataAccessService.getList(EPRole.class, " where app_role_id = " + addRole.getId() + " and app_id ="+app.getId(), null, null);
-               }
-               extSystemUpdateRole.put(ID, String.valueOf(role.get(0).getId()));
-               extSystemUpdateRole.put(ROLE_NAME, String.valueOf(addRole.getName()));
-               extSystemUpdateRole.put(ACTIVE, String.valueOf(role.get(0).getActive()));
-               extSystemUpdateRole.put(PRIORITY, String.valueOf(role.get(0).getPriority()));
-               extSystemUpdateRole.put(APP_ID, String.valueOf(role.get(0).getAppId()));
-               extSystemUpdateRole.put(APP_ROLE_ID, String.valueOf(role.get(0).getAppRoleId()));
-               addDesc = mapper.writeValueAsString(extSystemUpdateRole);
-               extRole.setName(app.getNameSpace() + "." + addRole.getName().replaceAll(" ", "_"));
-               extRole.setDescription(addDesc);
-               addNewRole = mapper.writeValueAsString(extRole);
-               return addNewRole;
-       }
-
-       /**
-        * It create a role in the external auth system and then in our local 
-        * 
-        * @param addRoleInDB
-        * @param app
-        * @return true else false
-        * @throws Exception
-        */
-       @SuppressWarnings("unchecked")
-       @Transactional
-       private boolean addRoleInEcompDB(Role addRoleInDB, EPApp app) throws Exception {
-               boolean result = false;
-               List<EPRole> applicationRoles = null;
-               EPRole epRole = null;
-               Set<RoleFunction> roleFunctionList = addRoleInDB.getRoleFunctions();
-               List<RoleFunction> roleFunctionListNew = new ArrayList<>();
-               ObjectMapper mapper = new ObjectMapper();
-               Iterator<RoleFunction> itetaror = roleFunctionList.iterator();
-               while (itetaror.hasNext()) {
-                       Object nextValue = itetaror.next();
-                       RoleFunction roleFunction = mapper.convertValue(nextValue, RoleFunction.class);
-                       roleFunctionListNew.add(roleFunction);
-               }
-               List<RoleFunction> listWithoutDuplicates = roleFunctionListNew.stream().distinct().collect(Collectors.toList());
-               try {
-                       if (addRoleInDB.getId() == null) { // check if it is new role
-                               checkIfRoleExitsInExternalSystem(addRoleInDB, app);
-                               EPRole epRoleNew = new EPRole();
-                               epRoleNew.setActive(addRoleInDB.getActive());
-                               epRoleNew.setName(addRoleInDB.getName());
-                               epRoleNew.setPriority(addRoleInDB.getPriority());
-                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                       epRoleNew.setAppId(null);
-                               } else {
-                                       epRoleNew.setAppId(app.getId());
-                               }
-                               dataAccessService.saveDomainObject(epRoleNew, null);
-                               List<EPRole> getRoleCreated = null;
-                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                       List<EPRole> roleCreated = dataAccessService.getList(EPRole.class,
-                                                       WHERE_ROLE_NAME_EQUALS + addRoleInDB.getName() + "' and app_id = " + app.getId(), null,
-                                                       null);
-                                       EPRole epUpdateRole = roleCreated.get(0);
-                                       epUpdateRole.setAppRoleId(epUpdateRole.getId());
-                                       dataAccessService.saveDomainObject(epUpdateRole, null);
-                                       getRoleCreated = dataAccessService.getList(EPRole.class,
-                                                       WHERE_ROLE_NAME_EQUALS + addRoleInDB.getName() + "' and app_id = " + app.getId(), null,
-                                                       null);
-                               } else {
-                                       getRoleCreated = dataAccessService.getList(EPRole.class,
-                                                       WHERE_ROLE_NAME_EQUALS + addRoleInDB.getName() + "' and app_id is null", null, null);
-                               }
-                               // Add role in External Auth system
-                               result = addNewRoleInExternalSystem(getRoleCreated, app);
-                       } else { // if role already exists then update it
-                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                       applicationRoles = dataAccessService.getList(EPRole.class,
-                                                       " where app_id is null " + " and role_id = " + addRoleInDB.getId(), null, null);
-                               } else {
-                                       applicationRoles = dataAccessService.getList(EPRole.class,
-                                                       WHERE_APP_ID_EQUALS + app.getId() + " and app_role_id = " + addRoleInDB.getId(), null, null);
-                               }
-                               if (applicationRoles.isEmpty()) {
-                                       applicationRoles = dataAccessService.getList(EPRole.class,
-                                                       WHERE_APP_ID_EQUALS + app.getId() + " and role_name = '" + addRoleInDB.getName() + "'", null,
-                                                       null);
-                               }
-                               updateRoleInExternalSystem(addRoleInDB, app);
-                               deleteRoleFunction(app, applicationRoles);
-                               if (!applicationRoles.isEmpty()) {
-                                       epRole = applicationRoles.get(0);
-                                       epRole.setName(addRoleInDB.getName());
-                                       epRole.setPriority(addRoleInDB.getPriority());
-                                       epRole.setActive(addRoleInDB.getActive());
-                                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                               epRole.setAppId(null);
-                                               epRole.setAppRoleId(null);
-                                       } else if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)
-                                                       && applicationRoles.get(0).getAppRoleId() == null) {
-                                               epRole.setAppRoleId(epRole.getId());
-                                       }
-                                       dataAccessService.saveDomainObject(epRole, null);
-                               }
-
-                               saveRoleFunction(listWithoutDuplicates, app, applicationRoles);
-                               result = true;
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "addRoleInEcompDB is failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return result;
-       }
-
-       /**
-        * 
-        * It validates whether role exists in external auth system
-        * 
-        * @param checkRole
-        * @param app
-        * @throws Exception
-        *                                      If role exits
-        */
-       private void checkIfRoleExitsInExternalSystem(Role checkRole, EPApp app) throws Exception {
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               String roleName = app.getNameSpace() + "." + checkRole.getName().replaceAll(" ", "_");
-               HttpEntity<String> checkRoleEntity = new HttpEntity<>(headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "checkIfRoleExitsInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-               ResponseEntity<String> checkRoleInExternalSystem = template
-                               .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "roles/"
-                                               + roleName, HttpMethod.GET, checkRoleEntity, String.class);
-               if (!checkRoleInExternalSystem.getBody().equals(IS_EMPTY_JSON_STRING)) {
-                       logger.debug("checkIfRoleExitsInExternalSystem: Role already exists in external system {} and status code: {} ", checkRoleInExternalSystem.getBody(), checkRoleInExternalSystem.getStatusCode().value());
-                       throw new Exception("Role already exists in external system");
-               }
-       }
-
-       /**
-        * It saves list of functions to the role in portal
-        * 
-        * @param roleFunctionListNew
-        * @param app
-        * @param applicationRoles
-        * @throws Exception
-        */
-       @SuppressWarnings("unchecked")
-       private void saveRoleFunction(List<RoleFunction> roleFunctionListNew, EPApp app, List<EPRole> applicationRoles)
-                       throws Exception {
-               for (RoleFunction roleFunc : roleFunctionListNew) {
-                       EPAppRoleFunction appRoleFunc = new EPAppRoleFunction();
-                       appRoleFunc.setAppId(app.getId());
-                       appRoleFunc.setRoleId(applicationRoles.get(0).getId());
-                       // query to check if function code is different for safe operation
-                       List<CentralRoleFunction> roleFunction = dataAccessService.getList(CentralRoleFunction.class,
-                                       WHERE_APP_ID_EQUALS+ app.getId()+FUNCTION_CD_LIKE_CLAUSE + roleFunc.getCode() + "'", null, null);
-                       appRoleFunc.setCode(roleFunction.get(0).getCode());
-                       dataAccessService.saveDomainObject(appRoleFunc, null);
-               }
-       }
-       
-       /**
-        * It deletes all EPAppRoleFunction records in the portal
-        * 
-        * @param app
-        * @param role
-        */
-       @SuppressWarnings("unchecked")
-       private void deleteRoleFunction(EPApp app, List<EPRole> role) {
-               List<EPAppRoleFunction> appRoleFunctionList = dataAccessService.getList(EPAppRoleFunction.class,
-                               WHERE_APP_ID_EQUALS + app.getId() + " and role_id = " + role.get(0).getId(), null, null);
-               if (!appRoleFunctionList.isEmpty()) {
-                       for (EPAppRoleFunction approleFunction : appRoleFunctionList) {
-                               dataAccessService.deleteDomainObject(approleFunction, null);
-                       }
-               }
-       }
-       
-       @Override
-       @SuppressWarnings("unchecked")
-       public List<EPUser> getUser(String loginId){
-               return (List<EPUser>) dataAccessService.getList(EPUser.class,
-                               " where org_user_id = '" + loginId + "'", null, null);
-       }
-
-       @Override
-       public String getUserWithRoles(String loginId, String uebkey) throws Exception {
-               final Map<String, String> params = new HashMap<>();
-               List<EPUser> userList = null;
-               CentralUser cenUser = null;
-               EPApp app = null;
-               String result = null;
-               try {
-                       params.put("orgUserIdValue", loginId);
-                       List<EPApp> appList = getApp(uebkey);
-                       if (!appList.isEmpty()) {
-                               app = appList.get(0);
-                               userList = getUser(loginId);
-                               if (!userList.isEmpty()) {
-                                       EPUser user = userList.get(0);
-                                       ObjectMapper mapper = new ObjectMapper();
-                                       Set<EPUserApp> userAppSet = user.getEPUserApps();
-                                       cenUser = createEPUser(user, userAppSet, app);
-                                       result = mapper.writeValueAsString(cenUser);
-                               } else if (userList.isEmpty()) {
-                                       throw new Exception("User not found");
-                               }
-                       } else {
-                               throw new Exception("Application not found");
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUser: failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return result;
-       }
-
-       @Override
-       public List<CentralRole> getRolesForApp(String uebkey) throws Exception {
-               logger.debug(EELFLoggerDelegate.debugLogger, "getRolesForApp: Entering into getRolesForApp");
-               List<CentralRole> roleList = new ArrayList<>();
-               final Map<String, Long> params = new HashMap<>();
-               try {
-                       List<EPApp> app = getApp(uebkey);
-                       List<EPRole> appRolesList = getAppRoles(app.get(0).getId());
-                       createCentralRoleObject(app, appRolesList, roleList, params);
-               } catch (Exception e) {
-                       throw new Exception("getRolesForApp Failed", e);
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "getRolesForApp: Finished getRolesForApp");
-               return roleList;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<CentralRoleFunction> getRoleFuncList(String uebkey) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               List<CentralRoleFunction> finalRoleList = new ArrayList<>();
-               final Map<String, Long> params = new HashMap<>();
-               params.put(APP_ID, app.getId());
-               // Sync all functions from external system into Ecomp portal DB
-               logger.debug(EELFLoggerDelegate.debugLogger, "getRoleFuncList: Entering into syncRoleFunctionFromExternalAccessSystem");
-               syncRoleFunctionFromExternalAccessSystem(app);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getRoleFuncList: Finished syncRoleFunctionFromExternalAccessSystem");
-               List<CentralRoleFunction> getRoleFuncList = dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null);
-               for(CentralRoleFunction roleFuncItem : getRoleFuncList ){
-                       if(roleFuncItem.getCode().contains(FUNCTION_PIPE)){
-                               String code = "";
-                               int count = StringUtils.countMatches(roleFuncItem.getCode(), FUNCTION_PIPE);
-                               if (count == 2)
-                                       code = roleFuncItem.getCode().substring(
-                                                       roleFuncItem.getCode().indexOf(FUNCTION_PIPE) + 1,
-                                                       roleFuncItem.getCode().lastIndexOf(FUNCTION_PIPE));
-                               else
-                                       code = roleFuncItem.getCode()
-                                                       .substring(roleFuncItem.getCode().lastIndexOf(FUNCTION_PIPE) + 1);
-                               
-                               roleFuncItem.setCode(code);
-                               finalRoleList.add(roleFuncItem);
-                       } else{
-                               finalRoleList.add(roleFuncItem);
-                       }
-               }
-               return finalRoleList;
-       }
-
-       /**
-        * It returns user detail information which is deep copy of EPUser.class object
-        * 
-        * @param userInfo
-        * @param userAppSet
-        * @param app
-        * @return
-        * @throws Exception
-        */
-       @SuppressWarnings("unchecked")
-       private CentralUser createEPUser(EPUser userInfo, Set<EPUserApp> userAppSet, EPApp app) throws Exception {
-
-               final Map<String, Long> params = new HashMap<>();
-               CentralUser userAppList = new CentralUser();
-               CentralUser user1 = null;
-               try {
-                       userAppList.userApps = new TreeSet<CentralUserApp>();
-                       for (EPUserApp userApp : userAppSet) {
-                               if (userApp.getRole().getActive()) {
-                                       EPApp epApp = userApp.getApp();
-                                       String globalRole = userApp.getRole().getName().toLowerCase();
-                                       if (((epApp.getId().equals(app.getId()))
-                                                       && (!userApp.getRole().getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)))
-                                                       || ((epApp.getId().equals(PortalConstants.PORTAL_APP_ID))
-                                                                       && (globalRole.toLowerCase().startsWith("global_")))) {
-                                               CentralUserApp cua = new CentralUserApp();
-                                               cua.setUserId(null);
-                                               CentralApp cenApp = new CentralApp(1L, epApp.getCreated(), epApp.getModified(),
-                                                               epApp.getCreatedId(), epApp.getModifiedId(), epApp.getRowNum(), epApp.getName(),
-                                                               epApp.getImageUrl(), epApp.getDescription(), epApp.getNotes(), epApp.getUrl(),
-                                                               epApp.getAlternateUrl(), epApp.getAppRestEndpoint(), epApp.getMlAppName(),
-                                                               epApp.getMlAppAdminId(), String.valueOf(epApp.getMotsId()), epApp.getAppPassword(),
-                                                               String.valueOf(epApp.getOpen()), String.valueOf(epApp.getEnabled()),
-                                                               epApp.getThumbnail(), epApp.getUsername(), epApp.getUebKey(), epApp.getUebSecret(),
-                                                               epApp.getUebTopicName());
-                                               cua.setApp(cenApp);
-                                               params.put("roleId", userApp.getRole().getId());
-                                               params.put(APP_ID, userApp.getApp().getId());
-                                               List<CentralRoleFunction> appRoleFunctionList = dataAccessService
-                                                               .executeNamedQuery("getAppRoleFunctionList", params, null);
-                                               SortedSet<CentralRoleFunction> roleFunctionSet = new TreeSet<>();
-                                               for (CentralRoleFunction roleFunc : appRoleFunctionList) {
-                                                       String functionCode = "";
-                                                       if (roleFunc.getCode().contains(FUNCTION_PIPE)) {
-                                                               int count = StringUtils.countMatches(roleFunc.getCode(), FUNCTION_PIPE);
-                                                               String finalFunctionCodeVal;
-                                                               if (count == 2)
-                                                                       finalFunctionCodeVal = roleFunc.getCode().substring(
-                                                                                       roleFunc.getCode().indexOf(FUNCTION_PIPE) + 1,
-                                                                                       roleFunc.getCode().lastIndexOf(FUNCTION_PIPE));
-                                                               else
-                                                                       finalFunctionCodeVal = roleFunc.getCode()
-                                                                                       .substring(roleFunc.getCode().lastIndexOf(FUNCTION_PIPE) + 1);
-
-                                                               functionCode = finalFunctionCodeVal;
-                                                       } else {
-                                                               functionCode = roleFunc.getCode();
-                                                       }
-                                                       CentralRoleFunction cenRoleFunc = new CentralRoleFunction(roleFunc.getId(), functionCode,
-                                                                       roleFunc.getName(), null, null);
-                                                       roleFunctionSet.add(cenRoleFunc);
-                                               }
-                                               Long userRoleId = null;
-                                               if (globalRole.toLowerCase().startsWith("global_")
-                                                               && epApp.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                                       userRoleId = userApp.getRole().getId();
-                                               } else {
-                                                       userRoleId = userApp.getRole().getAppRoleId();
-                                               }
-                                               CentralRole cenRole = new CentralRole(userRoleId, userApp.getRole().getCreated(),
-                                                               userApp.getRole().getModified(), userApp.getRole().getCreatedId(),
-                                                               userApp.getRole().getModifiedId(), userApp.getRole().getRowNum(),
-                                                               userApp.getRole().getName(), userApp.getRole().getActive(),
-                                                               userApp.getRole().getPriority(), roleFunctionSet, null, null);
-                                               cua.setRole(cenRole);
-
-                                               userAppList.userApps.add(cua);
-                                       }
-                               }
-                       }
-
-                       user1 = new CentralUser(null, userInfo.getCreated(), userInfo.getModified(), userInfo.getCreatedId(),
-                                       userInfo.getModifiedId(), userInfo.getRowNum(), userInfo.getOrgId(), userInfo.getManagerId(),
-                                       userInfo.getFirstName(), userInfo.getMiddleInitial(), userInfo.getLastName(), userInfo.getPhone(),
-                                       userInfo.getFax(), userInfo.getCellular(), userInfo.getEmail(), userInfo.getAddressId(),
-                                       userInfo.getAlertMethodCd(), userInfo.getHrid(), userInfo.getOrgUserId(), userInfo.getOrgCode(),
-                                       userInfo.getAddress1(), userInfo.getAddress2(), userInfo.getCity(), userInfo.getState(),
-                                       userInfo.getZipCode(), userInfo.getCountry(), userInfo.getOrgManagerUserId(),
-                                       userInfo.getLocationClli(), userInfo.getBusinessCountryCode(), userInfo.getBusinessCountryName(),
-                                       userInfo.getBusinessUnit(), userInfo.getBusinessUnitName(), userInfo.getDepartment(),
-                                       userInfo.getDepartmentName(), userInfo.getCompanyCode(), userInfo.getCompany(),
-                                       userInfo.getZipCodeSuffix(), userInfo.getJobTitle(), userInfo.getCommandChain(),
-                                       userInfo.getSiloStatus(), userInfo.getCostCenter(), userInfo.getFinancialLocCode(),
-                                       userInfo.getLoginId(), userInfo.getLoginPwd(), userInfo.getLastLoginDate(), userInfo.getActive(),
-                                       userInfo.getInternal(), userInfo.getSelectedProfileId(), userInfo.getTimeZoneId(),
-                                       userInfo.isOnline(), userInfo.getChatId(), userAppList.userApps, null);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "createEPUser: createEPUser failed", e);
-                       throw new Exception(e.getMessage());
-               }
-
-               return user1;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public CentralRole getRoleInfo(Long roleId, String uebkey) throws Exception {
-               final Map<String, Long> params = new HashMap<>();
-               List<CentralRole> roleList = new ArrayList<>();
-               CentralRole cenRole = new CentralRole();
-               List<EPRole> roleInfo = null;
-               List<EPApp> app = null;
-               try {
-                       app = getApp(uebkey);
-                       if (app.isEmpty()) {
-                               throw new Exception("Application not found");
-                       }
-                       String filter = null;
-                       if (app.get(0).getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                               filter = WHERE_ROLE_ID_EQUALS + roleId + " and app_id is null ";
-                       } else {
-                               filter = " where app_role_id = " + roleId + " and app_id = " + app.get(0).getId();
-
-                       }
-                       roleInfo = dataAccessService.getList(EPRole.class, filter, null, null);
-                       roleList = createCentralRoleObject(app, roleInfo, roleList, params);
-                       if (roleList.isEmpty()) {
-                               return cenRole;
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleInfo: failed", e);
-                       throw new Exception(e.getMessage());
-
-               }
-               return roleList.get(0);
-       }
-       
-       /**
-        * 
-        * It returns list of app roles along with role functions and which went through deep copy
-        * 
-        * @param app
-        * @param roleInfo
-        * @param roleList
-        * @param params
-        * @return
-        */
-       @SuppressWarnings("unchecked")
-       private List<CentralRole> createCentralRoleObject(List<EPApp> app, List<EPRole> roleInfo,
-                       List<CentralRole> roleList, Map<String, Long> params) {
-               for (EPRole role : roleInfo) {
-                       params.put("roleId", role.getId());
-                       params.put(APP_ID, app.get(0).getId());
-                       List<CentralRoleFunction> cenRoleFuncList = dataAccessService.executeNamedQuery("getAppRoleFunctionList",
-                                       params, null);
-                       SortedSet<CentralRoleFunction> roleFunctionSet = new TreeSet<>();
-                       for (CentralRoleFunction roleFunc : cenRoleFuncList) {
-                               String functionCode = "";
-                               if (roleFunc.getCode().contains(FUNCTION_PIPE)) {
-                                       int count = StringUtils.countMatches(roleFunc.getCode(), FUNCTION_PIPE);
-                                       String finalFunctionCodeVal;
-                                       if (count == 2)
-                                               finalFunctionCodeVal = roleFunc.getCode().substring(
-                                                               roleFunc.getCode().indexOf(FUNCTION_PIPE) + 1,
-                                                               roleFunc.getCode().lastIndexOf(FUNCTION_PIPE));
-                                       else
-                                               finalFunctionCodeVal = roleFunc.getCode()
-                                                               .substring(roleFunc.getCode().lastIndexOf(FUNCTION_PIPE) + 1);
-                                       functionCode = finalFunctionCodeVal;
-                               } else {
-                                       functionCode = roleFunc.getCode();
-                               }
-                               CentralRoleFunction cenRoleFunc = new CentralRoleFunction(role.getId(), functionCode,
-                                               roleFunc.getName(), null, null);
-                               roleFunctionSet.add(cenRoleFunc);
-                       }
-                       SortedSet<CentralRole> childRoles = new TreeSet<>();
-                       CentralRole cenRole = null;
-                       if (role.getAppRoleId() == null) {
-                               cenRole = new CentralRole(role.getId(), role.getCreated(), role.getModified(), role.getCreatedId(),
-                                               role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(), role.getPriority(),
-                                               roleFunctionSet, childRoles, null);
-                       } else {
-                               cenRole = new CentralRole(role.getAppRoleId(), role.getCreated(), role.getModified(),
-                                               role.getCreatedId(), role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(),
-                                               role.getPriority(), roleFunctionSet, childRoles, null);
-                       }
-                       roleList.add(cenRole);
-               }
-               return roleList;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public CentralRoleFunction getRoleFunction(String functionCode, String uebkey) throws Exception {
-               CentralRoleFunction roleFunc = null;
-               EPApp app = getApp(uebkey).get(0);
-               List<CentralRoleFunction> getRoleFuncList = null;
-               final Map<String, String> params = new HashMap<>();
-               try {
-                       params.put("functionCode", functionCode);
-                       params.put(APP_ID, String.valueOf(app.getId()));
-                       getRoleFuncList = dataAccessService.executeNamedQuery("getRoleFunction", params, null);
-                       if (getRoleFuncList.isEmpty()) {
-                               return roleFunc;
-                       } else{
-                               String functionCodeFormat = getRoleFuncList.get(0).getCode();
-                               if(functionCodeFormat.contains(FUNCTION_PIPE)){
-                                       String newfunctionCodeFormat = functionCodeFormat.substring(functionCodeFormat.lastIndexOf(FUNCTION_PIPE)+1); 
-                                       roleFunc = new CentralRoleFunction(getRoleFuncList.get(0).getId(), newfunctionCodeFormat, getRoleFuncList.get(0).getName(), getRoleFuncList.get(0).getAppId(), getRoleFuncList.get(0).getEditUrl());
-                               } else{
-                                       roleFunc = new CentralRoleFunction(getRoleFuncList.get(0).getId(), functionCodeFormat, getRoleFuncList.get(0).getName(), getRoleFuncList.get(0).getAppId(), getRoleFuncList.get(0).getEditUrl());
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRoleFunction: failed", e);
-                       throw new Exception("getRoleFunction failed", e);
-               }
-               return roleFunc;
-       }
-
-       @Override
-       public boolean saveCentralRoleFunction(CentralRoleFunction domainCentralRoleFunction, EPApp app) throws Exception {
-               boolean saveOrUpdateFunction = false;
-               try {
-                       addRoleFunctionInExternalSystem(domainCentralRoleFunction, app);
-                       dataAccessService.saveDomainObject(domainCentralRoleFunction, null);
-                       saveOrUpdateFunction = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveCentralRoleFunction: failed", e);
-                       saveOrUpdateFunction = false;
-               }
-               return saveOrUpdateFunction;
-       }
-       
-       /**
-        * It creates application permission in external auth system
-        * 
-        * @param domainCentralRoleFunction
-        * @param app
-        * @throws Exception
-        */
-       @SuppressWarnings("unchecked")
-       private void addRoleFunctionInExternalSystem(CentralRoleFunction domainCentralRoleFunction, EPApp app)
-                       throws Exception {
-               ObjectMapper mapper = new ObjectMapper();
-               ExternalAccessPerms extPerms = new ExternalAccessPerms();
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               List<CentralRoleFunction> appRoleFunc = dataAccessService.getList(CentralRoleFunction.class,
-                               WHERE_APP_ID_EQUALS + app.getId() + AND_FUNCTION_CD_EQUALS + domainCentralRoleFunction.getCode() + "'", null, null);
-               String roleFuncName = null;
-               if (!appRoleFunc.isEmpty()) {
-                       roleFuncName = appRoleFunc.get(0).getCode();
-               } else {
-                       roleFuncName = domainCentralRoleFunction.getCode();
-               }
-               String checkType = domainCentralRoleFunction.getCode().contains("menu") ? "menu" : "url";
-               HttpEntity<String> getSinglePermEntity = new HttpEntity<>(headers);
-               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: {} ", CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-               ResponseEntity<String> getResponse = template.exchange(
-                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "perms/"
-                                               + app.getNameSpace() + "." + checkType + "/" + roleFuncName + "/*",
-                               HttpMethod.GET, getSinglePermEntity, String.class);
-               if (getResponse.getStatusCode().value() != 200) {
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, getResponse.getStatusCode());
-                       throw new Exception(getResponse.getBody());
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: Finished GET permission from External Auth system and response: {} ", getResponse.getBody());
-               String res = getResponse.getBody();
-               if (res.equals(IS_EMPTY_JSON_STRING)) {
-                       try {
-                               extPerms.setAction("*");
-                               extPerms.setInstance(domainCentralRoleFunction.getCode());
-                               extPerms.setType(app.getNameSpace() + "." + checkType);
-                               extPerms.setDescription(domainCentralRoleFunction.getName());
-                               String updateRole = mapper.writeValueAsString(extPerms);
-                               HttpEntity<String> entity = new HttpEntity<>(updateRole, headers);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                               ResponseEntity<String> addPermResponse= template.exchange(
-                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "perm",
-                                               HttpMethod.POST, entity, String.class);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: Finished adding permission in  and status code: {} ", addPermResponse.getStatusCode().value());
-                       } catch(HttpClientErrorException e){
-                               logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to add function in external central auth system", e);
-                               EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-                       }catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionInExternalSystem: Failed to add fucntion in external central auth system",
-                                               e);
-                       }
-               } else {
-                       try {
-                               extPerms.setAction("*");
-                               extPerms.setInstance(domainCentralRoleFunction.getCode());
-                               extPerms.setType(app.getNameSpace() + "." + checkType);
-                               extPerms.setDescription(domainCentralRoleFunction.getName());
-                               String updateRole = mapper.writeValueAsString(extPerms);
-                               HttpEntity<String> entity = new HttpEntity<>(updateRole, headers);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                               ResponseEntity<String> updatePermResponse = template.exchange(
-                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "perm",
-                                               HttpMethod.PUT, entity, String.class);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "addRoleFunctionInExternalSystem: Finished updating permission in External Auth system and response: {} ", updatePermResponse.getBody());
-                       } catch(HttpClientErrorException e){
-                               logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to add function in external central auth system", e);
-                               EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionInExternalSystem: Failed to update function in external central auth system",
-                                               e);
-                       }
-               }
-       }
-
-       @Override
-       @Transactional
-       public boolean deleteCentralRoleFunction(String code, EPApp app) {
-               boolean deleteFunctionResponse = false;
-               try {
-                       final Map<String, String> params = new HashMap<>();
-                       params.put("functionCode", code);
-                       params.put(APP_ID, String.valueOf(app.getId()));
-                       CentralRoleFunction domainCentralRoleFunction = (CentralRoleFunction) dataAccessService
-                                       .executeNamedQuery("getRoleFunction", params, null).get(0);
-                       deleteRoleFunctionInExternalSystem(domainCentralRoleFunction, app);
-                       // Delete role function dependency records
-                       deleteAppRoleFunctions(code, app);
-                       dataAccessService.deleteDomainObject(domainCentralRoleFunction, null);
-                       deleteFunctionResponse = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteCentralRoleFunction: failed", e);
-               }
-               return deleteFunctionResponse;
-       }
-
-       /**
-        * It deletes app function record in portal 
-        * 
-        * @param code
-        * @param app
-        */
-       private void deleteAppRoleFunctions(String code, EPApp app) {
-               dataAccessService.deleteDomainObjects(EPAppRoleFunction.class,
-                               APP_ID_EQUALS + app.getId() + FUNCTION_CD_LIKE_CLAUSE + code + "'", null);
-       }
-       
-       /**
-        * 
-        * It deletes permission in the external auth system  
-        * 
-        * @param domainCentralRoleFunction
-        * @param app
-        * @throws Exception
-        */
-       private void deleteRoleFunctionInExternalSystem(CentralRoleFunction domainCentralRoleFunction, EPApp app)
-                       throws Exception {
-               try {
-                       ObjectMapper mapper = new ObjectMapper();
-                       ExternalAccessPerms extPerms = new ExternalAccessPerms();
-                       String instanceValue = "";
-                       if(domainCentralRoleFunction.getCode().contains(FUNCTION_PIPE)){
-                               instanceValue = domainCentralRoleFunction.getCode().substring(domainCentralRoleFunction.getCode().lastIndexOf(FUNCTION_PIPE)+1);
-                       }else{
-                               instanceValue = domainCentralRoleFunction.getCode();
-                       }
-                       String checkType = instanceValue.contains("menu") ? "menu" : "url";
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       extPerms.setAction("*");
-                       extPerms.setInstance(domainCentralRoleFunction.getCode());
-                       extPerms.setType(app.getNameSpace() + "." + checkType);
-                       extPerms.setDescription(domainCentralRoleFunction.getName());
-                       String updateRole = mapper.writeValueAsString(extPerms);
-                       HttpEntity<String> entity = new HttpEntity<>(updateRole, headers);
-                       logger.debug(EELFLoggerDelegate.debugLogger,"deleteRoleFunctionInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                       ResponseEntity<String> delPermResponse = template.exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                       + "perm?force=true", HttpMethod.DELETE, entity, String.class);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleFunctionInExternalSystem: Finished deleting permission in External Auth system and status code: {} ", delPermResponse.getStatusCode().value());
-               } catch(HttpClientErrorException e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to delete functions in External System", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               " deleteRoleFunctionInExternalSystem: It seems like function is already deleted in external central auth system  but exists in local DB",
-                                               e.getMessage());
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleFunctionInExternalSystem: Failed to delete functions in External System", e);
-                       }
-               }
-       }
-
-       @Override
-       public boolean saveRoleForApplication(Role saveRole, String uebkey) throws Exception {
-               boolean addRoleResponse = false;
-               try {
-                       EPApp app = getApp(uebkey).get(0);
-                       addRoleInEcompDB(saveRole, app);
-                       addRoleResponse = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveRoleForApplication failed", e);
-               }
-               return addRoleResponse;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public boolean deleteRoleForApplication(String deleteRole, String uebkey) throws Exception {
-               Session localSession = sessionFactory.openSession();
-               Transaction transaction = null;
-               boolean result = false;
-               try {
-                       transaction = localSession.beginTransaction();
-
-                       List<EPRole> epRoleList = null;
-                       ResponseEntity<String> deleteResponse = null;
-                       EPApp app = getApp(uebkey).get(0);
-                       if (app.getId() == 1) {
-                               epRoleList = dataAccessService.getList(EPRole.class,
-                                               " where app_id is null " + "and role_name = '" + deleteRole + "'", null, null);
-                       } else {
-                               epRoleList = dataAccessService.getList(EPRole.class,
-                                               WHERE_APP_ID_EQUALS + app.getId() + " and role_name = '" + deleteRole + "'", null, null);
-                       }
-                       // Delete app role functions before deleting role
-                       deleteRoleFunction(app, epRoleList);
-                       if (app.getId() == 1) {
-                               // Delete fn_user_ role
-                               dataAccessService.deleteDomainObjects(EPUserApp.class,
-                                               APP_ID_EQUALS + app.getId() + " and role_id = " + epRoleList.get(0).getId(), null);
-
-                               deleteRoleDependencyRecords(localSession, epRoleList.get(0).getId(), app.getId());
-                       }
-                       // Delete Role in External System
-                       String deleteRoleKey = "{\"name\":\"" + app.getNameSpace() + "."
-                                       + epRoleList.get(0).getName().replaceAll(" ", "_") + "\"}";
-                       deleteResponse = deleteRoleInExternalSystem(deleteRoleKey);
-                       if (deleteResponse.getStatusCode().value() != 200 || deleteResponse.getStatusCode().value() != 404) {
-                               EPLogUtil.logExternalAuthAccessAlarm(logger, deleteResponse.getStatusCode());
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "deleteRoleForApplication: Failed to delete role in external auth system! due to {} ",
-                                               deleteResponse.getBody());
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleForApplication: about to commit the transaction");
-                       transaction.commit();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleForApplication: committed the transaction");
-                       dataAccessService.deleteDomainObject(epRoleList.get(0), null);
-                       result = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteRoleForApplication: failed", e);
-                       result = false;
-               } finally {
-                       localSession.close();
-               }
-               return result;
-       }
-
-       /**
-        * 
-        * It deletes application user role in external auth system
-        * 
-        * @param role
-        * @param app
-        * @param LoginId
-        * @throws Exception
-        */
-       private void deleteUserRoleInExternalSystem(EPRole role, EPApp app, String LoginId) throws Exception {
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               HttpEntity<String> entity = new HttpEntity<>(headers);
-               logger.debug(EELFLoggerDelegate.debugLogger,"deleteUserRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-               ResponseEntity<String> getResponse = template
-                               .exchange(
-                                               SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "userRole/"
-                                                               + LoginId
-                                                               + SystemProperties
-                                                                               .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)
-                                                               + "/" + app.getNameSpace() + "." + role.getName().replaceAll(" ", "_"),
-                                               HttpMethod.GET, entity, String.class);
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteUserRoleInExternalSystem: Finished GET user roles from External Auth system and response: {} ", getResponse.getBody());
-               if (getResponse.getStatusCode().value() != 200) {
-                       throw new Exception(getResponse.getBody());
-               }
-               String res = getResponse.getBody();
-               if (!res.equals(IS_EMPTY_JSON_STRING)) {
-                       HttpEntity<String> userRoleentity = new HttpEntity<>(headers);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteUserRoleInExternalSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                       ResponseEntity<String> deleteResponse = template
-                                       .exchange(
-                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                       + "userRole/" + LoginId
-                                                                       + SystemProperties
-                                                                                       .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)
-                                                                       + "/" + app.getNameSpace() + "." + role.getName().replaceAll(" ", "_"),
-                                                       HttpMethod.DELETE, userRoleentity, String.class);
-                       if (deleteResponse.getStatusCode().value() != 200) {
-                               throw new Exception("Failed to delete user role");
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteUserRoleInExternalSystem: Finished deleting user role in External Auth system and status code: {} ", deleteResponse.getStatusCode().value());
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<CentralRole> getActiveRoles(String uebkey) throws Exception {
-               List<CentralRole> roleList = new ArrayList<>();
-               try {
-                       List<EPApp> app = getApp(uebkey);
-                       final Map<String, Long> params = new HashMap<>();
-                       // check if portal
-                       Long appId = null;
-                       if (!app.get(0).getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                               appId = app.get(0).getId();
-                       }
-                       List<EPRole> epRole = dataAccessService.getList(EPRole.class,
-                                       WHERE_APP_ID_EQUALS + appId + " and active_yn = 'Y'", null, null);
-                       roleList = createCentralRoleObject(app, epRole, roleList, params);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveRoles: failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return roleList;
-
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public boolean deleteDependencyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception {
-               boolean result = false;
-               Session localSession = sessionFactory.openSession();
-               Transaction transaction = null;
-               EPApp app = null;
-               try {
-                       transaction = localSession.beginTransaction();
-                       List<EPRole> epRoleList = null;
-                       app = getApp(uebkey).get(0);
-                       epRoleList = dataAccessService.getList(EPRole.class,
-                                       WHERE_APP_ID_EQUALS + app.getId() + " and app_role_id = " + roleId, null, null);
-                       if (epRoleList.isEmpty()) {
-                               epRoleList = dataAccessService.getList(EPRole.class,
-                                               WHERE_APP_ID_EQUALS + app.getId() + " and role_id = " + roleId, null, null);
-                       }
-                       // Delete User Role in External System before deleting role
-                       deleteUserRoleInExternalSystem(epRoleList.get(0), app, LoginId);
-                       // Delete user app roles
-                       dataAccessService.deleteDomainObjects(EPUserApp.class,
-                                       APP_ID_EQUALS + app.getId() + " and role_id = " + epRoleList.get(0).getId(), null);
-
-                       deleteRoleDependencyRecords(localSession, epRoleList.get(0).getId(), app.getId());
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteDependencyRoleRecord: about to commit the transaction");
-                       transaction.commit();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteDependencyRoleRecord: committed the transaction");
-                       result = true;
-               } catch(HttpClientErrorException e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord: HttpClientErrorException", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteDependencyRoleRecord failed", e);
-                       EcompPortalUtils.rollbackTransaction(transaction,
-                                       "deleteDependencyRoleRecord rollback, exception = " + e.toString());
-               } finally {
-                       localSession.close();
-               }
-               return result;
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public void syncRoleFunctionFromExternalAccessSystem(EPApp app) {
-               try {
-                       ResponseEntity<String> response = null;
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       HttpEntity<String> entity = new HttpEntity<>(headers);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncRoleFunctionFromExternalAccessSystem: {} " , CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                       response = template
-                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                       + "perms/ns/" + app.getNameSpace(), HttpMethod.GET, entity, String.class);
-
-                       String res = response.getBody();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncRoleFunctionFromExternalAccessSystem: Finished GET permissions from External Auth system and response: {} ", response.getBody());
-                       JSONObject jsonObj = new JSONObject(res);
-                       JSONArray extPerms = jsonObj.getJSONArray("perm");
-                       for (int i = 0; i < extPerms.length(); i++) {
-                               if (extPerms.getJSONObject(i).getString("type").equals(app.getNameSpace() + ".access")) {
-                                       extPerms.remove(i);
-                                       i--;
-                               }
-                       }
-                       ExternalAccessPermsDetail permDetails = null;
-                       List<ExternalAccessPermsDetail> permsDetailList = new ArrayList<>();
-                       for (int i = 0; i < extPerms.length(); i++) {
-                               String description = null;
-                               if(extPerms.getJSONObject(i).has("description")){
-                                       description = extPerms.getJSONObject(i).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
-                               } else{
-                                       description = extPerms.getJSONObject(i).getString("instance");
-                               }
-                               if (extPerms.getJSONObject(i).has("roles")) {
-                                       ObjectMapper rolesListMapper = new ObjectMapper();
-                                       JSONArray resRoles = extPerms.getJSONObject(i).getJSONArray("roles");
-                                       List<String> list = rolesListMapper.readValue(resRoles.toString(),
-                                                       TypeFactory.defaultInstance().constructCollectionType(List.class, String.class));
-                                       permDetails = new ExternalAccessPermsDetail(extPerms.getJSONObject(i).getString("type"),
-                                                       extPerms.getJSONObject(i).getString("type").substring(app.getNameSpace().length() + 1)
-                                                                       + FUNCTION_PIPE + extPerms.getJSONObject(i).getString("instance") + FUNCTION_PIPE
-                                                                       + extPerms.getJSONObject(i).getString("action"),
-                                                       extPerms.getJSONObject(i).getString("action"), list, description);
-                                       permsDetailList.add(permDetails);
-                               } else {
-                                       permDetails = new ExternalAccessPermsDetail(extPerms.getJSONObject(i).getString("type"),
-                                                       extPerms.getJSONObject(i).getString("type").substring(app.getNameSpace().length() + 1)
-                                                                       + FUNCTION_PIPE + extPerms.getJSONObject(i).getString("instance") + FUNCTION_PIPE
-                                                                       + extPerms.getJSONObject(i).getString("action"),
-                                                       extPerms.getJSONObject(i).getString("action"), description);
-                                       permsDetailList.add(permDetails);
-                               }
-                       }
-
-                       final Map<String, Long> params = new HashMap<>();
-                       final Map<String, CentralRoleFunction> roleFuncMap = new HashMap<>();
-                       params.put(APP_ID, app.getId());
-                       List<CentralRoleFunction> appFunctions = dataAccessService.executeNamedQuery("getAllRoleFunctions", params,
-                                       null);
-                       if (!appFunctions.isEmpty()) {
-                               for (CentralRoleFunction roleFunc : appFunctions) {
-                                       roleFuncMap.put(roleFunc.getCode(), roleFunc);
-                               }
-                       }
-                       // delete all application role functions
-                       dataAccessService.deleteDomainObjects(EPAppRoleFunction.class, APP_ID_EQUALS + app.getId(), null);
-                       // Add if new functions and app role functions were added in external auth system
-                       for (ExternalAccessPermsDetail permsDetail : permsDetailList) {
-                               String code = permsDetail.getInstance();
-                               CentralRoleFunction getFunctionCodeKey = roleFuncMap.get(permsDetail.getInstance());
-                               if (null == getFunctionCodeKey) {
-                                       String finalFunctionCodeVal = "";
-                                       if (permsDetail.getInstance().contains(FUNCTION_PIPE)) {
-                                               int count = StringUtils.countMatches(permsDetail.getInstance(), FUNCTION_PIPE);
-                                               if (count == 2)
-                                                       finalFunctionCodeVal = permsDetail.getInstance().substring(
-                                                                       permsDetail.getInstance().indexOf(FUNCTION_PIPE) + 1,
-                                                                       permsDetail.getInstance().lastIndexOf(FUNCTION_PIPE));
-                                               else
-                                                       finalFunctionCodeVal = permsDetail.getInstance()
-                                                                       .substring(permsDetail.getInstance().lastIndexOf(FUNCTION_PIPE) + 1);
-                                       } else {
-                                               finalFunctionCodeVal = permsDetail.getInstance();
-                                       }
-                                       CentralRoleFunction checkIfCodeStillExits = roleFuncMap.get(finalFunctionCodeVal);
-                                       if (null == checkIfCodeStillExits) {
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "syncRoleFunctionFromExternalAccessSystem: Adding function: {} ", code);
-                                               addFunctionInEcompDB(app, permsDetail, code);
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "syncRoleFunctionFromExternalAccessSystem: Finished adding function: {} ", code);
-
-                                       }
-                               }                               
-                               List<EPRole> epRolesList = null;
-                               List<String> roles = permsDetail.getRoles();
-                               if (roles != null) {
-                                       for (String roleList : roles) {
-                                               if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                                       epRolesList = dataAccessService.getList(EPRole.class,
-                                                                       " where app_id is null " + " and role_name = '"
-                                                                                       + roleList.substring(app.getNameSpace().length() + 1).replaceAll("_", " ")
-                                                                                       + "'",
-                                                                       null, null);
-                                               } else {
-                                                       epRolesList = dataAccessService.getList(EPRole.class,
-                                                                       WHERE_APP_ID_EQUALS + app.getId() + " and role_name = '"
-                                                                                       + roleList.substring(app.getNameSpace().length() + 1).replaceAll("_", " ")
-                                                                                       + "'",
-                                                                       null, null);
-                                               }
-                                               if (epRolesList.isEmpty()) {
-                                                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                                               epRolesList = dataAccessService.getList(EPRole.class,
-                                                                               " where app_id is null " + " and role_name = '"
-                                                                                               + roleList.substring(app.getNameSpace().length() + 1) + "'",
-                                                                               null, null);
-                                                       } else {
-                                                               epRolesList = dataAccessService.getList(EPRole.class,
-                                                                               WHERE_APP_ID_EQUALS + app.getId() + " and role_name = '"
-                                                                                               + roleList.substring(app.getNameSpace().length() + 1) + "'",
-                                                                               null, null);
-                                                       }
-                                                       // Adding new role thats does not exits in Local but exists in external access system
-                                                       if (epRolesList.isEmpty()) {
-                                                               Role role = addRoleInDBIfDoesNotExists(app, roleList.substring(app.getNameSpace().length() + 1));
-                                                               addIfRoleDescriptionNotExitsInExtSystem(role, app);
-                                                               epRolesList = dataAccessService.getList(EPRole.class,
-                                                                               WHERE_APP_ID_EQUALS + app.getId() + " and role_name = '"
-                                                                                               + role.getName() + "'",
-                                                                               null, null);
-                                                       }
-                                               }
-                                               // save all application role functions
-                                               if (!epRolesList.isEmpty()) {
-                                                       try {
-                                                               List<CentralRoleFunction> roleFunctionList = null;
-                                                               String functionCode = "";
-                                                               if (permsDetail.getInstance().contains(FUNCTION_PIPE)) {
-                                                                       int count = StringUtils.countMatches(permsDetail.getInstance(), FUNCTION_PIPE);
-                                                                       String finalFunctionCodeVal;
-                                                                       if (count == 2)
-                                                                               finalFunctionCodeVal = permsDetail.getInstance().substring(
-                                                                                               permsDetail.getInstance().indexOf(FUNCTION_PIPE) + 1,
-                                                                                               permsDetail.getInstance().lastIndexOf(FUNCTION_PIPE));
-                                                                       else
-                                                                               finalFunctionCodeVal = permsDetail.getInstance()
-                                                                                               .substring(permsDetail.getInstance().lastIndexOf(FUNCTION_PIPE) + 1);
-
-                                                                       functionCode = finalFunctionCodeVal;
-                                                               }
-                                                               roleFunctionList = dataAccessService.getList(CentralRoleFunction.class,
-                                                                               " where app_id = " + app.getId() + AND_FUNCTION_CD_EQUALS + functionCode + "'",
-                                                                               null, null);
-                                                               if (roleFunctionList.isEmpty()) {
-                                                                       roleFunctionList = dataAccessService.getList(CentralRoleFunction.class,
-                                                                                       " where app_id = " + app.getId() + AND_FUNCTION_CD_EQUALS + code + "'",
-                                                                                       null, null);
-                                                               }
-                                                               if (!roleFunctionList.isEmpty()) {
-                                                                       EPAppRoleFunction addAppRoleFunc = new EPAppRoleFunction();
-                                                                       addAppRoleFunc.setAppId(app.getId());
-                                                                       addAppRoleFunc.setCode(roleFunctionList.get(0).getCode());
-                                                                       addAppRoleFunc.setRoleId(epRolesList.get(0).getId());
-                                                                       dataAccessService.saveDomainObject(addAppRoleFunc, null);
-                                                               }
-                                                       } catch (Exception e) {
-                                                               logger.error(EELFLoggerDelegate.errorLogger,
-                                                                               "syncRoleFunctionFromExternalAccessSystem: Failed to save app role function ",
-                                                                               e);
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncRoleFunctionFromExternalAccessSystem: Finished syncRoleFunctionFromExternalAccessSystem");
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "syncRoleFunctionFromExternalAccessSystem: Failed syncRoleFunctionFromExternalAccessSystem", e);
-
-               }
-       }
-       
-       /**
-        * 
-        * Add function into local DB
-        * 
-        * @param app
-        * @param permsDetail
-        * @param code
-        */
-       private void addFunctionInEcompDB(EPApp app, ExternalAccessPermsDetail permsDetail, String code) {
-               try{
-               CentralRoleFunction addFunction = new CentralRoleFunction();
-               addFunction.setAppId(app.getId());
-               addFunction.setCode(code);
-               addFunction.setName(permsDetail.getDescription());
-               dataAccessService.saveDomainObject(addFunction, null);
-               } catch(Exception e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "addFunctionInEcompDB: Failed to add function", e);
-               }
-       }
-
-       /**
-        * 
-        * It updates description of a role in external auth system
-        * 
-        * @param role
-        * @param app
-        * @throws Exception
-        */
-       private void addIfRoleDescriptionNotExitsInExtSystem(Role role, EPApp app) throws Exception {
-               String addRoleNew = updateExistingRoleInExternalSystem(role, app);
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               try {
-                       HttpEntity<String> entity = new HttpEntity<>(addRoleNew, headers);
-                       template.exchange(
-                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
-                                       HttpMethod.PUT, entity, String.class);
-               } catch (HttpClientErrorException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to addIfRoleDescriptionNotExitsInExtSystem",
-                                       e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "addIfRoleDescriptionNotExitsInExtSystem: Failed",
-                                       e);
-               }
-       }
-
-       /**
-        * 
-        * While sync functions form external auth system if new role found we should add in local and return Role.class object
-        * 
-        * @param app
-        * @param role
-        * @return
-        */
-       @SuppressWarnings("unchecked")
-       private Role addRoleInDBIfDoesNotExists(EPApp app, String role) {
-               Role setNewRole = new Role();
-               EPRole epRoleNew = new EPRole();
-               try {
-                       epRoleNew.setActive(true);
-                       epRoleNew.setName(role);
-                       if (app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                               epRoleNew.setAppId(null);
-                       } else {
-                               epRoleNew.setAppId(app.getId());
-                       }
-                       dataAccessService.saveDomainObject(epRoleNew, null);
-                       List<EPRole> getRoleCreated = null;
-                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                               List<EPRole> roleCreated = dataAccessService.getList(EPRole.class,
-                                               WHERE_ROLE_NAME_EQUALS + role + "' and app_id = " + app.getId(), null, null);
-                               EPRole epUpdateRole = roleCreated.get(0);
-                               epUpdateRole.setAppRoleId(epUpdateRole.getId());
-                               dataAccessService.saveDomainObject(epUpdateRole, null);
-                               getRoleCreated = dataAccessService.getList(EPRole.class,
-                                               WHERE_ROLE_NAME_EQUALS + role + "' and app_id = " + app.getId(), null, null);
-                       } else {
-                               getRoleCreated = dataAccessService.getList(EPRole.class,
-                                               WHERE_ROLE_NAME_EQUALS + role + "' and app_id is null", null, null);
-                       }
-                       EPRole roleObject = getRoleCreated.get(0);
-                       setNewRole.setId(roleObject.getId());
-                       setNewRole.setName(roleObject.getName());
-                       setNewRole.setActive(roleObject.getActive());
-                       setNewRole.setPriority(roleObject.getPriority());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "addRoleInDBIfDoesNotExists: Failed", e);
-               }
-               return setNewRole;
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public Integer bulkUploadFunctions(String uebkey) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               List<RoleFunction> roleFuncList = null;
-               roleFuncList = dataAccessService.getList(RoleFunction.class, null);
-               CentralRoleFunction cenRoleFunc = null;
-               Integer functionsAdded = 0;
-               try {
-                       for (RoleFunction roleFunc : roleFuncList) {
-                               cenRoleFunc = new CentralRoleFunction(roleFunc.getCode(), roleFunc.getName());
-                               addRoleFunctionInExternalSystem(cenRoleFunc, app);
-                               functionsAdded++;
-                       }
-               } catch(HttpClientErrorException e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - bulkUploadFunctions failed", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadFunctions: failed", e.getMessage(), e);
-               }
-               return functionsAdded;
-       }
-
-       @Override
-       public Integer bulkUploadRoles(String uebkey) throws Exception {
-               List<EPApp> app = getApp(uebkey);
-               List<EPRole> roles = getAppRoles(app.get(0).getId());
-               List<CentralRole> cenRoleList = new ArrayList<>();
-               final Map<String, Long> params = new HashMap<>();
-               Integer rolesListAdded = 0;
-               try {
-                       cenRoleList = createCentralRoleObject(app, roles, cenRoleList, params);
-                       ObjectMapper mapper = new ObjectMapper();
-                       mapper.configure(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, false);
-                       String roleList = mapper.writeValueAsString(cenRoleList);
-                       List<Role> roleObjectList = mapper.readValue(roleList,
-                                       TypeFactory.defaultInstance().constructCollectionType(List.class, Role.class));
-                       for (Role role : roleObjectList) {
-                               addRoleInExternalSystem(role, app.get(0));
-                               rolesListAdded++;
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRoles: failed", e);
-                       throw new Exception(e.getMessage());
-               }
-               return rolesListAdded;
-       }
-
-       /**
-        * It creating new role in external auth system while doing bulk upload
-        * 
-        * @param role
-        * @param app
-        * @throws Exception
-        */
-       private void addRoleInExternalSystem(Role role, EPApp app) throws Exception {
-               String addRoleNew = updateExistingRoleInExternalSystem(role, app);
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               try {
-                       HttpEntity<String> entity = new HttpEntity<>(addRoleNew, headers);
-                       template.exchange(
-                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role",
-                                       HttpMethod.POST, entity, String.class);
-               } catch(HttpClientErrorException e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to addRoleInExternalSystem", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleInExternalSystem: Role already exits but does not break functionality", e);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleInExternalSystem: Failed to addRoleInExternalSystem", e.getMessage());
-                       }
-               }
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public Integer bulkUploadRolesFunctions(String uebkey) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               List<EPRole> roles = getAppRoles(app.getId());
-               final Map<String, Long> params = new HashMap<>();
-               Integer roleFunctions = 0;
-               try {
-                       for (EPRole role : roles) {
-                               params.put("roleId", role.getId());
-                               List<BulkUploadRoleFunction> appRoleFunc = dataAccessService.executeNamedQuery("uploadAllRoleFunctions",
-                                               params, null);
-                               if (!appRoleFunc.isEmpty()) {
-                                       for (BulkUploadRoleFunction addRoleFunc : appRoleFunc) {
-                                               addRoleFunctionsInExternalSystem(addRoleFunc, role, app);
-                                               roleFunctions++;
-                                       }
-                               }
-                       }
-               } catch(HttpClientErrorException e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to bulkUploadRolesFunctions", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadRolesFunctions: failed", e);
-               }
-               return roleFunctions;
-       }
-       
-       /**
-        * Its adding a role function while doing bulk upload
-        * 
-        * @param addRoleFunc
-        * @param role
-        * @param app
-        */
-       private void addRoleFunctionsInExternalSystem(BulkUploadRoleFunction addRoleFunc, EPRole role, EPApp app) {
-               String checkType = addRoleFunc.getFunctionCd().contains("menu") ? "menu" : "url";
-               ExternalAccessRolePerms extRolePerms = null;
-               ExternalAccessPerms extPerms = null;
-               ObjectMapper mapper = new ObjectMapper();
-               try {
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-
-                       extPerms = new ExternalAccessPerms(app.getNameSpace() + "." + checkType, addRoleFunc.getFunctionCd(), "*",
-                                       addRoleFunc.getFunctionName());
-                       extRolePerms = new ExternalAccessRolePerms(extPerms,
-                                       app.getNameSpace() + "." + role.getName().replaceAll(" ", "_"));
-                       String updateRolePerms = mapper.writeValueAsString(extRolePerms);
-                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
-                       template.exchange(
-                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "role/perm",
-                                       HttpMethod.POST, entity, String.class);
-               } catch (Exception e) {
-                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "addRoleFunctionsInExternalSystem: RoleFunction already exits but does not break functionality", e);
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addRoleFunctionsInExternalSystem: Failed to addRoleFunctionsInExternalSystem",
-                                               e.getMessage());
-                       }
-               }
-       }
-
-       @Override
-       public void bulkUploadPartnerFunctions(String uebkey, List<RoleFunction> roleFunctionsList) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               CentralRoleFunction cenRoleFunc = null;
-               for (RoleFunction roleFunction : roleFunctionsList) {
-                       cenRoleFunc = new CentralRoleFunction(roleFunction.getCode(), roleFunction.getName());
-                       addRoleFunctionInExternalSystem(cenRoleFunc, app);
-               }
-       }
-
-       @Override
-       public void bulkUploadPartnerRoles(String uebkey, List<Role> roleList) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               for (Role role : roleList) {
-                       addRoleInExternalSystem(role, app);
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-               for (Role role : roleList) {
-                       try {
-                               Set<RoleFunction> roleFunctionList = role.getRoleFunctions();
-                               List<RoleFunction> roleFunctionListNew = new ArrayList<>();
-                               ObjectMapper roleFunctionsMapper = new ObjectMapper();
-                               Iterator<RoleFunction> itetaror = roleFunctionList.iterator();
-                               while (itetaror.hasNext()) {
-                                       Object nextValue = itetaror.next();
-                                       RoleFunction roleFunction = roleFunctionsMapper.convertValue(nextValue, RoleFunction.class);
-                                       roleFunctionListNew.add(roleFunction);
-                               }
-                               List<RoleFunction> listWithoutDuplicates = roleFunctionListNew.stream().distinct()
-                                               .collect(Collectors.toList());
-                               for (RoleFunction roleFunction : listWithoutDuplicates) {
-                                       String checkType = roleFunction.getCode().contains("menu") ? "menu" : "url";
-                                       ExternalAccessRolePerms extRolePerms = null;
-                                       ExternalAccessPerms extPerms = null;
-                                       ObjectMapper mapper = new ObjectMapper();
-                                       extPerms = new ExternalAccessPerms(app.getNameSpace() + "." + checkType, roleFunction.getCode(),
-                                                       "*");
-                                       extRolePerms = new ExternalAccessRolePerms(extPerms,
-                                                       app.getNameSpace() + "." + role.getName().replaceAll(" ", "_"));
-                                       String updateRolePerms = mapper.writeValueAsString(extRolePerms);
-                                       HttpEntity<String> entity = new HttpEntity<>(updateRolePerms, headers);
-                                       template.exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                       + "role/perm", HttpMethod.PUT, entity, String.class);
-                               }
-                       } catch (Exception e) {
-                               if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "bulkUploadPartnerRoleFunctions: RoleFunction already exits but does not break functionality");
-                               } else {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "bulkUploadPartnerRoleFunctions: Failed to addRoleFunctionsInExternalSystem",
-                                                       e.getMessage());
-                               }
-                       }
-
-               }
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public void syncApplicationRolesWithEcompDB(EPApp app) {
-               try {
-                       ResponseEntity<String> response = null;
-                       List<EPRole> finalRoleList = new ArrayList<>();
-                       ExternalRoleDescription ApplicationRole = new ExternalRoleDescription();
-                       ExternalAccessPerms externalAccessPerms = null;
-                       List<String> functionCodelist = new ArrayList<>();
-                       List<ExternalRoleDetails> externalRoleDetailsList = new ArrayList<>();
-                       ObjectMapper mapper = new ObjectMapper();
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       HttpEntity<String> entity = new HttpEntity<>(headers);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncApplicationRolesWithEcompDB: {} ",
-                                       CONNECTING_TO_EXTERNAL_AUTH_SYSTEM_LOG_MESSAGE);
-                       response = template
-                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                       + "roles/ns/" + app.getNameSpace(), HttpMethod.GET, entity, String.class);
-                       String res = response.getBody();
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "syncApplicationRolesWithEcompDB: Finished GET roles from External Auth system and the result is :",
-                                       res);
-                       JSONObject jsonObj = new JSONObject(res);
-                       JSONArray extRole = jsonObj.getJSONArray("role");
-                       for (int i = 0; i < extRole.length(); i++) {
-                               if (extRole.getJSONObject(i).getString(ROLE_NAME).equals(app.getNameSpace() + ADMIN)
-                                               || extRole.getJSONObject(i).getString(ROLE_NAME).equals(app.getNameSpace() + OWNER)
-                                               || (extRole.getJSONObject(i).getString(ROLE_NAME).equals(app.getNameSpace() + ACCOUNT_ADMINISTRATOR)
-                                                               && !app.getId().equals(PortalConstants.PORTAL_APP_ID))) {
-                                       extRole.remove(i);
-                                       i--;
-                               }                       
-                       }
-                       dataAccessService.deleteDomainObjects(EPAppRoleFunction.class, APP_ID_EQUALS + app.getId(), null);
-                       for (int i = 0; i < extRole.length(); i++) {
-                               ExternalRoleDetails externalRoleDetail = new ExternalRoleDetails();
-                               EPAppRoleFunction ePAppRoleFunction = new EPAppRoleFunction();
-                               JSONObject Role = (JSONObject) extRole.get(i);
-                               if (!extRole.getJSONObject(i).has(EXTERNAL_AUTH_ROLE_DESCRIPTION)) {
-                                       ApplicationRole.setActive("true");
-                                       ApplicationRole.setAppId(IS_NULL_STRING);
-                                       ApplicationRole.setPriority(IS_NULL_STRING);
-                                       ApplicationRole.setAppRoleId(IS_NULL_STRING);
-                                       String roleName = extRole.getJSONObject(i).getString(ROLE_NAME);
-                                       ApplicationRole.setName(roleName.substring(app.getNameSpace().length() + 1));
-                               } else {
-                                       String desc = extRole.getJSONObject(i).getString(EXTERNAL_AUTH_ROLE_DESCRIPTION);
-                                       ApplicationRole = mapper.readValue(desc, ExternalRoleDescription.class);
-                               }
-
-                               SortedSet<ExternalAccessPerms> externalAccessPermsOfRole = new TreeSet<>();
-                               if (extRole.getJSONObject(i).has(EXTERNAL_AUTH_PERMS)) {
-                                       JSONArray extPerm = (JSONArray) Role.get(EXTERNAL_AUTH_PERMS);
-                                       for (int j = 0; j < extPerm.length(); j++) {
-                                               JSONObject perms = extPerm.getJSONObject(j);
-                                               externalAccessPerms = new ExternalAccessPerms(perms.getString("type"),
-                                                               perms.getString("instance"), perms.getString("action"));
-                                               ePAppRoleFunction.setCode(externalAccessPerms.getInstance());
-                                               functionCodelist.add(ePAppRoleFunction.getCode());
-                                               externalAccessPermsOfRole.add(externalAccessPerms);
-                                       }
-                               }
-
-                               if (ApplicationRole.getActive().equals(IS_NULL_STRING)) {
-                                       externalRoleDetail.setActive(false);
-                               } else {
-                                       externalRoleDetail.setActive(Boolean.parseBoolean(ApplicationRole.getActive()));
-                               }
-                               externalRoleDetail.setName(ApplicationRole.getName());
-
-                               if (ApplicationRole.getAppId().equals(IS_NULL_STRING) && app.getId() == 1) {
-                                       externalRoleDetail.setAppId(null);
-                               } else if (ApplicationRole.getAppId().equals(IS_NULL_STRING)) {
-                                       externalRoleDetail.setAppId(app.getId());
-                               } else {
-                                       externalRoleDetail.setAppId(Long.parseLong(ApplicationRole.getAppId()));
-                               }
-
-                               if (ApplicationRole.getPriority().equals(IS_NULL_STRING)) {
-                                       externalRoleDetail.setPriority(null);
-                               } else {
-                                       externalRoleDetail.setPriority(Integer.parseInt(ApplicationRole.getPriority()));
-                               }
-
-                               if (ApplicationRole.getAppRoleId().equals(IS_NULL_STRING) && app.getId() == 1) {
-                                       externalRoleDetail.setAppRoleId(null);
-                               }
-
-                               if (!externalAccessPermsOfRole.isEmpty()) {
-                                       // Adding functions to roles  
-                                       for (ExternalAccessPerms externalpermission : externalAccessPermsOfRole) {
-                                               try {
-                                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                                       "SyncApplicationRolesWithEcompDB: Adding function to the role: {}",
-                                                                       externalpermission.getInstance());
-                                                       List<CentralRoleFunction> roleFunction = null;
-                                                       roleFunction = dataAccessService.getList(
-                                                                       CentralRoleFunction.class, " where function_cd = '"
-                                                                                       + externalpermission.getInstance() + "' and " + APP_ID_EQUALS + app.getId(),
-                                                                       null, null);
-                                                       if (roleFunction.isEmpty()) {
-                                                               String funcCode = externalpermission.getType()
-                                                                               .substring(app.getNameSpace().length() + 1) + FUNCTION_PIPE
-                                                                               + externalAccessPerms.getInstance();
-                                                               roleFunction = dataAccessService.getList(CentralRoleFunction.class,
-                                                                               " where function_cd = '" + funcCode + "' and " + APP_ID_EQUALS + app.getId(), null,
-                                                                               null);
-                                                       }
-                                                       if(!roleFunction.isEmpty()){
-                                                       EPAppRoleFunction apRoleFunction = new EPAppRoleFunction();
-                                                       apRoleFunction.setAppId(app.getId());
-                                                       apRoleFunction.setRoleId(Long.parseLong(ApplicationRole.getId()));
-                                                       apRoleFunction.setCode(roleFunction.get(0).getCode());
-                                                       dataAccessService.saveDomainObject(apRoleFunction, null);
-                                                       }
-                                               } catch (Exception e) {
-                                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                                       "SyncApplicationRolesWithEcompDB: Failed to add role function", e);
-                                               }
-                                       }
-                               }
-                               externalRoleDetailsList.add(externalRoleDetail);
-                       }
-                       for (ExternalRoleDetails externalRole : externalRoleDetailsList) {
-                               EPRole ecompRole = convertExternalRoleDetailstoEpRole(externalRole);
-                               finalRoleList.add(ecompRole);
-                       }
-
-                       List<EPRole> applicationRolesList = new ArrayList<>();
-                       applicationRolesList = getAppRoles(app.getId());
-                       List<String> applicationRoleIdList = new ArrayList<>();
-                       for (EPRole applicationRole : applicationRolesList) {
-                               applicationRoleIdList.add(applicationRole.getName());
-                       }
-
-                       List<EPRole> roleListToBeAddInEcompDB = new ArrayList<>();
-                       for (EPRole aafRole : finalRoleList) {
-                               if (!applicationRoleIdList.contains(aafRole.getName())) {
-                                       roleListToBeAddInEcompDB.add(aafRole);
-                               }
-                       }
-
-                       // Check if roles exits in external Access system and make it inactive
-                       final Map<String, EPRole> checkRolesInactive = new HashMap<>();
-                       for (EPRole extrole : finalRoleList) {
-                               checkRolesInactive.put(extrole.getName(), extrole);
-                       }
-                       for (EPRole role : applicationRolesList) {
-                               try {
-                                       final Map<String, String> extRoleParams = new HashMap<>();
-                                       List<EPRole> roleList = null;
-                                       extRoleParams.put("appRoleName", role.getName());
-                                       if (!checkRolesInactive.containsKey(role.getName())) {
-                                               if (app.getId() == 1) {
-                                                       roleList = dataAccessService.executeNamedQuery("getPortalAppRoles", extRoleParams, null);
-                                               } else {
-                                                       extRoleParams.put(APP_ID, app.getId().toString());
-                                                       roleList = dataAccessService.executeNamedQuery("getRoletoUpdateAAF", extRoleParams, null);
-                                               }
-                                               EPRole updateRoleInactive = roleList.get(0);
-                                               updateRoleInactive.setActive(false);
-                                               dataAccessService.saveDomainObject(updateRoleInactive, null);
-                                       }
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "syncApplicationRolesWithEcompDB: Failed to de-activate role ", e);
-                               }
-                       }
-
-                       // It checks properties in the external auth system app role description and updates role in local
-                       for (EPRole roleItem : finalRoleList) {
-                               final Map<String, String> roleParams = new HashMap<>();
-                               List<EPRole> currentList = null;
-                               roleParams.put("appRoleName", roleItem.getName());
-                               if (app.getId() == 1) {
-                                       currentList = dataAccessService.executeNamedQuery("getPortalAppRoles", roleParams, null);
-                               } else {
-                                       roleParams.put(APP_ID, app.getId().toString());
-                                       currentList = dataAccessService.executeNamedQuery("getRoletoUpdateAAF", roleParams, null);
-                               }
-
-                               if (!currentList.isEmpty()) {
-                                       try {
-                                               Boolean aafRoleActive;
-                                               Boolean localRoleActive;
-                                               boolean result;
-                                               aafRoleActive = Boolean.valueOf(roleItem.getActive());
-                                               localRoleActive = Boolean.valueOf(currentList.get(0).getActive());
-                                               result = aafRoleActive.equals(localRoleActive);
-                                               EPRole updateRole = currentList.get(0);
-
-                                               if (!result) {
-                                                       updateRole.setActive(roleItem.getActive());
-                                                       dataAccessService.saveDomainObject(updateRole, null);
-                                               }
-                                               if (roleItem.getPriority() != null
-                                                               && !currentList.get(0).getPriority().equals(roleItem.getPriority())) {
-                                                       updateRole.setPriority(roleItem.getPriority());
-                                                       dataAccessService.saveDomainObject(updateRole, null);
-                                               }
-                                       } catch (Exception e) {
-                                               logger.error(EELFLoggerDelegate.errorLogger,
-                                                               "syncApplicationRolesWithEcompDB: Failed to update role ", e);
-                                       }
-                               }
-                       }
-
-                       EPRole roleToBeAddedInEcompDB = new EPRole();
-                       for (int i = 0; i < roleListToBeAddInEcompDB.size(); i++) {
-                               try {
-                                       roleToBeAddedInEcompDB = roleListToBeAddInEcompDB.get(i);
-                                       if (app.getId() == 1) {
-                                               roleToBeAddedInEcompDB.setAppRoleId(null);
-                                       }
-                                       dataAccessService.saveDomainObject(roleToBeAddedInEcompDB, null);
-                                       List<EPRole> getRoleCreatedInSync = null;
-                                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                               getRoleCreatedInSync = dataAccessService.getList(EPRole.class,
-                                                               WHERE_ROLE_NAME_EQUALS + roleToBeAddedInEcompDB.getName() + "' and app_id = "+app.getId(), null, null);
-                                               EPRole epUpdateRole = getRoleCreatedInSync.get(0);
-                                               epUpdateRole.setAppRoleId(epUpdateRole.getId());
-                                               dataAccessService.saveDomainObject(epUpdateRole, null);
-                                       }
-                                       List<EPRole> roleList = new ArrayList<>();
-                                       final Map<String, String> params = new HashMap<>();
-
-                                       params.put("appRoleName", roleToBeAddedInEcompDB.getName());
-                                       if (app.getId() == 1) {
-                                               roleList = dataAccessService.executeNamedQuery("getPortalAppRoles", params, null);
-                                       } else {
-                                               params.put(APP_ID, app.getId().toString());
-                                               roleList = dataAccessService.executeNamedQuery("getRoletoUpdateAAF", params, null);
-                                       }
-                                       EPRole role = roleList.get(0);
-                                       Role aaFrole = new Role();
-                                       aaFrole.setId(role.getId());
-                                       aaFrole.setActive(role.getActive());
-                                       aaFrole.setPriority(role.getPriority());
-                                       aaFrole.setName(role.getName());
-                                       updateRoleInExternalSystem(aaFrole, app);
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "SyncApplicationRolesWithEcompDB: Failed to add or update role in external auth system", e);
-                               }
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncApplicationRolesWithEcompDB: Finished");
-               } catch (HttpClientErrorException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to SyncApplicationRolesWithEcompDB", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "syncApplicationRolesWithEcompDB: Failed ", e);
-               }
-       }
-
-       /**
-        * 
-        * It converts from ExternalRoleDetails.class object to EPRole.class object
-        * 
-        * @param externalRoleDetails
-        * @return EPRole object
-        */
-       private EPRole convertExternalRoleDetailstoEpRole(ExternalRoleDetails externalRoleDetails) {
-               EPRole role = new EPRole();
-               role.setActive(externalRoleDetails.isActive());
-               role.setAppId(externalRoleDetails.getAppId());
-               role.setAppRoleId(externalRoleDetails.getAppRoleId());
-               role.setName(externalRoleDetails.getName());
-               role.setPriority(externalRoleDetails.getPriority());
-               return role;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public Integer bulkUploadUserRoles(String uebkey) throws Exception {
-               EPApp app = getApp(uebkey).get(0);
-               final Map<String, String> params = new HashMap<>();
-               params.put("uebKey", app.getUebKey());
-               List<BulkUploadUserRoles> userRolesList = null;
-               Integer userRolesAdded = 0;
-               if (app.getCentralAuth()) {
-                       userRolesList = dataAccessService.executeNamedQuery("getBulkUserRoles", params, null);
-                       for (BulkUploadUserRoles userRolesUpload : userRolesList) {
-                               addUserRoleInExternalSystem(userRolesUpload);
-                               userRolesAdded++;
-                       }
-               }
-               return userRolesAdded;
-       }
-
-       /**
-        * Its adding a user role in external auth system while doing bulk upload 
-        * 
-        * @param userRolesUpload
-        */
-       private void addUserRoleInExternalSystem(BulkUploadUserRoles userRolesUpload) {
-               try {
-                       String name = "";
-                       ObjectMapper mapper = new ObjectMapper();
-                       if (EPCommonSystemProperties
-                                       .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
-                               name = userRolesUpload.getOrgUserId()
-                                               + SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
-                       }
-                       ExternalAccessUser extUser = new ExternalAccessUser(name,
-                                       userRolesUpload.getAppNameSpace() + "." + userRolesUpload.getRoleName().replaceAll(" ", "_"));
-                       String userRole = mapper.writeValueAsString(extUser);
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       HttpEntity<String> entity = new HttpEntity<>(userRole, headers);
-                       template.exchange(
-                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL) + "userRole",
-                                       HttpMethod.POST, entity, String.class);
-               } catch(HttpClientErrorException e){
-                       logger.error(EELFLoggerDelegate.errorLogger, "HttpClientErrorException - Failed to addUserRoleInExternalSystem", e);
-                       EPLogUtil.logExternalAuthAccessAlarm(logger, e.getStatusCode());
-               } catch (Exception e) {
-                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addUserRoleInExternalSystem: UserRole already exits but does not break functionality");
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger, "addUserRoleInExternalSystem: Failed to addUserRoleInExternalSystem", e.getMessage());
-                       }
-               }
-       }
-
-       @Override
-       public void deleteRoleDependencyRecords(Session localSession, Long roleId, Long appId) throws Exception {
-               try {
-                       String sql = "";
-                       Query query = null;
-                       
-                       //It should delete only when it portal's roleId
-                       if(appId.equals(PortalConstants.PORTAL_APP_ID)){
-                       // Delete from fn_role_function
-                       sql = "DELETE FROM fn_role_function WHERE role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       
-                       // Delete from fn_role_composite
-                       sql = "DELETE FROM fn_role_composite WHERE parent_role_id=" + roleId + " OR child_role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       }
-                       
-                       // Delete from ep_app_role_function
-                       sql = "DELETE FROM ep_app_role_function WHERE role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Delete from ep_role_notification
-                       sql = "DELETE FROM ep_role_notification WHERE role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       
-                       // Delete from fn_user_pseudo_role
-                       sql = "DELETE FROM fn_user_pseudo_role WHERE pseudo_role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Delete form EP_WIDGET_CATALOG_ROLE
-                       sql = "DELETE FROM EP_WIDGET_CATALOG_ROLE WHERE role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Delete form EP_WIDGET_CATALOG_ROLE
-                       sql = "DELETE FROM ep_user_roles_request_det WHERE requested_role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-                       // Delete form fn_menu_functional_roles
-                       sql = "DELETE FROM fn_menu_functional_roles WHERE role_id=" + roleId;
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-
-               } catch (Exception e) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteRoleDependeciesRecord: failed ", e);
-                       throw new Exception("delete Failed" + e.getMessage());
-               }
-
-       }
-       
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<String> getMenuFunctionsList(String uebkey) throws Exception {
-               List<String> appMenuFunctionsList = null;
-               try {
-                       EPApp app = getApp(uebkey).get(0);
-                       final Map<String, Long> appParams = new HashMap<>();
-                       appParams.put(APP_ID, app.getId());
-                       appMenuFunctionsList = dataAccessService.executeNamedQuery("getMenuFunctions", appParams, null);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMenuFunctionsList: Failed", e);
-                       return appMenuFunctionsList;
-               }
-               return appMenuFunctionsList;
-       }
-
-       @SuppressWarnings({ "unchecked"})
-       @Override
-       public List<EcompUser> getAllAppUsers(String uebkey) throws Exception {
-               List<String> usersList = new ArrayList<>();
-               List<EcompUser> usersfinalList = new ArrayList<>();
-               try {
-                       EPApp app = getApp(uebkey).get(0);
-                       final Map<String, Long> appParams = new HashMap<>();
-                       appParams.put("appId", app.getId());
-                       List<EcompUserRoles> userList = (List<EcompUserRoles>) dataAccessService
-                                       .executeNamedQuery("ApplicationUserRoles", appParams, null);
-                       for (EcompUserRoles ecompUserRole : userList) {
-                               boolean found = false;
-                               Set<EcompRole> roles = null;
-                               for (EcompUser user : usersfinalList) {
-                                       if (user.getOrgUserId().equals(ecompUserRole.getOrgUserId())) {
-                                               EcompRole ecompRole = new EcompRole();
-                                               ecompRole.setId(ecompUserRole.getRoleId());
-                                               ecompRole.setName(ecompUserRole.getRoleName());
-                                               roles = user.getRoles();
-                                               roles.add(ecompRole);
-                                               user.setRoles(roles);
-                                               found = true;
-                                               break;
-                                       }
-                               }
-
-                               if (!found) {
-                                       EcompUser epUser = new EcompUser();
-                                       epUser.setOrgId(ecompUserRole.getOrgId());
-                                       epUser.setManagerId(ecompUserRole.getManagerId());
-                                       epUser.setFirstName(ecompUserRole.getFirstName());
-                                       epUser.setLastName(ecompUserRole.getLastName());
-                                       epUser.setPhone(ecompUserRole.getPhone());
-                                       epUser.setEmail(ecompUserRole.getEmail());
-                                       epUser.setOrgUserId(ecompUserRole.getOrgUserId());
-                                       epUser.setOrgCode(ecompUserRole.getOrgCode());
-                                       epUser.setOrgManagerUserId(ecompUserRole.getOrgManagerUserId());
-                                       epUser.setJobTitle(ecompUserRole.getJobTitle());
-                                       epUser.setLoginId(ecompUserRole.getLoginId());
-                                       epUser.setActive(true);
-                                       roles = new HashSet<>();
-                                       EcompRole ecompRole = new EcompRole();
-                                       ecompRole.setId(ecompUserRole.getRoleId());
-                                       ecompRole.setName(ecompUserRole.getRoleName());
-                                       roles.add(ecompRole);
-                                       epUser.setRoles(roles);
-                                       usersfinalList.add(epUser);
-                               }
-                       }
-                       ObjectMapper mapper = new ObjectMapper();
-
-                       for (EcompUser u1 : usersfinalList) {
-                               String str = mapper.writeValueAsString(u1);
-                               usersList.add(str);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getAllUsers failed", e);
-                       throw e;
-               }
-               return usersfinalList;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuService.java
deleted file mode 100644 (file)
index af049ff..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItemWithRoles;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-
-public interface FunctionalMenuService {
-       List<FunctionalMenuItem> getFunctionalMenuItems (EPUser user);
-       // return all active menu items
-       List<FunctionalMenuItem> getFunctionalMenuItems ();
-       // return all active menu items. If all is true, return all active and inactive menu items.
-       List<FunctionalMenuItem> getFunctionalMenuItems(Boolean all);
-       // return all active Functional menu items for Notification Tree in User Notification . If all is true, return all active menu items.
-       List<FunctionalMenuItem> getFunctionalMenuItemsForNotificationTree(Boolean all);
-       List<FunctionalMenuItem> getFunctionalMenuItemsForApp (Integer appId);
-       List<FunctionalMenuItem> getFunctionalMenuItemsForUser (String orgUserId);
-       FunctionalMenuItem getFunctionalMenuItemDetails (Integer menuid);
-       FieldsValidator createFunctionalMenuItem (FunctionalMenuItemWithRoles menuItemJson);
-       FieldsValidator editFunctionalMenuItem (FunctionalMenuItemWithRoles menuItemJson);
-       FieldsValidator deleteFunctionalMenuItem (Long menuId);
-       FieldsValidator regenerateAncestorTable ();
-       //Methods relevant to favorites
-       FieldsValidator setFavoriteItem(FavoritesFunctionalMenuItem menuItemJson);
-       List<FavoritesFunctionalMenuItemJson> getFavoriteItems(Long userId);
-       FieldsValidator removeFavoriteItem (Long userId, Long menuId);
-       List<FunctionalMenuItem> transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(List<FunctionalMenuItemWithAppID> functionalMenuItemWithAppIDList);
-       List<FunctionalMenuRole> getFunctionalMenuRole();
-       //Assign URLs under Help Menu
-       void assignHelpURLs(List<FunctionalMenuItem> menuItems);
-       List<BusinessCardApplicationRole> getUserAppRolesList(String userId);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/FunctionalMenuServiceImpl.java
deleted file mode 100644 (file)
index 26f1431..0000000
+++ /dev/null
@@ -1,1000 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang3.StringUtils;
-import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.criterion.Projections;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItemWithRoles;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("functionalMenuService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class FunctionalMenuServiceImpl implements FunctionalMenuService {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuServiceImpl.class);
-
-       private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
-       private String RESTRICTED_APP_ROLE_ID = "900";
-
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       private SessionFactory sessionFactory;
-
-       @PostConstruct
-       private void init() {
-               try {
-                       ACCOUNT_ADMIN_ROLE_ID = Long
-                                       .valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
-                       RESTRICTED_APP_ROLE_ID = SystemProperties.getProperty(EPCommonSystemProperties.RESTRICTED_APP_ROLE_ID);
-               } catch (Exception e) {
-               }
-       }
-
-       public List<FunctionalMenuItem> getFunctionalMenuItems(EPUser user) {
-               List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
-               return menuItems;
-       }
-
-       public List<FunctionalMenuItem> getFunctionalMenuItems() {
-               return getFunctionalMenuItems(false);
-       }
-
-       public List<FunctionalMenuItem> getFunctionalMenuItems(Boolean all) {
-               // Divide this into 2 queries: one which returns the bottom-level menu items
-               // associated with Restricted apps,
-               // and one that returns all the other menu items. Then we can easily add the
-               // boolean flag
-               // restrictedApp to each FunctionalMenuItem, to be used by the front end.
-               String activeWhereClause = "";
-               if (!all) {
-                       activeWhereClause = " AND UPPER(m.active_yn) = 'Y' ";
-               }
-               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
-                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
-                               + activeWhereClause // " AND UPPER(m.active_yn) = 'Y' "
-                               + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID + "' " + " UNION "
-                               + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
-                               + " FROM fn_menu_functional m " + " WHERE m.url='' " + activeWhereClause; // " AND UPPER(m.active_yn) =
-                                                                                                                                                                                       // 'Y' ";
-               logQuery(sql);
-
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,
-                               FunctionalMenuItemWithAppID.class, null);
-               List<FunctionalMenuItem> menuItems = new ArrayList<>();
-               menuItems = transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(menuItemsWithAppIdList);
-               for (FunctionalMenuItem menuItem : menuItems) {
-                       menuItem.restrictedApp = false;
-               }
-
-               sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
-                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
-                               + activeWhereClause // " AND UPPER(m.active_yn) = 'Y' "
-                               + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-               for (FunctionalMenuItem menuItem : menuItems2) {
-                       menuItem.restrictedApp = true;
-                       menuItems.add(menuItem);
-               }
-
-               return menuItems;
-       }
-
-       public List<FunctionalMenuItem> getFunctionalMenuItemsForNotificationTree(Boolean all) {
-               // Divide this into 2 queries: one which returns the bottom-level menu items
-               // associated with Restricted apps,
-               // and one that returns all the other menu items which are active. Then we can
-               // easily add the boolean flag
-               // restrictedApp to each FunctionalMenuItem, to be used by the front end.
-               String activeWhereClause = "";
-               if (!all) {
-                       activeWhereClause = " AND UPPER(m.active_yn) = 'Y' ";
-               }
-               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
-                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
-                               + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id != '" + RESTRICTED_APP_ROLE_ID
-                               + "' " + " UNION "
-                               + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id "
-                               + " FROM fn_menu_functional m " + " WHERE m.url='' " + activeWhereClause
-                               + " AND UPPER(m.active_yn) = 'Y' ";
-               logQuery(sql);
-
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItemWithAppID> menuItemsWithAppIdList = dataAccessService.executeSQLQuery(sql,
-                               FunctionalMenuItemWithAppID.class, null);
-               List<FunctionalMenuItem> menuItems = new ArrayList<>();
-               menuItems = transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(menuItemsWithAppIdList);
-               for (FunctionalMenuItem menuItem : menuItems) {
-                       menuItem.restrictedApp = false;
-               }
-
-               sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id "
-                               + "FROM fn_menu_functional m, fn_menu_functional_roles r " + "WHERE m.menu_id = r.menu_id "
-                               + activeWhereClause + " AND UPPER(m.active_yn) = 'Y' " + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID
-                               + "' ";
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-               for (FunctionalMenuItem menuItem : menuItems2) {
-                       menuItem.restrictedApp = true;
-                       menuItems.add(menuItem);
-               }
-
-               return menuItems;
-       }
-
-       public List<FunctionalMenuItem> getFunctionalMenuItemsForApp(Integer appId) {
-               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
-                               + " FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr "
-                               + " WHERE " + " mr.app_id='" + appId + "' " + " AND mr.menu_id = m.menu_id "
-                               + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y'" + " AND a.menu_id = m.menu_id "
-                               + " AND a.ancestor_menu_id = m1.menu_id";
-               logQuery(sql);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuItemsForApp: logged the query");
-
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-
-               return menuItems;
-       }
-
-       /**
-        * convert List of FunctionalMenuItemWithAppID into List of FunctionalMenuItem
-        * 
-        */
-       public List<FunctionalMenuItem> transformFunctionalMenuItemWithAppIDToFunctionalMenuItem(
-                       List<FunctionalMenuItemWithAppID> functionalMenuItemWithAppIDList) {
-               List<FunctionalMenuItem> functionalMenuItemList = new ArrayList<FunctionalMenuItem>();
-               for (FunctionalMenuItemWithAppID functionalMenuItemWithAppID : functionalMenuItemWithAppIDList) {
-                       FunctionalMenuItem menuItem = new FunctionalMenuItem();
-                       menuItem.menuId = functionalMenuItemWithAppID.menuId;
-                       menuItem.column = functionalMenuItemWithAppID.column;
-                       menuItem.text = functionalMenuItemWithAppID.text;
-                       menuItem.parentMenuId = functionalMenuItemWithAppID.parentMenuId;
-                       menuItem.url = functionalMenuItemWithAppID.url;
-                       menuItem.active_yn = functionalMenuItemWithAppID.active_yn;
-                       menuItem.appid = functionalMenuItemWithAppID.appid;
-                       menuItem.setRoles(functionalMenuItemWithAppID.roles);
-                       menuItem.restrictedApp = functionalMenuItemWithAppID.restrictedApp;
-                       functionalMenuItemList.add(menuItem);
-               }
-               return functionalMenuItemList;
-       }
-
-       public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(String orgUserId) {
-               // m represents the functional menu items that are the leaf nodes
-               // m1 represents the functional menu items for all the nodes
-
-               // Divide this into 2 queries: one which returns the bottom-level menu items
-               // associated with Restricted apps,
-               // and one that returns all the other menu items. Then we can easily add the
-               // boolean flag
-               // restrictedApp to each FunctionalMenuItem, to be used by the front end.
-               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn "
-                               + " FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, "
-                               + " fn_menu_functional_roles mr, fn_user u , fn_user_role ur " + " WHERE " + " u.org_user_id='"
-                               + orgUserId + "' " + " AND u.user_id = ur.user_id " + " AND ur.app_id = mr.app_id " +
-                               // " AND ur.role_id = mr.role_id " +
-                               " AND (ur.role_id = mr.role_id " + "     OR ur.role_id = '" + ACCOUNT_ADMIN_ROLE_ID + "') "
-                               + " AND m.menu_id = mr.menu_id " + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y' "
-                               + " AND a.menu_id = m.menu_id " + " AND a.ancestor_menu_id = m1.menu_id " + " UNION "
-                               // the ancestors of the restricted app menu items
-                               + " select m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m1.active_yn "
-                               + " FROM fn_menu_functional m, fn_menu_functional_roles mr, fn_menu_functional m1, "
-                               + " fn_menu_functional_ancestors a " + " where a.menu_id = m.menu_id "
-                               + " AND a.ancestor_menu_id = m1.menu_id " + " AND m.menu_id != m1.menu_id "
-                               + " AND m.menu_id = mr.menu_id " + " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' "
-                               + " AND UPPER(m.active_yn) = 'Y'" + " AND UPPER(m1.active_yn) ='Y' "
-                               // Add the Favorites menu item
-                               + " UNION " + " SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn "
-                               + " FROM fn_menu_functional m "
-                               + " WHERE m.text in ('Favorites','Get Access','Contact Us','Support','User Guide','Help')";
-
-               logQuery(sql);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuItemsForUser: logged the query");
-
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-               for (FunctionalMenuItem menuItem : menuItems) {
-                       menuItem.restrictedApp = false;
-               }
-
-               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 UPPER(m.active_yn) = 'Y' " + " AND r.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems2 = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-               for (FunctionalMenuItem menuItem : menuItems2) {
-                       menuItem.restrictedApp = true;
-                       menuItems.add(menuItem);
-               }
-
-               return menuItems;
-       }
-
-       public FunctionalMenuItem getFunctionalMenuItemDetails(Integer menuid) {
-               // First, fill in the fields that apply to all menu items
-
-               String sql = "SELECT * FROM fn_menu_functional WHERE menu_id = '" + menuid + "'";
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuItem> menuItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuItem.class, null);
-               FunctionalMenuItem menuItem = (menuItems == null || menuItems.isEmpty() ? null : menuItems.get(0));
-               // If it is a bottom-level menu item, must fill in the appid and the
-               // roles
-               sql = "SELECT * FROM fn_menu_functional_roles WHERE menu_id = '" + menuid + "'";
-               logQuery(sql);
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuRole> roleItems = dataAccessService.executeSQLQuery(sql, FunctionalMenuRole.class, null);
-               if (roleItems.size() > 0 && menuItem != null) {
-                       Integer appid = roleItems.get(0).appId;
-                       menuItem.appid = appid;
-                       List<Integer> roles = new ArrayList<Integer>();
-                       for (FunctionalMenuRole roleItem : roleItems) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "LR: app_id: " + roleItem.appId + "; role_id: " + roleItem.roleId + "\n");
-                               roles.add(roleItem.roleId);
-                       }
-                       menuItem.setRoles(roles);
-               }
-
-               return menuItem;
-       }
-
-       private FieldsValidator menuItemFieldsChecker(FunctionalMenuItemWithRoles menuItemJson) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               try {
-                       // TODO: validate all the fields
-                       @SuppressWarnings("unchecked")
-                       List<FunctionalMenuItem> functionalMenuItems = dataAccessService.getList(FunctionalMenuItem.class,
-                                       " where text = '" + menuItemJson.text + "'", null, null);
-
-                       boolean dublicatedName = false;
-                       for (FunctionalMenuItem fnMenuItem : functionalMenuItems) {
-                               if (menuItemJson.menuId != null && menuItemJson.menuId.equals(fnMenuItem.menuId)) {
-                                       // FunctionalMenuItem should not be compared with itself
-                                       continue;
-                               }
-
-                               if (!dublicatedName && fnMenuItem.text.equalsIgnoreCase(menuItemJson.text)) {
-                                       dublicatedName = true;
-                                       break;
-                               }
-                       }
-                       if (dublicatedName) {
-                               fieldsValidator.addProblematicFieldName("text");
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
-                               fieldsValidator.errorCode = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "In menuItemFieldsChecker, Error: we have an duplicate text field");
-                       } else if (StringUtils.isEmpty(menuItemJson.text) && menuItemJson.menuId == null) {
-                               // text must be non empty for a create. For an edit, can be empty, which means
-                               // it is a move request.
-                               // a null menuId indicates a create.
-                               fieldsValidator.addProblematicFieldName("text");
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "In menuItemFieldsChecker, Error: we have an empty text field");
-                       } else {
-                               // The url, appid, and roles must either be all filled or all empty.
-                               Boolean urlIsEmpty = StringUtils.isEmpty(menuItemJson.url);
-                               Boolean rolesIsEmpty = menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty();
-                               Boolean appidIsEmpty = menuItemJson.appid == null || menuItemJson.appid == 0;
-                               logger.debug(EELFLoggerDelegate.debugLogger, "LR: menuItemfieldsChecker: urlIsEmpty: " + urlIsEmpty
-                                               + "; rolesIsEmpty: " + rolesIsEmpty + "; appidIsEmpty: " + appidIsEmpty + "\n");
-                               if (!((urlIsEmpty && rolesIsEmpty && appidIsEmpty)
-                                               || (!urlIsEmpty && !rolesIsEmpty && !appidIsEmpty))) {
-                                       fieldsValidator.addProblematicFieldName("url,roles,appid");
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "In menuItemFieldsChecker, Error: we don't have: either all 3 fields empty or all 3 fields nonempty");
-                               } else {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "In menuItemFieldsChecker, Success: either all 3 fields empty or all 3 fields nonempty");
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "menuItemFieldsChecker failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-
-               return fieldsValidator;
-       }
-
-       // Turn foreign key checks on or off
-       protected void setForeignKeys(Session localSession, Boolean on) {
-               String keyCheck = "0";
-               if (on) {
-                       keyCheck = "1";
-               }
-               String sql = "set FOREIGN_KEY_CHECKS=" + keyCheck;
-               logQuery(sql);
-               Query query = localSession.createSQLQuery(sql);
-               query.executeUpdate();
-       }
-
-       public FieldsValidator createFunctionalMenuItem(FunctionalMenuItemWithRoles menuItemJson) {
-               FieldsValidator fieldsValidator = menuItemFieldsChecker(menuItemJson);
-               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "LR: createFunctionalMenuItem: test 1");
-                       boolean result = false;
-                       Session localSession = null;
-                       Transaction transaction = null;
-                       try {
-                               FunctionalMenuItem menuItem = new FunctionalMenuItem();
-                               menuItem.appid = menuItemJson.appid;
-                               menuItem.setRoles(menuItemJson.getRoles());
-                               menuItem.url = menuItemJson.url;
-                               menuItem.text = menuItemJson.text;
-                               menuItem.parentMenuId = menuItemJson.parentMenuId;
-                               menuItem.active_yn = "Y";
-                               localSession = sessionFactory.openSession();
-
-                               // If the app is disabled, deactivate the menu item.
-                               if (menuItemJson.appid != null) {
-                                       Long appidLong = Long.valueOf(menuItemJson.appid);
-                                       EPApp app = (EPApp) localSession.get(EPApp.class, appidLong);
-                                       if (app != null && !app.getEnabled()) {
-                                               menuItem.active_yn = "N";
-                                       }
-                               }
-
-                               // Set the column number to 1 higher than the highest column
-                               // number under this parent.
-                               Criteria criteria = localSession.createCriteria(FunctionalMenuItem.class);
-                               criteria.setProjection(Projections.max("column"));
-                               criteria.add(Restrictions.eq("parentMenuId", menuItem.parentMenuId));
-                               Integer maxColumn = (Integer) criteria.uniqueResult();
-                               if (maxColumn == null) {
-                                       maxColumn = 0;
-                               }
-                               menuItem.column = maxColumn + 1;
-                               logger.debug(EELFLoggerDelegate.debugLogger, "about to create menu item: " + menuItem.toString());
-
-                               transaction = localSession.beginTransaction();
-                               // localSession.saveOrUpdate(newMenuItem);
-                               localSession.save(menuItem);
-                               Long menuid = menuItem.menuId;
-                               menuItemJson.menuId = menuid;
-                               logger.debug(EELFLoggerDelegate.debugLogger, "after saving menu object, new id: " + menuid);
-
-                               // Next, save all the roles
-
-                               addRoles(menuItemJson, localSession);
-                               transaction.commit();
-                               result = true;
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "createFunctionalMenuItem failed", e);
-                               EcompPortalUtils.rollbackTransaction(transaction,
-                                               "createFunctionalMenuItem rollback, exception = " + e.toString());
-                       } finally {
-                               EcompPortalUtils.closeLocalSession(localSession, "createFunctionalMenuItem");
-                       }
-                       if (result) {
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
-                                                               + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "FunctionalMenuServiceImpl.createFunctionalMenuItem: bad request");
-               }
-               return fieldsValidator;
-       }
-
-       /* Add all the roles in the menu item to the database */
-       public void addRoles(FunctionalMenuItemWithRoles menuItemJson, Session localSession) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "entering addRoles.");
-               List<Integer> roles = menuItemJson.getRoles();
-               if (roles != null && roles.size() > 0) {
-                       Integer appid = menuItemJson.appid;
-                       Long menuid = menuItemJson.menuId;
-                       for (Integer roleid : roles) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "about to create record for role: " + roleid);
-                               FunctionalMenuRole role = new FunctionalMenuRole();
-                               role.appId = appid;
-                               role.menuId = menuid;
-                               role.roleId = roleid;
-                               localSession.save(role);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "after saving role menu object, new id: " + role.id);
-                       }
-               }
-       }
-
-       /* Delete all the roles associated with the menu item from the database */
-       public void deleteRoles(Long menuId) {
-               dataAccessService.deleteDomainObjects(FunctionalMenuRole.class, "menu_id='" + menuId + "'", null);
-       }
-
-       /* Delete all favorites associated with the menu item from the database */
-       public void deleteFavorites(Long menuId) {
-               dataAccessService.deleteDomainObjects(FavoritesFunctionalMenuItem.class, "menu_id='" + menuId + "'", null);
-       }
-
-       private Boolean parentMenuIdEqual(Integer menuId1, Integer menuId2) {
-               return ((menuId1 == null && menuId2 == null) || (menuId1 != null && menuId1.equals(menuId2)));
-       }
-
-       private void updateColumnForSiblings(Session localSession, Long menuId, Integer oldParentMenuId,
-                       Integer newParentMenuId, Integer oldColumn, Integer newColumn) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "entering updateColumnForSiblings");
-               Criteria criteria = localSession.createCriteria(FunctionalMenuItem.class);
-               criteria.add(Restrictions.ne("menuId", menuId));
-               if (parentMenuIdEqual(oldParentMenuId, newParentMenuId)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under the same parent");
-                       // We are moving to a new position under the same parent
-                       if (newParentMenuId == null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is null, so using isNull");
-                               criteria.add(Restrictions.isNull("parentMenuId"));
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is NOT null, so using eq");
-                               criteria.add(Restrictions.eq("parentMenuId", newParentMenuId));
-                       }
-                       if (oldColumn > newColumn) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "moving to a lower column under the same parent");
-                               // We are moving to a lower column under the same parent
-                               criteria.add(Restrictions.ge("column", newColumn));
-                               criteria.add(Restrictions.lt("column", oldColumn));
-                               @SuppressWarnings("unchecked")
-                               List<FunctionalMenuItem> menuItems = criteria.list();
-                               for (FunctionalMenuItem menuItem : menuItems) {
-                                       menuItem.column += 1;
-                                       localSession.save(menuItem);
-                               }
-                       } else if (oldColumn < newColumn) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "moving to a higher column under the same parent");
-                               // We are moving to a higher column under the same parent
-                               criteria.add(Restrictions.gt("column", oldColumn));
-                               criteria.add(Restrictions.le("column", newColumn));
-                               @SuppressWarnings("unchecked")
-                               List<FunctionalMenuItem> menuItems = criteria.list();
-                               for (FunctionalMenuItem menuItem : menuItems) {
-                                       menuItem.column -= 1;
-                                       localSession.save(menuItem);
-                               }
-                       } else {
-                               // No info has changed
-                               logger.debug(EELFLoggerDelegate.debugLogger, "no info has changed, so we are not moving");
-                       }
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under a new parent");
-                       // We are moving under a new parent.
-
-                       // Adjust the children under the old parent
-                       logger.debug(EELFLoggerDelegate.debugLogger, "about to adjust the children under the old parent");
-
-                       // If the parentId is null, must check for its children differently
-                       if (oldParentMenuId == null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "oldParentMenuId is null, so using isNull");
-                               criteria.add(Restrictions.isNull("parentMenuId"));
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "oldParentMenuId is NOT null, so using eq");
-                               criteria.add(Restrictions.eq("parentMenuId", oldParentMenuId));
-                       }
-
-                       criteria.add(Restrictions.gt("column", oldColumn));
-                       @SuppressWarnings("unchecked")
-                       List<FunctionalMenuItem> menuItems1 = criteria.list();
-                       for (FunctionalMenuItem menuItem : menuItems1) {
-                               menuItem.column -= 1;
-                               localSession.save(menuItem);
-                       }
-                       // Adjust the children under the new parent.
-                       logger.debug(EELFLoggerDelegate.debugLogger, "about to adjust the children under the new parent");
-                       logger.debug(EELFLoggerDelegate.debugLogger, "get all menu items where menuId!=" + menuId
-                                       + "; parentMenuId==" + newParentMenuId + "; column>=" + newColumn);
-                       criteria = localSession.createCriteria(FunctionalMenuItem.class);
-                       criteria.add(Restrictions.ne("menuId", menuId));
-                       if (newParentMenuId == null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is null, so using isNull");
-                               criteria.add(Restrictions.isNull("parentMenuId"));
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "newParentMenuId is NOT null, so using eq");
-                               criteria.add(Restrictions.eq("parentMenuId", newParentMenuId));
-                       }
-
-                       criteria.add(Restrictions.ge("column", newColumn));
-                       @SuppressWarnings("unchecked")
-                       List<FunctionalMenuItem> menuItems2 = criteria.list();
-                       if (menuItems2 != null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "found " + menuItems2.size() + " menu items");
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "found null menu items");
-                       }
-                       for (FunctionalMenuItem menuItem : menuItems2) {
-                               menuItem.column += 1;
-                               localSession.save(menuItem);
-                       }
-               }
-               logger.debug(EELFLoggerDelegate.debugLogger, "done with updateColumnForSiblings");
-       }
-
-       public void removeAppInfo(Session localSession, Long menuId) {
-               // Remove the url, role, and app info from a menu item
-               FunctionalMenuItem menuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class, menuId);
-               menuItem.url = "";
-               deleteRoles(menuId);
-       }
-
-       public FieldsValidator editFunctionalMenuItem(FunctionalMenuItemWithRoles menuItemJson) {
-               boolean result = false;
-               Session localSession = null;
-               Transaction transaction = null;
-               Long menuId = menuItemJson.menuId;
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "LR: editFunctionalMenuItem: test 1");
-               FieldsValidator fieldsValidator = menuItemFieldsChecker(menuItemJson);
-               if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                       // TODO: make sure menuId is here. And, it might not already exist
-                       // in db table.
-                       if (menuId == null) {
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "FunctionalMenuServiceImpl.editFunctionalMenuItem: bad request");
-                       } else {
-                               // To simplify the code, assume we will have a transaction
-                               try {
-                                       localSession = sessionFactory.openSession();
-                                       transaction = localSession.beginTransaction();
-
-                                       // Get the existing info associated with menuItem from the DB
-                                       FunctionalMenuItem menuItem = (FunctionalMenuItem) localSession.get(FunctionalMenuItem.class,
-                                                       menuId);
-                                       Integer oldColumn = menuItem.column;
-                                       Integer oldParentMenuId = menuItem.parentMenuId;
-                                       Integer newColumn = menuItemJson.column;
-                                       Integer newParentMenuId = menuItemJson.parentMenuId;
-
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "prev info: column: " + oldColumn + "; parentMenuId: " + oldParentMenuId);
-
-                                       if (menuItemJson.appid != null && menuItemJson.getRoles() != null
-                                                       && !menuItemJson.getRoles().isEmpty() && menuItemJson.url != null
-                                                       && !menuItemJson.url.isEmpty() && menuItemJson.text != null
-                                                       && !menuItemJson.text.isEmpty()) {
-                                               // Scenario: appid, roles, url and text are all non-null.
-                                               // This menu item is associated with an app.
-                                               // (Note: this should only occur for a bottom-level menu
-                                               // item with no children.)
-                                               // 1) Remove all the records from fn_menu_functional_role
-                                               // for this menuId.
-                                               // 2) Add records to the fn_menu_function_role table for the
-                                               // appId and each roleId
-                                               // 3) Update the url and text for this menu item.
-
-                                               // Because of foreign key constraints, delete the roles,
-                                               // then update the menuItem then add the roles.
-                                               deleteRoles(menuId);
-                                               // Assumption: this is not a Move, so don't change the
-                                               // parentMenuId and column.
-                                               menuItem.appid = menuItemJson.appid;
-                                               menuItem.setRoles(menuItemJson.getRoles());
-                                               menuItem.url = menuItemJson.url;
-                                               menuItem.text = menuItemJson.text;
-
-                                               // If the app is disabled, deactivate the menu item.
-                                               Long appidLong = Long.valueOf(menuItemJson.appid);
-                                               EPApp app = (EPApp) localSession.get(EPApp.class, appidLong);
-                                               if (app != null && !app.getEnabled()) {
-                                                       menuItem.active_yn = "N";
-                                               } else {
-                                                       menuItem.active_yn = "Y";
-                                               }
-
-                                               localSession.update(menuItem);
-                                               addRoles(menuItemJson, localSession);
-
-                                       } else if (menuItemJson.appid == null
-                                                       && (menuItemJson.getRoles() == null || menuItemJson.getRoles().isEmpty())
-                                                       && (menuItemJson.url == null || menuItemJson.url.isEmpty()) && menuItemJson.text != null
-                                                       && !menuItemJson.text.isEmpty()) {
-                                               // Scenario: appid, roles and url are all null; text is
-                                               // non-null.
-                                               // This menu item is NOT associated with an app.
-                                               // 1) Remove all the records from fn_menu_functional_role
-                                               // for this menuId
-                                               // (in case it was previously associated with an app).
-                                               // 2) Update the text for this menu item.
-                                               // 3) Set the url to ""
-                                               deleteRoles(menuId);
-                                               // Assumption: this is not a Move, so don't change the
-                                               // parentMenuId and column.
-                                               menuItem.text = menuItemJson.text;
-                                               menuItem.url = "";
-                                               menuItem.active_yn = "Y";
-                                               localSession.update(menuItem);
-
-                                       } else if (newColumn != null) {
-                                               // This is a "move" request.
-                                               // Menu item has been moved to a different position under
-                                               // the same parent, or under a new parent.
-                                               logger.debug(EELFLoggerDelegate.debugLogger, "Doing a move operation.");
-                                               if (parentMenuIdEqual(oldParentMenuId, newParentMenuId)) {
-                                                       // The parent is the same. We have just changed the
-                                                       // column
-                                                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under the same parent");
-                                                       menuItem.column = newColumn;
-                                                       localSession.update(menuItem);
-                                               } else {
-                                                       logger.debug(EELFLoggerDelegate.debugLogger, "moving under a different parent");
-                                                       menuItem.parentMenuId = newParentMenuId;
-                                                       menuItem.column = newColumn;
-                                                       localSession.update(menuItem);
-                                                       // If we are moving under a new parent, must delete any
-                                                       // app/role info from
-                                                       // the new parent, since it is no longer a leaf menu
-                                                       // item and cannot have app info
-                                                       // associated with it. The front end will have warned
-                                                       // the user and gotten confirmation.
-                                                       if (menuItemJson.parentMenuId != null) {
-                                                               Long parentMenuIdLong = new Long(menuItemJson.parentMenuId);
-                                                               removeAppInfo(localSession, parentMenuIdLong);
-                                                               // deleteRoles(parentMenuIdLong);
-                                                       }
-                                               }
-                                               // must update the column for all old and new sibling menu
-                                               // items
-                                               updateColumnForSiblings(localSession, menuId, oldParentMenuId, newParentMenuId, oldColumn,
-                                                               newColumn);
-                                       }
-
-                                       transaction.commit();
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "LR: editFunctionalMenuItem: finished committing transaction");
-                                       result = true;
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "editFunctionalMenuItem failed", e);
-                                       EcompPortalUtils.rollbackTransaction(transaction,
-                                                       "createFunctionalMenuItem rollback, exception = " + e.toString());
-                               } finally {
-                                       EcompPortalUtils.closeLocalSession(localSession, "editFunctionalMenuItem");
-                               }
-
-                               if (result) {
-                               } else {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "LR: createFunctionalMenuItem: no result. setting httpStatusCode to "
-                                                                       + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               }
-                       }
-               }
-
-               return fieldsValidator;
-       }
-
-       public FieldsValidator deleteFunctionalMenuItem(Long menuId) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               logger.debug(EELFLoggerDelegate.debugLogger, "LR: deleteFunctionalMenuItem: test 1");
-               boolean result = false;
-               Session localSession = null;
-               Transaction transaction = null;
-
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       // We must turn off foreign keys before deleting a menu item. Otherwise there
-                       // will be a
-                       // constraint violation from the ancestors table.
-                       setForeignKeys(localSession, false);
-                       deleteRoles(menuId);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteFunctionalMenuItem: after deleting roles");
-                       deleteFavorites(menuId);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteFunctionalMenuItem: after deleting favorites");
-                       localSession.delete(localSession.get(FunctionalMenuItem.class, menuId));
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deleteFunctionalMenuItem: about to commit");
-                       transaction.commit();
-                       result = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteFunctionalMenuItem failed", e);
-                       EcompPortalUtils.rollbackTransaction(transaction,
-                                       "deleteFunctionalMenuItem rollback, exception = " + e.toString());
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "deleteFunctionalMenuItem");
-               }
-               if (result) {
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "LR: deleteFunctionalMenuItem: no result. setting httpStatusCode to "
-                                                       + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       // Regenerate the fn_menu_functional_ancestors table, which is used
-       // by the queries that return the functional menu items.
-       public FieldsValidator regenerateAncestorTable() {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               Session localSession = null;
-               Transaction transaction = null;
-
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       String sql = "DELETE FROM fn_menu_functional_ancestors";
-                       logQuery(sql);
-                       Query query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 1");
-
-                       sql = "ALTER TABLE fn_menu_functional_ancestors AUTO_INCREMENT=1";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: reset AUTO_INCREMENT to 1");
-
-                       int depth = 0;
-                       sql = "INSERT INTO fn_menu_functional_ancestors(menu_id, ancestor_menu_id, depth) "
-                                       + "SELECT m.menu_id, m.menu_id, " + depth + " FROM fn_menu_functional m";
-                       logQuery(sql);
-                       query = localSession.createSQLQuery(sql);
-                       query.executeUpdate();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 2");
-                       for (depth = 0; depth < 3; depth++) {
-                               int depthPlusOne = depth + 1;
-                               sql = "INSERT INTO fn_menu_functional_ancestors(menu_id, ancestor_menu_id, depth) "
-                                               + " SELECT a.menu_id, m.parent_menu_id, " + depthPlusOne
-                                               + " FROM fn_menu_functional m, fn_menu_functional_ancestors a " + " WHERE a.depth='" + depth
-                                               + "' AND " + " a.ancestor_menu_id = m.menu_id AND " + " m.parent_menu_id != '-1'";
-                               logQuery(sql);
-                               query = localSession.createSQLQuery(sql);
-                               query.executeUpdate();
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "regenerateAncestorTable: finished query 3");
-                       transaction.commit();
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "regenerateAncestorTable failed", e);
-                       EcompPortalUtils.rollbackTransaction(transaction,
-                                       "regenerateAncestorTable rollback, exception = " + e.toString());
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "regenerateAncestorTable");
-               }
-               return fieldsValidator;
-       }
-
-       private void logQuery(String sql) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-       }
-
-       public FieldsValidator setFavoriteItem(FavoritesFunctionalMenuItem menuItemJson) {
-               boolean result = false;
-               FieldsValidator fieldsValidator = new FieldsValidator();
-
-               Session localSession = null;
-               Transaction transaction = null;
-
-               try {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       String.format("Before adding favorite for user id:{0} and menu id:{1} ", menuItemJson.userId,
-                                                       menuItemJson.menuId));
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       localSession.save(menuItemJson);
-                       transaction.commit();
-                       result = true;
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       String.format("After adding favorite for user id:{0} and menu id:{1} ", menuItemJson.userId,
-                                                       menuItemJson.menuId));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "setFavoriteItem failed", e);
-                       EcompPortalUtils.rollbackTransaction(transaction, "setFavoriteItem rollback, exception = " + e.toString());
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "setFavoriteItem");
-               }
-
-               if (result) {
-               } else {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-
-               return fieldsValidator;
-       }
-
-       public List<FavoritesFunctionalMenuItemJson> getFavoriteItems(Long userId) {
-               try {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Before getting favorites for user id: " + userId);
-
-                       // Divide this into 2 queries: one which returns the favorites items associated
-                       // with Restricted apps,
-                       // and one that returns all the other favorites items. Then we can easily add
-                       // the boolean flag
-                       // restrictedApp to each FavoritesFunctionalMenuItemJson, to be used by the
-                       // front end.
-
-                       String sql = "SELECT f.user_id,f.menu_id,m.text,m.url "
-                                       + " FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
-                                       + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id " + " AND f.menu_id = mr.menu_id "
-                                       + " AND mr.role_id = '" + RESTRICTED_APP_ROLE_ID + "' ";
-
-                       @SuppressWarnings("unchecked")
-                       List<FavoritesFunctionalMenuItemJson> menuItems = dataAccessService.executeSQLQuery(sql,
-                                       FavoritesFunctionalMenuItemJson.class, null);
-                       for (FavoritesFunctionalMenuItemJson menuItem : menuItems) {
-                               menuItem.restrictedApp = true;
-                       }
-
-                       sql = "SELECT DISTINCT f.user_id,f.menu_id,m.text,m.url "
-                                       + " FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr "
-                                       + " WHERE f.user_id='" + userId + "' AND f.menu_id = m.menu_id " + " AND f.menu_id = mr.menu_id "
-                                       + " AND mr.role_id != '" + RESTRICTED_APP_ROLE_ID + "' ";
-                       @SuppressWarnings("unchecked")
-                       List<FavoritesFunctionalMenuItemJson> menuItems2 = dataAccessService.executeSQLQuery(sql,
-                                       FavoritesFunctionalMenuItemJson.class, null);
-                       for (FavoritesFunctionalMenuItemJson menuItem : menuItems2) {
-                               menuItem.restrictedApp = false;
-                               menuItems.add(menuItem);
-                       }
-
-                       return menuItems;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getFavoriteItems failed", e);
-                       List<FavoritesFunctionalMenuItemJson> menuItems = new ArrayList<FavoritesFunctionalMenuItemJson>();
-                       return menuItems;
-               }
-       }
-
-       public FieldsValidator removeFavoriteItem(Long userId, Long menuId) {
-               boolean result = false;
-               FieldsValidator fieldsValidator = new FieldsValidator();
-
-               Session localSession = null;
-               Transaction transaction = null;
-
-               try {
-
-                       FavoritesFunctionalMenuItem menuItemJson = new FavoritesFunctionalMenuItem();
-                       menuItemJson.userId = userId;
-                       menuItemJson.menuId = menuId;
-
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       localSession.delete(menuItemJson);
-                       localSession.flush();
-                       transaction.commit();
-                       result = true;
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       String.format("After removing favorite for user id: " + userId + "; menu id: " + menuId));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "removeFavoriteItem failed", e);
-                       EcompPortalUtils.rollbackTransaction(transaction,
-                                       "removeFavoriteItem rollback, exception = " + e.toString());
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "removeFavoriteItem");
-               }
-
-               if (result) {
-               } else {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-
-               return fieldsValidator;
-       }
-
-       @Override
-       public void assignHelpURLs(List<FunctionalMenuItem> menuItems) {
-               try {
-                       String user_guide_link = SystemProperties.getProperty(EPCommonSystemProperties.USER_GUIDE_URL);
-
-                       for (FunctionalMenuItem menuItem : menuItems) {
-                               if (menuItem.text.equalsIgnoreCase("Contact Us")) {
-                                       menuItem.setUrl("contactUs");
-                                       // menuItem.setRestrictedApp(true);
-                               }
-                               if (menuItem.text.equalsIgnoreCase("Get Access")) {
-                                       menuItem.setUrl("getAccess");
-                               }
-                               if (menuItem.text.equalsIgnoreCase("User Guide")) {
-                                       menuItem.setUrl(user_guide_link);
-                                       menuItem.setRestrictedApp(true);
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "assignHelpURLs process failed", e);
-               }
-
-       }
-
-       public List<FunctionalMenuRole> getFunctionalMenuRole() {
-               String sql = "SELECT * from fn_menu_functional_roles";
-               logQuery(sql);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getFunctionalMenuRole: logged the query");
-
-               @SuppressWarnings("unchecked")
-               List<FunctionalMenuRole> functionalMenuRole = dataAccessService.executeSQLQuery(sql, FunctionalMenuRole.class,
-                               null);
-
-               return functionalMenuRole;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<BusinessCardApplicationRole> getUserAppRolesList(String userId) {
-               Map<String, String> params = new HashMap<>();
-               params.put("userId", userId);
-
-               List<BusinessCardApplicationRole> userAppRoles = null;
-               try {
-                       userAppRoles = dataAccessService.executeNamedQuery("getUserApproles", params, null);
-               } catch (Exception e) {
-                       // TODO Auto-generated catch block
-                       logger.error(EELFLoggerDelegate.errorLogger, "getUserAppRolesList failed", e);
-               }
-               return userAppRoles;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/GetAccessService.java
deleted file mode 100644 (file)
index 5857658..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-
-public interface GetAccessService {
-       /**
-        * @return One entry per application function AND role; i.e., each application
-        *         appears many times.
-        */
-       List<GetAccessResult> getAppAccessList(EPUser user);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/GetAccessServiceImpl.java
deleted file mode 100644 (file)
index 317e838..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-@Service("getAccessService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class GetAccessServiceImpl implements GetAccessService{
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       /*
-        * (non-Javadoc)
-        * @see org.openecomp.portalapp.portal.service.GetAccessService#getAppAccessList()
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<GetAccessResult> getAppAccessList(EPUser user) {
-               final Map<String, Long> params = new HashMap<>();
-               List<GetAccessResult> appAccessList = null;
-               params.put("userId", user.getId());
-               appAccessList = dataAccessService
-                               .executeNamedQuery("getAppAccessFunctionRole", params, null);
-               return appAccessList;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ManifestService.java
deleted file mode 100644 (file)
index 5e4c96a..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.io.IOException;
-import java.util.jar.Attributes;
-
-public interface ManifestService {
-       /**
-        * Gets the content of the webapp manifest file META-INF/MANIFEST.MF.
-        *
-        * @return Attributes object with key-value pairs from the manifest
-        * @throws IOException
-        */
-       public Attributes getWebappManifest() throws IOException;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/ManifestServiceImpl.java
deleted file mode 100644 (file)
index 0e5da80..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.Attributes;
-import java.util.jar.Manifest;
-
-import javax.servlet.ServletContext;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-@Service("manifestService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class ManifestServiceImpl implements ManifestService {
-       @Autowired
-       ServletContext context;
-
-       /*
-        * (non-Javadoc)
-        * @see org.openecomp.portalapp.portal.service.ManifestService#getWebappManifest()
-        */
-       public Attributes getWebappManifest() throws IOException {
-               EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManifestServiceImpl.class);
-               // Path to resource on classpath
-               final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
-               // Manifest is formatted as Java-style properties
-               try {
-                       InputStream inputStream = context.getResourceAsStream(MANIFEST_RESOURCE_PATH);
-                       Manifest manifest = new Manifest(inputStream);
-                       inputStream.close();
-                       return manifest.getMainAttributes();
-               } catch (IOException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getWebappManifest: failed to read/find manifest");
-                       throw e;
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyService.java
deleted file mode 100644 (file)
index 85977ef..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.springframework.web.client.RestClientException;
-
-public interface MicroserviceProxyService {
-
-       /**
-        * Gets the specific microservice from table ep_microservice, communicates
-        * to microservice with the specified security type. The microservice sends
-        * back the response.
-        * 
-        * Gets the data while testing the microservice with no widget associated with
-        * 
-        * @param serviceId
-        *            Id of microservice to be used
-        * @return response sent from microservice
-        * @throws Exception
-        */
-       String proxyToDestination(long serviceId, EPUser user, HttpServletRequest request) throws Exception;
-       
-       
-       
-       /**
-        * Gets the microservice data based on the user id and widget id. Different
-        * users have his/her own parameters for one widget. The method sends back
-        * the response.
-        * 
-        * @param widgetId
-        *                        Id of widget to be used
-        * @param user
-        *                        User information
-        * @param request
-        * @return response sent from microserivce 
-        * @throws Exception
-        */
-       String proxyToDestinationByWidgetId(long widgetId, EPUser user, HttpServletRequest request) throws Exception;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceProxyServiceImpl.java
deleted file mode 100644 (file)
index acd8524..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.codec.binary.Base64;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-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.stereotype.Service;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestTemplate;
-
-@Service("microserviceProxyService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class MicroserviceProxyServiceImpl implements MicroserviceProxyService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceProxyServiceImpl.class);
-
-       private static final String BASIC_AUTH = "Basic Authentication";
-       private static final String NO_AUTH = "No Authentication";
-       private static final String COOKIE_AUTH = "Cookie based Authentication";
-       private static final String QUESTION_MARK = "?";
-       private static final String ADD_MARK = "&";
-
-       @Autowired
-       private ConsulHealthService consulHealthService;
-       @Autowired
-       MicroserviceService microserviceService;
-       @Autowired
-       WidgetParameterService widgetParameterService;
-
-       private String whatService = "widgets-service";
-
-       private RestTemplate template = new RestTemplate();
-
-       @Override
-       public String proxyToDestination(long serviceId, EPUser user, HttpServletRequest request) throws Exception {
-               // get the microservice object by the id
-               MicroserviceData data = microserviceService.getMicroserviceDataById(serviceId);
-               // No such microservice available
-               if (data == null) {
-                       // can we return a better response than null?
-                       return null;
-               }
-               return authenticateAndRespond(data, request, composeParams(data, user));
-       }
-
-       @Override
-       public String proxyToDestinationByWidgetId(long widgetId, EPUser user, HttpServletRequest request)
-                       throws Exception {
-               @SuppressWarnings({ "rawtypes", "unchecked" })
-               ResponseEntity<Long> ans = (ResponseEntity<Long>) template.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://"
-                                               + consulHealthService.getServiceLocation(whatService,
-                                                               SystemProperties.getProperty("microservices.widget.local.port"))
-                                               + "/widget/microservices/widgetCatalog/parameters/" + widgetId,
-                               HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), Long.class);
-               Long serviceId = ans.getBody();
-               // get the microservice object by the id
-               MicroserviceData data = microserviceService.getMicroserviceDataById(serviceId);
-               // No such microservice available
-               if (data == null)
-                       return null;
-
-               List<MicroserviceParameter> params = composeParams(data, user);
-               for (MicroserviceParameter p : params) {
-                       WidgetCatalogParameter userValue = widgetParameterService.getUserParamById(widgetId, user.getId(),
-                                       p.getId());
-                       if (userValue != null)
-                               p.setPara_value(userValue.getUser_value());
-               }
-               return authenticateAndRespond(data, request, params);
-       }
-
-       private String authenticateAndRespond(MicroserviceData data, HttpServletRequest request,
-                       List<MicroserviceParameter> params) throws HttpClientErrorException, IllegalArgumentException {
-               String response = null;
-               if (data.getSecurityType().equals(NO_AUTH)) {
-                       HttpEntity<String> entity = new HttpEntity<String>(headersForNoAuth());
-                       String url = microserviceUrlConverter(data, params);
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "authenticateAndRespond: Before making no authentication call: {}", url);
-                       response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "authenticateAndRespond: No authentication call response: {}",
-                                       response);
-               } else if (data.getSecurityType().equals(BASIC_AUTH)) {
-                       // encoding the username and password
-                       String plainCreds = null;
-                       try {
-                               plainCreds = data.getUsername() + ":" + decryptedPassword(data.getPassword());
-                       } catch (Exception e) {
-                               logger.error("authenticateAndRespond failed to decrypt password", e);
-                               throw new IllegalArgumentException("Failed to decrypt password", e);
-                       }
-                       byte[] plainCredsBytes = plainCreds.getBytes();
-                       byte[] base64CredsBytes = Base64.encodeBase64(plainCredsBytes);
-                       String base64Creds = new String(base64CredsBytes);
-
-                       HttpEntity<String> entity = new HttpEntity<String>(headersForBasicAuth(request, base64Creds));
-
-                       String url = microserviceUrlConverter(data, params);
-                       try {
-                               response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
-                       } catch (HttpClientErrorException e) {
-                               logger.error("authenticateAndRespond failed for basic security url " + url, e);
-                               throw e;
-                       }
-               } else if (data.getSecurityType().equals(COOKIE_AUTH)) {
-                       HttpEntity<String> entity = new HttpEntity<String>(headersForCookieAuth(request));
-                       String url = microserviceUrlConverter(data, params);
-                       try {
-                               response = template.exchange(url, HttpMethod.GET, entity, String.class).getBody();
-                       } catch (HttpClientErrorException e) {
-                               logger.error("authenticateAndRespond failed for cookie auth url " + url, e);
-                               throw e;
-                       }
-               }
-
-               return response;
-       }
-
-       private String decryptedPassword(String encryptedPwd) throws Exception {
-               String result = "";
-               if (encryptedPwd != null && encryptedPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.decrypt(encryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
-                               throw e;
-                       }
-               }
-
-               return result;
-       }
-
-       private String microserviceUrlConverter(MicroserviceData data, List<MicroserviceParameter> params) {
-               String url = data.getUrl();
-               for (int i = 0; i < params.size(); i++) {
-                       if (i == 0) {
-                               url += QUESTION_MARK;
-                       }
-                       url += params.get(i).getPara_key() + "=" + params.get(i).getPara_value();
-                       if (i != (params.size() - 1)) {
-                               url += ADD_MARK;
-                       }
-               }
-
-               return url;
-       }
-
-       private HttpHeaders headersForNoAuth() {
-               HttpHeaders headers = new HttpHeaders();
-               headers.setContentType(MediaType.APPLICATION_JSON);
-
-               return headers;
-       }
-
-       // TODO: why is this generically named cookie used?
-       private final static String Cookie = "Cookie";
-       
-       private HttpHeaders headersForBasicAuth(HttpServletRequest request, String base64Creds) {
-               HttpHeaders headers = new HttpHeaders();
-               headers.add("Authorization", "Basic " + base64Creds);
-               headers.setContentType(MediaType.APPLICATION_JSON);
-               String rawCookie = request.getHeader(Cookie);
-               if (rawCookie != null)
-                       headers.add(Cookie, rawCookie);
-               return headers;
-       }
-
-       private HttpHeaders headersForCookieAuth(HttpServletRequest request) {
-               HttpHeaders headers = new HttpHeaders();
-               headers.setContentType(MediaType.APPLICATION_JSON);
-               String rawCookie = request.getHeader(Cookie);
-               if (rawCookie != null)
-                       headers.add(Cookie, rawCookie);
-               return headers;
-       }
-
-       private List<MicroserviceParameter> composeParams(MicroserviceData data, EPUser user) {
-               List<MicroserviceParameter> params = data.getParameterList();
-               MicroserviceParameter userIdParam = new MicroserviceParameter();
-               userIdParam.setPara_key("userId");
-               userIdParam.setPara_value(user.getOrgUserId());
-               params.add(userIdParam);
-               return params;
-       }
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceService.java
deleted file mode 100644 (file)
index d2ef364..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-
-public interface MicroserviceService {
-
-       /**
-        * Get all microservices from the ep_microservice
-        * 
-        * @return list of all microservices
-        * @throws Exception
-        */
-       List<MicroserviceData> getMicroserviceData() throws Exception;
-
-       /**
-        * Gets the specified microservice with id from ep_microservice
-        * 
-        * @param id
-        *            ID of microservice to be fetched
-        * @return the microservice with the specified id
-        */
-       MicroserviceData getMicroserviceDataById(long id);
-
-       /**
-        * Saves the specified microservice to the table ep_microservice
-        * 
-        * @param newService
-        *            Content of microservice to be saved
-        * @return new microservice id
-        * @throws Exception
-        */
-       Long saveMicroservice(MicroserviceData newService) throws Exception;
-
-       void saveServiceParameters(long serviceId, List<MicroserviceParameter> list) throws Exception;
-
-       /**
-        * Deletes the specified microservice from all tables where the serviceId is
-        * used
-        * 
-        * @param serviceId
-        * @throws Exception
-        */
-       void deleteMicroservice(long serviceId) throws Exception;
-
-       /**
-        * Updates the specified microservice from all tables where the serviceId is
-        * used
-        * 
-        * @param serviceId
-        *            Id of microservice to be updated
-        * @param newService
-        *            Content of microservice to be updated
-        * @throws Exception
-        */
-       void updateMicroservice(long serviceId, MicroserviceData newService) throws Exception;
-
-       /**
-        * Gets the Service parameters by the service Id
-        * 
-        * @param serviceId
-        * @return List<MicroserviceParameter>
-        */
-       List<MicroserviceParameter> getParametersById(long serviceId);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/MicroserviceServiceImpl.java
deleted file mode 100644 (file)
index 23a8c50..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.crypto.BadPaddingException;
-
-import org.hibernate.criterion.Criterion;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("microserviceService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class MicroserviceServiceImpl implements MicroserviceService {
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MicroserviceServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       public Long saveMicroservice(MicroserviceData newService) throws Exception {
-               if (newService.getPassword() != null)
-                       newService.setPassword(encryptedPassword(newService.getPassword()));
-               getDataAccessService().saveDomainObject(newService, null);
-               return newService.getId();
-       }
-
-       public void saveServiceParameters(long serviceId, List<MicroserviceParameter> list) throws Exception {
-               for (int i = 0; i < list.size(); i++) {
-                       MicroserviceParameter para = list.get(i);
-                       para.setServiceId(serviceId);
-                       getDataAccessService().saveDomainObject(para, null);
-               }
-       }
-
-       @Override
-       public MicroserviceData getMicroserviceDataById(long id) {
-               MicroserviceData data = null;
-               try {
-                       data = (MicroserviceData) dataAccessService
-                                       .getList(MicroserviceData.class, " where id = '" + id + "'", null, null).get(0);
-                       data.setParameterList(getServiceParameters(id));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMicroserviceDataById failed", e);
-                       throw e;
-               }
-               return data;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<MicroserviceData> getMicroserviceData() throws Exception {
-               List<MicroserviceData> list = (List<MicroserviceData>) dataAccessService.getList(MicroserviceData.class, null);
-               for (int i = 0; i < list.size(); i++) {
-                       if (list.get(i).getPassword() != null)
-                               try{
-                                       list.get(i).setPassword(decryptedPassword(list.get(i).getPassword()));
-                               } catch(BadPaddingException bpe){
-                                       logger.error(EELFLoggerDelegate.errorLogger, "Couldn't decrypt - Check decryption key in system.properties - looks wrong. Still going ahead with list population though", bpe);
-                               }
-                       list.get(i).setParameterList(getServiceParameters(list.get(i).getId()));
-               }
-               return list;
-       }
-
-       @SuppressWarnings("unchecked")
-       private List<MicroserviceParameter> getServiceParameters(long serviceId) {
-               List<MicroserviceParameter> list = (List<MicroserviceParameter>) dataAccessService
-                               .getList(MicroserviceParameter.class, " where service_id = '" + serviceId + "'", null, null);
-               return list;
-       }
-
-       @Override
-       public void deleteMicroservice(long serviceId) throws Exception {
-
-               try {
-                       Map<String, String> params = new HashMap<String, String>();
-                       params.put("serviceId", Long.toString(serviceId));
-
-                       dataAccessService.executeNamedQuery("deleteMicroserviceParameter", params, null);
-                       dataAccessService.executeNamedQuery("deleteMicroservice", params, null);
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       logger.error(EELFLoggerDelegate.errorLogger, "deleteMicroservice failed", e);
-                       throw e;
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public void updateMicroservice(long serviceId, MicroserviceData newService) throws Exception {
-               try {
-                       newService.setId(serviceId);
-                       if (newService.getPassword() != null)
-                               newService.setPassword(encryptedPassword(newService.getPassword()));
-                       getDataAccessService().saveDomainObject(newService, null);
-                       List<MicroserviceParameter> oldService = getServiceParameters(serviceId);
-                       boolean foundParam;
-                       for (int i = 0; i < oldService.size(); i++) {
-                               foundParam = false;
-                               for (int n = 0; n < newService.getParameterList().size(); n++) {
-                                       if (newService.getParameterList().get(n).getId().equals(oldService.get(i).getId())) {
-                                               foundParam = true;
-                                               break;
-                                       }
-                               }
-                               if (foundParam == false) {
-                                       MicroserviceParameter pd = oldService.get(i);
-                                       getDataAccessService().deleteDomainObject(pd, null);
-                               }
-                       }
-                       for (int i = 0; i < newService.getParameterList().size(); i++) {
-                               MicroserviceParameter param = newService.getParameterList().get(i);
-                               param.setServiceId(serviceId);
-                               getDataAccessService().saveDomainObject(param, null);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "updateMicroservice failed", e);
-                       throw e;
-               }
-               saveServiceParameters(serviceId, newService.getParameterList());
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public List<MicroserviceParameter> getParametersById(long serviceId) {
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion contextIdCrit = Restrictions.eq("serviceId", serviceId);
-               restrictionsList.add(contextIdCrit);
-               List<MicroserviceParameter> list = (List<MicroserviceParameter>) dataAccessService
-                               .getList(MicroserviceParameter.class, null, restrictionsList, null);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "getParametersById: microservice parameters list size: " + list.size());
-               return list;
-       }
-
-       private String decryptedPassword(String encryptedPwd) throws Exception {
-               String result = "";
-               if (encryptedPwd != null & encryptedPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.decrypt(encryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-
-       private String encryptedPassword(String decryptedPwd) throws Exception {
-               String result = "";
-               if (decryptedPwd != null & decryptedPwd.length() > 0) {
-                       try {
-                               result = CipherUtil.encrypt(decryptedPwd,
-                                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "encryptedPassword failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppService.java
deleted file mode 100644 (file)
index af69f33..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface PersUserAppService {
-
-       /**
-        * Sets the appropriate code in the user personalization table to indicate
-        * the application is (de)selected and/or pending.
-        * 
-        * @param user
-        *            EP User
-        * @param app
-        *            EP Application
-        * @param select
-        *            True or false
-        * @param pending
-        *            True or false
-        */
-       void setPersUserAppValue(EPUser user, EPApp app, boolean select, boolean pending);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImpl.java
deleted file mode 100644 (file)
index c547a9d..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.PersUserAppSelection;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-@Service("persUserAppService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class PersUserAppServiceImpl implements PersUserAppService {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PersUserAppServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       private AdminRolesService adminRolesService;
-       @Autowired
-       private UserRolesService userRolesService;
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserAppSelectService#
-        * setAppCatalogSelection(org.openecomp.portalapp.portal.domain.EPUser,
-        * org.openecomp.portalapp.portal.transport.AppCatalogSelection)
-        */
-       @Override
-       public void setPersUserAppValue(EPUser user, EPApp app, boolean select, boolean pending) {
-               if (user == null || app == null)
-                       throw new IllegalArgumentException("setPersUserAppValue: Null values");
-
-               // Find the record for this user-app combo, if any
-               String filter = " where user_id = " + Long.toString(user.getId()) + " and app_id = "
-                               + Long.toString(app.getId());
-               @SuppressWarnings("unchecked")
-               List<PersUserAppSelection> persList = dataAccessService.getList(PersUserAppSelection.class, filter, null, null);
-
-               // Key constraint limits to 1 row
-               PersUserAppSelection persRow = null;
-               if (persList.size() == 1)
-                       persRow = persList.get(0);
-               else
-                       persRow = new PersUserAppSelection(null, user.getId(), app.getId(), null);
-
-               if (app.getOpen()) {
-                       // Pending status is not meaningful for open apps.
-                       if (pending)
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "setPersUserAppValue: invalid request, ignoring set-pending for open app");
-
-                       // Open apps have same behavior for regular and admin users
-                       if (select) {
-                               // Selection of an open app requires a record
-                               persRow.setStatusCode("S"); // show
-                               dataAccessService.saveDomainObject(persRow, null);
-                       } else {
-                               // De-selection of an open app requires no record
-                               if (persRow.getId() != null)
-                                       dataAccessService.deleteDomainObject(persRow, null);
-                       }
-               } else {
-                       // Non-open app.
-
-                       // Pending overrides select.
-                       if (pending) {
-                               persRow.setStatusCode("P");
-                               dataAccessService.saveDomainObject(persRow, null);
-                       } else {
-                               // Behavior depends on Portal (super) admin status, bcos an
-                               // admin can force an app onto the dashboard.
-                               boolean isPortalAdmin = adminRolesService.isSuperAdmin(user);
-                               boolean adminUserHasAppRole = false;
-                               if (isPortalAdmin) {
-                                       List<EPUserApp> roles = userRolesService.getCachedAppRolesForUser(app.getId(), user.getId());
-                                       adminUserHasAppRole = (roles.size() > 0);
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "setPersUserAppValue: app {}, admin user {}, role count {}",
-                                                       app.getId(), user.getId(), roles.size());
-                               }
-
-                               if (select) {
-                                       if (isPortalAdmin) {
-                                               // The special case: portal admin
-                                               persRow.setStatusCode("S"); // show
-                                               dataAccessService.saveDomainObject(persRow, null);
-                                       } else {
-                                               // User has role-based access to the app.
-                                               // Showing an accessible app requires no record.
-                                               if (persRow.getId() != null)
-                                                       dataAccessService.deleteDomainObject(persRow, null);
-                                       }
-                               } // select
-                               else {
-                                       if (isPortalAdmin && !adminUserHasAppRole) {
-                                               // The special case: portal admin, no role
-                                               if (persRow.getId() != null)
-                                                       dataAccessService.deleteDomainObject(persRow, null);
-                                       } else {
-                                               // User has role-based access to the app.
-                                               // Hiding an accessible app requires a record
-                                               persRow.setStatusCode("H"); // hide
-                                               dataAccessService.saveDomainObject(persRow, null);
-                                       }
-                               } // deselect
-                       }
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserWidgetService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserWidgetService.java
deleted file mode 100644 (file)
index a59e43e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface PersUserWidgetService {
-
-       /**
-        * Sets the appropriate code in the user personalization table to indicate
-        * the application is (de)selected and/or pending.
-        * 
-        * @param user
-        *            EP User
-        * @param widgetId
-        *            widget
-        * @param select
-        *            True or false
-        */
-       void setPersUserAppValue(EPUser user, Long widgetId, boolean select);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserWidgetServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PersUserWidgetServiceImpl.java
deleted file mode 100644 (file)
index 5c38997..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.PersUserWidgetSelection;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-@Service("persUserWidgetService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class PersUserWidgetServiceImpl implements PersUserWidgetService{
-       
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PersUserAppServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-       
-       @Override
-       public void setPersUserAppValue(EPUser user, Long widgetId, boolean select) {
-               if (user == null || widgetId == null)
-                       throw new IllegalArgumentException("setPersUserAppValue: Null values");
-
-               String filter = " where user_id = " + Long.toString(user.getId()) + " and widget_id = "
-                               + Long.toString(widgetId);
-               @SuppressWarnings("unchecked")
-               List<PersUserWidgetSelection> persList = dataAccessService.getList(PersUserWidgetSelection.class, filter, null, null);
-
-               // Key constraint limits to 1 row
-               PersUserWidgetSelection persRow = null;
-               if (persList.size() == 1){
-                       persRow = persList.get(0);
-               }
-               else {
-                       persRow = new PersUserWidgetSelection(null, user.getId(), widgetId, null);
-               }                       
-               if(select){
-                       if (persRow.getId() != null){
-                               dataAccessService.deleteDomainObject(persRow, null);                            
-                       }
-                       persRow.setStatusCode("S"); // show
-                       dataAccessService.saveDomainObject(persRow, null);                      
-               } else{
-                       if (persRow.getId() != null){
-                               dataAccessService.deleteDomainObject(persRow, null);
-                       } 
-                       persRow.setStatusCode("H"); // Hide
-                       dataAccessService.saveDomainObject(persRow, null);                      
-               }
-               
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminService.java
deleted file mode 100644 (file)
index 03257f9..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-
-public interface PortalAdminService {
-       List<PortalAdmin> getPortalAdmins ();
-       FieldsValidator createPortalAdmin(String orgUserId);
-       FieldsValidator deletePortalAdmin(Long userId);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/PortalAdminServiceImpl.java
deleted file mode 100644 (file)
index bc4c339..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletResponse;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUser;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-import org.openecomp.portalapp.portal.transport.PortalAdminUserRole;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.stereotype.Service;
-import org.springframework.web.client.RestTemplate;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Service("portalAdminService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class PortalAdminServiceImpl implements PortalAdminService {    
-
-       private String SYS_ADMIN_ROLE_ID = "1";
-       private String ECOMP_APP_ID = "1";
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalAdminServiceImpl.class);
-
-       @Autowired
-       private SessionFactory sessionFactory;
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       SearchService searchService;
-       @Autowired
-       private EPAppService epAppService;
-       
-       RestTemplate template = new RestTemplate();
-       
-       @PostConstruct
-       private void init() {
-               SYS_ADMIN_ROLE_ID = SystemProperties.getProperty(SystemProperties.SYS_ADMIN_ROLE_ID);
-               ECOMP_APP_ID = SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID);
-       }
-
-       public List<PortalAdmin> getPortalAdmins() {
-               try {
-                       Map<String, String> params = new HashMap<>();
-                       params.put("adminRoleId", SYS_ADMIN_ROLE_ID);
-                       @SuppressWarnings("unchecked")
-                       List<PortalAdmin> portalAdmins = (List<PortalAdmin>) dataAccessService.executeNamedQuery("getPortalAdmins",
-                                       params, null);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "getPortalAdmins was successful");
-                       return portalAdmins;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getPortalAdmins failed", e);
-                       return null;
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       public FieldsValidator createPortalAdmin(String orgUserId) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               logger.debug(EELFLoggerDelegate.debugLogger, "LR: createPortalAdmin: test 1");
-               boolean result = false;
-               EPUser user = null;
-               boolean createNewUser = false;
-               List<EPUser> localUserList = dataAccessService.getList(EPUser.class, " where orgUserId='" + orgUserId + "'",
-                               null, null);
-               if (localUserList.size() > 0) {
-                       user = localUserList.get(0);
-               } else {
-                       createNewUser = true;
-               }
-
-               if (user != null && isLoggedInUserPortalAdmin(user.getId())) {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "User '" + user.getOrgUserId() + "' already has PortalAdmin role assigned.");
-               } else if (user != null || createNewUser) {
-                       Session localSession = null;
-                       Transaction transaction = null;
-                       try {
-                               localSession = sessionFactory.openSession();
-
-                               transaction = localSession.beginTransaction();
-                               if (createNewUser) {
-                                       user = this.searchService.searchUserByUserId(orgUserId);
-                                       if (user != null) {
-                                               // insert the user with active true in order to
-                                               // pass login phase.
-                                               user.setActive(true);
-                                               localSession.save(EPUser.class.getName(), user);
-                                       }
-                               }
-                               if (user != null) {
-                                       Long userid = user.getId();
-                                       PortalAdminUserRole userRole = new PortalAdminUserRole();
-                                       userRole.userId = userid;
-                                       userRole.roleId = Long.valueOf(SYS_ADMIN_ROLE_ID);
-                                       userRole.appId = Long.valueOf(ECOMP_APP_ID);
-
-                                       localSession.save(PortalAdminUserRole.class.getName(), userRole);
-                               }
-
-                               transaction.commit();
-                               // Add role in the external central auth system
-                               if(user != null)
-                                       result = addPortalAdminInExternalCentralAuth(user.getOrgUserId(), PortalConstants.PORTAL_ADMIN_ROLE);
-                               else
-                                       logger.error(EELFLoggerDelegate.errorLogger, "PortalAdminServiceImpl createPortalAdmin: failed to Add role in the external central auth system since User obj is null" );
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "createPortalAdmin failed", e);
-                               EcompPortalUtils.rollbackTransaction(transaction, "createPortalAdmin rollback, exception = " + e.toString());
-                       } finally {
-                               EcompPortalUtils.closeLocalSession(localSession, "createPortalAdmin");
-                       }
-                       if (!result) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "LR: createPortalAdmin: no result. setting httpStatusCode to "
-                                                               + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                               logger.error(EELFLoggerDelegate.errorLogger, "PortalAdminServiceImpl.createPortalAdmin: bad request");
-                       }
-               }
-               return fieldsValidator;
-       }
-       
-       private boolean addPortalAdminInExternalCentralAuth(String loginId, String portalAdminRole){
-               boolean result = false;
-               try{
-                       String name = "";
-                       if (EPCommonSystemProperties.containsProperty(
-                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
-                               name = loginId + SystemProperties
-                                               .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
-                       }
-                       EPApp app = epAppService.getApp(PortalConstants.PORTAL_APP_ID);
-                       String extRole = app.getNameSpace()+"."+portalAdminRole.replaceAll(" ", "_");
-                       ObjectMapper addUserRoleMapper = new ObjectMapper();
-                       ExternalAccessUser extUser = new ExternalAccessUser(name, extRole);
-                       String userRole = addUserRoleMapper.writeValueAsString(extUser);
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-
-                       HttpEntity<String> addUserRole = new HttpEntity<>(userRole, headers);
-                       template.exchange(
-                                       SystemProperties.getProperty(
-                                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                       + "userRole",
-                                       HttpMethod.POST, addUserRole, String.class);
-                       result = true;
-               } catch (Exception e) {
-                       // This happens only if role already exists in external central access system but not in local DB thats where we logging here
-                       if (e.getMessage().equalsIgnoreCase("409 Conflict")) {
-                               result = true;
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Portal Admin role already exists", e.getMessage());
-                       } else{
-                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to add Portal Admin role ", e);
-                               result = false;
-                       }
-               }
-               return result;
-       }
-
-       public FieldsValidator deletePortalAdmin(Long userId) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               logger.debug(EELFLoggerDelegate.debugLogger, "deletePortalAdmin: test 1");
-               boolean result = false;
-               Session localSession = null;
-               Transaction transaction = null;
-
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       dataAccessService.deleteDomainObjects(PortalAdminUserRole.class,
-                                       "user_id='" + userId + "' AND role_id='" + SYS_ADMIN_ROLE_ID + "'", null);
-                       transaction.commit();
-                       result = deletePortalAdminInExternalCentralAuth(userId, PortalConstants.PORTAL_ADMIN_ROLE);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "deletePortalAdmin failed", e);
-                       EcompPortalUtils.rollbackTransaction(transaction, "deletePortalAdmin rollback, exception = " + e.toString());
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "deletePortalAdmin");
-               }
-               if (result) {
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "deletePortalAdmin: no result. setting httpStatusCode to "
-                                       + HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       
-       @SuppressWarnings("unchecked")
-       private boolean deletePortalAdminInExternalCentralAuth(Long userId, String portalAdminRole){
-               boolean result = false;
-               try{                                                                    
-                       String name = "";
-                       List<EPUser> localUserList = dataAccessService.getList(EPUser.class, " where user_id = " + userId,
-                                       null, null);
-                       if (EPCommonSystemProperties.containsProperty(
-                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
-                               name = localUserList.get(0).getOrgUserId() + SystemProperties
-                                               .getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
-                       }
-                       EPApp app = epAppService.getApp(PortalConstants.PORTAL_APP_ID);
-                       String extRole = app.getNameSpace()+"."+portalAdminRole.replaceAll(" ", "_");
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       HttpEntity<String> addUserRole = new HttpEntity<>(headers);
-                       template.exchange(
-                                       SystemProperties.getProperty(
-                                                       EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                       + "userRole/"+name+"/"+extRole,
-                                       HttpMethod.DELETE, addUserRole, String.class);
-                       result = true;
-               } catch (Exception e) {
-                       if (e.getMessage().equalsIgnoreCase("404 Not Found")) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Portal Admin role already deleted or may not be found", e.getMessage());
-                       } else{
-                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to add Portal Admin role ", e);
-                               result = false;
-                       }
-               }
-               return result;
-       }
-       
-       private void logQuery(String sql) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "Executing query: " + sql);
-       }
-
-       private boolean isLoggedInUserPortalAdmin(Long userId) {
-               try {
-                       String sql = "SELECT u.user_id, u.first_name, u.last_name, u.login_id "
-                                       + " FROM fn_user u, fn_user_role ur " + " WHERE u.user_id = ur.user_id " + " AND ur.user_id="
-                                       + userId + " AND ur.role_id=" + SYS_ADMIN_ROLE_ID;
-
-                       logQuery(sql);
-
-                       @SuppressWarnings("unchecked")
-                       List<PortalAdmin> portalAdmins = dataAccessService.executeSQLQuery(sql, PortalAdmin.class, null);
-                       logger.debug(EELFLoggerDelegate.debugLogger, portalAdmins.toString());
-                       if (portalAdmins == null || portalAdmins.size() <= 0) {
-                               return false;
-                       }
-                       return true;
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "isLoggedInUserPortalAdmin failed", e);
-                       return false;
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java
deleted file mode 100644 (file)
index 56e6440..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface SearchService {
-
-       public String searchUsersInPhoneBook(String searchString);
-
-       public EPUser searchUserByUserId(String orgUserId);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java
deleted file mode 100644 (file)
index df0c388..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Service("searchService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class SearchServiceImpl implements SearchService {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SearchServiceImpl.class);
-       
-       // TODO: the values below should be defined in other place
-       private static final int maxSizeOfSearchResult = 100;
-
-
-       @Autowired
-       EPLdapService ldapService;
-
-       @Override
-       public String searchUsersInPhoneBook(String searchString) {
-               String orgUserId = null;
-               List<String> tokens = EcompPortalUtils.parsingByRegularExpression(searchString, " ");
-               for (int i = 0; i < tokens.size(); i++) { // find orgUserId if possible and remove it from tokens
-                       if (tokens.get(i).matches(".*\\d+.*")) {
-                               orgUserId = tokens.get(i);
-                               tokens.remove(i);
-                       }
-               }
-               while (tokens.size() > 2) { // we use no more then first 2 tokens (orgUserId is removed, see above)
-                       tokens.remove(tokens.size() - 1);
-               }
-               EPUser attrUser = new EPUser();
-               attrUser.setOrgUserId(orgUserId);
-               List<UserWithNameSurnameTitle> resultOfSearch = new ArrayList<UserWithNameSurnameTitle>(), resultOfAdditionalSearch = null;
-               if (tokens.size() == 2) {
-                       attrUser.setFirstName(tokens.get(0));
-                       attrUser.setLastName(tokens.get(1));
-                       resultOfSearch = this.searchUsersByAttrs(attrUser);
-                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
-                       resultOfSearch = this.removeWrongLastNames(resultOfSearch, tokens.get(1));
-                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
-                               attrUser.setFirstName(tokens.get(1));
-                               attrUser.setLastName(tokens.get(0));
-                               resultOfAdditionalSearch = this.searchUsersByAttrs(attrUser);
-                               resultOfAdditionalSearch = this.removeWrongFirstNames(resultOfAdditionalSearch, tokens.get(1));
-                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
-                       }
-               } else if (tokens.size() == 1) {
-                       attrUser.setFirstName(tokens.get(0));
-                       resultOfSearch = this.searchUsersByAttrs(attrUser);
-                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
-                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
-                               attrUser.setFirstName(null);
-                               attrUser.setLastName(tokens.get(0));
-                               resultOfAdditionalSearch = this.searchUsersByAttrs(attrUser);
-                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
-                       }
-               } else if (orgUserId != null) {
-                       resultOfSearch = this.searchUsersByAttrs(attrUser);
-               }
-               if (resultOfAdditionalSearch != null) {
-                       resultOfSearch.addAll(resultOfAdditionalSearch);
-               }
-               resultOfSearch = this.cutSearchResultToMaximumSize(resultOfSearch);
-               ObjectMapper mapper = new ObjectMapper();
-               String result = "[]";
-               try {
-                       result = mapper.writeValueAsString(resultOfSearch);
-               } catch (JsonProcessingException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInPhoneBook failed", e);
-               }
-               return result;
-       }
-
-       private List<UserWithNameSurnameTitle> searchUsersByAttrs(EPUser attrUser) {
-               List<UserWithNameSurnameTitle> foundUsers = new ArrayList<UserWithNameSurnameTitle>();
-               try {
-                       org.openecomp.portalsdk.core.command.support.SearchResult searchResult = this.ldapService.searchPost(attrUser, null, null, null, 0, 0, -1);
-                       for (Object obj : searchResult) {
-                               EPUser user = (EPUser) obj;
-                               UserWithNameSurnameTitle foundUser = new UserWithNameSurnameTitle(user.getOrgUserId(), user.getFirstName(), user.getLastName(), user.getJobTitle());
-                               foundUsers.add(foundUser);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByAttrs failed", e);
-               }
-               return foundUsers;
-       }
-
-       private List<UserWithNameSurnameTitle> removeWrongFirstNames(List<UserWithNameSurnameTitle> resultOfSearch, String firstName) {
-               firstName = firstName.toUpperCase();
-               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
-                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
-                       if ((user.firstName == null) || !user.firstName.toUpperCase().startsWith(firstName)) {
-                               resultOfSearch.remove(i);
-                       }
-               }
-               return resultOfSearch;
-       }
-
-       private List<UserWithNameSurnameTitle> removeWrongLastNames(List<UserWithNameSurnameTitle> resultOfSearch, String lastName) {
-               lastName = lastName.toUpperCase();
-               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
-                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
-                       if ((user.lastName == null) || !user.lastName.toUpperCase().startsWith(lastName)) {
-                               resultOfSearch.remove(i);
-                       }
-               }
-               return resultOfSearch;
-       }
-
-       private List<UserWithNameSurnameTitle> cutSearchResultToMaximumSize(List<UserWithNameSurnameTitle> resultOfSearch) {
-               for (int i = resultOfSearch.size() - 1; i >= maxSizeOfSearchResult; i--) {
-                       resultOfSearch.remove(i);
-               }
-               return resultOfSearch;
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       public EPUser searchUserByUserId(String orgUserId) {
-               EPUser user = null;
-               EPUser searchedUser = new EPUser();
-               searchedUser.setOrgUserId(orgUserId);
-               try {
-                       List<Object> searchResult = ldapService.searchPost(searchedUser, "", null, null, 0, -1, 1);
-                       for (Object obj : searchResult) {
-                               if (obj instanceof EPUser) {
-                                       user = (EPUser) obj;
-                                       // This assignment should be checked later!
-                                       user.setLoginId(orgUserId);
-                                       break;
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId failed", e);
-               }
-               return user;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SharedContextService.java
deleted file mode 100644 (file)
index 24b164e..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.SharedContext;
-
-/**
- * Defines the methods exposed by the service that manages shared context
- * objects in the database.
- */
-public interface SharedContextService {
-
-       /**
-        * Gets all shared context objects for the specified context ID.
-        * 
-        * @param contextId
-        *            SharedContext ID
-        * @return List of SharedContext objects
-        */
-       List<SharedContext> getSharedContexts(String contextId);
-
-       /**
-        * Gets the shared context with the specified context ID and key.
-        * 
-        * @param contextId
-        *            Context ID; usually a session ID
-        * @param key
-        *            Key for the key-value pair
-        * @return Value found in the database, null if any parameter is null or no
-        *         shared context exists with that context ID - key pair.
-        */
-       SharedContext getSharedContext(String contextId, String key);
-
-       /**
-        * Creates a new shared context entry with the specified context ID, key and
-        * value.
-        * 
-        * @param contextId
-        *            SharedContext ID
-        * @param key
-        *            Key for the key-value pair.
-        * @param value
-        *            Value for the key-value pair.
-        */
-       void addSharedContext(String contextId, String key, String value);
-
-       /**
-        * Saves the specified shared context.
-        * 
-        * @param context
-        *            SharedContext object to save.
-        */
-       void saveSharedContext(SharedContext context);
-
-       /**
-        * Deletes the specified shared context.
-        * 
-        * @param context
-        *            SharedContext object to delete.
-        */
-       void deleteSharedContext(SharedContext context);
-
-       /**
-        * Deletes all shared contexts with the specified context ID.
-        * 
-        * @param contextId
-        *            Context ID; usually a session ID
-        * @return number of shared-context objects deleted
-        */
-       int deleteSharedContexts(String contextId);
-
-       /**
-        * Deletes all shared contexts with a creation time that is older than the
-        * specified value.
-        * 
-        * @param ageInSeconds
-        *            Expiration threshold in seconds
-        */
-       void expireSharedContexts(int ageInSeconds);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/SharedContextServiceImpl.java
deleted file mode 100644 (file)
index 37b3870..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.hibernate.criterion.Criterion;
-import org.hibernate.criterion.Restrictions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalapp.portal.domain.SharedContext;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-
-/**
- * Implementation of the shared-context service that talks to the database.
- */
-@Service("sharedContextService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class SharedContextServiceImpl implements SharedContextService {
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SharedContextServiceImpl.class);
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalsdk.core.service.SharedContextService#
-        * getSharedContexts()
-        */
-       @Override
-       @SuppressWarnings("unchecked")
-       public List<SharedContext> getSharedContexts(String contextId) {
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion contextIdCrit = Restrictions.eq("context_id", contextId);
-               restrictionsList.add(contextIdCrit);
-               List<SharedContext> contexts = (List<SharedContext>) getDataAccessService().getList(SharedContext.class, null,
-                               restrictionsList, null);
-
-               return contexts;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalsdk.core.service.SharedContextService#
-        * getSharedContext(java. lang.String, java.lang.String)
-        */
-       @Override
-       public SharedContext getSharedContext(String contextId, String key) {
-               SharedContext context = null;
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion contextIdCrit = Restrictions.eq("context_id", contextId);
-               Criterion keyCrit = Restrictions.eq("ckey", key);
-               restrictionsList.add(contextIdCrit);
-               restrictionsList.add(keyCrit);
-               @SuppressWarnings("unchecked")
-               List<SharedContext> contexts = (List<SharedContext>) getDataAccessService().getList(SharedContext.class, null,
-                               restrictionsList, null);
-               if (contexts != null && contexts.size() == 1)
-                       context = contexts.get(0);
-
-               return context;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.SharedContextService#
-        * addSharedContext(java.lang.String, java.lang.String, java.lang.String)
-        */
-       @Override
-       public void addSharedContext(String contextId, String key, String value) {
-               SharedContext context = new SharedContext(contextId, key, value);
-               saveSharedContext(context);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalsdk.core.service.SharedContextService#
-        * saveSharedContext(org.openecomp.portalapp.portal.domain.SharedContext)
-        */
-       @Override
-       public void saveSharedContext(SharedContext context) {
-               getDataAccessService().saveDomainObject(context, null);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalsdk.core.service.SharedContextService#
-        * deleteSharedContext(org.openecomp.portalapp.portal.domain.SharedContext)
-        */
-       @Override
-       public void deleteSharedContext(SharedContext context) {
-               getDataAccessService().deleteDomainObject(context, null);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.SharedContextService#
-        * deleteSharedContexts(java.lang.String)
-        */
-       @Override
-       public int deleteSharedContexts(String contextId) {
-               // Uses an inefficient method to avoid a where clause
-               // that could be used to mount a SQL injection attack.
-               List<SharedContext> contexts = getSharedContexts(contextId);
-               if (contexts == null)
-                       return 0;
-
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteSharedContexts: count is " + contexts.size());
-               for (SharedContext sc : contexts)
-                       deleteSharedContext(sc);
-
-               return contexts.size();
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.SharedContextService#
-        * expireSharedContexts(int)
-        */
-       @Override
-       public void expireSharedContexts(int ageInSeconds) {
-               // Specific to the MySQL database.
-               // final String whereClause = " where create_time < ADDDATE(NOW(),
-               // INTERVAL - " + ageInSeconds + " SECOND)";
-               final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-               Date expiredDateTime = new Date(System.currentTimeMillis() - ageInSeconds * 1000);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "expireSharedContexts: expire time is " + expiredDateTime.toString());
-               final String whereClause = " create_time < '" + dateFormat.format(expiredDateTime) + "'";
-               getDataAccessService().deleteDomainObjects(SharedContext.class, whereClause, null);
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/TicketEventService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/TicketEventService.java
deleted file mode 100644 (file)
index 4219e03..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-public interface TicketEventService {
-
-       public String getNotificationHyperLink(JsonNode application, String ticket, String eventSource);
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserNotificationService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserNotificationService.java
deleted file mode 100644 (file)
index 4aa6a18..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAppRole;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
-import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-
-public interface UserNotificationService {
-
-       /**
-        * Gets the specified notifications with userId from ep_notification
-        * 
-        * @param userId
-        * 
-        * @return the notifications with the specified userId
-        */
-
-       List<EpNotificationItem> getNotifications(Long userId);
-
-       /**
-        * Gets the specified roles from ep_role_notification
-        * 
-        * @param notificationId
-        * 
-        * @return the roles for a specified notification
-        */
-
-       List<EpRoleNotificationItem> getNotificationRoles(Long notificationId);
-
-       /**
-        * Get all app role list from the fn_app and fn_role table
-        * 
-        * @return list of all roles associated with the applications
-        */
-       List<EcompAppRole> getAppRoleList();
-
-       /**
-        * Marks the notification as viewed by the specified user.
-        * 
-        * @param notificationId
-        * @param userId
-        */
-       void setNotificationRead(Long notificationId, int userId);
-
-       /**
-        * Saves the specified notification to the table ep_notification
-        * 
-        * @param notificationItem
-        * @throws Exception
-        */
-
-       String saveNotification(EpNotificationItem notificationItem) throws Exception;
-
-       /**
-        * Gets the specified notification with the userId for view all recent
-        * notifications
-        * 
-        * @param userId
-        * 
-        * @return the notification list
-        */
-
-       List<EpNotificationItemVO> getNotificationHistoryVO(Long userId);
-
-       /**
-        * Gets the notifications with the userId for user notifications
-        * 
-        * @param userId
-        * 
-        * @return the notification list
-        */
-
-       List<EpNotificationItemVO> getAdminNotificationVOS(Long userId);
-
-       /**
-        * Gets the user list from fn_user
-        * 
-        * @param OrgIds
-        * 
-        * @return the users list
-        */
-
-       List<EPUser> getUsersByOrgIds(List<String> OrgIds);
-
-       /**
-        * Gets the received recipient to whom the notification is delivered from
-        * external system
-        * 
-        * @param notificationId
-        * 
-        * @return the active users
-        */
-
-       List<String> getMessageRecipients(Long notificationId);
-
-       /**
-        * delete the records from ep_notification table when the endtime is more
-        * than 3 months
-        * 
-        */
-
-       void deleteNotificationsFromEpNotificationTable();
-
-       /**
-        * delete the records from ep_user_notification table when the endtime is
-        * more than 3 months
-        * 
-        */
-       void deleteNotificationsFromEpUserNotificationTable();
-
-       /**
-        * delete the records from ep_role_notification table when the endtime is
-        * more than 3 months
-        * 
-        */
-       void deleteNotificationsFromEpRoleNotificationTable();
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserNotificationServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserNotificationServiceImpl.java
deleted file mode 100644 (file)
index 329d4e8..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.hibernate.SessionFactory;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserNotification;
-import org.openecomp.portalapp.portal.domain.EcompAppRole;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
-import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("userNotificationService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class UserNotificationServiceImpl implements UserNotificationService {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       private SessionFactory sessionFactory;
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * getNotifications(java.lang.Long)
-        */
-       @Override
-       public List<EpNotificationItem> getNotifications(Long userId) {
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("user_id", userId.toString());
-               @SuppressWarnings("unchecked")
-               List<EpNotificationItem> notificationList = dataAccessService.executeNamedQuery("getNotifications", params,
-                               null);
-               // set the roles to null for pure retrieval of all notifications
-               for (EpNotificationItem item : notificationList) {
-                       item.setRoles(null);
-               }
-               return notificationList;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * getNotificationHistoryVO(java.lang.Long)
-        */
-       @Override
-       public List<EpNotificationItemVO> getNotificationHistoryVO(Long userId) {
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("user_id", userId.toString());
-               @SuppressWarnings("unchecked")
-               List<EpNotificationItemVO> notificationList = dataAccessService.executeNamedQuery("getNotificationHistoryVO",
-                               params, null);
-               return notificationList;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * getAdminNotificationVOS()
-        */
-       @Override
-       public List<EpNotificationItemVO> getAdminNotificationVOS(Long userId) {
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("user_id", userId.toString());
-               @SuppressWarnings("unchecked")
-               List<EpNotificationItemVO> notificationList = dataAccessService
-                               .executeNamedQuery("getAdminNotificationHistoryVO", params, null);
-               return notificationList;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * getNotificationRoles(java.lang.Long)
-        */
-       @Override
-       public List<EpRoleNotificationItem> getNotificationRoles(Long notificationId) {
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("notificationId", Long.toString(notificationId));
-               @SuppressWarnings("unchecked")
-               List<EpRoleNotificationItem> roleNotifList = dataAccessService.executeNamedQuery("getNotificationRoles", params,
-                               null);
-               return roleNotifList;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * getAppRoleList()
-        */
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EcompAppRole> getAppRoleList() {
-               List<EcompAppRole> appRoleList = (List<EcompAppRole>) dataAccessService
-                               .executeNamedQuery("getEpNotificationAppRoles", null, null);
-               return appRoleList;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * setNotificationsRead(java.lang.Long, int)
-        */
-       @Override
-       public void setNotificationRead(Long notificationId, int userId) {
-               EPUserNotification userNotification = new EPUserNotification();
-               userNotification.setNotificationId(notificationId);
-               userNotification.setUpdateTime(new Date());
-               userNotification.setViewed("Y");
-               userNotification.setUserId((long) userId);
-               getDataAccessService().saveDomainObject(userNotification, null);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserNotificationService#
-        * saveNotification(org.openecomp.portalapp.portal.transport.
-        * EpNotificationItem)
-        */
-       @Override
-       public String saveNotification(EpNotificationItem notificationItem) throws Exception {
-
-               // gather the roles
-               if (notificationItem.getRoleIds() != null && !notificationItem.getIsForAllRoles().equals("Y")) {
-                       if (notificationItem.getRoles() == null) {
-                               Set<EpRoleNotificationItem> roleSet = new HashSet<EpRoleNotificationItem>();
-                               notificationItem.setRoles(roleSet);
-                       }
-                       for (Long roleId : notificationItem.getRoleIds()) {
-                               EpRoleNotificationItem roleItem = new EpRoleNotificationItem();
-                               roleItem.setNotificationId(notificationItem.getNotificationId());
-                               roleItem.setRoleId(roleId.intValue());
-                               notificationItem.getRoles().add(roleItem);
-                       }
-               }
-
-               // for updates fetch roles and then save
-               if (notificationItem.getNotificationId() != null) {
-                       EpNotificationItem updateNotificationItem = (EpNotificationItem) getDataAccessService()
-                                       .getDomainObject(EpNotificationItem.class, notificationItem.getNotificationId(), null);
-                       notificationItem.setRoles(updateNotificationItem.getRoles());
-               }
-               if (notificationItem.msgSource == null) {
-                       notificationItem.setMsgSource("EP");
-               }
-               getDataAccessService().saveDomainObject(notificationItem, null);
-               return "";
-
-       }
-
-       @Override
-       public List<EPUser> getUsersByOrgIds(List<String> OrgIds) {
-               Map<String, Object> params = new HashMap<String, Object>();
-               params.put("OrgIds", OrgIds);
-               @SuppressWarnings("unchecked")
-               List<EPUser> userList = dataAccessService.executeNamedQuery("getUsersByOrgIdsNotifications", params, null);
-               return userList;
-       }
-
-       @Override
-       public List<String> getMessageRecipients(Long notificationId) {
-               Map<String, String> params = new HashMap<>();
-               params.put("notificationId", Long.toString(notificationId));
-               @SuppressWarnings("unchecked")
-               List<String> activeUsers = dataAccessService.executeNamedQuery("messageRecipients", params, null);
-               return activeUsers;
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-       public SessionFactory getSessionFactory() {
-               return sessionFactory;
-       }
-
-       public void setSessionFactory(SessionFactory sessionFactory) {
-               this.sessionFactory = sessionFactory;
-       }
-
-       @Override
-       public void deleteNotificationsFromEpNotificationTable() {
-               Map<String, String> params = new HashMap<String, String>();
-               dataAccessService.executeNamedUpdateQuery("deleteNotificationsFromEpNotificationTable", params, null);
-       }
-
-       @Override
-       public void deleteNotificationsFromEpUserNotificationTable() {
-               Map<String, String> params = new HashMap<String, String>();
-               dataAccessService.executeNamedUpdateQuery("deleteNotificationsFromEpUserNotificationTable", params, null);
-
-       }
-
-       @Override
-       public void deleteNotificationsFromEpRoleNotificationTable() {
-               Map<String, String> params = new HashMap<String, String>();
-               dataAccessService.executeNamedUpdateQuery("deleteNotificationsFromEpRoleNotificationTable", params, null);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesCommonServiceImpl.java
deleted file mode 100644 (file)
index f5bdca7..0000000
+++ /dev/null
@@ -1,1952 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.service;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.cxf.transport.http.HTTPException;
-import org.hibernate.SQLQuery;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemUser;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
-import org.openecomp.portalapp.portal.domain.EPUserAppRoles;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequestDetail;
-import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.transport.EPUserAppCurrentRoles;
-import org.openecomp.portalapp.portal.transport.EcompUserAppRoles;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUser;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUserRoleDetail;
-import org.openecomp.portalapp.portal.transport.ExternalRequestFieldsValidator;
-import org.openecomp.portalapp.portal.transport.ExternalRoleDescription;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.portal.transport.RemoteRole;
-import org.openecomp.portalapp.portal.transport.RemoteUserWithRoles;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-import org.openecomp.portalapp.portal.transport.RolesInAppForUser;
-import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.restful.domain.EcompRole;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.RoleService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.RestTemplate;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@EPMetricsLog
-public class UserRolesCommonServiceImpl {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesCommonServiceImpl.class);
-
-       private static final Object syncRests = new Object();
-
-       @Autowired
-       private DataAccessService dataAccessService;
-       @Autowired
-       private SessionFactory sessionFactory;
-       @Autowired
-       private SearchService searchService;
-       @Autowired
-       private EPAppService appsService;
-       @Autowired
-       private ApplicationsRestClientService applicationsRestClientService;
-       @Autowired
-       private EPRoleService epRoleService;
-       @Autowired
-       private RoleService roleService;
-
-       @Autowired
-       private ExternalAccessRolesService externalAccessRolesService;
-
-       RestTemplate template = new RestTemplate();
-
-       /**
-        * 
-        * @param ecompRoles
-        * @return HashMap<Long, EcompRole>
-        */
-       private static HashMap<Long, EcompRole> hashMapFromEcompRoles(EcompRole[] ecompRoles) {
-               HashMap<Long, EcompRole> result = new HashMap<Long, EcompRole>();
-               if (ecompRoles != null) {
-                       for (int i = 0; i < ecompRoles.length; i++) {
-                               if (ecompRoles[i].getId() != null) {
-                                       result.put(ecompRoles[i].getId(), ecompRoles[i]);
-                               }
-                       }
-               }
-               return result;
-       }
-
-       /**
-        * 
-        * @param userId
-        */
-       protected void createLocalUserIfNecessary(String userId) {
-               if (StringUtils.isEmpty(userId)) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "createLocalUserIfNecessary : empty userId!");
-                       return;
-               }
-               Session localSession = null;
-               Transaction transaction = null;
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       @SuppressWarnings("unchecked")
-                       List<EPUser> userList = localSession
-                                       .createQuery("from " + EPUser.class.getName() + " where orgUserId='" + userId + "'").list();
-                       if (userList.size() == 0) {
-                               EPUser client = searchService.searchUserByUserId(userId);
-                               if (client == null) {
-                                       String msg = "createLocalUserIfNecessary: cannot create user " + userId
-                                                       + ", because not found in phonebook";
-                                       logger.error(EELFLoggerDelegate.errorLogger, msg);
-                               } else {
-                                       client.setLoginId(userId);
-                                       client.setActive(true);
-                                       localSession.save(client);
-                               }
-                       }
-                       transaction.commit();
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       EcompPortalUtils.rollbackTransaction(transaction, "searchOrCreateUser rollback, exception = " + e);
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "searchOrCreateUser");
-               }
-       }
-
-       /**
-        * This method return nothing and remove roles before adding any roles for an
-        * app
-        * 
-        * @param userRole
-        * @param appId
-        * @param localSession
-        * @param userAppRoles
-        * @param newUserAppRolesMap
-        */
-       private static void syncUserRolesExtension(EPUserApp userRole, Long appId, Session localSession,
-                       EcompRole[] userAppRoles, HashMap<Long, EcompRole> newUserAppRolesMap) {
-
-               Long userAppRoleId = 0L;
-               if (appId == PortalConstants.PORTAL_APP_ID) { // local app
-                       userAppRoleId = userRole.getRoleId();
-               } else { // remote app
-                       userAppRoleId = userRole.getAppRoleId();
-               }
-
-               if (!newUserAppRolesMap.containsKey(userAppRoleId)) {
-                       localSession.delete(userRole);
-               } else {
-                       newUserAppRolesMap.remove(userAppRoleId);
-               }
-       }
-
-       /**
-        * Checks whether the role is inactive
-        * 
-        * @param epRole
-        * @throws Exception
-        *             if role is inactive, throws exception
-        */
-       private void checkIfRoleInactive(EPRole epRole) throws Exception {
-               if (!epRole.getActive()) {
-                       throw new Exception(epRole.getName() + " role is unavailable");
-               }
-       }
-
-       /**
-        * 
-        * @param sessionFactory
-        * @param userId
-        * @param appId
-        * @param userAppRoles
-        * @param extRequestValue
-        *            set to false if request is from users page otherwise true
-        * @throws Exception
-        */
-       protected void syncUserRoles(SessionFactory sessionFactory, String userId, Long appId, EcompRole[] userAppRoles,
-                       Boolean extRequestValue, String reqType) throws Exception {
-               boolean result = false;
-               Session localSession = null;
-               Transaction transaction = null;
-               String roleActive = null;
-               final Map<String, String> userAppParams = new HashMap<>();
-               final Map<String, String> appParams = new HashMap<>();
-               HashMap<Long, EcompRole> newUserAppRolesMap = hashMapFromEcompRoles(userAppRoles);
-
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       @SuppressWarnings("unchecked")
-                       List<EPUser> userList = localSession
-                                       .createQuery("from " + EPUser.class.getName() + " where orgUserId='" + userId + "'").list();
-                       if (userList.size() > 0) {
-                               EPUser client = userList.get(0);
-                               roleActive = ("DELETE".equals(reqType)) ? "" : " and role.active = 'Y'";
-                               @SuppressWarnings("unchecked")
-                               List<EPUserApp> userRoles = localSession.createQuery("from " + EPUserApp.class.getName()
-                                               + " where app.id=" + appId + roleActive + " and userId=" + client.getId()).list();
-
-                               if ("DELETE".equals(reqType)) {
-                                       for (EPUserApp userAppRoleList : userRoles) {
-                                               userAppParams.put("roleName", String.valueOf(userAppRoleList.getRole().getName()));
-                                               userAppParams.put("appId", String.valueOf(appId));
-                                               appParams.put("appRoleName", userAppRoleList.getRole().getName());
-                                               @SuppressWarnings("unchecked")
-                                               List<EPRole> rolesList = (!userAppRoleList.getRole().getName()
-                                                               .equals(PortalConstants.ADMIN_ROLE))
-                                                                               ? (List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles",
-                                                                                               userAppParams, null)
-                                                                               : (List<EPRole>) dataAccessService.executeNamedQuery("getPortalAppRoles",
-                                                                                               appParams, null);
-                                               if (rolesList.size() > 0 || !rolesList.isEmpty()) {
-                                                       checkIfRoleInactive(rolesList.get(0));
-                                               }
-                                       }
-                               }
-
-                               for (EPUserApp userRole : userRoles) {
-                                       if (!userRole.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)
-                                                       && userRole.getRoleId() != PortalConstants.SYS_ADMIN_ROLE_ID && !extRequestValue) {
-                                               syncUserRolesExtension(userRole, appId, localSession, userAppRoles, newUserAppRolesMap);
-                                       } else if (extRequestValue
-                                                       && ("PUT".equals(reqType) || "POST".equals(reqType) || "DELETE".equals(reqType))) {
-                                               syncUserRolesExtension(userRole, appId, localSession, userAppRoles, newUserAppRolesMap);
-                                       } else if (extRequestValue && !userRole.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)) {
-                                               syncUserRolesExtension(userRole, appId, localSession, userAppRoles, newUserAppRolesMap);
-                                       }
-                               }
-                               Collection<EcompRole> newRolesToAdd = newUserAppRolesMap.values();
-                               if (newRolesToAdd.size() > 0) {
-                                       EPApp app = (EPApp) localSession.get(EPApp.class, appId);
-
-                                       HashMap<Long, EPRole> rolesMap = new HashMap<Long, EPRole>();
-                                       if (appId.equals(PortalConstants.PORTAL_APP_ID)) { // local app
-                                               String appIdValue = "";
-                                               if (!extRequestValue) {
-                                                       appIdValue = "and id != " + PortalConstants.SYS_ADMIN_ROLE_ID;
-                                               }
-                                               @SuppressWarnings("unchecked")
-                                               List<EPRole> roles = localSession
-                                                               .createQuery("from " + EPRole.class.getName() + " where appId is null " + appIdValue)
-                                                               .list();
-                                               for (EPRole role : roles) {
-                                                       role.setAppId(1L);
-                                                       rolesMap.put(role.getId(), role);
-                                               }
-                                       } else { // remote app
-                                               @SuppressWarnings("unchecked")
-                                               List<EPRole> roles = localSession
-                                                               .createQuery("from " + EPRole.class.getName() + " where appId=" + appId).list();
-                                               for (EPRole role : roles) {
-                                                       if (!extRequestValue && app.getCentralAuth()) {
-                                                               rolesMap.put(role.getId(), role);
-                                                       } else {
-                                                               rolesMap.put(role.getAppRoleId(), role);
-                                                       }
-                                               }
-                                       }
-
-                                       EPRole role = null;
-                                       for (EcompRole userRole : newRolesToAdd) {
-                                               EPUserApp userApp = new EPUserApp();
-                                               if (("PUT".equals(reqType) || "POST".equals(reqType))
-                                                               && userRole.getName().equals(PortalConstants.ADMIN_ROLE)) {
-                                                       role = (EPRole) localSession.get(EPRole.class,
-                                                                       new Long(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
-                                                       userApp.setRole(role);
-                                               } else if ((userRole.getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID))
-                                                               && !extRequestValue) {
-                                                       continue;
-                                               } else if ((userRole.getId().equals(PortalConstants.SYS_ADMIN_ROLE_ID))
-                                                               && app.getId().equals(PortalConstants.PORTAL_APP_ID) && !extRequestValue) {
-                                                       continue;
-                                               } else {
-                                                       userApp.setRole(rolesMap.get(userRole.getId()));
-                                               }
-
-                                               userApp.setUserId(client.getId());
-                                               userApp.setApp(app);
-                                               localSession.save(userApp);
-                                               localSession.flush();
-                                       }
-
-                                       if (appId == PortalConstants.PORTAL_APP_ID) {
-                                               /*
-                                                * for local app -- hack - always make sure fn_role table's app_id is null and
-                                                * not 1 for primary app in this case being ecomp portal app; reason: hibernate
-                                                * is rightly setting this to 1 while persisting to fn_role as per the mapping
-                                                * but SDK role management code expects the app_id to be null as there is no
-                                                * concept of App_id in SDK
-                                                */
-                                               localSession.flush();
-                                               SQLQuery sqlQuery = localSession
-                                                               .createSQLQuery("update fn_role set app_id = null where app_id = 1 ");
-                                               sqlQuery.executeUpdate();
-
-                                       }
-                               }
-                       }
-                       transaction.commit();
-                       result = true;
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "syncUserRoles failed", e);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       EcompPortalUtils.rollbackTransaction(transaction,
-                                       "Exception occurred in syncUserRoles, Details: " + e.toString());
-                       if ("DELETE".equals(reqType)) {
-                               throw new Exception(e.getMessage());
-                       }
-               } finally {
-                       localSession.close();
-                       if (!result && !"DELETE".equals(reqType)) {
-                               throw new Exception(
-                                               "Exception occurred in syncUserRoles while closing database session for app: '" + appId + "'.");
-                       }
-               }
-       }
-
-       /**
-        * Called when getting the list of roles for the user
-        * 
-        * @param appRoles
-        * @param userAppRoles
-        * @return List<RoleInAppForUser>
-        */
-       protected List<RoleInAppForUser> constructRolesInAppForUserGet(EcompRole[] appRoles, EcompRole[] userAppRoles) {
-               List<RoleInAppForUser> rolesInAppForUser = new ArrayList<RoleInAppForUser>();
-
-               Set<Long> userAppRolesMap = new HashSet<Long>();
-               if (userAppRoles != null) {
-                       for (EcompRole ecompRole : userAppRoles) {
-                               userAppRolesMap.add(ecompRole.getId());
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "constructRolesInAppForUserGet has received userAppRoles list empty");
-               }
-
-               if (appRoles != null) {
-                       for (EcompRole ecompRole : appRoles) {
-                               RoleInAppForUser roleForUser = new RoleInAppForUser(ecompRole.getId(), ecompRole.getName());
-                               roleForUser.isApplied = userAppRolesMap.contains(ecompRole.getId());
-                               rolesInAppForUser.add(roleForUser);
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger, "constructRolesInAppForUser has received appRoles list empty");
-               }
-               return rolesInAppForUser;
-       }
-
-       /**
-        * Called when getting the list of roles for the user
-        * 
-        * @param appRoles
-        * @param userAppRoles
-        * @param extRequestValue
-        *            set to false if request is from users page otherwise true
-        * @return List<RoleInAppForUser>
-        */
-       protected List<RoleInAppForUser> constructRolesInAppForUserGet(List<Role> appRoles, EPRole[] userAppRoles,
-                       Boolean extRequestValue) {
-               List<RoleInAppForUser> rolesInAppForUser = new ArrayList<RoleInAppForUser>();
-
-               Set<Long> userAppRolesMap = new HashSet<Long>();
-               if (userAppRoles != null) {
-                       for (EPRole ecompRole : userAppRoles) {
-                               userAppRolesMap.add(ecompRole.getId());
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "constructRolesInAppForUserGet has received userAppRoles list empty.");
-               }
-
-               if (appRoles != null) {
-                       for (Role ecompRole : appRoles) {
-                               if (ecompRole.getId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID) && !extRequestValue)
-                                       continue;
-                               RoleInAppForUser roleForUser = new RoleInAppForUser(ecompRole.getId(), ecompRole.getName());
-                               roleForUser.isApplied = userAppRolesMap.contains(ecompRole.getId());
-                               rolesInAppForUser.add(roleForUser);
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "constructRolesInAppForUser has received appRoles list empty.");
-               }
-               return rolesInAppForUser;
-       }
-
-       /**
-        * copies of methods in GetAppsWithUserRoleState
-        * 
-        * @param sessionFactory
-        * @param appId
-        * @param appRoles
-        * @throws Exception
-        */
-       protected void syncAppRoles(SessionFactory sessionFactory, Long appId, EcompRole[] appRoles) throws Exception {
-               logger.debug(EELFLoggerDelegate.debugLogger, "entering syncAppRoles for appId: " + appId);
-               HashMap<Long, EcompRole> newRolesMap = hashMapFromEcompRoles(appRoles);
-               Session localSession = null;
-               Transaction transaction = null;
-
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       // Attention! All roles from remote application supposed to be
-                       // active!
-                       @SuppressWarnings("unchecked")
-                       List<EPRole> currentAppRoles = localSession
-                                       .createQuery("from " + EPRole.class.getName() + " where appId=" + appId).list();
-                       List<EPRole> obsoleteRoles = new ArrayList<EPRole>();
-                       for (int i = 0; i < currentAppRoles.size(); i++) {
-                               EPRole oldAppRole = currentAppRoles.get(i);
-                               if (oldAppRole.getAppRoleId() != null) {
-                                       EcompRole role = null;
-                                       role = newRolesMap.get(oldAppRole.getAppRoleId());
-                                       if (role != null) {
-                                               if (!(role.getName() == null || oldAppRole.getName().equals(role.getName()))) {
-                                                       oldAppRole.setName(role.getName());
-                                                       localSession.update(oldAppRole);
-                                               }
-                                               newRolesMap.remove(oldAppRole.getAppRoleId());
-                                       } else {
-                                               obsoleteRoles.add(oldAppRole);
-                                       }
-                               } else {
-                                       obsoleteRoles.add(oldAppRole);
-                               }
-                       }
-                       Collection<EcompRole> newRolesToAdd = newRolesMap.values();
-                       if (obsoleteRoles.size() > 0) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: we have obsolete roles to delete");
-                               for (EPRole role : obsoleteRoles) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: obsolete role: " + role.toString());
-                                       Long roleId = role.getId();
-                                       // delete obsolete roles here
-                                       // Must delete all records with foreign key constraints on
-                                       // fn_role:
-                                       // fn_user_role, fn_role_composite, fn_role_function,
-                                       // fn_user_pseudo_role, fn_menu_functional_roles.
-                                       // And for fn_menu_functional, if no other roles for that
-                                       // menu item, remove the url.
-
-                                       // Delete from fn_user_role
-                                       @SuppressWarnings("unchecked")
-                                       List<EPUserApp> userRoles = localSession.createQuery(
-                                                       "from " + EPUserApp.class.getName() + " where app.id=" + appId + " and role_id=" + roleId)
-                                                       .list();
-
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "syncAppRoles: number of userRoles to delete: " + userRoles.size());
-                                       for (EPUserApp userRole : userRoles) {
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "syncAppRoles: about to delete userRole: " + userRole.toString());
-                                               localSession.delete(userRole);
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "syncAppRoles: finished deleting userRole: " + userRole.toString());
-                                       }
-
-                                       // Delete from fn_menu_functional_roles
-                                       @SuppressWarnings("unchecked")
-                                       List<FunctionalMenuRole> funcMenuRoles = localSession
-                                                       .createQuery("from " + FunctionalMenuRole.class.getName() + " where roleId=" + roleId)
-                                                       .list();
-                                       int numMenuRoles = funcMenuRoles.size();
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "syncAppRoles: number of funcMenuRoles for roleId: " + roleId + ": " + numMenuRoles);
-                                       for (FunctionalMenuRole funcMenuRole : funcMenuRoles) {
-                                               Long menuId = funcMenuRole.menuId;
-                                               // If this is the only role for this menu item, then the
-                                               // app and roles will be gone,
-                                               // so must null out the url too, to be consistent
-                                               @SuppressWarnings("unchecked")
-                                               List<FunctionalMenuRole> funcMenuRoles2 = localSession
-                                                               .createQuery("from " + FunctionalMenuRole.class.getName() + " where menuId=" + menuId)
-                                                               .list();
-                                               int numMenuRoles2 = funcMenuRoles2.size();
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "syncAppRoles: number of funcMenuRoles for menuId: " + menuId + ": " + numMenuRoles2);
-                                               localSession.delete(funcMenuRole);
-                                               if (numMenuRoles2 == 1) {
-                                                       // If this is the only role for this menu item, then
-                                                       // the app and roles will be gone,
-                                                       // so must null out the url too, to be consistent
-                                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                                       "syncAppRoles: There is exactly 1 menu item for this role, so emptying the url");
-                                                       @SuppressWarnings("unchecked")
-                                                       List<FunctionalMenuItem> funcMenuItems = localSession
-                                                                       .createQuery(
-                                                                                       "from " + FunctionalMenuItem.class.getName() + " where menuId=" + menuId)
-                                                                       .list();
-                                                       if (funcMenuItems.size() > 0) {
-                                                               logger.debug(EELFLoggerDelegate.debugLogger, "got the menu item");
-                                                               FunctionalMenuItem funcMenuItem = funcMenuItems.get(0);
-                                                               funcMenuItem.url = "";
-                                                               localSession.update(funcMenuItem);
-                                                       }
-                                               }
-                                       }
-                                       externalAccessRolesService.deleteRoleDependencyRecords(localSession, roleId, appId);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "syncAppRoles: about to delete the role: " + role.toString());
-                                       localSession.delete(role);
-                                       localSession.flush();
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: deleted the role");
-                               }
-                       }
-                       for (EcompRole role : newRolesToAdd) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "syncAppRoles: about to add missing role: " + role.toString());
-                               EPRole newRole = new EPRole();
-                               // Attention! All roles from remote application supposed to be
-                               // active!
-                               newRole.setActive(true);
-                               newRole.setName(role.getName());
-                               newRole.setAppId(appId);
-                               newRole.setAppRoleId(role.getId());
-                               localSession.save(newRole);
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: about to commit the transaction");
-                       transaction.commit();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "syncAppRoles: committed the transaction");
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "syncAppRoles failed", e);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       EcompPortalUtils.rollbackTransaction(transaction,
-                                       "Exception occurred in syncAppRoles, Details: " + e.toString());
-                       throw new Exception(e);
-               } finally {
-                       localSession.close();
-               }
-       }
-
-       /**
-        * Called when updating the list of roles for the user
-        * 
-        * @param userId
-        * @param appId
-        * @param userRolesInRemoteApp
-        * @return RolesInAppForUser
-        */
-       protected RolesInAppForUser constructRolesInAppForUserUpdate(String userId, Long appId,
-                       Set<EcompRole> userRolesInRemoteApp) {
-               RolesInAppForUser result;
-               result = new RolesInAppForUser();
-               result.appId = appId;
-               result.orgUserId = userId;
-               for (EcompRole role : userRolesInRemoteApp) {
-                       RoleInAppForUser roleInAppForUser = new RoleInAppForUser();
-                       roleInAppForUser.roleId = role.getId();
-                       roleInAppForUser.roleName = role.getName();
-                       roleInAppForUser.isApplied = new Boolean(true);
-                       result.roles.add(roleInAppForUser);
-               }
-               return result;
-       }
-
-       /**
-        * 
-        * @param roleInAppForUserList
-        * @return boolean
-        */
-       protected boolean remoteUserShouldBeCreated(List<RoleInAppForUser> roleInAppForUserList) {
-               for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) {
-                       if (roleInAppForUser.isApplied.booleanValue()) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-
-       /**
-        * Builds JSON and posts it to a remote application to update user roles.
-        * 
-        * @param roleInAppForUserList
-        * @param mapper
-        * @param applicationsRestClientService
-        * @param appId
-        * @param userId
-        * @return Set of roles as sent; NOT the response from the app.
-        * @throws JsonProcessingException
-        * @throws HTTPException
-        */
-       protected Set<EcompRole> postUsersRolesToRemoteApp(List<RoleInAppForUser> roleInAppForUserList, ObjectMapper mapper,
-                       ApplicationsRestClientService applicationsRestClientService, Long appId, String userId)
-                       throws JsonProcessingException, HTTPException {
-               Set<EcompRole> updatedUserRolesinRemote = constructUsersRemoteAppRoles(roleInAppForUserList);
-               Set<EcompRole> updateUserRolesInEcomp = constructUsersEcompRoles(roleInAppForUserList);
-               String userRolesAsString = mapper.writeValueAsString(updatedUserRolesinRemote);
-               applicationsRestClientService.post(EcompRole.class, appId, userRolesAsString,
-                               String.format("/user/%s/roles", userId));
-               // TODO: We should add code that verifies that the post operation did
-               // succeed. Because the SDK may still return 200 OK with an html page
-               // even when it fails!
-               return updateUserRolesInEcomp;
-       }
-
-       /**
-        * 
-        * @param roleInAppForUserList
-        * @return Set<EcompRole>
-        */
-       protected Set<EcompRole> constructUsersEcompRoles(List<RoleInAppForUser> roleInAppForUserList) {
-               Set<EcompRole> existingUserRoles = new TreeSet<EcompRole>();
-               for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) {
-                       if (roleInAppForUser.isApplied) {
-                               EcompRole ecompRole = new EcompRole();
-                               ecompRole.setId(roleInAppForUser.roleId);
-                               ecompRole.setName(roleInAppForUser.roleName);
-                               existingUserRoles.add(ecompRole);
-                       }
-               }
-               return existingUserRoles;
-       }
-
-       /**
-        * Constructs user app roles excluding Account Administrator role
-        * 
-        * @param roleInAppForUserList
-        * @return List of roles with Role name, Role Id
-        */
-       protected Set<EcompRole> constructUsersRemoteAppRoles(List<RoleInAppForUser> roleInAppForUserList) {
-               Set<EcompRole> existingUserRoles = new TreeSet<EcompRole>();
-               for (RoleInAppForUser roleInAppForUser : roleInAppForUserList) {
-                       if (roleInAppForUser.isApplied
-                                       && !roleInAppForUser.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)) {
-                               EcompRole ecompRole = new EcompRole();
-                               ecompRole.setId(roleInAppForUser.roleId);
-                               ecompRole.setName(roleInAppForUser.roleName);
-                               existingUserRoles.add(ecompRole);
-                       }
-               }
-               return existingUserRoles;
-       }
-
-       /**
-        * This is for a single app
-        * 
-        * @param rolesInAppForUser
-        * @param externalSystemRequest
-        *            set to false if requests from Users page otherwise true
-        * @return true on success, false otherwise
-        */
-       protected boolean applyChangesInUserRolesForAppToEcompDB(RolesInAppForUser rolesInAppForUser,
-                       boolean externalSystemRequest, String reqType) throws Exception {
-               boolean result = false;
-               String userId = rolesInAppForUser.orgUserId;
-               Long appId = rolesInAppForUser.appId;
-               synchronized (syncRests) {
-                       if (rolesInAppForUser != null) {
-                               createLocalUserIfNecessary(userId);
-                       }
-
-                       if (rolesInAppForUser != null) {
-                               EcompRole[] userAppRoles = new EcompRole[rolesInAppForUser.roles.stream().distinct()
-                                               .collect(Collectors.toList()).size()];
-                               for (int i = 0; i < rolesInAppForUser.roles.stream().distinct().collect(Collectors.toList())
-                                               .size(); i++) {
-                                       RoleInAppForUser roleInAppForUser = rolesInAppForUser.roles.get(i);
-                                       EcompRole role = new EcompRole();
-                                       role.setId(roleInAppForUser.roleId);
-                                       role.setName(roleInAppForUser.roleName);
-                                       userAppRoles[i] = role;
-                               }
-                               try {
-                                       syncUserRoles(sessionFactory, userId, appId, userAppRoles, externalSystemRequest, reqType);
-                                       result = true;
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger,
-                                                       "applyChangesInUserRolesForAppToEcompDB: failed to syncUserRoles for orgUserId " + userId,
-                                                       e);
-                                       if ("DELETE".equals(reqType)) {
-                                               throw new Exception(e.getMessage());
-                                       }
-                               }
-                       }
-               }
-               return result;
-       }
-
-       /**
-        * 
-        * @param appId
-        * @param remoteUser
-        * @return UserApplicationRoles
-        */
-       protected UserApplicationRoles convertToUserApplicationRoles(Long appId, RemoteUserWithRoles remoteUser) {
-               UserApplicationRoles userWithRemoteAppRoles = new UserApplicationRoles();
-               userWithRemoteAppRoles.setAppId(appId);
-               userWithRemoteAppRoles.setOrgUserId(remoteUser.getOrgUserId());
-               userWithRemoteAppRoles.setFirstName(remoteUser.getFirstName());
-               userWithRemoteAppRoles.setLastName(remoteUser.getLastName());
-               userWithRemoteAppRoles.setRoles(remoteUser.getRoles());
-               return userWithRemoteAppRoles;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserRolesService#
-        * importRolesFromRemoteApplication(java.lang.Long)
-        */
-       public List<EPRole> importRolesFromRemoteApplication(Long appId) throws HTTPException {
-               EPRole[] appRolesFull = applicationsRestClientService.get(EPRole[].class, appId, "/rolesFull");
-               List<EPRole> rolesList = Arrays.asList(appRolesFull);
-               for (EPRole externalAppRole : rolesList) {
-
-                       // Try to find an existing extern role for the app in the local
-                       // ecomp DB. If so, then use its id to update the existing external
-                       // application role record.
-                       Long externAppId = externalAppRole.getId();
-                       EPRole existingAppRole = epRoleService.getRole(appId, externAppId);
-                       if (existingAppRole != null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               String.format("ecomp role already exists for app=%s; appRoleId=%s. No need to import this one.",
-                                                               appId, externAppId));
-                               continue;
-                       }
-                       // persistExternalRoleInEcompDb(externalAppRole, appId,
-                       // roleService);
-               }
-
-               return rolesList;
-       }
-
-       /**
-        * It adds new user for remote application
-        * 
-        * @param roleInAppForUserList
-        * @param remoteAppUser
-        * @param userId
-        * @param app
-        * @param mapper
-        * @param searchService
-        * @param applicationsRestClientService
-        * @return
-        * @throws Exception
-        */
-       private EPUser addRemoteUser(List<RoleInAppForUser> roleInAppForUserList, String userId, EPApp app,
-                       ObjectMapper mapper, SearchService searchService,
-                       ApplicationsRestClientService applicationsRestClientService) throws Exception {
-               EPUser addRemoteUser = null;
-               if (remoteUserShouldBeCreated(roleInAppForUserList)) {
-
-                       createNewUserOnRemoteApp(userId, app, applicationsRestClientService, searchService, mapper,
-                                       isAppUpgradeVersion(app));
-                       // If we succeed, we know that the new user was
-                       // persisted on remote app.
-                       addRemoteUser = getUserFromApp(userId, app, applicationsRestClientService);
-                       if (addRemoteUser == null) {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "Failed to persist new user: " + userId + " in remote app. appId = " + app.getId());
-                               // return null;
-                       }
-               }
-               return addRemoteUser;
-       }
-
-       /**
-        * It checks whether the remote user exists or not if exits returns user object
-        * else null
-        * 
-        * @param userId
-        * @param app
-        * @param applicationsRestClientService
-        * @return
-        * @throws HTTPException
-        */
-       private EPUser checkIfRemoteUserExits(String userId, EPApp app,
-                       ApplicationsRestClientService applicationsRestClientService) throws HTTPException {
-               EPUser checkRemoteUser = null;
-               try {
-                       checkRemoteUser = getUserFromApp(userId, app, applicationsRestClientService);
-               } catch (HTTPException e) {
-                       // Some apps are returning 400 if user is not found.
-                       if (e.getResponseCode() == 400) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "setAppWithUserRoleStateForUser: getuserFromApp threw exception with response code 400; continuing",
-                                               e);
-                       } else if (e.getResponseCode() == 404) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "setAppWithUserRoleStateForUser: getuserFromApp threw exception with response code 404; continuing",
-                                               e);
-                       } else {
-                               // Other response code, let it come thru.
-                               throw e;
-                       }
-               }
-               return checkRemoteUser;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserRolesService#
-        * setAppWithUserRoleStateForUser(org.openecomp.portalapp.portal.domain. EPUser,
-        * org.openecomp.portalapp.portal.transport.AppWithRolesForUser)
-        */
-       public boolean setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser) {
-               boolean result = false;
-               boolean epRequestValue = false;
-               String userId = "";
-               if (newAppRolesForUser != null && newAppRolesForUser.orgUserId != null) {
-                       userId = newAppRolesForUser.orgUserId.trim();
-               }
-               Long appId = newAppRolesForUser.appId;
-               List<RoleInAppForUser> roleInAppForUserList = newAppRolesForUser.appRoles;
-               if (userId.length() > 0) {
-                       ObjectMapper mapper = new ObjectMapper();
-                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
-                       try {
-                               EPApp app = appsService.getApp(appId);
-                               applyChangesToUserAppRolesForMyLoginsRequest(user, appId);
-
-                               // if centralized app
-                               if (app.getCentralAuth()) {
-                                       // We should add If user does not exist in remote application
-                                       if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                               EPUser remoteAppUser = null;
-                                               remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService);
-
-                                               if (remoteAppUser == null) {
-                                                       addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService,
-                                                                       applicationsRestClientService);
-                                               }
-                                       }
-
-                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
-                                                       applicationsRestClientService, appId, userId);
-                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
-                                                       userRolesInLocalApp);
-                                       List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
-                                       // Apply changes in external Access system
-                                       updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList, epRequestValue);
-                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal");
-                               }
-                               // In case if portal is not centralized then follow existing approach
-                               else if (!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
-                                                       applicationsRestClientService, appId, userId);
-                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
-                                                       userRolesInLocalApp);
-                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, "Portal");
-                               } else {// remote app
-                                       EPUser remoteAppUser = null;
-                                       if (!app.getCentralAuth() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-
-                                               remoteAppUser = checkIfRemoteUserExits(userId, app, applicationsRestClientService);
-
-                                               if (remoteAppUser == null) {
-                                                       remoteAppUser = addRemoteUser(roleInAppForUserList, userId, app, mapper, searchService,
-                                                                       applicationsRestClientService);
-                                               }
-                                               if (remoteAppUser != null) {
-                                                       Set<EcompRole> userRolesInRemoteApp = postUsersRolesToRemoteApp(roleInAppForUserList,
-                                                                       mapper, applicationsRestClientService, appId, userId);
-                                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(userId, appId,
-                                                                       userRolesInRemoteApp);
-                                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, epRequestValue, null);
-
-                                                       // If no roles remain, request app to set user inactive.
-                                                       if (userRolesInRemoteApp.size() == 0) {
-                                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                                               "setAppWithUserRoleStateForUser: no roles in app {}, set user {} to inactive",
-                                                                               app, userId);
-                                                               remoteAppUser.setActive(false);
-                                                               postUserToRemoteApp(userId, user, app, applicationsRestClientService);
-                                                       }
-                                               }
-                                       }
-                               }
-                       } catch (Exception e) {
-                               String message = String.format("Failed to create user or update user roles for User %s, AppId %s",
-                                               userId, Long.toString(appId));
-                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
-                               result = false;
-                       }
-
-               }
-               return result;
-       }
-
-       /**
-        * It adds user roles in External system and also make data consistent in both
-        * local and in External System
-        * 
-        * @param app
-        *            details
-        * @param orgUserId
-        * @param roleInAppUser
-        *            Contains list of active roles
-        */
-       @SuppressWarnings("unchecked")
-       private void updateUserRolesInExternalSystem(EPApp app, String orgUserId, List<RoleInAppForUser> roleInAppUser,
-                       boolean isPortalRequest) {
-               try {
-                       // check if user exists
-                       final Map<String, String> userParams = new HashMap<>();
-                       userParams.put("orgUserIdValue", orgUserId);
-                       List<EPUser> userInfo = checkIfUserExists(userParams);
-                       if (userInfo.isEmpty()) {
-                               createLocalUserIfNecessary(orgUserId);
-                       }
-                       String name = "";
-                       if (EPCommonSystemProperties
-                                       .containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN)) {
-                               name = orgUserId
-                                               + SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN);
-                       }
-                       ObjectMapper mapper = new ObjectMapper();
-                       HttpHeaders headers = EcompPortalUtils.base64encodeKeyForAAFBasicAuth();
-                       HttpEntity<String> getUserRolesEntity = new HttpEntity<>(headers);
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Connecting to external system to get current user roles");
-                       ResponseEntity<String> getResponse = template
-                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                       + "roles/user/" + name, HttpMethod.GET, getUserRolesEntity, String.class);
-                       if (getResponse.getStatusCode().value() == 200) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "updateUserRolesInExternalSystem: Finished GET user roles from external system and received user roles {}",
-                                               getResponse.getBody());
-
-                       }
-                       List<ExternalAccessUserRoleDetail> userRoleDetailList = new ArrayList<>();
-                       String res = getResponse.getBody();
-                       JSONObject jsonObj = null;
-                       JSONArray extRoles = null;
-                       if (!res.equals("{}")) {
-                               jsonObj = new JSONObject(res);
-                               extRoles = jsonObj.getJSONArray("role");
-                       }
-                       ExternalAccessUserRoleDetail userRoleDetail = null;
-                       if (extRoles != null) {
-                               for (int i = 0; i < extRoles.length(); i++) {
-                                       if (extRoles.getJSONObject(i).getString("name").startsWith(app.getNameSpace() + ".")
-                                                       && !extRoles.getJSONObject(i).getString("name").equals(app.getNameSpace() + ".admin")
-                                                       && !extRoles.getJSONObject(i).getString("name").equals(app.getNameSpace() + ".owner")) {
-                                               ObjectMapper descMapper = new ObjectMapper();
-                                               if (extRoles.getJSONObject(i).has("description")) {
-                                                       ExternalRoleDescription desc = descMapper.readValue(
-                                                                       extRoles.getJSONObject(i).getString("description"), ExternalRoleDescription.class);
-                                                       userRoleDetail = new ExternalAccessUserRoleDetail(
-                                                                       extRoles.getJSONObject(i).getString("name"), desc);
-                                                       userRoleDetailList.add(userRoleDetail);
-                                               } else {
-                                                       userRoleDetail = new ExternalAccessUserRoleDetail(
-                                                                       extRoles.getJSONObject(i).getString("name"), null);
-                                                       userRoleDetailList.add(userRoleDetail);
-                                               }
-
-                                       }
-                               }
-                       }
-                       // If request coming from portal not from external role approval system then we
-                       // have to check if user already
-                       // have account admin or system admin as GUI will not send these roles
-                       if (!isPortalRequest) {
-                               final Map<String, String> loginIdParams = new HashMap<>();
-                               loginIdParams.put("orgUserIdValue", orgUserId);
-                               EPUser user = (EPUser) dataAccessService.executeNamedQuery("epUserAppId", loginIdParams, null).get(0);
-                               final Map<String, Long> params = new HashMap<>();
-                               params.put("appId", app.getId());
-                               params.put("userId", user.getId());
-                               List<EcompUserAppRoles> userAppList = dataAccessService.executeNamedQuery("getUserAppExistingRoles",
-                                               params, null);
-                               if (!roleInAppUser.isEmpty()) {
-                                       for (EcompUserAppRoles userApp : userAppList) {
-                                               if (userApp.getRoleId().equals(PortalConstants.SYS_ADMIN_ROLE_ID)
-                                                               || userApp.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID)) {
-                                                       RoleInAppForUser addSpecialRole = new RoleInAppForUser();
-                                                       addSpecialRole.setIsApplied(true);
-                                                       addSpecialRole.setRoleId(userApp.getRoleId());
-                                                       addSpecialRole.setRoleName(userApp.getRoleName());
-                                                       roleInAppUser.add(addSpecialRole);
-                                               }
-                                       }
-                               }
-                       }
-                       List<RoleInAppForUser> roleInAppUserNonDupls = roleInAppUser.stream().distinct()
-                                       .collect(Collectors.toList());
-                       final Map<String, RoleInAppForUser> currentUserRolesToUpdate = new HashMap<>();
-                       for (RoleInAppForUser roleInAppUserNew : roleInAppUser) {
-                               currentUserRolesToUpdate.put(roleInAppUserNew.getRoleName(), roleInAppUserNew);
-                       }
-                       final Map<String, ExternalAccessUserRoleDetail> currentUserRolesInExternalSystem = new HashMap<>();
-                       for (ExternalAccessUserRoleDetail extAccessUserRole : userRoleDetailList) {
-                               currentUserRolesInExternalSystem.put(extAccessUserRole.getName(), extAccessUserRole);
-                       }
-                       // Check if roles does not exists in local but still there in External Central
-                       // Auth System delete them all
-                       for (ExternalAccessUserRoleDetail userRole : userRoleDetailList) {
-                               if (!(currentUserRolesToUpdate
-                                               .containsKey(userRole.getName().substring(app.getNameSpace().length() + 1).replaceAll("_", " "))
-                                               || currentUserRolesToUpdate
-                                                               .containsKey(userRole.getName().substring(app.getNameSpace().length() + 1)))) {
-                                       HttpEntity<String> entity = new HttpEntity<>(headers);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateUserRolesInExternalSystem: Connecting to external system to DELETE user role {}",
-                                                       userRole);
-                                       ResponseEntity<String> deleteResponse = template.exchange(
-                                                       SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                       + "userRole/" + name + "/" + userRole.getName(),
-                                                       HttpMethod.DELETE, entity, String.class);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateUserRolesInExternalSystem: Finished DELETE operation in external system for user role {} and the response is {}",
-                                                       userRole, deleteResponse.getBody());
-                               }
-                       }
-                       // Check if user roles does not exists in External Central Auth System add them
-                       // all
-                       for (RoleInAppForUser addUserRole : roleInAppUserNonDupls) {
-                               if (!(currentUserRolesInExternalSystem
-                                               .containsKey(app.getNameSpace() + "." + addUserRole.getRoleName().replaceAll(" ", "_")))) {
-                                       ExternalAccessUser extUser = new ExternalAccessUser(name,
-                                                       app.getNameSpace() + "." + addUserRole.getRoleName().replaceAll(" ", "_"));
-                                       String formattedUserRole = mapper.writeValueAsString(extUser);
-                                       HttpEntity<String> entity = new HttpEntity<>(formattedUserRole, headers);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateUserRolesInExternalSystem: Connecting to external system and adding user role",
-                                                       addUserRole.getRoleName());
-                                       ResponseEntity<String> addResponse = template
-                                                       .exchange(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
-                                                                       + "userRole", HttpMethod.POST, entity, String.class);
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateUserRolesInExternalSystem: Finished adding user role in external system {} and added user role {}",
-                                                       getResponse.getBody(), addUserRole.getRoleName());
-                                       if (addResponse.getStatusCode().value() != 201 && addResponse.getStatusCode().value() != 404) {
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "Finished POST operation in external system but unable to save user role",
-                                                               getResponse.getBody(), addUserRole.getRoleName());
-                                               throw new Exception(addResponse.getBody());
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "updateUserRolesInExternalSystem: Failed to add user role for application {} due to {}",
-                                       app.getId(), e);
-               }
-
-       }
-
-       /**
-        * 
-        * @param userId
-        * @param app
-        * @param applicationsRestClientService
-        * @param searchService
-        * @param mapper
-        * @throws Exception
-        */
-       protected void createNewUserOnRemoteApp(String userId, EPApp app,
-                       ApplicationsRestClientService applicationsRestClientService, SearchService searchService,
-                       ObjectMapper mapper, boolean postOpenSource) throws Exception {
-
-               EPUser client = searchService.searchUserByUserId(userId);
-
-               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-
-               if (client == null) {
-                       String msg = "cannot create user " + userId + ", because he/she cannot be found in phonebook.";
-                       logger.error(EELFLoggerDelegate.errorLogger, msg);
-                       throw new Exception(msg);
-               }
-
-               client.setLoginId(userId);
-               client.setActive(true);
-
-               String userInString = null;
-               userInString = mapper.writerFor(EPUser.class).writeValueAsString(client);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "about to post new client to remote application, users json = " + userInString);
-               applicationsRestClientService.post(EPUser.class, app.getId(), userInString, String.format("/user", userId));
-
-       }
-
-       @SuppressWarnings("unchecked")
-       protected void applyChangesToAppRolesRequest(Long appId, Long userId, String updateStatus,
-                       EPUserAppRolesRequest epUserAppRolesRequest) {
-               final Map<String, Long> epRequestParams = new HashMap<>();
-               try {
-                       EPUserAppRolesRequest epAppRolesRequestData = epUserAppRolesRequest;
-                       epAppRolesRequestData.setUpdatedDate(new Date());
-                       epAppRolesRequestData.setRequestStatus(updateStatus);
-                       HashMap<String, Long> addiotonalUpdateParam = new HashMap<String, Long>();
-                       addiotonalUpdateParam.put("userId", userId);
-                       dataAccessService.saveDomainObject(epAppRolesRequestData, addiotonalUpdateParam);
-                       epRequestParams.put("reqId", epUserAppRolesRequest.getId());
-                       List<EPUserAppRolesRequestDetail> epUserAppRolessDetailList = new ArrayList<EPUserAppRolesRequestDetail>();
-                       epUserAppRolessDetailList = dataAccessService.executeNamedQuery("userAppRolesRequestDetailList",
-                                       epRequestParams, null);
-                       if (epUserAppRolessDetailList.size() > 0) {
-                               for (EPUserAppRolesRequestDetail epRequestUpdateData : epUserAppRolessDetailList) {
-                                       EPUserAppRolesRequestDetail epAppRoleDetailData = epRequestUpdateData;
-                                       epAppRoleDetailData.setReqType(updateStatus);
-                                       epAppRoleDetailData.setEpRequestIdData(epAppRolesRequestData);
-                                       HashMap<String, Long> updateDetailsParam = new HashMap<String, Long>();
-                                       addiotonalUpdateParam.put("reqId", epUserAppRolesRequest.getId());
-                                       dataAccessService.saveDomainObject(epAppRoleDetailData, updateDetailsParam);
-                               }
-                       }
-                       logger.debug(EELFLoggerDelegate.debugLogger, "The request is set to complete");
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "applyChangesToAppRolesRequest failed", e);
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       public void applyChangesToUserAppRolesForMyLoginsRequest(EPUser user, Long appId) {
-               final Map<String, Long> params = new HashMap<>();
-               final Map<String, Long> epDetailParams = new HashMap<>();
-               List<EPUserAppRolesRequest> epRequestIdVal = new ArrayList<EPUserAppRolesRequest>();
-               params.put("appId", appId);
-               params.put("userId", user.getId());
-               try {
-                       epRequestIdVal = (List<EPUserAppRolesRequest>) dataAccessService
-                                       .executeNamedQuery("userAppRolesRequestList", params, null);
-                       if (epRequestIdVal.size() > 0) {
-                               EPUserAppRolesRequest epAppRolesRequestData = epRequestIdVal.get(0);
-                               epAppRolesRequestData.setUpdatedDate(new Date());
-                               epAppRolesRequestData.setRequestStatus("O");
-                               HashMap<String, Long> addiotonalUpdateParam = new HashMap<String, Long>();
-                               addiotonalUpdateParam.put("userId", user.getId());
-                               dataAccessService.saveDomainObject(epAppRolesRequestData, addiotonalUpdateParam);
-                               epDetailParams.put("reqId", epAppRolesRequestData.getId());
-                               List<EPUserAppRolesRequestDetail> epUserAppRolesDetailList = new ArrayList<EPUserAppRolesRequestDetail>();
-                               epUserAppRolesDetailList = dataAccessService.executeNamedQuery("userAppRolesRequestDetailList",
-                                               epDetailParams, null);
-                               if (epUserAppRolesDetailList.size() > 0) {
-                                       for (EPUserAppRolesRequestDetail epRequestUpdateList : epUserAppRolesDetailList) {
-                                               EPUserAppRolesRequestDetail epAppRoleDetailData = epRequestUpdateList;
-                                               epAppRoleDetailData.setReqType("O");
-                                               epAppRoleDetailData.setEpRequestIdData(epAppRolesRequestData);
-                                               HashMap<String, Long> updateDetailsParams = new HashMap<String, Long>();
-                                               addiotonalUpdateParam.put("reqId", epAppRolesRequestData.getId());
-                                               dataAccessService.saveDomainObject(epAppRoleDetailData, updateDetailsParams);
-                                       }
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "User App roles request from User Page is overridden");
-                               }
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "applyChangesToUserAppRolesRequest failed", e);
-               }
-       }
-
-       /**
-        * Pushes specified user details to the specified remote app.
-        * 
-        * @param userId
-        *            OrgUserId identifying user at remote app in REST endpoint path
-        * @param user
-        *            User details to be pushed
-        * @param app
-        *            Remote app
-        * @param applicationsRestClientService
-        * @throws HTTPException
-        */
-       protected void postUserToRemoteApp(String userId, EPUser user, EPApp app,
-                       ApplicationsRestClientService applicationsRestClientService) throws HTTPException {
-
-               getUser(userId, app, applicationsRestClientService);
-
-       }
-
-       /**
-        * It returns user details for single org user id
-        * 
-        * @param userParams
-        * @return if user exists it returns list of user details otherwise empty value
-        */
-       @SuppressWarnings("unchecked")
-       private List<EPUser> checkIfUserExists(Map<String, String> userParams) {
-               return (List<EPUser>) dataAccessService.executeNamedQuery("epUserAppId", userParams, null);
-       }
-
-       /**
-        * It checks whether the new user is valid or not otherwise throws exception
-        * 
-        * @param orgUserId
-        * @param app
-        * @return Checks if user is valid and returns message otherwise throws
-        *         exception
-        * @throws Exception
-        */
-       private String validateNewUser(String orgUserId, EPApp app) throws Exception {
-               EPUser epUser = searchService.searchUserByUserId(orgUserId);
-               if (epUser == null) {
-                       throw new Exception("User does not exist");
-               } else if (!epUser.getOrgUserId().equals(orgUserId)) {
-                       throw new Exception("User does not exist");
-               } else if (app == null) {
-                       throw new Exception("Application does not exist");
-               }
-               return "Saved Successfully";
-       }
-
-       /**
-        * Checks if the fields exists or not
-        * 
-        * @param userList
-        *            contains user information
-        * @param app
-        *            contains app name
-        * @throws Exception
-        *             throws exception if the field is not valid
-        */
-       private void validateExternalRequestFields(List<EPUser> userList, EPApp app) throws Exception {
-               if (userList.size() == 0 || userList.isEmpty()) {
-                       throw new Exception("User does not exist");
-               } else if (app == null) {
-                       throw new Exception("Application does not exist");
-               } else if (!app.getEnabled() && !app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                       throw new Exception(app.getMlAppName() + " application is unavailable");
-               }
-       }
-
-       @SuppressWarnings("unchecked")
-       public ExternalRequestFieldsValidator setExternalRequestUserAppRole(ExternalSystemUser newAppRolesForUser,
-                       String reqType) {
-               boolean result = false;
-               boolean externalSystemRequest = true;
-               final Map<String, Long> params = new HashMap<>();
-               final Map<String, String> userParams = new HashMap<>();
-               List<EPUser> userInfo = null;
-               EPUser userId = null;
-               List<EPUserAppRolesRequest> epRequestId = null;
-               String orgUserId = "";
-               String updateStatus = "";
-               String reqMessage = "";
-               EPApp app = null;
-               if (newAppRolesForUser != null && newAppRolesForUser.getLoginId() != null) {
-                       orgUserId = newAppRolesForUser.getLoginId().trim();
-               }
-               String appName = newAppRolesForUser.getApplicationName();
-               String logMessage = ("DELETE").equals(reqType) ? "Deleting" : "Assigning/Updating";
-               if (orgUserId.length() > 0) {
-                       ObjectMapper mapper = new ObjectMapper();
-                       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-                       int epRequestIdSize = 0;
-                       try {
-                               app = appsService.getAppDetail(appName);
-                               userParams.put("orgUserIdValue", orgUserId);
-                               userInfo = checkIfUserExists(userParams);
-                               reqMessage = "Updated Successfully";
-                               if (!reqType.equals("DELETE") && (userInfo.size() == 0 || userInfo.isEmpty())) {
-                                       reqMessage = validateNewUser(orgUserId, app);
-                               }
-                               if (userInfo.size() != 0 || !userInfo.isEmpty()) {
-                                       validateExternalRequestFields(userInfo, app);
-                                       userId = userInfo.get(0);
-                                       params.put("appId", app.getId());
-                                       params.put("userId", userId.getId());
-                                       epRequestId = (List<EPUserAppRolesRequest>) dataAccessService
-                                                       .executeNamedQuery("userAppRolesRequestList", params, null);
-                                       epRequestIdSize = epRequestId.size();
-                               }
-
-                               // If Non-Centralized app make sure you sync app roles before assigning to user
-                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID) && !app.getCentralAuth()) {
-                                       EcompRole[] appRoles = applicationsRestClientService.get(EcompRole[].class, app.getId(), "/roles");
-                                       syncAppRoles(sessionFactory, app.getId(), appRoles);
-                               }
-                               List<RoleInAppForUser> roleInAppForUserList = roleInAppForUserList(newAppRolesForUser.getRoles(),
-                                               app.getId(), app.getMlAppName());
-                               List<EcompUserAppRoles> userRoleList = null;
-                               if (!userInfo.isEmpty()) {
-                                       final Map<String, Long> appParams = new HashMap<>();
-                                       appParams.put("userId", userId.getId());
-                                       appParams.put("appId", app.getId());
-                                       userRoleList = dataAccessService.executeNamedQuery("getUserAppExistingRoles", appParams, null);
-                               }
-                               // Check if list contains just account admin role
-                               boolean checkIfAdminRoleExists = false;
-                               if (reqType.equals("DELETE") && userRoleList != null) {
-                                       checkIfAdminRoleExists = userRoleList.stream()
-                                                       .anyMatch(userRole -> userRole.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
-                               } else {
-                                       checkIfAdminRoleExists = roleInAppForUserList.stream()
-                                                       .anyMatch(roleList -> roleList.getRoleId().equals(PortalConstants.ACCOUNT_ADMIN_ROLE_ID));
-                               }
-                               // if Centralized app
-                               if (app.getCentralAuth()) {
-                                       // We should add If user does not exist in remote application
-                                       try {
-                                               // If adding just account admin role dont make remote application user call
-                                               if (!app.getId().equals(PortalConstants.PORTAL_APP_ID)
-                                                               && !(checkIfAdminRoleExists && reqType.equals("DELETE"))
-                                                               && roleInAppForUserList.size() > 1) {
-                                                       EPUser remoteAppUser = null;
-                                                       remoteAppUser = checkIfRemoteUserExits(orgUserId, app, applicationsRestClientService);
-                                                       if (remoteAppUser == null) {
-                                                               addRemoteUser(roleInAppForUserList, orgUserId, app, mapper, searchService,
-                                                                               applicationsRestClientService);
-                                                               reqMessage = "Saved Successfully";
-                                                       }
-                                               }
-                                       } catch (Exception e) {
-                                               reqMessage = e.getMessage();
-                                               logger.error(EELFLoggerDelegate.errorLogger,
-                                                               "setExternalRequestUserAppRole: Failed to added remote user", e);
-                                               throw new Exception(reqMessage);
-                                       }
-                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
-                                                       applicationsRestClientService, app.getId(), orgUserId);
-                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
-                                                       userRolesInLocalApp);
-                                       List<RoleInAppForUser> roleAppUserList = rolesInAppForUser.roles;
-                                       // Apply changes in external Access system
-                                       updateUserRolesInExternalSystem(app, rolesInAppForUser.orgUserId, roleAppUserList,
-                                                       externalSystemRequest);
-                                       logger.info(EELFLoggerDelegate.debugLogger,
-                                                       "setExternalRequestUserAppRole: {} user app roles: for app {}, user {}", logMessage,
-                                                       newAppRolesForUser.getApplicationName(), newAppRolesForUser.getLoginId());
-                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest, reqType);
-                               }
-                               // If local application is not centralized
-                               else if (!app.getCentralAuth() && app.getId().equals(PortalConstants.PORTAL_APP_ID)) {
-                                       Set<EcompRole> userRolesInLocalApp = postUsersRolesToLocalApp(roleInAppForUserList, mapper,
-                                                       applicationsRestClientService, app.getId(), orgUserId);
-                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
-                                                       userRolesInLocalApp);
-                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest, reqType);
-                               } else {// remote app
-                                       // If adding just account admin role don't do remote application user call
-                                       if (!((roleInAppForUserList.size() == 1 || reqType.equals("DELETE")) && checkIfAdminRoleExists)) {
-                                               EPUser remoteAppUser = null;
-                                               remoteAppUser = checkIfRemoteUserExits(orgUserId, app, applicationsRestClientService);
-                                               if (remoteAppUser == null) {
-                                                       remoteAppUser = addRemoteUser(roleInAppForUserList, orgUserId, app, mapper, searchService,
-                                                                       applicationsRestClientService);
-                                                       reqMessage = "Saved Successfully";
-                                               }
-                                               if (remoteAppUser != null) {
-                                                       Set<EcompRole> userRolesInRemoteApp = postUsersRolesToRemoteApp(roleInAppForUserList,
-                                                                       mapper, applicationsRestClientService, app.getId(), orgUserId);
-
-                                                       RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId,
-                                                                       app.getId(), userRolesInRemoteApp);
-                                                       logger.info(EELFLoggerDelegate.debugLogger,
-                                                                       "setExternalRequestUserAppRole: {} user app roles: for app {}, user {}", logMessage,
-                                                                       newAppRolesForUser.getApplicationName(), newAppRolesForUser.getLoginId());
-                                                       result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest,
-                                                                       reqType);
-                                                       // If no roles remain, request app to set user inactive.
-                                                       /*
-                                                        * if (userRolesInRemoteApp.size() == 0) {
-                                                        * logger.debug(EELFLoggerDelegate.debugLogger,
-                                                        * "setAppWithUserRoleStateForUser: no roles in app {}, set user {} to inactive"
-                                                        * , app, orgUserId); //TODO Need to fix the logged in user is not set to
-                                                        * inactive remoteAppUser.setActive(false); postUserToRemoteApp(orgUserId, user,
-                                                        * app, applicationsRestClientService); }
-                                                        */
-                                               }
-                                       } else {
-                                               // Here we are adding only we have single account admin in roleInAppForUserList
-                                               // and this should not add in remote
-                                               if (!(reqType.equals("DELETE")) && userInfo.isEmpty()) {
-                                                       reqMessage = "Saved Successfully";
-                                               }
-                                               Set<EcompRole> userRolesInRemoteApp = constructUsersEcompRoles(roleInAppForUserList);
-
-                                               RolesInAppForUser rolesInAppForUser = constructRolesInAppForUserUpdate(orgUserId, app.getId(),
-                                                               userRolesInRemoteApp);
-                                               logger.info(EELFLoggerDelegate.debugLogger,
-                                                               "setExternalRequestUserAppRole: {} user app roles: for app {}, user {}", logMessage,
-                                                               newAppRolesForUser.getApplicationName(), newAppRolesForUser.getLoginId());
-                                               result = applyChangesInUserRolesForAppToEcompDB(rolesInAppForUser, externalSystemRequest,
-                                                               reqType);
-                                       }
-                                       if (!result) {
-                                               reqMessage = "Failed to save the user app role(s)";
-                                       }
-                                       if (epRequestIdSize > 0 && !userInfo.isEmpty()) {
-                                               updateStatus = "C";
-                                               applyChangesToAppRolesRequest(app.getId(), userId.getId(), updateStatus, epRequestId.get(0));
-                                       }
-                               }
-                       } catch (Exception e) {
-                               String message = String.format(
-                                               "setExternalRequestUserAppRole: Failed to create user or update user roles for User %s, AppId %s",
-                                               orgUserId, appName);
-                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
-                               result = false;
-                               reqMessage = e.getMessage();
-                               if (epRequestIdSize > 0 && userInfo != null && !userInfo.isEmpty()) {
-                                       updateStatus = "F";
-                                       applyChangesToAppRolesRequest(app.getId(), userId.getId(), updateStatus, epRequestId.get(0));
-                               }
-                       }
-
-               }
-               return new ExternalRequestFieldsValidator(result, reqMessage);
-       }
-
-       /**
-        * 
-        * @param roleInAppForUserList
-        * @param mapper
-        * @param applicationsRestClientService
-        * @param appId
-        * @param userId
-        * @return Set<EcompRole>
-        * @throws JsonProcessingException
-        * @throws HTTPException
-        */
-       private Set<EcompRole> postUsersRolesToLocalApp(List<RoleInAppForUser> roleInAppForUserList, ObjectMapper mapper,
-                       ApplicationsRestClientService applicationsRestClientService, Long appId, String userId)
-                       throws JsonProcessingException, HTTPException {
-               Set<EcompRole> updatedUserRoles = constructUsersEcompRoles(roleInAppForUserList);
-               return updatedUserRoles;
-       }
-
-       /**
-        * It constructs and returns list of user app roles when the external API role
-        * approval system calls this method
-        * 
-        * @param roleInAppForUserList
-        * @param appId
-        * @return list of user app roles
-        * @throws Exception
-        *             throws exceptions if role id does not exits
-        */
-       private List<RoleInAppForUser> roleInAppForUserList(List<ExternalSystemRoleApproval> roleInAppForUserList,
-                       Long appId, String appName) throws Exception {
-               List<RoleInAppForUser> existingUserRoles = new ArrayList<RoleInAppForUser>();
-               EPRole existingAppRole = null;
-               for (ExternalSystemRoleApproval roleInAppForUser : roleInAppForUserList) {
-                       RoleInAppForUser ecompRole = new RoleInAppForUser();
-                       existingAppRole = epRoleService.getAppRole(roleInAppForUser.getRoleName(), appId);
-                       if (existingAppRole == null) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "roleInAppForUserList failed for the roles {}",
-                                               roleInAppForUserList);
-                               throw new Exception("'" + roleInAppForUser.getRoleName() + "'" + " role does not exist for " + appName
-                                               + " application");
-                       }
-                       if (!existingAppRole.getActive()) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "roleInAppForUserList failed for the roles {}",
-                                               roleInAppForUserList);
-                               throw new Exception(
-                                               roleInAppForUser.getRoleName() + " role is unavailable for " + appName + " application");
-                       } else {
-                               ecompRole.roleId = (appId == 1 || roleInAppForUser.getRoleName().equals(PortalConstants.ADMIN_ROLE))
-                                               ? existingAppRole.getId()
-                                               : existingAppRole.getAppRoleId();
-                               ecompRole.roleName = roleInAppForUser.getRoleName();
-                               ecompRole.isApplied = true;
-                               existingUserRoles.add(ecompRole);
-                       }
-               }
-               return existingUserRoles;
-       }
-
-       /**
-        * 
-        * @param userId
-        * @param app
-        * @param applicationsRestClientService
-        * @return EPUser
-        * @throws HTTPException
-        */
-       protected EPUser getUserFromApp(String userId, EPApp app,
-                       ApplicationsRestClientService applicationsRestClientService) throws HTTPException {
-               // local app
-               if (app.getId() == PortalConstants.PORTAL_APP_ID) {
-                       // Map<String,String> params = new HashMap<String,String>();
-                       // params.put("sbcid",userId);
-                       @SuppressWarnings("unchecked")
-                       List<EPUser> userList = (List<EPUser>) dataAccessService
-                                       .executeQuery("from EPUser where orgUserId='" + userId + "'", null);
-                       if (userList != null && !userList.isEmpty())
-                               return userList.get(0);
-                       else
-                               return null;
-               }
-               // remote app
-
-               return getUser(userId, app, applicationsRestClientService);
-       }
-
-       protected EPUser getUser(String userId, EPApp app, ApplicationsRestClientService applicationsRestClientService)
-                       throws HTTPException {
-               return applicationsRestClientService.get(EPUser.class, app.getId(), String.format("/user/%s", userId), true);
-
-       }
-
-       protected boolean isAppUpgradeVersion(EPApp app) {
-               return true;
-       }
-
-       public ExternalSystemAccess getExternalRequestAccess() {
-               ExternalSystemAccess res = null;
-               try {
-                       res = new ExternalSystemAccess(EPCommonSystemProperties.EXTERNAL_ACCESS_ENABLE, Boolean
-                                       .parseBoolean(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_ACCESS_ENABLE)));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getExternalRequestAccess failed" + e.getMessage());
-               }
-               return res;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserRolesService#
-        * getAppRolesForUser(java.lang.Long, java.lang.String)
-        */
-       @SuppressWarnings("unchecked")
-       public List<RoleInAppForUser> getAppRolesForUser(Long appId, String userId, Boolean extRequestValue) {
-
-               List<RoleInAppForUser> rolesInAppForUser = null;
-               EPApp app = appsService.getApp(appId);
-               try {
-                       // for ecomp portal app, no need to make a remote call
-                       List<Role> roleList = new ArrayList<>();
-                       if (appId == PortalConstants.PORTAL_APP_ID) {
-                               if (app.getCentralAuth()) {
-                                       List<CentralRole> cenRoleList = externalAccessRolesService.getRolesForApp(app.getUebKey());
-                                       for (CentralRole cenRole : cenRoleList) {
-                                               Role role = new Role();
-                                               role.setActive(cenRole.isActive());
-                                               role.setId(cenRole.getId());
-                                               role.setName(cenRole.getName());
-                                               role.setPriority(cenRole.getPriority());
-                                               roleList.add(role);
-                                       }
-                               } else {
-                                       roleList = roleService.getAvailableRoles(userId);
-                               }
-                               List<Role> activeRoleList = new ArrayList<Role>();
-                               for (Role role : roleList) {
-                                       if (role.getActive()) {
-                                               if (role.getId() != 1) { // prevent portal admin from being added
-                                                       activeRoleList.add(role);
-                                               } else if (extRequestValue) {
-                                                       activeRoleList.add(role);
-                                               }
-                                       }
-
-                               }
-                               EPUser localUser = getUserFromApp(userId, app, applicationsRestClientService);
-                               // If localUser does not exists return roles
-                               Set<EPRole> roleSet = null;
-                               EPRole[] roleSetList = null;
-                               if (localUser != null) {
-                                       roleSet = localUser.getAppEPRoles(app);
-                                       roleSetList = roleSet.toArray(new EPRole[0]);
-                               }
-                               rolesInAppForUser = constructRolesInAppForUserGet(activeRoleList, roleSetList, extRequestValue);
-                               return rolesInAppForUser;
-                       }
-
-                       EcompRole[] appRoles = null;
-                       List<EcompRole> roles = new ArrayList<>();
-                       if (app.getCentralAuth()) {
-                               // Sync application functions from External Access System
-                               externalAccessRolesService.syncRoleFunctionFromExternalAccessSystem(app);
-                               List<EPRole> applicationRoles = dataAccessService.getList(EPRole.class,
-                                               " where app_id = " + app.getId() + " and active_yn = 'Y'", null, null);
-                               ;
-                               for (EPRole role : applicationRoles) {
-                                       EcompRole ecompRole = new EcompRole();
-                                       ecompRole.setId(role.getId());
-                                       ecompRole.setName(role.getName());
-                                       roles.add(ecompRole);
-                               }
-                               appRoles = roles.toArray(new EcompRole[roles.size()]);
-                       } else {
-                               appRoles = applicationsRestClientService.get(EcompRole[].class, appId, "/roles");
-                       }
-                       // Test this error case, for generating an internal Ecomp Portal
-                       // error
-                       // EcompRole[] appRoles = null;
-                       // If there is an exception in the rest client api, then null will
-                       // be returned.
-                       if (appRoles != null) {
-                               if (!app.getCentralAuth()) {
-                                       syncAppRoles(sessionFactory, appId, appRoles);
-                               }
-                               EcompRole[] userAppRoles = null;
-                               try {
-                                       try {
-                                               if (app.getCentralAuth()) {
-                                                       final Map<String, String> params = new HashMap<>();
-                                                       final Map<String, Long> userParams = new HashMap<>();
-                                                       params.put("orgUserIdValue", userId);
-                                                       List<EPUser> user = dataAccessService.executeNamedQuery("epUserAppId", params, null);
-                                                       userParams.put("appId", app.getId());
-                                                       userParams.put("userId", user.get(0).getId());
-                                                       List<EPUserAppCurrentRoles> userAppsRolesList = dataAccessService
-                                                                       .executeNamedQuery("getUserAppCurrentRoles", userParams, null);
-                                                       List<EcompRole> setUserRoles = new ArrayList<>();
-                                                       for (EPUserAppCurrentRoles role : userAppsRolesList) {
-                                                               EcompRole ecompRole = new EcompRole();
-                                                               ecompRole.setId(role.getRoleId());
-                                                               ecompRole.setName(role.getRoleName());
-                                                               setUserRoles.add(ecompRole);
-                                                       }
-                                                       userAppRoles = setUserRoles.toArray(new EcompRole[setUserRoles.size()]);
-                                                       rolesInAppForUser = constructRolesInAppForUserGet(appRoles, userAppRoles);
-                                                       return rolesInAppForUser;
-                                               } else {
-                                                       userAppRoles = applicationsRestClientService.get(EcompRole[].class, appId,
-                                                                       String.format("/user/%s/roles", userId));
-                                               }
-                                       } catch (HTTPException e) {
-                                               // Some apps are returning 400 if user is not found.
-                                               if (e.getResponseCode() == 400) {
-                                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                                       "getAppRolesForUser caught exception with response code 400; continuing", e);
-                                               } else {
-                                                       // Other response code, let it come thru.
-                                                       throw e;
-                                               }
-                                       }
-                                       if (userAppRoles == null) {
-                                               if (EcompPortalUtils.getExternalAppResponseCode() == 400) {
-                                                       EcompPortalUtils.setExternalAppResponseCode(200);
-                                                       String message = String.format(
-                                                                       "getAppRolesForUser: App %s, User %, endpoint /user/{userid}/roles returned 400, "
-                                                                                       + "assuming user doesn't exist, app is framework SDK based, and things are ok. "
-                                                                                       + "Overriding to 200 until framework SDK returns a useful response.",
-                                                                       Long.toString(appId), userId);
-                                                       logger.warn(EELFLoggerDelegate.applicationLogger, message);
-                                               }
-                                       }
-
-                                       HashMap<Long, EcompRole> appRolesActiveMap = hashMapFromEcompRoles(appRoles);
-                                       ArrayList<EcompRole> activeRoles = new ArrayList<EcompRole>();
-                                       if (userAppRoles != null) {
-                                               for (int i = 0; i < userAppRoles.length; i++) {
-                                                       if (appRolesActiveMap.containsKey(userAppRoles[i].getId())) {
-                                                               EcompRole role = new EcompRole();
-                                                               role.setId(userAppRoles[i].getId());
-                                                               role.setName(userAppRoles[i].getName());
-                                                               activeRoles.add(role);
-                                                       }
-                                               }
-                                       }
-                                       EcompRole[] userAppRolesActive = activeRoles.toArray(new EcompRole[activeRoles.size()]);
-
-                                       // If the remote application isn't down we MUST sync user
-                                       // roles here in case we have this user here!
-                                       syncUserRoles(sessionFactory, userId, appId, userAppRolesActive, extRequestValue, null);
-                               } catch (Exception e) {
-                                       // TODO: we may need to check if user exists, maybe remote
-                                       // app is down.
-                                       String message = String.format(
-                                                       "getAppRolesForUser: user %s does not exist in remote application %s", userId,
-                                                       Long.toString(appId));
-                                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
-                                       userAppRoles = new EcompRole[0];
-                               }
-                               rolesInAppForUser = constructRolesInAppForUserGet(appRoles, userAppRoles);
-                       }
-               } catch (Exception e) {
-                       String message = String.format("getAppRolesForUser: failed for User %s, AppId %s", userId,
-                                       Long.toString(appId));
-                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
-               }
-               return rolesInAppForUser;
-
-       }
-
-       private boolean postUserRolesToMylogins(AppWithRolesForUser userAppRolesData,
-                       ApplicationsRestClientService applicationsRestClientService, Long appId, Long userId)
-                       throws JsonProcessingException, HTTPException {
-               boolean result = false;
-               ObjectMapper mapper = new ObjectMapper();
-               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-               String userRolesAsString = mapper.writeValueAsString(userAppRolesData);
-               logger.error(EELFLoggerDelegate.errorLogger,
-                               "Should not be reached here, as the endpoint is not defined yet from the Mylogins");
-               applicationsRestClientService.post(AppWithRolesForUser.class, appId, userRolesAsString,
-                               String.format("/user/%s/myLoginroles", userId));
-               return result;
-       }
-
-       public FieldsValidator putUserAppRolesRequest(AppWithRolesForUser userAppRolesData, EPUser user) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               final Map<String, Long> params = new HashMap<>();
-               EPUserAppRoles appRole = new EPUserAppRoles();
-               try {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "Should not be reached here, still the endpoint is yet to be defined");
-                       boolean result = postUserRolesToMylogins(userAppRolesData, applicationsRestClientService,
-                                       userAppRolesData.appId, user.getId());
-                       logger.debug(EELFLoggerDelegate.debugLogger, "putUserAppRolesRequest: result {}", result);
-
-                       params.put("appId", userAppRolesData.appId);
-                       EPUserAppRolesRequest epAppRolesRequestData = new EPUserAppRolesRequest();
-                       epAppRolesRequestData.setCreatedDate(new Date());
-                       epAppRolesRequestData.setUpdatedDate(new Date());
-                       epAppRolesRequestData.setUserId(user.getId());
-                       epAppRolesRequestData.setAppId(userAppRolesData.appId);
-                       epAppRolesRequestData.setRequestStatus("P");
-                       List<RoleInAppForUser> appRoleIdList = userAppRolesData.appRoles;
-                       Set<EPUserAppRolesRequestDetail> appRoleDetails = new LinkedHashSet<EPUserAppRolesRequestDetail>();
-                       dataAccessService.saveDomainObject(epAppRolesRequestData, null);
-                       for (RoleInAppForUser userAppRoles : appRoleIdList) {
-                               Boolean isAppliedVal = userAppRoles.isApplied;
-                               params.put("appRoleId", userAppRoles.roleId);
-                               if (isAppliedVal) {
-                                       appRole = (EPUserAppRoles) dataAccessService.executeNamedQuery("appRoles", params, null).get(0);
-                                       EPUserAppRolesRequestDetail epAppRoleDetail = new EPUserAppRolesRequestDetail();
-                                       epAppRoleDetail.setReqRoleId(appRole.getRoleId());
-                                       epAppRoleDetail.setReqType("P");
-                                       epAppRoleDetail.setEpRequestIdData(epAppRolesRequestData);
-                                       dataAccessService.saveDomainObject(epAppRoleDetail, null);
-                               }
-                       }
-                       epAppRolesRequestData.setEpRequestIdDetail(appRoleDetails);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_OK);
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "putUserAppRolesRequest failed", e);
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-               return fieldsValidator;
-       }
-
-       public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(EPUser userid, String appName) {
-               Map<String, String> params = new HashMap<>();
-               params.put("userid", userid.getId().toString());
-               // params.put("appid", appid);
-               params.put("appName", appName);
-
-               @SuppressWarnings("unchecked")
-               List<EPUserAppCatalogRoles> userAppRoles = (List<EPUserAppCatalogRoles>) dataAccessService
-                               .executeNamedQuery("userAppCatalogRoles", params, null);
-               return userAppRoles;
-       }
-
-       public String updateRemoteUserProfile(String orgUserId, Long appId) {
-               ObjectMapper mapper = new ObjectMapper();
-               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-               EPUser client = searchService.searchUserByUserId(orgUserId);
-               EPUser newUser = new EPUser();
-               newUser.setActive(client.getActive());
-               newUser.setFirstName(client.getFirstName());
-               newUser.setLastName(client.getLastName());
-               newUser.setLoginId(client.getLoginId());
-               newUser.setLoginPwd(client.getLoginPwd());
-               newUser.setMiddleInitial(client.getMiddleInitial());
-               newUser.setEmail(client.getEmail());
-               newUser.setOrgUserId(client.getLoginId());
-               try {
-                       String userAsString = mapper.writeValueAsString(newUser);
-                       List<EPApp> appList = appsService.getUserRemoteApps(client.getId().toString());
-                       // applicationsRestClientService.post(EPUser.class, appId,
-                       // userAsString, String.format("/user", orgUserId));
-                       for (EPApp eachApp : appList) {
-                               try {
-                                       applicationsRestClientService.post(EPUser.class, eachApp.getId(), userAsString,
-                                                       String.format("/user/%s", orgUserId));
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to update user: " + client.getOrgUserId()
-                                                       + " in remote app. appId = " + eachApp.getId());
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "updateRemoteUserProfile failed", e);
-                       return "failure";
-               }
-
-               return "success";
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.openecomp.portalapp.portal.service.UserRolesService#
-        * getCachedAppRolesForUser(java.lang.Long, java.lang.Long)
-        */
-       public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId) {
-               // Find the records for this user-app combo, if any
-               String filter = " where user_id = " + Long.toString(userId) + " and app_id = " + Long.toString(appId);
-               @SuppressWarnings("unchecked")
-               List<EPUserApp> roleList = dataAccessService.getList(EPUserApp.class, filter, null, null);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getCachedAppRolesForUser: list size is {}", roleList.size());
-               return roleList;
-       }
-
-       /**
-        * Retrieves and returns a list of user app roles for local and remote
-        * applications based on the app id.
-        * 
-        * @param appId
-        * @return list of user app roles
-        * @throws HTTPException
-        */
-       public List<UserApplicationRoles> getUsersFromAppEndpoint(Long appId) throws HTTPException {
-               ArrayList<UserApplicationRoles> userApplicationRoles = new ArrayList<UserApplicationRoles>();
-
-               EPApp app = appsService.getApp(appId);
-               // If local or centralized application
-               if (appId == PortalConstants.PORTAL_APP_ID || app.getCentralAuth()) {
-                       @SuppressWarnings("unchecked")
-                       List<EPUser> userList = (List<EPUser>) dataAccessService.executeNamedQuery("getActiveUsers", null, null);
-                       for (EPUser user : userList) {
-                               UserApplicationRoles userWithAppRoles = convertToUserApplicationRoles(appId, user, app);
-                               if (userWithAppRoles.getRoles() != null && userWithAppRoles.getRoles().size() > 0)
-                                       userApplicationRoles.add(userWithAppRoles);
-                       }
-               }
-               // remote app
-               else {
-                       RemoteUserWithRoles[] remoteUsers = null;
-                       String remoteUsersString = applicationsRestClientService.getIncomingJsonString(appId, "/users");
-                       remoteUsers = doGetUsers(isAppUpgradeVersion(app), remoteUsersString);
-                       userApplicationRoles = new ArrayList<UserApplicationRoles>();
-                       for (RemoteUserWithRoles remoteUser : remoteUsers) {
-                               UserApplicationRoles userWithRemoteAppRoles = convertToUserApplicationRoles(appId, remoteUser);
-                               if (userWithRemoteAppRoles.getRoles() != null && userWithRemoteAppRoles.getRoles().size() > 0) {
-                                       userApplicationRoles.add(userWithRemoteAppRoles);
-                               } else {
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "User " + userWithRemoteAppRoles.getOrgUserId()
-                                                       + " doesn't have any roles assigned to any app.");
-                               }
-                       }
-               }
-               return userApplicationRoles;
-       }
-
-       /**
-        * 
-        * @param appId
-        * @param user
-        * @param appgetUsersFromAppEndpoint
-        * @return
-        */
-       private UserApplicationRoles convertToUserApplicationRoles(Long appId, EPUser user, EPApp app) {
-               UserApplicationRoles userWithRemoteAppRoles = new UserApplicationRoles();
-               userWithRemoteAppRoles.setAppId(appId);
-               userWithRemoteAppRoles.setOrgUserId(user.getOrgUserId());
-               userWithRemoteAppRoles.setFirstName(user.getFirstName());
-               userWithRemoteAppRoles.setLastName(user.getLastName());
-               userWithRemoteAppRoles.setRoles(convertToRemoteRoleList(user, app));
-               return userWithRemoteAppRoles;
-       }
-
-       /**
-        * 
-        * @param user
-        * @param app
-        * @return
-        */
-       private List<RemoteRole> convertToRemoteRoleList(EPUser user, EPApp app) {
-               List<RemoteRole> roleList = new ArrayList<RemoteRole>();
-               SortedSet<EPRole> roleSet = user.getAppEPRoles(app);
-               for (EPRole role : roleSet) {
-                       RemoteRole rRole = new RemoteRole();
-                       rRole.setId(role.getId());
-                       rRole.setName(role.getName());
-                       roleList.add(rRole);
-               }
-               return roleList;
-       }
-
-       /**
-        *  
-        * Returns RemoteUserWithRoles reading the value from remote application user in the form a string from an ObjectMapper
-        * @param postOpenSource
-        * @param remoteUsersString
-        * @return RemoteUserWithRoles
-        */
-       public RemoteUserWithRoles[] doGetUsers(boolean postOpenSource, String remoteUsersString) {
-               ObjectMapper mapper = new ObjectMapper();
-               try {
-                       return mapper.readValue(remoteUsersString, RemoteUserWithRoles[].class);
-               } catch (IOException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "doGetUsers : Failed : Unexpected property in incoming JSON",
-                                       e);
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "doGetUsers : Incoming JSON that caused it --> " + remoteUsersString);
-               }
-
-               return new RemoteUserWithRoles[0];
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserRolesService.java
deleted file mode 100644 (file)
index 5718894..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.apache.cxf.transport.http.HTTPException;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemUser;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
-import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-import org.openecomp.portalapp.portal.transport.ExternalRequestFieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
-
-public interface UserRolesService {
-
-       /**
-        * Returns list of app roles of a single app
-        * 
-        * @param appId
-        *            ID of row in fn_app
-        * @param userId
-        *            ID of row in fn_user
-        * @param extRequestValue
-        *            set to false if request is from users page otherwise true
-        * @return List<RoleInAppForUser>
-        */
-       public List<RoleInAppForUser> getAppRolesForUser(Long appId, String userId, Boolean extRequestValue);
-
-       public boolean setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser);
-
-       public List<UserApplicationRoles> getUsersFromAppEndpoint(Long appId) throws HTTPException;
-
-       public List<EPRole> importRolesFromRemoteApplication(Long appId) throws HTTPException;
-
-       /**
-        * Gets entries from the local fn_user_role table for the specified user and
-        * app.
-        * 
-        * @param appId
-        *            ID of row in fn_app
-        * @param userId
-        *            ID of row in fn_user
-        * @return List of EPRole; empty if none found.
-        */
-       public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId);
-
-       public FieldsValidator putUserAppRolesRequest(AppWithRolesForUser userAppRolesData, EPUser user);
-
-       /**
-        * Save user app roles in the database from the external request
-        * 
-        * @param newAppRolesForUser
-        * 
-        *            contains login id, app name, request id, and list of role
-        *            names
-        * @param reqType
-        * @return if any exceptions, returns detail message and true or false
-        */
-       ExternalRequestFieldsValidator setExternalRequestUserAppRole(ExternalSystemUser newAppRolesForUser, String reqType);
-
-       public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(EPUser user, String appName);
-
-       public String updateRemoteUserProfile(String orgUserId, Long appId);
-
-       public ExternalSystemAccess getExternalRequestAccess();
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserService.java
deleted file mode 100644 (file)
index 38c7fa3..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface UserService {
-
-       List<EPUser> getUserByUserId(String orgUserId);
-
-       List<EPUser> getUserByFirstLastName(String firstName, String lastName);
-
-       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception;
-
-       public void saveUser(EPUser user) throws Exception;
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java
deleted file mode 100644 (file)
index 4983143..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.FusionObject.Utilities;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service("userService")
-@Transactional
-public class UserServiceImpl implements UserService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPUser> getUserByUserId(String userId) {
-
-               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
-                       List<EPUser> users = new ArrayList<EPUser>();
-                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
-                       BufferedReader in = null;
-                       HttpURLConnection con = null;
-                       try {
-                               String url = EPCommonSystemProperties.getProperty(EPCommonSystemProperties.AUTH_USER_SERVER);
-                               URL obj = new URL(url);
-
-                               con = (HttpURLConnection) obj.openConnection();
-
-                               // optional default is GET
-                               con.setRequestMethod("GET");
-                               con.setConnectTimeout(3000);
-                               con.setReadTimeout(8000);
-
-                               StringBuffer response = new StringBuffer();
-
-                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
-                               String inputLine;
-                               while ((inputLine = in.readLine()) != null)
-                                       response.append(inputLine);
-                               JSONObject jObject = new JSONObject(response.toString()); // json
-                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get
-                                                                                                                                               // data
-                                                                                                                                               // object
-                               for (int i = 0; i < jsonUsers.length(); i++) {
-                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
-                                       EPUser eachUser = new EPUser();
-                                       eachUser.setOrgUserId(eachObject.get("id").toString());
-                                       eachUser.setFirstName(eachObject.get("givenName").toString());
-                                       eachUser.setLastName(eachObject.get("familyName").toString());
-                                       eachUser.setEmail(eachObject.get("email").toString());
-                                       users.add(eachUser);
-                               }
-
-                               for (int i = 0; i < users.size(); i++) {
-                                       if (Utilities.nvl(userId).length() > 0) {
-                                               if (!userId.equalsIgnoreCase(users.get(i).getOrgUserId())) {
-                                                       continue;
-                                               }
-                                       }
-                                       filterdUsers.add(users.get(i));
-                               }
-
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed", e);
-                       } finally {
-                               try {
-                                       in.close();
-                                       con.disconnect();
-                               } catch (IOException e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed to close", e);
-                               }
-                       }
-
-                       return filterdUsers;
-
-               } else {
-
-                       List<EPUser> list = null;
-                       StringBuffer criteria = new StringBuffer();
-                       criteria.append(" where org_user_id = '").append(userId).append("'");
-                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
-                       return (list == null || list.size() == 0) ? null : list;
-
-               }
-
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<EPUser> getUserByFirstLastName(String firstName, String lastName) {
-
-               if (!SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
-
-                       List<EPUser> list = null;
-                       StringBuffer criteria = new StringBuffer();
-                       if (firstName != null)
-                               criteria.append(" where first_name = '").append(firstName).append("'");
-                       if (lastName != null)
-                               criteria.append(" where last_name = '").append(lastName).append("'");
-                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
-                       return (list == null || list.size() == 0) ? null : list;
-
-               } else {
-
-                       List<EPUser> users = new ArrayList<EPUser>();
-                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
-                       BufferedReader in = null;
-                       HttpURLConnection con = null;
-                       try {
-                               String url = EPCommonSystemProperties.getProperty(EPCommonSystemProperties.AUTH_USER_SERVER);
-                               URL obj = new URL(url);
-
-                               con = (HttpURLConnection) obj.openConnection();
-
-                               // optional default is GET
-                               con.setRequestMethod("GET");
-                               con.setConnectTimeout(3000);
-                               con.setReadTimeout(8000);
-
-                               StringBuffer response = new StringBuffer();
-
-                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
-                               String inputLine;
-                               while ((inputLine = in.readLine()) != null)
-                                       response.append(inputLine);
-                               JSONObject jObject = new JSONObject(response.toString()); // json
-                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get
-                                                                                                                                               // data
-                                                                                                                                               // object
-                               for (int i = 0; i < jsonUsers.length(); i++) {
-                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
-                                       EPUser eachUser = new EPUser();
-                                       eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
-                                       eachUser.setFirstName(eachObject.get("givenName").toString());
-                                       eachUser.setLastName(eachObject.get("familyName").toString());
-                                       eachUser.setEmail(eachObject.get("email").toString());
-                                       users.add(eachUser);
-                               }
-
-                               for (int i = 0; i < users.size(); i++) {
-
-                                       if (Utilities.nvl(firstName).length() > 0) {
-                                               if (!firstName.equalsIgnoreCase(users.get(i).getFirstName())) {
-                                                       continue;
-                                               }
-                                       }
-                                       if (Utilities.nvl(lastName).length() > 0) {
-                                               if (!lastName.equalsIgnoreCase(users.get(i).getLastName())) {
-                                                       continue;
-                                               }
-                                       }
-
-                                       filterdUsers.add(users.get(i));
-
-                               }
-
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed", e);
-                       } finally {
-                               try {
-                                       in.close();
-                                       con.disconnect();
-                               } catch (IOException e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed to close", e);
-                               }
-                       }
-
-                       return filterdUsers;
-               }
-
-       }
-
-       @SuppressWarnings("unchecked")
-       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception {
-
-               try {
-
-                       List<EPUser> list = null;
-                       StringBuffer criteria = new StringBuffer();
-                       criteria.append(" where org_user_id = '").append(newUser.getLoginId()).append("'");
-                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
-                       if (list == null || list.size() == 0) {
-                               newUser.setActive(true);
-                               newUser.setOrgUserId(newUser.getLoginId());
-                               newUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
-                               getDataAccessService().saveDomainObject(newUser, null);
-                       } else {
-                               if (checkDuplicate.equals("Yes")) {
-                                       // userId already exist in database
-                                       return "Record already exist";
-                               } else {
-
-                                       EPUser oldUser = (EPUser) list.get(0);
-                                       oldUser.setFirstName(newUser.getFirstName());
-                                       oldUser.setLastName(newUser.getLastName());
-                                       oldUser.setMiddleInitial(newUser.getMiddleInitial());
-                                       if (!oldUser.getLoginPwd().equals(newUser.getLoginPwd()))
-                                               oldUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
-                                       else
-                                               oldUser.setLoginPwd(newUser.getLoginPwd());
-                                       getDataAccessService().saveDomainObject(oldUser, null);
-
-                               }
-
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveNewUser failed", e);
-                       throw new Exception(e);
-               }
-               return "success";
-       };
-
-       @Override
-       public void saveUser(EPUser user) throws Exception {
-               getDataAccessService().saveDomainObject(user, null);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetParameterService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetParameterService.java
deleted file mode 100644 (file)
index 81b5e1e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
-
-public interface WidgetParameterService {
-       
-       /**
-        * Saves the specified user-defined widget parameters to the table ep_widget_parameters
-        * 
-        * @param newParameter
-        */
-       void saveUserParameter(WidgetCatalogParameter newParameter);
-       
-       /**
-        * Gets the specified user-defined widget parameter where paramId is used from all users 
-        * 
-        * @param paramId
-        * @return
-        * List of widget parameters
-        */
-       List<WidgetCatalogParameter> getUserParameterById(Long paramId);
-       
-       
-       /**
-        * Deletes the specified user-defined widget parameters from ep_widget_parameters table 
-        * where paramId is used
-        * 
-        * @param paramId
-        */
-       void deleteUserParameterById(Long paramId);
-
-       
-       /**
-        * Gets the specified user-defined widget parameter where paramId is used from the specified
-        * user with userId 
-        * @param widgetId
-        * @param userId
-        * @param paramId
-        * @return WidgetCatalogParameter
-        */
-       WidgetCatalogParameter getUserParamById(Long widgetId, Long userId, Long paramId);
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetParameterServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetParameterServiceImpl.java
deleted file mode 100644 (file)
index e69c727..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.hibernate.criterion.Criterion;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("widgetParameterService")
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class WidgetParameterServiceImpl implements WidgetParameterService{
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetParameterServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public WidgetCatalogParameter getUserParamById(Long widgetId, Long userId, Long paramId) {
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion widgetIdCrit = Restrictions.eq("widgetId", widgetId);
-               restrictionsList.add(widgetIdCrit);
-               Criterion userIdCrit = Restrictions.eq("userId", userId);
-               restrictionsList.add(userIdCrit);
-               Criterion paramIdCrit = Restrictions.eq("paramId", paramId);
-               restrictionsList.add(paramIdCrit);
-               
-               
-               WidgetCatalogParameter widgetParam = null;
-               List<WidgetCatalogParameter> list = (List<WidgetCatalogParameter>) dataAccessService
-                               .getList(WidgetCatalogParameter.class, null, restrictionsList, null);
-               if(list.size() != 0)
-                       widgetParam = list.get(0);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "getUserParamById: widget parameters: " + widgetParam);
-               return widgetParam;
-       }
-
-       @Override
-       public void saveUserParameter(WidgetCatalogParameter newParameter) {
-               dataAccessService.saveDomainObject(newParameter, null);
-       }
-       
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<WidgetCatalogParameter> getUserParameterById(Long paramId) {
-               List<Criterion> restrictionsList = new ArrayList<Criterion>();
-               Criterion paramIdCrit = Restrictions.eq("paramId", paramId);
-               restrictionsList.add(paramIdCrit);
-               List<WidgetCatalogParameter> list = (List<WidgetCatalogParameter>) dataAccessService
-                               .getList(WidgetCatalogParameter.class, null, restrictionsList, null);
-               return list;
-       }
-
-       @Override
-       public void deleteUserParameterById(Long paramId) {
-               Map<String, String> params = new HashMap<String, String>();
-               params.put("paramId", Long.toString(paramId));
-               dataAccessService.executeNamedQuery("deleteWidgetCatalogParameter", params, null);
-               dataAccessService.executeNamedQuery("deleteMicroserviceParameterById", params, null);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetService.java
deleted file mode 100644 (file)
index a90fc4e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingWidget;
-
-public interface WidgetService {
-
-       List<OnboardingWidget> getOnboardingWidgets(EPUser user, boolean managed);
-
-       FieldsValidator setOnboardingWidget(EPUser user, OnboardingWidget onboardingWidget);
-
-       FieldsValidator deleteOnboardingWidget(EPUser user, Long onboardingWidgetId);
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/service/WidgetServiceImpl.java
deleted file mode 100644 (file)
index 7633e34..0000000
+++ /dev/null
@@ -1,294 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletResponse;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.Widget;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingWidget;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-
-@Service("widgetService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class WidgetServiceImpl implements WidgetService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetServiceImpl.class);
-
-       private static final String baseSqlToken = " widget.WIDGET_ID, widget.WDG_NAME, widget.APP_ID, app.APP_NAME, widget.WDG_WIDTH, widget.WDG_HEIGHT, widget.WDG_URL"
-                       + " from FN_WIDGET widget join FN_APP app ON widget.APP_ID = app.APP_ID";
-
-       private String validAppsFilter = "";
-
-       private Long LONG_ECOMP_APP_ID = 1L;
-       private Long ACCOUNT_ADMIN_ROLE_ID = 999L;
-       private static final Long DUBLICATED_FIELD_VALUE_ECOMP_ERROR = new Long(EPCommonSystemProperties.DUBLICATED_FIELD_VALUE_ECOMP_ERROR);
-
-       private static final String urlField = "url";
-
-       private static final String nameField = "name";
-       @Autowired
-       AdminRolesService adminRolesService;
-       @Autowired
-       private SessionFactory sessionFactory;
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @PostConstruct
-       private void init() {
-               try {
-                       validAppsFilter = " AND app.ENABLED = 'Y' AND app.APP_ID != " + SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID);
-                       ACCOUNT_ADMIN_ROLE_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ACCOUNT_ADMIN_ROLE_ID));
-                       LONG_ECOMP_APP_ID = Long.valueOf(SystemProperties.getProperty(EPCommonSystemProperties.ECOMP_APP_ID));
-               } catch(Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
-               }
-       }
-       
-       private String sqlWidgetsForAllApps() {
-               return "SELECT" + baseSqlToken + validAppsFilter;
-       }
-
-       private String sqlWidgetsForAllAppsWhereUserIsAdmin(Long userId) {
-               return "SELECT" + baseSqlToken + " join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = app.APP_ID where FN_USER_ROLE.USER_ID = " + userId
-                               + " AND FN_USER_ROLE.ROLE_ID = " + ACCOUNT_ADMIN_ROLE_ID + validAppsFilter;
-       }
-
-       private String sqlWidgetsForAllAppsWhereUserHasAnyRole(Long userId) {
-               return "SELECT DISTINCT" + baseSqlToken + " join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = app.APP_ID where FN_USER_ROLE.USER_ID = "
-                               + userId + validAppsFilter;
-       }
-
-       @SuppressWarnings("unchecked")
-       @Override
-       public List<OnboardingWidget> getOnboardingWidgets(EPUser user, boolean managed) {
-               List<OnboardingWidget> onboardingWidgets = new ArrayList<OnboardingWidget>();
-               String sql = null;
-               if (adminRolesService.isSuperAdmin(user)) {
-                       sql = this.sqlWidgetsForAllApps();
-               } else if (managed) {
-                       if (adminRolesService.isAccountAdmin(user)) {
-                               sql = this.sqlWidgetsForAllAppsWhereUserIsAdmin(user.getId());
-                       }
-               } else if (adminRolesService.isAccountAdmin(user) || adminRolesService.isUser(user)) {
-                       sql = this.sqlWidgetsForAllAppsWhereUserHasAnyRole(user.getId());
-               }
-               if (sql != null) {
-                       onboardingWidgets = dataAccessService.executeSQLQuery(sql, OnboardingWidget.class, null);
-               }
-               return onboardingWidgets;
-       }
-
-       private static final Object syncRests = new Object();
-
-       private boolean isUserAdminOfAppForWidget(boolean superAdmin, Long userId, Long appId) {
-               if (!superAdmin) {
-                       @SuppressWarnings("unchecked")
-                       List<EPUserApp> userRoles = dataAccessService.getList(EPUserApp.class,
-                                       " where userId = " + userId + " and role.id = " + ACCOUNT_ADMIN_ROLE_ID + " and app.id = " + appId, null, null);
-                       return (userRoles.size() > 0);
-               }
-               return true;
-       }
-
-       private void validateOnboardingWidget(OnboardingWidget onboardingWidget, FieldsValidator fieldsValidator) {
-               @SuppressWarnings("unchecked")
-               List<Widget> widgets = dataAccessService.getList(Widget.class,
-                               " where url = '" + onboardingWidget.url + "'" + " or name = '" + onboardingWidget.name + "'", null, null);
-               boolean dublicatedUrl = false;
-               boolean dublicatedName = false;
-               for (Widget widget : widgets) {
-                       if (onboardingWidget.id != null && onboardingWidget.id.equals(widget.getId())) {
-                               // widget should not be compared with itself
-                               continue;
-                       }
-                       if (!dublicatedUrl && widget.getUrl().equals(onboardingWidget.url)) {
-                               dublicatedUrl = true;
-                               if (dublicatedName) {
-                                       break;
-                               }
-                       }
-                       if (!dublicatedName && widget.getName().equalsIgnoreCase(onboardingWidget.name) && widget.getAppId().equals(onboardingWidget.appId)) {
-                               dublicatedName = true;
-                               if (dublicatedUrl) {
-                                       break;
-                               }
-                       }
-               }
-               if (dublicatedUrl || dublicatedName) {
-                       if (dublicatedUrl) {
-                               fieldsValidator.addProblematicFieldName(urlField);
-                       }
-                       if (dublicatedName) {
-                               fieldsValidator.addProblematicFieldName(nameField);
-                       }
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_CONFLICT);
-                       fieldsValidator.errorCode = DUBLICATED_FIELD_VALUE_ECOMP_ERROR;
-               }
-       }
-
-       private void applyOnboardingWidget(OnboardingWidget onboardingWidget, FieldsValidator fieldsValidator) {
-               boolean result = false;
-               Session localSession = null;
-               Transaction transaction = null;
-               try {
-                       localSession = sessionFactory.openSession();
-                       transaction = localSession.beginTransaction();
-                       Widget widget;
-                       if (onboardingWidget.id == null) {
-                               widget = new Widget();
-                       } else {
-                               widget = (Widget) localSession.get(Widget.class, onboardingWidget.id);
-                       }
-                       widget.setAppId(onboardingWidget.appId);
-                       widget.setName(onboardingWidget.name);
-                       widget.setWidth(onboardingWidget.width);
-                       widget.setHeight(onboardingWidget.height);
-                       widget.setUrl(onboardingWidget.url);
-                       localSession.saveOrUpdate(widget);
-                       transaction.commit();
-                       result = true;
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                       EcompPortalUtils.rollbackTransaction(transaction, "applyOnboardingWidget rollback, exception = " + e);
-               } finally {
-                       EcompPortalUtils.closeLocalSession(localSession, "applyOnboardingWidget");
-               }
-               if (!result) {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-               }
-       }
-
-       private FieldsValidator updateOrSaveWidget(boolean superAdmin, Long userId, OnboardingWidget onboardingWidget) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               if (!this.isUserAdminOfAppForWidget(superAdmin, userId, onboardingWidget.appId)) {
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_FORBIDDEN);
-                       return fieldsValidator;
-               }
-               synchronized (syncRests) {
-                       // onboardingWidget.id is null for POST and not null for PUT
-                       if (onboardingWidget.id == null) {
-                               this.validateOnboardingWidget(onboardingWidget, fieldsValidator);
-                       } else {
-                               Widget widget = (Widget) dataAccessService.getDomainObject(Widget.class, onboardingWidget.id, null);
-                               if (widget == null || widget.getId() == null) {
-                                       // Widget not found
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
-                                       return fieldsValidator;
-                               }
-                               this.validateOnboardingWidget(onboardingWidget, fieldsValidator);
-                       }
-                       if (fieldsValidator.httpStatusCode.intValue() == HttpServletResponse.SC_OK) {
-                               this.applyOnboardingWidget(onboardingWidget, fieldsValidator);
-                       }
-               }
-               return fieldsValidator;
-       }
-
-       @Override
-       public FieldsValidator setOnboardingWidget(EPUser user, OnboardingWidget onboardingWidget) {
-               if (onboardingWidget.name.length() == 0 || onboardingWidget.url.length() == 0 || onboardingWidget.appId == null
-                               || onboardingWidget.appId.equals(LONG_ECOMP_APP_ID) || onboardingWidget.width.intValue() <= 0 || onboardingWidget.height.intValue() <= 0) {
-                       if (onboardingWidget.appId.equals(LONG_ECOMP_APP_ID)) {
-                               // logger.error("Alarm!!! Security breach attempt on user " + user.getFullName() + ", userId = " + user.getUserId());
-                       }
-                       FieldsValidator fieldsValidator = new FieldsValidator();
-                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_BAD_REQUEST);
-                       return fieldsValidator;
-               }
-               return this.updateOrSaveWidget(adminRolesService.isSuperAdmin(user), user.getId(), onboardingWidget);
-       }
-
-       @Override
-       public FieldsValidator deleteOnboardingWidget(EPUser user, Long onboardingWidgetId) {
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               synchronized (syncRests) {
-                       Widget widget = (Widget) dataAccessService.getDomainObject(Widget.class, onboardingWidgetId, null);
-                       if (widget != null && widget.getId() != null) { // widget exists
-                               if (!this.isUserAdminOfAppForWidget(adminRolesService.isSuperAdmin(user), user.getId(), widget.getAppId())) {
-                                       fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_FORBIDDEN);
-                               } else {
-                                       boolean result = false;
-                                       Session localSession = null;
-                                       Transaction transaction = null;
-                                       try {
-                                               localSession = sessionFactory.openSession();
-                                               transaction = localSession.beginTransaction();
-                                               localSession.delete(localSession.get(Widget.class, onboardingWidgetId));
-                                               transaction.commit();
-                                               result = true;
-                                       } catch (Exception e) {
-                                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                                               EcompPortalUtils.rollbackTransaction(transaction, "deleteOnboardingWidget rollback, exception = " + e);
-                                       } finally {
-                                               EcompPortalUtils.closeLocalSession(localSession, "deleteOnboardingWidget");
-                                       }
-                                       if (!result) {
-                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                                       }
-                               }
-                       }
-               }
-               return fieldsValidator;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AllAppsWithRolesForUser.java
deleted file mode 100644 (file)
index b08eafe..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-public class AllAppsWithRolesForUser {
-
-       public String orgUserId;
-
-       public List<AppWithUserRoles> apps;
-
-       public static class AppWithUserRoles {
-
-               public Long appId;
-
-               public String appName;
-               
-               public List<RoleInAppForUser> appRoles;
-
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/Analytics.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/Analytics.java
deleted file mode 100644 (file)
index fc84012..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class Analytics {
-       
-       private String action;
-       private String page;
-       private String function;
-       private String userid;
-       private String type;
-       
-       public String getType() {
-               return type;
-       }
-       public void setType(String type) {
-               this.type = type;
-       }
-       public String getAction() {
-               return action;
-       }
-       public void setAction(String action) {
-               this.action = action;
-       }
-       public String getPage() {
-               return page;
-       }
-       public void setPage(String page) {
-               this.page = page;
-       }
-       public String getFunction() {
-               return function;
-       }
-       public void setFunction(String function) {
-               this.function = function;
-       }
-       public String getUserid() {
-               return userid;
-       }
-       public void setUserid(String userId) {
-               this.userid = userId;
-       }
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalization.java
deleted file mode 100644 (file)
index 0480f1b..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-/**
- * Model for the object PUT to the controller when the user takes an action on
- * an application in the catalog.
- */
-public class AppCatalogPersonalization {
-
-       public Long appId;
-       public Boolean select;
-       public Boolean pending;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public Boolean getSelect() {
-               return select;
-       }
-
-       public void setSelect(Boolean select) {
-               this.select = select;
-       }
-
-       public Boolean getPending() {
-               return pending;
-       }
-
-       public void setPending(Boolean pending) {
-               this.pending = pending;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((pending == null) ? 0 : pending.hashCode());
-               result = prime * result + ((select == null) ? 0 : select.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               AppCatalogPersonalization other = (AppCatalogPersonalization) obj;
-               if (appId == null) {
-                       if (other.appId != null)
-                               return false;
-               } else if (!appId.equals(other.appId))
-                       return false;
-               if (pending == null) {
-                       if (other.pending != null)
-                               return false;
-               } else if (!pending.equals(other.pending))
-                       return false;
-               if (select == null) {
-                       if (other.select != null)
-                               return false;
-               } else if (!select.equals(other.select))
-                       return false;
-               return true;
-       }
-
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdmin.java
deleted file mode 100644 (file)
index 2d44b67..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class AppNameIdIsAdmin {
-
-       public Long id;
-
-       public String appName;
-
-       public Boolean isAdmin;
-
-       public Boolean restrictedApp;
-
-       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 Boolean getIsAdmin() {
-               return isAdmin;
-       }
-
-       public void setIsAdmin(Boolean isAdmin) {
-               this.isAdmin = isAdmin;
-       }
-
-       public Boolean getRestrictedApp() {
-               return restrictedApp;
-       }
-
-       public void setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((isAdmin == null) ? 0 : isAdmin.hashCode());
-               result = prime * result + ((restrictedApp == null) ? 0 : restrictedApp.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               AppNameIdIsAdmin other = (AppNameIdIsAdmin) obj;
-               if (appName == null) {
-                       if (other.appName != null)
-                               return false;
-               } else if (!appName.equals(other.appName))
-                       return false;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (isAdmin == null) {
-                       if (other.isAdmin != null)
-                               return false;
-               } else if (!isAdmin.equals(other.isAdmin))
-                       return false;
-               if (restrictedApp == null) {
-                       if (other.restrictedApp != null)
-                               return false;
-               } else if (!restrictedApp.equals(other.restrictedApp))
-                       return false;
-               return true;
-       }
-
-       @Override
-       public String toString() {
-               return "AppNameIdIsAdmin [id=" + id + ", appName=" + appName + ", isAdmin=" + isAdmin + ", restrictedApp="
-                               + restrictedApp + "]";
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUser.java
deleted file mode 100644 (file)
index 7c21781..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-public class AppWithRolesForUser {
-
-       public String orgUserId;
-
-       public Long appId;
-
-       public String appName;
-
-       public List<RoleInAppForUser> appRoles;
-
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-
-       public List<RoleInAppForUser> getAppRoles() {
-               return appRoles;
-       }
-
-       public void setAppRoles(List<RoleInAppForUser> appRoles) {
-               this.appRoles = appRoles;
-       }
-
-       @Override
-       public String toString() {
-               return "AppWithRolesForUser [orgUserId=" + orgUserId + ", appId=" + appId + ", appName=" + appName
-                               + ", appRoles=" + appRoles + "]";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRole.java
deleted file mode 100644 (file)
index 4bcf21a..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-
-public class AppsListWithAdminRole {
-
-       public String orgUserId;
-
-       public ArrayList<AppNameIdIsAdmin> appsRoles;
-
-       public AppsListWithAdminRole() {
-               appsRoles = new ArrayList<AppNameIdIsAdmin>();
-       }
-
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-
-       public ArrayList<AppNameIdIsAdmin> getAppsRoles() {
-               return appsRoles;
-       }
-
-       public void setAppsRoles(ArrayList<AppNameIdIsAdmin> appsRoles) {
-               this.appsRoles = appsRoles;
-       }
-
-       @Override
-       public String toString() {
-               return "AppsListWithAdminRole [orgUserId=" + orgUserId + ", appsRoles=" + appsRoles + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appsRoles == null) ? 0 : appsRoles.hashCode());
-               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               AppsListWithAdminRole other = (AppsListWithAdminRole) obj;
-               if (appsRoles == null) {
-                       if (other.appsRoles != null)
-                               return false;
-               } else if (!appsRoles.equals(other.appsRoles))
-                       return false;
-               if (orgUserId == null) {
-                       if (other.orgUserId != null)
-                               return false;
-               } else if (!orgUserId.equals(other.orgUserId))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BulkUploadRoleFunction.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BulkUploadRoleFunction.java
deleted file mode 100644 (file)
index e1924fa..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class BulkUploadRoleFunction implements Serializable{
-       
-
-       private static final long serialVersionUID = -1880947347092068841L;
-       
-       @Id
-       @Column(name="function_name")
-       private String functionName;
-       @Id
-       @Column(name="function_cd")
-       private String functionCd;
-       
-       public String getFunctionName() {
-               return functionName;
-       }
-       public void setFunctionName(String functionName) {
-               this.functionName = functionName;
-       }
-       public String getFunctionCd() {
-               return functionCd;
-       }
-       public void setFunctionCd(String functionCd) {
-               this.functionCd = functionCd;
-       }
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((functionCd == null) ? 0 : functionCd.hashCode());
-               result = prime * result + ((functionName == null) ? 0 : functionName.hashCode());
-               return result;
-       }
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               BulkUploadRoleFunction other = (BulkUploadRoleFunction) obj;
-               if (functionCd == null) {
-                       if (other.functionCd != null)
-                               return false;
-               } else if (!functionCd.equals(other.functionCd))
-                       return false;
-               if (functionName == null) {
-                       if (other.functionName != null)
-                               return false;
-               } else if (!functionName.equals(other.functionName))
-                       return false;
-               return true;
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BulkUploadUserRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BulkUploadUserRoles.java
deleted file mode 100644 (file)
index d2add21..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class BulkUploadUserRoles implements Serializable{
-
-       private static final long serialVersionUID = -7478654947593502185L;
-       
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-       @Id
-       @Column(name="org_user_id")
-       private String orgUserId;
-       @Id
-       @Column(name="auth_namespace")
-       private String appNameSpace;
-       
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-       public String getAppNameSpace() {
-               return appNameSpace;
-       }
-       public void setAppNameSpace(String appNameSpace) {
-               this.appNameSpace = appNameSpace;
-       }
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appNameSpace == null) ? 0 : appNameSpace.hashCode());
-               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
-               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
-               return result;
-       }
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               BulkUploadUserRoles other = (BulkUploadUserRoles) obj;
-               if (appNameSpace == null) {
-                       if (other.appNameSpace != null)
-                               return false;
-               } else if (!appNameSpace.equals(other.appNameSpace))
-                       return false;
-               if (orgUserId == null) {
-                       if (other.orgUserId != null)
-                               return false;
-               } else if (!orgUserId.equals(other.orgUserId))
-                       return false;
-               if (roleName == null) {
-                       if (other.roleName != null)
-                               return false;
-               } else if (!roleName.equals(other.roleName))
-                       return false;
-               return true;
-       }
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRole.java
deleted file mode 100644 (file)
index fff7282..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class BusinessCardApplicationRole implements Serializable{
-       
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 1L;
-
-
-       public BusinessCardApplicationRole() {
-       }
-
-       
-    @Id
-       @Column(name="app_name")
-       private String appName;
-       
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-
-
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-
-       @Override
-       public String toString() {
-               return "BusinessCardUserApplicationRoles [appName=" + appName + ", roleName=" + roleName + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
-               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               BusinessCardApplicationRole other = (BusinessCardApplicationRole) obj;
-               if (appName == null) {
-                       if (other.appName != null)
-                               return false;
-               } else if (!appName.equals(other.appName))
-                       return false;
-               if (roleName == null) {
-                       if (other.roleName != null)
-                               return false;
-               } else if (!roleName.equals(other.roleName))
-                       return false;
-               return true;
-       }       
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRolesList.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRolesList.java
deleted file mode 100644 (file)
index 74c8370..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class BusinessCardApplicationRolesList {
-
-       public BusinessCardApplicationRolesList(){}
-
-    private String appName;
-       private List<String> roleNames;
-
-
-       public String getAppName() {
-               return appName;
-       }
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-       public List<String> getRoleNames() {
-               return roleNames;
-       }
-       public void setRoleNames(List<String> roleNames) {
-               this.roleNames = roleNames;
-       }
-       public BusinessCardApplicationRolesList(String appName, List<String> roleNames) {
-               super();
-               this.appName = appName;
-               this.roleNames = roleNames;
-       }
-       @Override
-       public String toString() {
-               return "BusinessCardUserAppRoles [appName=" + appName + ", roleNames=" + roleNames + "]";
-       }
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appName == null) ? 0 : appName.hashCode());
-               result = prime * result + ((roleNames == null) ? 0 : roleNames.hashCode());
-               return result;
-       }
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               BusinessCardApplicationRolesList other = (BusinessCardApplicationRolesList) obj;
-               if (appName == null) {
-                       if (other.appName != null)
-                               return false;
-               } else if (!appName.equals(other.appName))
-                       return false;
-               if (roleNames == null) {
-                       if (other.roleNames != null)
-                               return false;
-               } else if (!roleNames.equals(other.roleNames))
-                       return false;
-               return true;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralApp.java
deleted file mode 100644 (file)
index 6f7861b..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.Arrays;
-import java.util.Date;
-
-public class CentralApp {
-       public Long id;
-       public Date created;
-       public Date modified;
-       public Long createdId;
-       public Long modifiedId;
-       public Long rowNum;
-       public String name; // app_name
-       public String imageUrl; // app_image_url
-       public String description; // app_description
-       public String notes; // app_notes
-       public String url; // app_url
-       public String alternateUrl; // app_alternate_url
-       public String restEndpoint; // app_rest_endpoint
-       public String mlAppName; // ml_app_name
-       public String mlAppAdminId; // ml_app_admin_id;
-       public String motsId; // mots_id
-       public String appPassword; // app_password
-       public String open;
-       public String enabled;
-       public byte[] thumbnail;
-       public String username; // app_username
-       public String uebKey; // ueb_key
-       public String uebSecret; // ueb_secret
-       public String uebTopicName; // ueb_topic_name
-
-       public CentralApp(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
-                       String imageUrl, String description, String notes, String url, String alternateUrl, String restEndpoint,
-                       String mlAppName, String mlAppAdminId, String motsId, String appPassword, String open, String enabled,
-                       byte[] thumbnail, String username, String uebKey, String uebSecret, String uebTopicName) {
-               super();
-               this.id = id;
-               this.created = created;
-               this.modified = modified;
-               this.createdId = createdId;
-               this.modifiedId = modifiedId;
-               this.rowNum = rowNum;
-               this.name = name;
-               this.imageUrl = imageUrl;
-               this.description = description;
-               this.notes = notes;
-               this.url = url;
-               this.alternateUrl = alternateUrl;
-               this.restEndpoint = restEndpoint;
-               this.mlAppName = mlAppName;
-               this.mlAppAdminId = mlAppAdminId;
-               this.motsId = motsId;
-               this.appPassword = appPassword;
-               this.open = open;
-               this.enabled = enabled;
-               this.thumbnail = thumbnail;
-               this.username = username;
-               this.uebKey = uebKey;
-               this.uebSecret = uebSecret;
-               this.uebTopicName = uebTopicName;
-       }
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public Date getCreated() {
-               return created;
-       }
-
-       public void setCreated(Date created) {
-               this.created = created;
-       }
-
-       public Date getModified() {
-               return modified;
-       }
-
-       public void setModified(Date modified) {
-               this.modified = modified;
-       }
-
-       public Long getCreatedId() {
-               return createdId;
-       }
-
-       public void setCreatedId(Long createdId) {
-               this.createdId = createdId;
-       }
-
-       public Long getModifiedId() {
-               return modifiedId;
-       }
-
-       public void setModifiedId(Long modifiedId) {
-               this.modifiedId = modifiedId;
-       }
-
-       public Long getRowNum() {
-               return rowNum;
-       }
-
-       public void setRowNum(Long rowNum) {
-               this.rowNum = rowNum;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getImageUrl() {
-               return imageUrl;
-       }
-
-       public void setImageUrl(String imageUrl) {
-               this.imageUrl = imageUrl;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-       public String getNotes() {
-               return notes;
-       }
-
-       public void setNotes(String notes) {
-               this.notes = notes;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getAlternateUrl() {
-               return alternateUrl;
-       }
-
-       public void setAlternateUrl(String alternateUrl) {
-               this.alternateUrl = alternateUrl;
-       }
-
-       public String getRestEndpoint() {
-               return restEndpoint;
-       }
-
-       public void setRestEndpoint(String restEndpoint) {
-               this.restEndpoint = restEndpoint;
-       }
-
-       public String getMlAppName() {
-               return mlAppName;
-       }
-
-       public void setMlAppName(String mlAppName) {
-               this.mlAppName = mlAppName;
-       }
-
-       public String getMlAppAdminId() {
-               return mlAppAdminId;
-       }
-
-       public void setMlAppAdminId(String mlAppAdminId) {
-               this.mlAppAdminId = mlAppAdminId;
-       }
-
-       public String getMotsId() {
-               return motsId;
-       }
-
-       public void setMotsId(String motsId) {
-               this.motsId = motsId;
-       }
-
-       public String getAppPassword() {
-               return appPassword;
-       }
-
-       public void setAppPassword(String appPassword) {
-               this.appPassword = appPassword;
-       }
-
-       public String getOpen() {
-               return open;
-       }
-
-       public void setOpen(String open) {
-               this.open = open;
-       }
-
-       public String getEnabled() {
-               return enabled;
-       }
-
-       public void setEnabled(String enabled) {
-               this.enabled = enabled;
-       }
-
-       public byte[] getThumbnail() {
-               return thumbnail;
-       }
-
-       public void setThumbnail(byte[] thumbnail) {
-               this.thumbnail = thumbnail;
-       }
-
-       public String getUsername() {
-               return username;
-       }
-
-       public void setUsername(String username) {
-               this.username = username;
-       }
-
-       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 String getUebTopicName() {
-               return uebTopicName;
-       }
-
-       public void setUebTopicName(String uebTopicName) {
-               this.uebTopicName = uebTopicName;
-       }
-
-       @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 + ((created == null) ? 0 : created.hashCode());
-               result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
-               result = prime * result + ((description == null) ? 0 : description.hashCode());
-               result = prime * result + ((enabled == null) ? 0 : enabled.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());
-               result = prime * result + ((mlAppAdminId == null) ? 0 : mlAppAdminId.hashCode());
-               result = prime * result + ((mlAppName == null) ? 0 : mlAppName.hashCode());
-               result = prime * result + ((modified == null) ? 0 : modified.hashCode());
-               result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
-               result = prime * result + ((motsId == null) ? 0 : motsId.hashCode());
-               result = prime * result + ((name == null) ? 0 : name.hashCode());
-               result = prime * result + ((notes == null) ? 0 : notes.hashCode());
-               result = prime * result + ((open == null) ? 0 : open.hashCode());
-               result = prime * result + ((restEndpoint == null) ? 0 : restEndpoint.hashCode());
-               result = prime * result + ((rowNum == null) ? 0 : rowNum.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());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               CentralApp other = (CentralApp) obj;
-               if (alternateUrl == null) {
-                       if (other.alternateUrl != null)
-                               return false;
-               } else if (!alternateUrl.equals(other.alternateUrl))
-                       return false;
-               if (appPassword == null) {
-                       if (other.appPassword != null)
-                               return false;
-               } else if (!appPassword.equals(other.appPassword))
-                       return false;
-               if (created == null) {
-                       if (other.created != null)
-                               return false;
-               } else if (!created.equals(other.created))
-                       return false;
-               if (createdId == null) {
-                       if (other.createdId != null)
-                               return false;
-               } else if (!createdId.equals(other.createdId))
-                       return false;
-               if (description == null) {
-                       if (other.description != null)
-                               return false;
-               } else if (!description.equals(other.description))
-                       return false;
-               if (enabled == null) {
-                       if (other.enabled != null)
-                               return false;
-               } else if (!enabled.equals(other.enabled))
-                       return false;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (imageUrl == null) {
-                       if (other.imageUrl != null)
-                               return false;
-               } else if (!imageUrl.equals(other.imageUrl))
-                       return false;
-               if (mlAppAdminId == null) {
-                       if (other.mlAppAdminId != null)
-                               return false;
-               } else if (!mlAppAdminId.equals(other.mlAppAdminId))
-                       return false;
-               if (mlAppName == null) {
-                       if (other.mlAppName != null)
-                               return false;
-               } else if (!mlAppName.equals(other.mlAppName))
-                       return false;
-               if (modified == null) {
-                       if (other.modified != null)
-                               return false;
-               } else if (!modified.equals(other.modified))
-                       return false;
-               if (modifiedId == null) {
-                       if (other.modifiedId != null)
-                               return false;
-               } else if (!modifiedId.equals(other.modifiedId))
-                       return false;
-               if (motsId == null) {
-                       if (other.motsId != null)
-                               return false;
-               } else if (!motsId.equals(other.motsId))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       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 (restEndpoint == null) {
-                       if (other.restEndpoint != null)
-                               return false;
-               } else if (!restEndpoint.equals(other.restEndpoint))
-                       return false;
-               if (rowNum == null) {
-                       if (other.rowNum != null)
-                               return false;
-               } else if (!rowNum.equals(other.rowNum))
-                       return false;
-               if (!Arrays.equals(thumbnail, other.thumbnail))
-                       return false;
-               if (uebKey == null) {
-                       if (other.uebKey != null)
-                               return false;
-               } else if (!uebKey.equals(other.uebKey))
-                       return false;
-               if (uebSecret == null) {
-                       if (other.uebSecret != null)
-                               return false;
-               } else if (!uebSecret.equals(other.uebSecret))
-                       return false;
-               if (uebTopicName == null) {
-                       if (other.uebTopicName != null)
-                               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)
-                               return false;
-               } else if (!username.equals(other.username))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralRole.java
deleted file mode 100644 (file)
index eb90fcd..0000000
+++ /dev/null
@@ -1,284 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.Date;
-import java.util.SortedSet;
-
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPRole;
-
-public class CentralRole implements Comparable {
-       public Long id;
-       public Date created;
-       public Date modified;
-       public Long createdId;
-       public Long modifiedId;
-       public Long rowNum;
-
-       public String name;
-       public boolean active;
-       public Integer priority;
-
-       public SortedSet<CentralRoleFunction> roleFunctions = null;
-
-       public SortedSet<CentralRole> childRoles = null;
-
-       public SortedSet<CentralRole> parentRoles = null;
-
-       public CentralRole(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
-                       boolean active, Integer priority, SortedSet<CentralRoleFunction> roleFunctions,
-                       SortedSet<CentralRole> childRoles, SortedSet<CentralRole> parentRoles) {
-               super();
-               this.id = id;
-               this.created = created;
-               this.modified = modified;
-               this.createdId = createdId;
-               this.modifiedId = modifiedId;
-               this.rowNum = rowNum;
-               this.name = name;
-               this.active = active;
-               this.priority = priority;
-               this.roleFunctions = roleFunctions;
-               this.childRoles = childRoles;
-               this.parentRoles = parentRoles;
-       }
-
-       public CentralRole() {
-
-       }
-
-       public CentralRole(Long id, String name) {
-               this.id = id;
-               this.name = name;
-       }
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public Date getCreated() {
-               return created;
-       }
-
-       public void setCreated(Date created) {
-               this.created = created;
-       }
-
-       public Date getModified() {
-               return modified;
-       }
-
-       public void setModified(Date modified) {
-               this.modified = modified;
-       }
-
-       public Long getCreatedId() {
-               return createdId;
-       }
-
-       public void setCreatedId(Long createdId) {
-               this.createdId = createdId;
-       }
-
-       public Long getModifiedId() {
-               return modifiedId;
-       }
-
-       public void setModifiedId(Long modifiedId) {
-               this.modifiedId = modifiedId;
-       }
-
-       public Long getRowNum() {
-               return rowNum;
-       }
-
-       public void setRowNum(Long rowNum) {
-               this.rowNum = rowNum;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public boolean isActive() {
-               return active;
-       }
-
-       public void setActive(boolean active) {
-               this.active = active;
-       }
-
-       public Integer getPriority() {
-               return priority;
-       }
-
-       public void setPriority(Integer priority) {
-               this.priority = priority;
-       }
-
-       public SortedSet<CentralRoleFunction> getRoleFunctions() {
-               return roleFunctions;
-       }
-
-       public void setRoleFunctions(SortedSet<CentralRoleFunction> roleFunctions) {
-               this.roleFunctions = roleFunctions;
-       }
-
-       public SortedSet<CentralRole> getChildRoles() {
-               return childRoles;
-       }
-
-       public void setChildRoles(SortedSet<CentralRole> childRoles) {
-               this.childRoles = childRoles;
-       }
-
-       public SortedSet<CentralRole> getParentRoles() {
-               return parentRoles;
-       }
-
-       public void setParentRoles(SortedSet<CentralRole> parentRoles) {
-               this.parentRoles = parentRoles;
-       }
-
-       public int compareTo(Object obj) {
-               EPRole other = (EPRole) obj;
-
-               String c1 = getName();
-               String c2 = other.getName();
-
-               return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + (active ? 1231 : 1237);
-               result = prime * result + ((childRoles == null) ? 0 : childRoles.hashCode());
-               result = prime * result + ((created == null) ? 0 : created.hashCode());
-               result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((modified == null) ? 0 : modified.hashCode());
-               result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
-               result = prime * result + ((name == null) ? 0 : name.hashCode());
-               result = prime * result + ((parentRoles == null) ? 0 : parentRoles.hashCode());
-               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
-               result = prime * result + ((roleFunctions == null) ? 0 : roleFunctions.hashCode());
-               result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               CentralRole other = (CentralRole) obj;
-               if (active != other.active)
-                       return false;
-               if (childRoles == null) {
-                       if (other.childRoles != null)
-                               return false;
-               } else if (!childRoles.equals(other.childRoles))
-                       return false;
-               if (created == null) {
-                       if (other.created != null)
-                               return false;
-               } else if (!created.equals(other.created))
-                       return false;
-               if (createdId == null) {
-                       if (other.createdId != null)
-                               return false;
-               } else if (!createdId.equals(other.createdId))
-                       return false;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (modified == null) {
-                       if (other.modified != null)
-                               return false;
-               } else if (!modified.equals(other.modified))
-                       return false;
-               if (modifiedId == null) {
-                       if (other.modifiedId != null)
-                               return false;
-               } else if (!modifiedId.equals(other.modifiedId))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       return false;
-               if (parentRoles == null) {
-                       if (other.parentRoles != null)
-                               return false;
-               } else if (!parentRoles.equals(other.parentRoles))
-                       return false;
-               if (priority == null) {
-                       if (other.priority != null)
-                               return false;
-               } else if (!priority.equals(other.priority))
-                       return false;
-               if (roleFunctions == null) {
-                       if (other.roleFunctions != null)
-                               return false;
-               } else if (!roleFunctions.equals(other.roleFunctions))
-                       return false;
-               if (rowNum == null) {
-                       if (other.rowNum != null)
-                               return false;
-               } else if (!rowNum.equals(other.rowNum))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralUser.java
deleted file mode 100644 (file)
index e402456..0000000
+++ /dev/null
@@ -1,500 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.Date;
-import java.util.Set;
-
-public class CentralUser {
-
-       public Long id;
-       public Date created;
-       public Date modified;
-       public Long createdId;
-       public Long modifiedId;
-       public Long rowNum;
-
-       public Long orgId;
-       public Long managerId;
-       public String firstName;
-       public String middleInitial;
-       public String lastName;
-       public String phone;
-       public String fax;
-       public String cellular;
-       public String email;
-       public Long addressId;
-       public String alertMethodCd;
-       public String hrid;
-       public String orgUserId;
-       public String orgCode;
-       public String address1;
-       public String address2;
-       public String city;
-       public String state;
-       public String zipCode;
-       public String country;
-       public String orgManagerUserId;
-       public String locationClli;
-       public String businessCountryCode;
-       public String businessCountryName;
-       public String businessUnit;
-       public String businessUnitName;
-       public String department;
-       public String departmentName;
-       public String companyCode;
-       public String company;
-       public String zipCodeSuffix;
-       public String jobTitle;
-       public String commandChain;
-       public String siloStatus;
-       public String costCenter;
-       public String financialLocCode;
-
-       public String loginId;
-       public String loginPwd;
-       public Date lastLoginDate;
-       public boolean active;
-       public boolean internal;
-       public Long selectedProfileId;
-       public Long timeZoneId;
-       public boolean online;
-       public String chatId;
-
-       public Set<CentralUserApp> userApps = null;
-       public Set<CentralRole> pseudoRoles = null;
-
-       public CentralUser() {
-
-       }
-
-       public CentralUser(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, Long orgId,
-                       Long managerId, String firstName, String middleInitial, String lastName, String phone, String fax,
-                       String cellular, String email, Long addressId, String alertMethodCd, String hrid, String orgUserId,
-                       String orgCode, String address1, String address2, String city, String state, String zipCode, String country,
-                       String orgManagerUserId, String locationClli, String businessCountryCode, String businessCountryName,
-                       String businessUnit, String businessUnitName, String department, String departmentName, String companyCode,
-                       String company, String zipCodeSuffix, String jobTitle, String commandChain, String siloStatus,
-                       String costCenter, String financialLocCode, String loginId, String loginPwd, Date lastLoginDate,
-                       boolean active, boolean internal, Long selectedProfileId, Long timeZoneId, boolean online, String chatId,
-                       Set<CentralUserApp> userApps, Set<CentralRole> pseudoRoles) {
-               super();
-               this.id = id;
-               this.created = created;
-               this.modified = modified;
-               this.createdId = createdId;
-               this.modifiedId = modifiedId;
-               this.rowNum = rowNum;
-               this.orgId = orgId;
-               this.managerId = managerId;
-               this.firstName = firstName;
-               this.middleInitial = middleInitial;
-               this.lastName = lastName;
-               this.phone = phone;
-               this.fax = fax;
-               this.cellular = cellular;
-               this.email = email;
-               this.addressId = addressId;
-               this.alertMethodCd = alertMethodCd;
-               this.hrid = hrid;
-               this.orgUserId = orgUserId;
-               this.orgCode = orgCode;
-               this.address1 = address1;
-               this.address2 = address2;
-               this.city = city;
-               this.state = state;
-               this.zipCode = zipCode;
-               this.country = country;
-               this.orgManagerUserId = orgManagerUserId;
-               this.locationClli = locationClli;
-               this.businessCountryCode = businessCountryCode;
-               this.businessCountryName = businessCountryName;
-               this.businessUnit = businessUnit;
-               this.businessUnitName = businessUnitName;
-               this.department = department;
-               this.departmentName = departmentName;
-               this.companyCode = companyCode;
-               this.company = company;
-               this.zipCodeSuffix = zipCodeSuffix;
-               this.jobTitle = jobTitle;
-               this.commandChain = commandChain;
-               this.siloStatus = siloStatus;
-               this.costCenter = costCenter;
-               this.financialLocCode = financialLocCode;
-               this.loginId = loginId;
-               this.loginPwd = loginPwd;
-               this.lastLoginDate = lastLoginDate;
-               this.active = active;
-               this.internal = internal;
-               this.selectedProfileId = selectedProfileId;
-               this.timeZoneId = timeZoneId;
-               this.online = online;
-               this.chatId = chatId;
-               this.userApps = userApps;
-               this.pseudoRoles = pseudoRoles;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + (active ? 1231 : 1237);
-               result = prime * result + ((address1 == null) ? 0 : address1.hashCode());
-               result = prime * result + ((address2 == null) ? 0 : address2.hashCode());
-               result = prime * result + ((addressId == null) ? 0 : addressId.hashCode());
-               result = prime * result + ((alertMethodCd == null) ? 0 : alertMethodCd.hashCode());
-               result = prime * result + ((businessCountryCode == null) ? 0 : businessCountryCode.hashCode());
-               result = prime * result + ((businessCountryName == null) ? 0 : businessCountryName.hashCode());
-               result = prime * result + ((businessUnit == null) ? 0 : businessUnit.hashCode());
-               result = prime * result + ((businessUnitName == null) ? 0 : businessUnitName.hashCode());
-               result = prime * result + ((cellular == null) ? 0 : cellular.hashCode());
-               result = prime * result + ((chatId == null) ? 0 : chatId.hashCode());
-               result = prime * result + ((city == null) ? 0 : city.hashCode());
-               result = prime * result + ((commandChain == null) ? 0 : commandChain.hashCode());
-               result = prime * result + ((company == null) ? 0 : company.hashCode());
-               result = prime * result + ((companyCode == null) ? 0 : companyCode.hashCode());
-               result = prime * result + ((costCenter == null) ? 0 : costCenter.hashCode());
-               result = prime * result + ((country == null) ? 0 : country.hashCode());
-               result = prime * result + ((created == null) ? 0 : created.hashCode());
-               result = prime * result + ((createdId == null) ? 0 : createdId.hashCode());
-               result = prime * result + ((department == null) ? 0 : department.hashCode());
-               result = prime * result + ((departmentName == null) ? 0 : departmentName.hashCode());
-               result = prime * result + ((email == null) ? 0 : email.hashCode());
-               result = prime * result + ((fax == null) ? 0 : fax.hashCode());
-               result = prime * result + ((financialLocCode == null) ? 0 : financialLocCode.hashCode());
-               result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
-               result = prime * result + ((hrid == null) ? 0 : hrid.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + (internal ? 1231 : 1237);
-               result = prime * result + ((jobTitle == null) ? 0 : jobTitle.hashCode());
-               result = prime * result + ((lastLoginDate == null) ? 0 : lastLoginDate.hashCode());
-               result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
-               result = prime * result + ((locationClli == null) ? 0 : locationClli.hashCode());
-               result = prime * result + ((loginId == null) ? 0 : loginId.hashCode());
-               result = prime * result + ((loginPwd == null) ? 0 : loginPwd.hashCode());
-               result = prime * result + ((managerId == null) ? 0 : managerId.hashCode());
-               result = prime * result + ((middleInitial == null) ? 0 : middleInitial.hashCode());
-               result = prime * result + ((modified == null) ? 0 : modified.hashCode());
-               result = prime * result + ((modifiedId == null) ? 0 : modifiedId.hashCode());
-               result = prime * result + (online ? 1231 : 1237);
-               result = prime * result + ((orgCode == null) ? 0 : orgCode.hashCode());
-               result = prime * result + ((orgId == null) ? 0 : orgId.hashCode());
-               result = prime * result + ((orgManagerUserId == null) ? 0 : orgManagerUserId.hashCode());
-               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
-               result = prime * result + ((phone == null) ? 0 : phone.hashCode());
-               result = prime * result + ((pseudoRoles == null) ? 0 : pseudoRoles.hashCode());
-               result = prime * result + ((rowNum == null) ? 0 : rowNum.hashCode());
-               result = prime * result + ((selectedProfileId == null) ? 0 : selectedProfileId.hashCode());
-               result = prime * result + ((siloStatus == null) ? 0 : siloStatus.hashCode());
-               result = prime * result + ((state == null) ? 0 : state.hashCode());
-               result = prime * result + ((timeZoneId == null) ? 0 : timeZoneId.hashCode());
-               result = prime * result + ((userApps == null) ? 0 : userApps.hashCode());
-               result = prime * result + ((zipCode == null) ? 0 : zipCode.hashCode());
-               result = prime * result + ((zipCodeSuffix == null) ? 0 : zipCodeSuffix.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               CentralUser other = (CentralUser) obj;
-               if (active != other.active)
-                       return false;
-               if (address1 == null) {
-                       if (other.address1 != null)
-                               return false;
-               } else if (!address1.equals(other.address1))
-                       return false;
-               if (address2 == null) {
-                       if (other.address2 != null)
-                               return false;
-               } else if (!address2.equals(other.address2))
-                       return false;
-               if (addressId == null) {
-                       if (other.addressId != null)
-                               return false;
-               } else if (!addressId.equals(other.addressId))
-                       return false;
-               if (alertMethodCd == null) {
-                       if (other.alertMethodCd != null)
-                               return false;
-               } else if (!alertMethodCd.equals(other.alertMethodCd))
-                       return false;
-               if (businessCountryCode == null) {
-                       if (other.businessCountryCode != null)
-                               return false;
-               } else if (!businessCountryCode.equals(other.businessCountryCode))
-                       return false;
-               if (businessCountryName == null) {
-                       if (other.businessCountryName != null)
-                               return false;
-               } else if (!businessCountryName.equals(other.businessCountryName))
-                       return false;
-               if (businessUnit == null) {
-                       if (other.businessUnit != null)
-                               return false;
-               } else if (!businessUnit.equals(other.businessUnit))
-                       return false;
-               if (businessUnitName == null) {
-                       if (other.businessUnitName != null)
-                               return false;
-               } else if (!businessUnitName.equals(other.businessUnitName))
-                       return false;
-               if (cellular == null) {
-                       if (other.cellular != null)
-                               return false;
-               } else if (!cellular.equals(other.cellular))
-                       return false;
-               if (chatId == null) {
-                       if (other.chatId != null)
-                               return false;
-               } else if (!chatId.equals(other.chatId))
-                       return false;
-               if (city == null) {
-                       if (other.city != null)
-                               return false;
-               } else if (!city.equals(other.city))
-                       return false;
-               if (commandChain == null) {
-                       if (other.commandChain != null)
-                               return false;
-               } else if (!commandChain.equals(other.commandChain))
-                       return false;
-               if (company == null) {
-                       if (other.company != null)
-                               return false;
-               } else if (!company.equals(other.company))
-                       return false;
-               if (companyCode == null) {
-                       if (other.companyCode != null)
-                               return false;
-               } else if (!companyCode.equals(other.companyCode))
-                       return false;
-               if (costCenter == null) {
-                       if (other.costCenter != null)
-                               return false;
-               } else if (!costCenter.equals(other.costCenter))
-                       return false;
-               if (country == null) {
-                       if (other.country != null)
-                               return false;
-               } else if (!country.equals(other.country))
-                       return false;
-               if (created == null) {
-                       if (other.created != null)
-                               return false;
-               } else if (!created.equals(other.created))
-                       return false;
-               if (createdId == null) {
-                       if (other.createdId != null)
-                               return false;
-               } else if (!createdId.equals(other.createdId))
-                       return false;
-               if (department == null) {
-                       if (other.department != null)
-                               return false;
-               } else if (!department.equals(other.department))
-                       return false;
-               if (departmentName == null) {
-                       if (other.departmentName != null)
-                               return false;
-               } else if (!departmentName.equals(other.departmentName))
-                       return false;
-               if (email == null) {
-                       if (other.email != null)
-                               return false;
-               } else if (!email.equals(other.email))
-                       return false;
-               if (fax == null) {
-                       if (other.fax != null)
-                               return false;
-               } else if (!fax.equals(other.fax))
-                       return false;
-               if (financialLocCode == null) {
-                       if (other.financialLocCode != null)
-                               return false;
-               } else if (!financialLocCode.equals(other.financialLocCode))
-                       return false;
-               if (firstName == null) {
-                       if (other.firstName != null)
-                               return false;
-               } else if (!firstName.equals(other.firstName))
-                       return false;
-               if (hrid == null) {
-                       if (other.hrid != null)
-                               return false;
-               } else if (!hrid.equals(other.hrid))
-                       return false;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (internal != other.internal)
-                       return false;
-               if (jobTitle == null) {
-                       if (other.jobTitle != null)
-                               return false;
-               } else if (!jobTitle.equals(other.jobTitle))
-                       return false;
-               if (lastLoginDate == null) {
-                       if (other.lastLoginDate != null)
-                               return false;
-               } else if (!lastLoginDate.equals(other.lastLoginDate))
-                       return false;
-               if (lastName == null) {
-                       if (other.lastName != null)
-                               return false;
-               } else if (!lastName.equals(other.lastName))
-                       return false;
-               if (locationClli == null) {
-                       if (other.locationClli != null)
-                               return false;
-               } else if (!locationClli.equals(other.locationClli))
-                       return false;
-               if (loginId == null) {
-                       if (other.loginId != null)
-                               return false;
-               } else if (!loginId.equals(other.loginId))
-                       return false;
-               if (loginPwd == null) {
-                       if (other.loginPwd != null)
-                               return false;
-               } else if (!loginPwd.equals(other.loginPwd))
-                       return false;
-               if (managerId == null) {
-                       if (other.managerId != null)
-                               return false;
-               } else if (!managerId.equals(other.managerId))
-                       return false;
-               if (middleInitial == null) {
-                       if (other.middleInitial != null)
-                               return false;
-               } else if (!middleInitial.equals(other.middleInitial))
-                       return false;
-               if (modified == null) {
-                       if (other.modified != null)
-                               return false;
-               } else if (!modified.equals(other.modified))
-                       return false;
-               if (modifiedId == null) {
-                       if (other.modifiedId != null)
-                               return false;
-               } else if (!modifiedId.equals(other.modifiedId))
-                       return false;
-               if (online != other.online)
-                       return false;
-               if (orgCode == null) {
-                       if (other.orgCode != null)
-                               return false;
-               } else if (!orgCode.equals(other.orgCode))
-                       return false;
-               if (orgId == null) {
-                       if (other.orgId != null)
-                               return false;
-               } else if (!orgId.equals(other.orgId))
-                       return false;
-               if (orgManagerUserId == null) {
-                       if (other.orgManagerUserId != null)
-                               return false;
-               } else if (!orgManagerUserId.equals(other.orgManagerUserId))
-                       return false;
-               if (orgUserId == null) {
-                       if (other.orgUserId != null)
-                               return false;
-               } else if (!orgUserId.equals(other.orgUserId))
-                       return false;
-               if (phone == null) {
-                       if (other.phone != null)
-                               return false;
-               } else if (!phone.equals(other.phone))
-                       return false;
-               if (pseudoRoles == null) {
-                       if (other.pseudoRoles != null)
-                               return false;
-               } else if (!pseudoRoles.equals(other.pseudoRoles))
-                       return false;
-               if (rowNum == null) {
-                       if (other.rowNum != null)
-                               return false;
-               } else if (!rowNum.equals(other.rowNum))
-                       return false;
-               if (selectedProfileId == null) {
-                       if (other.selectedProfileId != null)
-                               return false;
-               } else if (!selectedProfileId.equals(other.selectedProfileId))
-                       return false;
-               if (siloStatus == null) {
-                       if (other.siloStatus != null)
-                               return false;
-               } else if (!siloStatus.equals(other.siloStatus))
-                       return false;
-               if (state == null) {
-                       if (other.state != null)
-                               return false;
-               } else if (!state.equals(other.state))
-                       return false;
-               if (timeZoneId == null) {
-                       if (other.timeZoneId != null)
-                               return false;
-               } else if (!timeZoneId.equals(other.timeZoneId))
-                       return false;
-               if (userApps == null) {
-                       if (other.userApps != null)
-                               return false;
-               } else if (!userApps.equals(other.userApps))
-                       return false;
-               if (zipCode == null) {
-                       if (other.zipCode != null)
-                               return false;
-               } else if (!zipCode.equals(other.zipCode))
-                       return false;
-               if (zipCodeSuffix == null) {
-                       if (other.zipCodeSuffix != null)
-                               return false;
-               } else if (!zipCodeSuffix.equals(other.zipCodeSuffix))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralUserApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CentralUserApp.java
deleted file mode 100644 (file)
index 8f6c15b..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-@SuppressWarnings("rawtypes")
-public class CentralUserApp implements Comparable {
-
-       private Long userId;
-       private CentralApp app;
-       private CentralRole role;
-       private Short priority;
-
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-
-       public CentralApp getApp() {
-               return app;
-       }
-
-       public void setApp(CentralApp app) {
-               this.app = app;
-       }
-
-       public CentralRole getRole() {
-               return role;
-       }
-
-       public void setRole(CentralRole role) {
-               this.role = role;
-       }
-
-       public Short getPriority() {
-               return priority;
-       }
-
-       public void setPriority(Short priority) {
-               this.priority = priority;
-       }
-
-       public int compareTo(Object other) {
-               CentralUserApp castOther = (CentralUserApp) other;
-
-               Long c1 = (this.getUserId() == null ? 0 : this.getUserId()) + (this.priority == null ? 0 : this.priority);
-               Long c2 = (castOther.getUserId() == null ? 0 : castOther.getUserId())
-                               + (castOther.getApp() == null || castOther.getApp().getId() == null ? 0 : castOther.getApp().getId())
-                               + (castOther.priority == null ? 0 : castOther.priority);
-
-               return c1.compareTo(c2);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidget.java
deleted file mode 100644 (file)
index ae75986..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-/**
- * This is to handle portal admins
- */
-@Entity 
-@Table(name="fn_common_widget_data")
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class CommonWidget extends DomainVo{
-
-       private static final long serialVersionUID = 7897021982887364557L;
-       
-       @Id
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       @Column(name = "id")
-       private Long id;
-
-       @Column(name = "category")
-       public String category;
-       
-       @Column(name = "href")
-       public String href;
-
-       @Column(name = "title")
-       public String title;
-       
-       @Column(name = "content")
-       public String content;
-
-       @Column(name = "event_date")
-       public String eventDate;
-       
-       @Column(name = "sort_order")
-       public Integer sortOrder;
-
-       
-       public CommonWidget(){
-               
-       }
-       
-       public CommonWidget(String category, String href, String title, String content, String eventDate, Integer sortOrder){
-               this.category = category;
-               this.href = href;
-               this.title = title;
-               this.content = content;
-               this.eventDate = eventDate;
-               this.sortOrder = sortOrder;
-       }
-
-       public String getCategory() {
-               return category;
-       }
-
-       public void setCategory(String category) {
-               this.category = category;
-       }
-
-       public String getHref() {
-               return href;
-       }
-
-       public void setHref(String href) {
-               this.href = href;
-       }
-
-       public String getTitle() {
-               return title;
-       }
-
-       public void setTitle(String title) {
-               this.title = title;
-       }
-
-       public Integer getSortOrder() {
-               return sortOrder;
-       }
-
-       public void setSortOrder(Integer sortOrder) {
-               this.sortOrder = sortOrder;
-       }
-
-       public static long getSerialversionuid() {
-               return serialVersionUID;
-       }
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {            
-               this.id = id;
-       }
-
-       public String getContent() {
-               return content;
-       }
-
-       public void setContent(String content) {
-               this.content = content;
-       }
-
-       public String getEventDate() {
-               return eventDate;
-       }
-
-       public void setEventDate(String eventDate) {
-               this.eventDate = eventDate;
-       }       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/CommonWidgetMeta.java
deleted file mode 100644 (file)
index 2e82f57..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-public class CommonWidgetMeta {
-       
-       private String category;
-       private List<CommonWidget> items;
-       
-       public CommonWidgetMeta(){      
-               
-       }
-
-       public CommonWidgetMeta(String category, List<CommonWidget> items){
-               this.category = category;
-               this.items = items;
-       }
-       
-       public String getCategory() {
-               return category;
-       }
-       public void setCategory(String category) {
-               this.category = category;
-       }
-       public List<CommonWidget> getItems() {
-               return items;
-       }
-       public void setItems(List<CommonWidget> items) {
-               this.items = items;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPAppsManualPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPAppsManualPreference.java
deleted file mode 100644 (file)
index cd59cdb..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class EPAppsManualPreference {
-       
-       private Long appid;
-       private int col;
-       private String headerText;
-       private String imageLink;
-       private int order;
-       private boolean restrictedApp;
-       private int row;
-       private int sizeX;
-       private int sizeY;
-       private String subHeaderText;
-       private String url;
-       private boolean addRemoveApps;
-       
-       
-       public boolean isAddRemoveApps() {
-               return addRemoveApps;
-       }
-       public void setAddRemoveApps(boolean addRemoveApps) {
-               this.addRemoveApps = addRemoveApps;
-       }
-       public Long getAppid() {
-               return appid;
-       }
-       public void setAppid(Long appid) {
-               this.appid = appid;
-       }
-       public int getCol() {
-               return col;
-       }
-       public void setCol(int col) {
-               this.col = col;
-       }
-       public String getHeaderText() {
-               return headerText;
-       }
-       public void setHeaderText(String headerText) {
-               this.headerText = headerText;
-       }
-       public String getImageLink() {
-               return imageLink;
-       }
-       public void setImageLink(String imageLink) {
-               this.imageLink = imageLink;
-       }
-       public int getOrder() {
-               return order;
-       }
-       public void setOrder(int order) {
-               this.order = order;
-       }
-       public boolean isRestrictedApp() {
-               return restrictedApp;
-       }
-       public void setRestrictedApp(boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-       public int getRow() {
-               return row;
-       }
-       public void setRow(int row) {
-               this.row = row;
-       }
-       public int getSizeX() {
-               return sizeX;
-       }
-       public void setSizeX(int sizeX) {
-               this.sizeX = sizeX;
-       }
-       public int getSizeY() {
-               return sizeY;
-       }
-       public void setSizeY(int sizeY) {
-               this.sizeY = sizeY;
-       }
-       public String getSubHeaderText() {
-               return subHeaderText;
-       }
-       public void setSubHeaderText(String subHeaderText) {
-               this.subHeaderText = subHeaderText;
-       }
-       public String getUrl() {
-               return url;
-       }
-       public void setUrl(String url) {
-               this.url = url;
-       }
-       
-       public boolean isValid(){
-               return appid != null;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPAppsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPAppsSortPreference.java
deleted file mode 100644 (file)
index eef43c6..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class EPAppsSortPreference {
-       
-       private int index;
-       private String value;
-       private String title;
-       
-       public int getIndex() {
-               return index;
-       }
-       public void setIndex(int index) {
-               this.index = index;
-       }
-       public String getValue() {
-               return value;
-       }
-       public void setValue(String value) {
-               this.value = value;
-       }
-       public String getTitle() {
-               return title;
-       }
-       public void setTitle(String title) {
-               this.title = title;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPDeleteAppsManualSortPref.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPDeleteAppsManualSortPref.java
deleted file mode 100644 (file)
index 341ed48..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class EPDeleteAppsManualSortPref {
-       private Long appId;
-       private boolean select;
-       private boolean pending;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public boolean isSelect() {
-               return select;
-       }
-
-       public void setSelect(boolean select) {
-               this.select = select;
-       }
-
-       public boolean isPending() {
-               return pending;
-       }
-
-       public void setPending(boolean pending) {
-               this.pending = pending;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPUserAppCurrentRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPUserAppCurrentRoles.java
deleted file mode 100644 (file)
index 8e140ad..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class EPUserAppCurrentRoles implements Serializable{
-
-       private static final long serialVersionUID = -8145807875293949759L;
-       
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-       @Id
-       @Column(name="user_id")
-       private Long userId;
-       @Id
-       @Column(name="priority")
-       private String priority ;
-       @Id
-       @Column(name="role_id")
-       private Long roleId;
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       public Long getUserId() {
-               return userId;
-       }
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-       public String getPriority() {
-               return priority;
-       }
-       public void setPriority(String priority) {
-               this.priority = priority;
-       }
-       public Long getRoleId() {
-               return roleId;
-       }
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
-               result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
-               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
-               result = prime * result + ((userId == null) ? 0 : userId.hashCode());
-               return result;
-       }
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               EPUserAppCurrentRoles other = (EPUserAppCurrentRoles) obj;
-               if (priority == null) {
-                       if (other.priority != null)
-                               return false;
-               } else if (!priority.equals(other.priority))
-                       return false;
-               if (roleId == null) {
-                       if (other.roleId != null)
-                               return false;
-               } else if (!roleId.equals(other.roleId))
-                       return false;
-               if (roleName == null) {
-                       if (other.roleName != null)
-                               return false;
-               } else if (!roleName.equals(other.roleName))
-                       return false;
-               if (userId == null) {
-                       if (other.userId != null)
-                               return false;
-               } else if (!userId.equals(other.userId))
-                       return false;
-               return true;
-       }
-       
-       
-
-}
-       
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPWidgetsSortPreference.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EPWidgetsSortPreference.java
deleted file mode 100644 (file)
index d8a2b2d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-public class EPWidgetsSortPreference {
-       
-       private int SizeX;
-       private int SizeY;
-       private String headerText;
-       private String url;
-       private Long widgetid;
-       private List<Object> attrb;
-       private String widgetIdentifier;
-       private int row;
-       private int col;
-       
-       public String getWidgetIdentifier() {
-               return widgetIdentifier;
-       }
-       public List<Object> getAttrb() {
-               return attrb;
-       }
-       public void setAttrb(List<Object> attrb) {
-               this.attrb = attrb;
-       }
-       public void setWidgetIdentifier(String widgetIdentifier) {
-               this.widgetIdentifier = widgetIdentifier;
-       }
-       public int getSizeX() {
-               return SizeX;
-       }
-       public void setSizeX(int sizeX) {
-               SizeX = sizeX;
-       }
-       public int getSizeY() {
-               return SizeY;
-       }
-       public void setSizeY(int sizeY) {
-               SizeY = sizeY;
-       }
-       public String getHeaderText() {
-               return headerText;
-       }
-       public void setHeaderText(String headerText) {
-               this.headerText = headerText;
-       }
-       public String getUrl() {
-               return url;
-       }
-       public void setUrl(String url) {
-               this.url = url;
-       }
-       public Long getWidgetid() {
-               return widgetid;
-       }
-       public void setWidgetid(Long widgetid) {
-               this.widgetid = widgetid;
-       }
-       public int getRow() {
-               return row;
-       }
-       public void setRow(int row) {
-               this.row = row;
-       }
-       public int getCol() {
-               return col;
-       }
-       public void setCol(int col) {
-               this.col = col;
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EcompUserAppRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EcompUserAppRoles.java
deleted file mode 100644 (file)
index e98421f..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@Entity
-@JsonInclude(JsonInclude.Include.NON_NULL)     
-public class EcompUserAppRoles implements Serializable {
-
-       private static final long serialVersionUID = -3394219387296578741L;
-       
-       @Id
-       @Column(name="app_id")
-       private String appId;
-       @Id
-       @Column(name="user_id")
-       private Long userId;
-       @Id
-       @Column(name="priority")
-       private String priority ;
-       @Id
-       @Column(name="role_id")
-       private Long roleId;
-       @Id
-       @Column(name="role_name")
-       private String roleName;
-       public String getAppId() {
-               return appId;
-       }
-       public void setAppId(String appId) {
-               this.appId = appId;
-       }
-       public Long getUserId() {
-               return userId;
-       }
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-       public String getPriority() {
-               return priority;
-       }
-       public void setPriority(String priority) {
-               this.priority = priority;
-       }
-       public Long getRoleId() {
-               return roleId;
-       }
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EcompUserRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EcompUserRoles.java
deleted file mode 100644 (file)
index 953b7b8..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class EcompUserRoles implements Serializable{
-       
-       private static final long serialVersionUID = 1L;
-       
-       @Id
-       @Column(name = "org_id")
-       private Long orgId;
-       @Id
-       @Column(name = "manager_id")
-       private String managerId;
-       @Id
-       @Column(name = "first_name")
-       private String firstName;
-       @Id
-       @Column(name = "middle_name")
-       private String middleInitial;
-       @Id
-       @Column(name = "last_name")
-       private String lastName;
-       @Id
-       @Column(name = "phone")
-       private String phone;
-       @Id
-       @Column(name = "email")
-       private String email;
-       @Id
-       @Column(name = "hrid")
-       private String hrid;
-       @Id
-       @Column(name = "org_user_id")
-       private String orgUserId;
-       @Id
-       @Column(name = "org_code")
-       private String orgCode;
-       @Id
-       @Column(name = "org_manager_userid")
-       private String orgManagerUserId;
-       @Id
-       @Column(name = "job_title")
-       private String jobTitle;
-       @Id
-       @Column(name = "login_id")
-       private String loginId;
-
-       @Id
-       @Column(name = "app_role_id")
-       private Long roleId;
-       @Id
-       @Column(name = "role_name")
-       private String roleName;
-       @Id
-       @Column(name = "active_yn")
-       private boolean active;
-       public Long getOrgId() {
-               return orgId;
-       }
-       public void setOrgId(Long orgId) {
-               this.orgId = orgId;
-       }
-       public String getManagerId() {
-               return managerId;
-       }
-       public void setManagerId(String managerId) {
-               this.managerId = managerId;
-       }
-       public String getFirstName() {
-               return firstName;
-       }
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-       public String getMiddleInitial() {
-               return middleInitial;
-       }
-       public void setMiddleInitial(String middleInitial) {
-               this.middleInitial = middleInitial;
-       }
-       public String getLastName() {
-               return lastName;
-       }
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-       public String getPhone() {
-               return phone;
-       }
-       public void setPhone(String phone) {
-               this.phone = phone;
-       }
-       public String getEmail() {
-               return email;
-       }
-       public void setEmail(String email) {
-               this.email = email;
-       }
-       public String getHrid() {
-               return hrid;
-       }
-       public void setHrid(String hrid) {
-               this.hrid = hrid;
-       }
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-       public String getOrgCode() {
-               return orgCode;
-       }
-       public void setOrgCode(String orgCode) {
-               this.orgCode = orgCode;
-       }
-       public String getOrgManagerUserId() {
-               return orgManagerUserId;
-       }
-       public void setOrgManagerUserId(String orgManagerUserId) {
-               this.orgManagerUserId = orgManagerUserId;
-       }
-       public String getJobTitle() {
-               return jobTitle;
-       }
-       public void setJobTitle(String jobTitle) {
-               this.jobTitle = jobTitle;
-       }
-       public String getLoginId() {
-               return loginId;
-       }
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       }
-       
-       public Long getRoleId() {
-               return roleId;
-       }
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-       public String getRoleName() {
-               return roleName;
-       }
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-       
-       public boolean isActive() {
-               return active;
-       }
-       public void setActive(boolean active) {
-               this.active = active;
-       }
-       @Override
-       public String toString() {
-               return "EcompUserRoles [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName
-                               + ", middleInitial=" + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", email="
-                               + email + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", orgManagerUserId="
-                               + orgManagerUserId + ", jobTitle=" + jobTitle + ", loginId=" + loginId + ", active=" + active
-                               + ", roleId=" + roleId + ", roleName=" + roleName + "]";
-       }
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItem.java
deleted file mode 100644 (file)
index c525695..0000000
+++ /dev/null
@@ -1,357 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-
-/**
- * This is to handle notifications in notification PopUp
- */
-
-
-@Entity
-@Table(name = "ep_notification")
-public class EpNotificationItem extends DomainVo {
-       public EpNotificationItem() {
-       };
-
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @GeneratedValue(strategy = GenerationType.IDENTITY)
-       @Column(name = "notification_ID")
-       public Long notificationId;
-
-       @Column(name = "is_for_online_users")
-       public String isForOnlineUsers;
-
-       @Column(name = "is_for_all_roles")
-       public String isForAllRoles;
-
-       @Column(name = "active_YN")
-       public String activeYn;
-       
-       @Column(name = "msg_header")
-       public String msgHeader;
-
-       @Column(name = "msg_description")
-       public String msgDescription;
-       
-       @Column(name = "msg_source")
-       public String msgSource;
-
-       @Column(name = "start_time")
-       public Date startTime;
-       
-       @Column(name = "end_time")
-       public Date endTime;
-
-       @Column(name = "priority")
-       public Long priority;
-       
-       @Column(name = "creator_ID")
-       public Long creatorId;
-       
-       @Column(name = "created_date")
-       public Date createdDate;
-       
-       @Column(name = "notification_hyperlink")
-       public String notificationHyperlink;
-               
-       
-       @OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, orphanRemoval = true)
-       @JoinColumn(name="notification_ID")
-       private Set<EpRoleNotificationItem> roles;
-       
-       @Transient
-       private List<Long> roleIds;
-       
-       public Long getNotificationId() {
-               return notificationId;
-       }
-
-       public void setNotificationId(Long notificationId) {
-               this.notificationId = notificationId;
-       }
-
-       public String getIsForOnlineUsers() {
-               return isForOnlineUsers;
-       }
-
-       public void setIsForOnlineUsers(String isForOnlineUsers) {
-               this.isForOnlineUsers = isForOnlineUsers;
-       }
-
-       public String getIsForAllRoles() {
-               return isForAllRoles;
-       }
-
-       public void setIsForAllRoles(String isForAllRoles) {
-               this.isForAllRoles = isForAllRoles;
-       }
-       
-       public String getActiveYn() {
-               return activeYn;
-       }
-
-       public void setActiveYn(String activeYn) {
-               this.activeYn = activeYn;
-       }
-
-       public String getMsgHeader() {
-               return msgHeader;
-       }
-
-       public void setMsgHeader(String msgHeader) {
-               this.msgHeader = msgHeader;
-       }
-
-       public String getMsgDescription() {
-               return msgDescription;
-       }
-
-       public void setMsgDescription(String msgDescription) {
-               this.msgDescription = msgDescription;
-       }
-
-       public Date getStartTime() {
-               return startTime;
-       }
-
-       public void setStartTime(Date startTime) {
-               this.startTime = startTime;
-       }
-
-       public Date getEndTime() {
-               return endTime;
-       }
-
-       public void setEndTime(Date endTime) {
-               this.endTime = endTime;
-       }
-
-       public Long getPriority() {
-               return priority;
-       }
-
-       public void setPriority(Long priority) {
-               this.priority = priority;
-       }
-
-       public Long getCreatorId() {
-               return creatorId;
-       }
-
-       public void setCreatorId(Long creatorId) {
-               this.creatorId = creatorId;
-       }
-
-       public Date getCreatedDate() {
-               return createdDate;
-       }
-
-       public void setCreatedDate(Date createdDate) {
-               this.createdDate = createdDate;
-       }
-
-       public static long getSerialversionuid() {
-               return serialVersionUID;
-       }
-
-       public Set<EpRoleNotificationItem> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(Set<EpRoleNotificationItem> roles) {
-               this.roles = roles;
-       }
-
-       public List<Long> getRoleIds() {
-               return roleIds;
-       }
-
-       public void setRoleIds(List<Long> roleIds) {
-               this.roleIds = roleIds;
-       }
-       
-       public String getMsgSource() {
-               return msgSource;
-       }
-
-       public void setMsgSource(String msgSource) {
-               this.msgSource = msgSource;
-       }
-       
-       public String getNotificationHyperlink() {
-               return notificationHyperlink;
-       }
-
-       public void setNotificationHyperlink(String notificationHyperlink) {
-               this.notificationHyperlink = notificationHyperlink;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((activeYn == null) ? 0 : activeYn.hashCode());
-               result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode());
-               result = prime * result + ((creatorId == null) ? 0 : creatorId.hashCode());
-               result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
-               result = prime * result + ((isForAllRoles == null) ? 0 : isForAllRoles.hashCode());
-               result = prime * result + ((isForOnlineUsers == null) ? 0 : isForOnlineUsers.hashCode());
-               result = prime * result + ((msgDescription == null) ? 0 : msgDescription.hashCode());
-               result = prime * result + ((msgHeader == null) ? 0 : msgHeader.hashCode());
-               result = prime * result + ((msgSource == null) ? 0 : msgSource.hashCode());
-               result = prime * result + ((notificationId == null) ? 0 : notificationId.hashCode());
-               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
-               result = prime * result + ((roleIds == null) ? 0 : roleIds.hashCode());
-               result = prime * result + ((roles == null) ? 0 : roles.hashCode());
-               result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               EpNotificationItem other = (EpNotificationItem) obj;
-               if (activeYn == null) {
-                       if (other.activeYn != null)
-                               return false;
-               } else if (!activeYn.equals(other.activeYn))
-                       return false;
-               if (createdDate == null) {
-                       if (other.createdDate != null)
-                               return false;
-               } else if (!createdDate.equals(other.createdDate))
-                       return false;
-               if (creatorId == null) {
-                       if (other.creatorId != null)
-                               return false;
-               } else if (!creatorId.equals(other.creatorId))
-                       return false;
-               if (endTime == null) {
-                       if (other.endTime != null)
-                               return false;
-               } else if (!endTime.equals(other.endTime))
-                       return false;
-               if (isForAllRoles == null) {
-                       if (other.isForAllRoles != null)
-                               return false;
-               } else if (!isForAllRoles.equals(other.isForAllRoles))
-                       return false;
-               if (isForOnlineUsers == null) {
-                       if (other.isForOnlineUsers != null)
-                               return false;
-               } else if (!isForOnlineUsers.equals(other.isForOnlineUsers))
-                       return false;
-               if (msgDescription == null) {
-                       if (other.msgDescription != null)
-                               return false;
-               } else if (!msgDescription.equals(other.msgDescription))
-                       return false;
-               if (msgHeader == null) {
-                       if (other.msgHeader != null)
-                               return false;
-               } else if (!msgHeader.equals(other.msgHeader))
-                       return false;
-               if (msgSource == null) {
-                       if (other.msgSource != null)
-                               return false;
-               } else if (!msgSource.equals(other.msgSource))
-                       return false;
-               if (notificationId == null) {
-                       if (other.notificationId != null)
-                               return false;
-               } else if (!notificationId.equals(other.notificationId))
-                       return false;
-               if (priority == null) {
-                       if (other.priority != null)
-                               return false;
-               } else if (!priority.equals(other.priority))
-                       return false;
-               if (roleIds == null) {
-                       if (other.roleIds != null)
-                               return false;
-               } else if (!roleIds.equals(other.roleIds))
-                       return false;
-               if (roles == null) {
-                       if (other.roles != null)
-                               return false;
-               } else if (!roles.equals(other.roles))
-                       return false;
-               if (startTime == null) {
-                       if (other.startTime != null)
-                               return false;
-               } else if (!startTime.equals(other.startTime))
-                       return false;
-               return true;
-       }
-
-       @Override
-       public String toString() {
-               return "EpNotificationItem [notificationId=" + notificationId + ", isForOnlineUsers=" + isForOnlineUsers
-                               + ", isForAllRoles=" + isForAllRoles + ", activeYn=" + activeYn + ", msgHeader=" + msgHeader
-                               + ", msgDescription=" + msgDescription + ", msgSource=" + msgSource + ", startTime=" + startTime
-                               + ", endTime=" + endTime + ", priority=" + priority + ", creatorId=" + creatorId + ", createdDate="
-                               + createdDate + ", roles=" + roles + ", roleIds=" + roleIds + "]";
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItemExtVO.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItemExtVO.java
deleted file mode 100644 (file)
index d7170fe..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.Date;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class EpNotificationItemExtVO {
-       
-       private Character activeYn;
-
-       private String msgHeader;
-
-       private String msgDescription;
-
-       private Date startTime;
-
-       private Date endTime;
-
-       private Integer priority;
-
-       private Integer creatorId;
-
-       private Date createdDate;
-       
-       private String loginId;
-
-       public Character getActiveYn() {
-               return activeYn;
-       }
-
-       public void setActiveYn(Character activeYn) {
-               this.activeYn = activeYn;
-       }
-
-       public String getMsgHeader() {
-               return msgHeader;
-       }
-
-       public void setMsgHeader(String msgHeader) {
-               this.msgHeader = msgHeader;
-       }
-
-       public String getMsgDescription() {
-               return msgDescription;
-       }
-
-       public void setMsgDescription(String msgDescription) {
-               this.msgDescription = msgDescription;
-       }
-
-       public Date getStartTime() {
-               return startTime;
-       }
-
-       public void setStartTime(Date startTime) {
-               this.startTime = startTime;
-       }
-
-       public Date getEndTime() {
-               return endTime;
-       }
-
-       public void setEndTime(Date endTime) {
-               this.endTime = endTime;
-       }
-
-       public Integer getPriority() {
-               return priority;
-       }
-
-       public void setPriority(Integer priority) {
-               this.priority = priority;
-       }
-
-       public Integer getCreatorId() {
-               return creatorId;
-       }
-
-       public void setCreatorId(Integer creatorId) {
-               this.creatorId = creatorId;
-       }
-
-       public Date getCreatedDate() {
-               return createdDate;
-       }
-
-       public void setCreatedDate(Date createdDate) {
-               this.createdDate = createdDate;
-       }
-
-       public String getLoginId() {
-               return loginId;
-       }
-
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       } 
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItemVO.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpNotificationItemVO.java
deleted file mode 100644 (file)
index 2bf5a10..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.Date;
-
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-/**
- * This is to handle notifications in user notifications and in notification history
- */
-
-/**
- * POJO that models a single notification with the org user ID (not integer
- * user_id).
- */
-@Entity
-public class EpNotificationItemVO extends DomainVo {
-
-       private static final long serialVersionUID = 9095479701352339201L;
-
-       @Id
-       private Integer notificationId;
-
-       private Character isForOnlineUsers;
-
-       private Character isForAllRoles;
-
-       private Character activeYn;
-
-       private String msgHeader;
-
-       private String msgDescription;
-       
-       private String msgSource;
-
-       private Date startTime;
-
-       private Date endTime;
-
-       private Integer priority;
-
-       private Integer creatorId;
-
-       private Date createdDate;
-
-       private String loginId;
-       
-       private String notificationHyperlink;
-
-       
-       /**
-        * Answers whether the notification is expired.
-        * 
-        * @return true if the end time is past the current time, else false.
-        */
-       public boolean isExpired() {
-               boolean result = false;
-               if (endTime != null) {
-                       int expired = endTime.compareTo(new Date());
-                       result = (expired == -1) ? true : false;
-               }
-               return result;
-       }
-
-       public String getLoginId() {
-               return loginId;
-       }
-
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       }
-
-       public Integer getNotificationId() {
-               return notificationId;
-       }
-
-       public void setNotificationId(Integer notificationId) {
-               this.notificationId = notificationId;
-       }
-
-       public Character getIsForOnlineUsers() {
-               return isForOnlineUsers;
-       }
-
-       public void setIsForOnlineUsers(Character isForOnlineUsers) {
-               this.isForOnlineUsers = isForOnlineUsers;
-       }
-
-       public Character getIsForAllRoles() {
-               return isForAllRoles;
-       }
-
-       public void setIsForAllRoles(Character isForAllRoles) {
-               this.isForAllRoles = isForAllRoles;
-       }
-
-       public Character getActiveYn() {
-               return activeYn;
-       }
-
-       public void setActiveYn(Character activeYn) {
-               this.activeYn = activeYn;
-       }
-
-       public String getMsgHeader() {
-               return msgHeader;
-       }
-
-       public void setMsgHeader(String msgHeader) {
-               this.msgHeader = msgHeader;
-       }
-
-       public String getMsgDescription() {
-               return msgDescription;
-       }
-
-       public void setMsgDescription(String msgDescription) {
-               this.msgDescription = msgDescription;
-       }
-
-       public Date getStartTime() {
-               return startTime;
-       }
-
-       public void setStartTime(Date startTime) {
-               this.startTime = startTime;
-       }
-
-       public Date getEndTime() {
-               return endTime;
-       }
-
-       public void setEndTime(Date endTime) {
-               this.endTime = endTime;
-       }
-
-       public Integer getPriority() {
-               return priority;
-       }
-
-       public void setPriority(Integer priority) {
-               this.priority = priority;
-       }
-
-       public Integer getCreatorId() {
-               return creatorId;
-       }
-
-       public void setCreatorId(Integer creatorId) {
-               this.creatorId = creatorId;
-       }
-
-       public Date getCreatedDate() {
-               return createdDate;
-       }
-
-       public void setCreatedDate(Date createdDate) {
-               this.createdDate = createdDate;
-       }
-
-       public static long getSerialversionuid() {
-               return serialVersionUID;
-       }
-
-       
-       public String getMsgSource() {
-               return msgSource;
-       }
-
-       public void setMsgSource(String msgSource) {
-               this.msgSource = msgSource;
-       }
-       
-       public String getNotificationHyperlink() {
-               return notificationHyperlink;
-       }
-
-       public void setNotificationHyperlink(String notificationHyperlink) {
-               this.notificationHyperlink = notificationHyperlink;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpRoleNotificationItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EpRoleNotificationItem.java
deleted file mode 100644 (file)
index 5ec117d..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-
-@Entity
-@Table(name="ep_role_notification")
-public class EpRoleNotificationItem extends DomainVo  {
-       public EpRoleNotificationItem(){};
-       
-       private static final long serialVersionUID = 1L;
-
-       @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-       @Column(name = "ID")
-       public Long id;
-       
-       @Column(name = "notification_ID")
-       public Long notificationId;
-               
-       @Column(name = "role_ID")
-       public Integer roleId;
-       
-       @Column(name = "recv_user_id")
-       public Integer RecvUserId;
-
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public Long getNotificationId() {
-               return notificationId;
-       }
-
-       public void setNotificationId(Long notificationId) {
-               this.notificationId = notificationId;
-       }
-
-       public Integer getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Integer roleId) {
-               this.roleId = roleId;
-       }
-
-       public static long getSerialversionuid() {
-               return serialVersionUID;
-       }
-       
-       public Integer getRecvUserId() {
-               return RecvUserId;
-       }
-
-       public void setRecvUserId(Integer recvUserId) {
-               RecvUserId = recvUserId;
-       }
-
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EventWidget.java
deleted file mode 100644 (file)
index 1da7f7f..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-/*package org.openecomp.portalapp.portal.transport;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.openecomp.portalsdk.core.domain.support.DomainVo;
-import com.fasterxml.jackson.annotation.JsonInclude;
-
-*//**
- * This is to handle portal admins
- *//*
-@Entity 
-@Table(name="fn_event_widget_data")
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class EventWidget extends DomainVo{
-
-       *//**
-        * 
-        *//*
-       private static final long serialVersionUID = -2784849102886421352L;
-
-       
-       @Id
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       @Column(name = "id")
-       private Long id;
-
-       @Column(name = "category")
-       private String category;
-
-       @Column(name = "title")
-       private String title;
-       
-       @Column(name = "href")
-       private String href;
-
-       @Column(name = "content")
-       private String content;
-       
-       @Column(name = "month_val")
-       private String mon;
-
-       @Column(name = "day_val")
-       private Integer  day;
-
-       @Column(name = "year_val")
-       private Integer year;
-
-       @Column(name = "sort_order")
-       private Integer sortOrder;
-
-       public String getTitle() {
-               return title;
-       }
-
-       public void setTitle(String title) {
-               this.title = title;
-       }
-
-       public String getHref() {
-               return href;
-       }
-
-       public void setHref(String href) {
-               this.href = href;
-       }
-
-       public String getContent() {
-               return content;
-       }
-
-       public void setContent(String content) {
-               this.content = content;
-       }
-
-       public String getMon() {
-               return mon;
-       }
-
-       public void setMonth(String mon) {
-               this.mon = mon;
-       }
-
-       public Integer getDay() {
-               return day;
-       }
-
-       public void setDay(Integer day) {
-               this.day = day;
-       }
-
-       public Integer getYear() {
-               return year;
-       }
-
-       public void setYear(Integer year) {
-               this.year = year;
-       }
-
-       public Integer getSortOrder() {
-               return sortOrder;
-       }
-
-       public String getCategory() {
-               return category;
-       }
-
-       public void setCategory(String category) {
-               this.category = category;
-       }
-       
-       
-}
-*/
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/EventWidgetMeta.java
deleted file mode 100644 (file)
index 3447108..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-/*package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-public class EventWidgetMeta {
-       
-       private String category;
-       private List<EventWidget> items;
-       
-       public EventWidgetMeta(){       
-               
-       }
-
-       public EventWidgetMeta(String category, List<EventWidget> items){
-               this.category = category;
-               this.items = items;
-       }
-       
-       public String getCategory() {
-               return category;
-       }
-       public void setCategory(String category) {
-               this.category = category;
-       }
-       public List<EventWidget> getItems() {
-               return items;
-       }
-       public void setItems(List<EventWidget> items) {
-               this.items = items;
-       }
-}
-*/
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessPerms.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessPerms.java
deleted file mode 100644 (file)
index aeb2ad3..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-public class ExternalAccessPerms implements Serializable, Comparable {
-
-       /**
-        * 
-        */
-       private static final long serialVersionUID = -200964838466882602L;
-       public String type;
-       public String instance;
-       public String action;
-       public String description;
-
-       public ExternalAccessPerms() {
-               super();
-       }
-
-       public ExternalAccessPerms(String type, String instance, String action, String description) {
-               super();
-               this.type = type;
-               this.instance = instance;
-               this.action = action;
-               this.description = description;
-       }
-
-       public ExternalAccessPerms(String type, String instance, String action) {
-               super();
-               this.type = type;
-               this.instance = instance;
-               this.action = action;
-       }
-
-       /**
-        * @return the type
-        */
-       public String getType() {
-               return type;
-       }
-
-       /**
-        * @param type
-        *            the type to set
-        */
-       public void setType(String type) {
-               this.type = type;
-       }
-
-       /**
-        * @return the instance
-        */
-       public String getInstance() {
-               return instance;
-       }
-
-       /**
-        * @param instance
-        *            the instance to set
-        */
-       public void setInstance(String instance) {
-               this.instance = instance;
-       }
-
-       /**
-        * @return the action
-        */
-       public String getAction() {
-               return action;
-       }
-
-       /**
-        * @param action
-        *            the action to set
-        */
-       public void setAction(String action) {
-               this.action = action;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-       @Override
-       public int compareTo(Object obj) {
-               ExternalAccessPerms other = (ExternalAccessPerms) obj;
-
-               String c1 = getInstance();
-               String c2 = other.getInstance();
-
-               return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((action == null) ? 0 : action.hashCode());
-               result = prime * result + ((description == null) ? 0 : description.hashCode());
-               result = prime * result + ((instance == null) ? 0 : instance.hashCode());
-               result = prime * result + ((type == null) ? 0 : type.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               ExternalAccessPerms other = (ExternalAccessPerms) obj;
-               if (action == null) {
-                       if (other.action != null)
-                               return false;
-               } else if (!action.equals(other.action))
-                       return false;
-               if (description == null) {
-                       if (other.description != null)
-                               return false;
-               } else if (!description.equals(other.description))
-                       return false;
-               if (instance == null) {
-                       if (other.instance != null)
-                               return false;
-               } else if (!instance.equals(other.instance))
-                       return false;
-               if (type == null) {
-                       if (other.type != null)
-                               return false;
-               } else if (!type.equals(other.type))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsDetail.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsDetail.java
deleted file mode 100644 (file)
index 554aebb..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.List;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonIgnoreProperties(ignoreUnknown = true)
-@JsonRootName(value = "perm")
-public class ExternalAccessPermsDetail {
-
-       private String type;
-       private String instance;
-       private String action;
-       private List<String> roles;
-       private String description;
-
-       public ExternalAccessPermsDetail() {
-               super();
-       }
-
-       /**
-        * @param type
-        * @param instance
-        * @param action
-        * @param roles
-        * @param description
-        */
-       public ExternalAccessPermsDetail(String type, String instance, String action, List<String> roles,
-                       String description) {
-               super();
-               this.type = type;
-               this.instance = instance;
-               this.action = action;
-               this.roles = roles;
-               this.description = description;
-       }
-
-       /**
-        * @param type
-        * @param instance
-        * @param action
-        * @param description
-        */
-       public ExternalAccessPermsDetail(String type, String instance, String action, String description) {
-               super();
-               this.type = type;
-               this.instance = instance;
-               this.action = action;
-               this.description = description;
-       }
-
-       public String getType() {
-               return type;
-       }
-
-       public void setType(String type) {
-               this.type = type;
-       }
-
-       public String getInstance() {
-               return instance;
-       }
-
-       public void setInstance(String instance) {
-               this.instance = instance;
-       }
-
-       public String getAction() {
-               return action;
-       }
-
-       public void setAction(String action) {
-               this.action = action;
-       }
-
-       public List<String> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<String> roles) {
-               this.roles = roles;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessRole.java
deleted file mode 100644 (file)
index 415665a..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-public class ExternalAccessRole implements Serializable {
-
-       /**
-        * 
-        */
-       private static final long serialVersionUID = 3439986826362436339L;
-       public String name;
-       public String description;
-
-       public ExternalAccessRole() {
-
-       }
-
-       public ExternalAccessRole(String name, String description) {
-               super();
-               this.name = name;
-               this.description = description;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getDescription() {
-               return description;
-       }
-
-       public void setDescription(String description) {
-               this.description = description;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessRolePerms.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessRolePerms.java
deleted file mode 100644 (file)
index 314df1d..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class ExternalAccessRolePerms {
-
-       private ExternalAccessPerms perm;
-       private String role;
-
-       public ExternalAccessRolePerms(ExternalAccessPerms perm, String role) {
-               super();
-               this.perm = perm;
-               this.role = role;
-       }
-
-       public ExternalAccessPerms getPerm() {
-               return perm;
-       }
-
-       public void setPerm(ExternalAccessPerms perm) {
-               this.perm = perm;
-       }
-
-       public String getRole() {
-               return role;
-       }
-
-       public void setRole(String role) {
-               this.role = role;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessUser.java
deleted file mode 100644 (file)
index 4b18130..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class ExternalAccessUser {
-
-       private String user;
-       private String role;
-
-       public ExternalAccessUser(String user, String role) {
-               super();
-               this.user = user;
-               this.role = role;
-       }
-       
-       public String getUser() {
-               return user;
-       }
-       public void setUser(String user) {
-               this.user = user;
-       }
-       public String getRole() {
-               return role;
-       }
-       public void setRole(String role) {
-               this.role = role;
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserRoleDetail.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserRoleDetail.java
deleted file mode 100644 (file)
index 45b2819..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class ExternalAccessUserRoleDetail {
-
-       private String name;
-       private ExternalRoleDescription description;
-
-       /**
-        * 
-        */
-       public ExternalAccessUserRoleDetail() {
-               super();
-       }
-
-       public ExternalAccessUserRoleDetail(String name, ExternalRoleDescription description) {
-               super();
-               this.name = name;
-               this.description = description;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public ExternalRoleDescription getDescription() {
-               return description;
-       }
-
-       public void setDescription(ExternalRoleDescription description) {
-               this.description = description;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((description == null) ? 0 : description.hashCode());
-               result = prime * result + ((name == null) ? 0 : name.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               ExternalAccessUserRoleDetail other = (ExternalAccessUserRoleDetail) obj;
-               if (description == null) {
-                       if (other.description != null)
-                               return false;
-               } else if (!description.equals(other.description))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalRequestFieldsValidator.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalRequestFieldsValidator.java
deleted file mode 100644 (file)
index 0e7581a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class ExternalRequestFieldsValidator {
-
-       private boolean result;
-       private String detailMessage;
-       
-       public ExternalRequestFieldsValidator(boolean result, String detailMessage) {
-               super();
-               this.result = result;
-               this.detailMessage = detailMessage;
-       }
-       public boolean isResult() {
-               return result;
-       }
-       public void setResult(boolean result) {
-               this.result = result;
-       }
-       public String getDetailMessage() {
-               return detailMessage;
-       }
-       public void setDetailMessage(String detailMessage) {
-               this.detailMessage = detailMessage;
-       }
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalRoleDescription.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ExternalRoleDescription.java
deleted file mode 100644 (file)
index 5c73c1f..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class ExternalRoleDescription {
-
-       private String id;
-       private String  name;
-    private String active;
-    private String priority;
-    private String appId;
-    private String appRoleId;
-    
-       public String getId() {
-               return id;
-       }
-       public void setId(String id) {
-               this.id = id;
-       }
-       public String getName() {
-               return name;
-       }
-       public void setName(String name) {
-               this.name = name;
-       }
-       public String getActive() {
-               return active;
-       }
-       public void setActive(String active) {
-               this.active = active;
-       }
-       public String getPriority() {
-               return priority;
-       }
-       public void setPriority(String priority) {
-               this.priority = priority;
-       }
-       public String getAppId() {
-               return appId;
-       }
-       public void setAppId(String appId) {
-               this.appId = appId;
-       }
-       public String getAppRoleId() {
-               return appRoleId;
-       }
-       public void setAppRoleId(String appRoleId) {
-               this.appRoleId = appRoleId;
-       }
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((active == null) ? 0 : active.hashCode());
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((appRoleId == null) ? 0 : appRoleId.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((name == null) ? 0 : name.hashCode());
-               result = prime * result + ((priority == null) ? 0 : priority.hashCode());
-               return result;
-       }
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               ExternalRoleDescription other = (ExternalRoleDescription) obj;
-               if (active == null) {
-                       if (other.active != null)
-                               return false;
-               } else if (!active.equals(other.active))
-                       return false;
-               if (appId == null) {
-                       if (other.appId != null)
-                               return false;
-               } else if (!appId.equals(other.appId))
-                       return false;
-               if (appRoleId == null) {
-                       if (other.appRoleId != null)
-                               return false;
-               } else if (!appRoleId.equals(other.appRoleId))
-                       return false;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       return false;
-               if (priority == null) {
-                       if (other.priority != null)
-                               return false;
-               } else if (!priority.equals(other.priority))
-                       return false;
-               return true;
-       }
-    
-    
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItem.java
deleted file mode 100644 (file)
index df38272..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-
-/**
- * This is to handle functional menu favorites
- */
-@Entity
-@Table(name="fn_menu_favorites")
-public class FavoritesFunctionalMenuItem implements Serializable {
-       private static final long serialVersionUID = 1L;
-       
-       @Id
-       @Column(name = "user_id")
-       public Long userId;
-       
-       @Id
-       @Column(name = "menu_id")
-       public Long menuId;     
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FavoritesFunctionalMenuItemJson.java
deleted file mode 100644 (file)
index ea64f13..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-
-
-/**
- * This is to handle functional menu favorites
- */
-@Entity
-@Table(name="fn_menu_favorites")
-public class FavoritesFunctionalMenuItemJson implements Serializable {
-
-       private static final long serialVersionUID = 1L;
-       
-       @Id
-       @Column(name = "user_id")
-       public Long userId;
-       
-       @Id
-       @Column(name = "menu_id")
-       public Long menuId;
-       
-       @Column(name = "text")
-       public String text;
-       
-       @Column(name = "url")
-       public String url;
-       
-       @Transient
-       public Boolean restrictedApp;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FieldsValidator.java
deleted file mode 100644 (file)
index f029e8a..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletResponse;
-
-public class FieldsValidator {
-
-       public Long httpStatusCode = new Long(HttpServletResponse.SC_OK);
-
-       public Long errorCode;
-
-       public class FieldName {
-
-               public String name;
-
-               public FieldName(String name) {
-                       this.name = name;
-               }
-
-               public String getName() {
-                       return name;
-               }
-
-               public void setName(String name) {
-                       this.name = name;
-               }
-
-       }
-       
-
-       public List<FieldName> fields = new ArrayList<FieldName>();
-
-       public void addProblematicFieldName(String name) {
-               fields.add(new FieldName(name));
-       }
-
-       public Long getHttpStatusCode() {
-               return httpStatusCode;
-       }
-
-       public void setHttpStatusCode(Long httpStatusCode) {
-               this.httpStatusCode = httpStatusCode;
-       }
-
-       public Long getErrorCode() {
-               return errorCode;
-       }
-
-       public void setErrorCode(Long errorCode) {
-               this.errorCode = errorCode;
-       }
-
-       public List<FieldName> getFields() {
-               return fields;
-       }
-
-       public void setFields(List<FieldName> fields) {
-               this.fields = fields;
-       }
-
-       @Override
-       public String toString() {
-               return "FieldsValidator [httpStatusCode=" + httpStatusCode + ", errorCode=" + errorCode + ", fields=" + fields
-                               + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode());
-               result = prime * result + ((fields == null) ? 0 : fields.hashCode());
-               result = prime * result + ((httpStatusCode == null) ? 0 : httpStatusCode.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               FieldsValidator other = (FieldsValidator) obj;
-               if (errorCode == null) {
-                       if (other.errorCode != null)
-                               return false;
-               } else if (!errorCode.equals(other.errorCode))
-                       return false;
-               if (fields == null) {
-                       if (other.fields != null)
-                               return false;
-               } else if (!fields.equals(other.fields))
-                       return false;
-               if (httpStatusCode == null) {
-                       if (other.httpStatusCode != null)
-                               return false;
-               } else if (!httpStatusCode.equals(other.httpStatusCode))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItem.java
deleted file mode 100644 (file)
index 3deb49b..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-@Entity
-@Table(name="fn_menu_functional")
-public class FunctionalMenuItem implements Serializable {
-       public FunctionalMenuItem(){};
-       
-       private static final long serialVersionUID = 1L;
-
-       @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-       @Column(name = "MENU_ID")
-       public Long menuId;
-       
-       @Column(name = "COLUMN_NUM")
-       public Integer column;
-       
-       @Column(name = "TEXT")
-       public String text;
-       
-       @Column(name = "PARENT_MENU_ID")
-       public Integer parentMenuId;
-       
-       @Column(name = "URL")
-       public String url;
-       
-       @Column(name="ACTIVE_YN")
-       public String active_yn;
-
-       @Transient
-       public Integer appid;
-       
-       public List<Integer> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<Integer> roles) {
-               this.roles = roles;
-       }
-
-       @Transient
-       private List<Integer> roles;
-       
-       @Transient
-       public Boolean restrictedApp;
-       
-       public void normalize() {
-               if (this.column == null)
-                       this.column = new Integer(1);
-               this.text = (this.text == null) ? "" : this.text.trim();
-               if (this.parentMenuId == null)
-                       this.parentMenuId = new Integer(-1);
-               this.url = (this.url == null) ? "" : this.url.trim();
-       }
-
-       @Override
-       public String toString() {
-               return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
-                               + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
-                               + ", restrictedApp=" + restrictedApp + "]";
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public void setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemWithRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemWithRoles.java
deleted file mode 100644 (file)
index 0dc6402..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-import java.util.List;
-
-// This type is used to read the Json in from the API call from the Front End
-public class FunctionalMenuItemWithRoles implements Serializable {
-       private static final long serialVersionUID = 1L;
-
-       public Long menuId;
-       
-       public Integer column;
-       
-       public String text;
-       
-       public Integer parentMenuId;
-       
-       public String url;
-
-       public Integer appid;
-       
-       private List<Integer> roles;
-
-       public List<Integer> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<Integer> roles) {
-               this.roles = roles;
-       }
-
-       public void normalize() {
-               if (this.column == null)
-                       this.column = new Integer(1);
-               this.text = (this.text == null) ? "" : this.text.trim();
-               if (this.parentMenuId == null)
-                       this.parentMenuId = new Integer(-1);
-               this.url = (this.url == null) ? "" : this.url.trim();
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRole.java
deleted file mode 100644 (file)
index 83aab18..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name="fn_menu_functional_roles")
-public class FunctionalMenuRole implements Serializable {
-       private static final long serialVersionUID = 1L;
-
-       @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-       @Column(name = "ID")
-       public Integer id;
-       
-       @Column(name = "MENU_ID")
-       public Long menuId;
-       
-       @Column(name = "APP_ID")
-       public Integer appId;
-       
-       @Column(name = "ROLE_ID")
-       public Integer roleId;
-
-       public Integer getId() {
-               return id;
-       }
-
-       public void setId(Integer id) {
-               this.id = id;
-       }
-
-       public Long getMenuId() {
-               return menuId;
-       }
-
-       public void setMenuId(Long menuId) {
-               this.menuId = menuId;
-       }
-
-       public Integer getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Integer appId) {
-               this.appId = appId;
-       }
-
-       public Integer getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Integer roleId) {
-               this.roleId = roleId;
-       }
-
-       @Override
-       public String toString() {
-               return "FunctionalMenuRole [id=" + id + ", menuId=" + menuId + ", appId=" + appId + ", roleId=" + roleId + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((appId == null) ? 0 : appId.hashCode());
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((menuId == null) ? 0 : menuId.hashCode());
-               result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
-               return result;
-       }
-
-       @Override
-    public boolean equals(Object o) {
-
-        if (o == this) return true;
-        if (!(o instanceof FunctionalMenuRole)) {
-            return false;
-        }
-        FunctionalMenuRole functionalMenuRole = (FunctionalMenuRole) o;
-        System.out.println("test");
-        return  id.equals(functionalMenuRole.getId()) &&
-                       menuId.equals(functionalMenuRole.menuId) &&
-                       appId.equals(functionalMenuRole.appId) &&
-                       roleId.equals(functionalMenuRole.roleId) ;
-    }
-       
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/LocalRole.java
deleted file mode 100644 (file)
index 05dfc5b..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class LocalRole implements Serializable {
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name = "ROLE_ID")
-       public Integer roleId;
-
-       @Column(name = "ROLE_NAME")
-       public String rolename;
-
-       public void normalize() {
-               this.rolename = (this.rolename == null) ? "" : this.rolename.trim();
-       }
-
-       public Integer getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Integer roleId) {
-               this.roleId = roleId;
-       }
-
-       public String getRolename() {
-               return rolename;
-       }
-
-       public void setRolename(String rolename) {
-               this.rolename = rolename;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java
deleted file mode 100644 (file)
index 54fe7fb..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-/**
- * Model of rows in the fn_app table; serialized as a message add or update an
- * on-boarded application.
- */
-public class OnboardingApp {
-
-       public Long id;
-
-       public String name;
-
-       public String imageUrl;
-
-       public String imageLink;
-
-       public String description;
-
-       public String notes;
-
-       public String url;
-
-       public String alternateUrl;
-
-       public String restUrl;
-
-       public Boolean isOpen;
-
-       public Boolean isEnabled;
-
-       public Long motsId;
-
-       public String myLoginsAppName;
-
-       public String myLoginsAppOwner;
-
-       public String username;
-
-       public String appPassword;
-
-       public String thumbnail;
-
-       public String uebTopicName;
-
-       public String uebKey;
-
-       public String uebSecret;
-
-       public Boolean restrictedApp;
-       
-       public Boolean isCentralAuth;
-       
-       public String nameSpace;
-
-       /**
-        * 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.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();
-       }
-
-       public void setUebTopicName(String topicName) {
-               this.uebTopicName = topicName;
-       }
-
-       public void setUebKey(String key) {
-               this.uebKey = key;
-       }
-
-       public void setUebSecret(String secret) {
-               this.uebSecret = secret;
-       }
-
-       // 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 setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingWidget.java
deleted file mode 100644 (file)
index 26a6d6a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-@Entity
-public class OnboardingWidget implements Serializable {
-
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name = "WIDGET_ID")
-       public Long id;
-
-       @Column(name = "WDG_NAME")
-       public String name;
-
-       @Column(name = "APP_ID")
-       public Long appId;
-
-       @Column(name = "APP_NAME")
-       public String appName;
-
-       @Column(name = "WDG_WIDTH")
-       public Integer width;
-
-       @Column(name = "WDG_HEIGHT")
-       public Integer height;
-
-       @Column(name = "WDG_URL")
-       public String url;
-
-       public void normalize() {
-               this.name = (this.name == null) ? "" : this.name.trim();
-               this.appName = (this.appName == null) ? "" : this.appName.trim();
-               if (this.width == null)
-                       this.width = new Integer(0);
-               if (this.height == null)
-                       this.height = new Integer(0);
-               this.url = (this.url == null) ? "" : this.url.trim();
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdmin.java
deleted file mode 100644 (file)
index 643af75..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * This is to handle portal admins
- */
-@Entity
-@Table(name = "fn_user")
-public class PortalAdmin implements Serializable {
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @GeneratedValue(strategy = GenerationType.IDENTITY)
-       @Column(name = "user_id")
-       public Long userId;
-
-       @Column(name = "login_id")
-       public String loginId;
-
-       @Column(name = "first_name")
-       public String firstName;
-
-       @Column(name = "last_name")
-       public String lastName;
-
-       public Long getUserId() {
-               return userId;
-       }
-
-       public void setUserId(Long userId) {
-               this.userId = userId;
-       }
-
-       public String getLoginId() {
-               return loginId;
-       }
-
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       }
-
-       public String getFirstName() {
-               return firstName;
-       }
-
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-
-       public String getLastName() {
-               return lastName;
-       }
-
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/PortalAdminUserRole.java
deleted file mode 100644 (file)
index 9e18716..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * This is to handle portal admins
- */
-@Entity
-@Table(name="fn_user_role")
-public class PortalAdminUserRole implements Serializable{
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name = "user_id")
-       public Long userId;
-       
-       @Id
-       @Column(name = "role_id")
-       public Long roleId;
-       
-       @Column(name = "app_id")
-       public Long appId;
-               
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ProfileDetail.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/ProfileDetail.java
deleted file mode 100644 (file)
index cbc6b69..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class ProfileDetail {
-
-       private String firstName;
-       private String lastName;
-       private String middleName;
-       private String email;
-       private String loginId;
-       private String loginPassword;
-
-       public ProfileDetail() {
-       }
-
-       public ProfileDetail(String firstName, String lastName, String middleName, String email, String loginId,
-                       String loginPassword) {
-               this.firstName = firstName;
-               this.lastName = lastName;
-               this.middleName = middleName;
-               this.email = email;
-               this.loginId = loginId;
-               this.loginPassword = loginPassword;
-       }
-
-       public String getFirstName() {
-               return firstName;
-       }
-
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-
-       public String getLastName() {
-               return lastName;
-       }
-
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-
-       public String getMiddleName() {
-               return middleName;
-       }
-
-       public void setMiddleName(String middleName) {
-               this.middleName = middleName;
-       }
-
-       public String getEmail() {
-               return email;
-       }
-
-       public void setEmail(String email) {
-               this.email = email;
-       }
-
-       public String getLoginId() {
-               return loginId;
-       }
-
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       }
-
-       public String getLoginPassword() {
-               return loginPassword;
-       }
-
-       public void setLoginPassword(String loginPassword) {
-               this.loginPassword = loginPassword;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RemoteRole.java
deleted file mode 100644 (file)
index 6de3228..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class RemoteRole {
-
-       private Long id;
-       private String name;
-       
-       public Long getId() {
-               return id;
-       }
-       public void setId(Long id) {
-               this.id = id;
-       }
-       public String getName() {
-               return name;
-       }
-       public void setName(String name) {
-               this.name = name;
-       }
-       
-       @Override
-       public String toString() {
-               return "RemoteRole [id=" + id + ", name=" + name + "]";
-       }
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((id == null) ? 0 : id.hashCode());
-               result = prime * result + ((name == null) ? 0 : name.hashCode());
-               return result;
-       }
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               RemoteRole other = (RemoteRole) obj;
-               if (id == null) {
-                       if (other.id != null)
-                               return false;
-               } else if (!id.equals(other.id))
-                       return false;
-               if (name == null) {
-                       if (other.name != null)
-                               return false;
-               } else if (!name.equals(other.name))
-                       return false;
-               return true;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRoles.java
deleted file mode 100644 (file)
index 4aa3057..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-/**
- * User description which we receive in response from request to remote
- * application: applicationsRestClientService.get(RemoteUserWithRoles[].class,
- * appId, "/users"). It contains the most important info about remote
- * application user including his roles in this application.
- */
-public class RemoteUserWithRoles {
-
-       private Long orgId;
-
-       private Long managerId;
-
-       private String firstName;
-
-       private String middleInitial;
-
-       private String lastName;
-
-       private String phone;
-
-       private String email;
-
-       private String hrid;
-
-       private String orgUserId;
-
-       private String orgCode;
-
-       private String orgManagerUserId;
-
-       private String jobTitle;
-
-       private String loginId;
-
-       private Boolean active;
-
-       private List<RemoteRole> roles = new ArrayList<RemoteRole>();
-
-       public Long getOrgId() {
-               return orgId;
-       }
-
-       public void setOrgId(Long orgId) {
-               this.orgId = orgId;
-       }
-
-       public Long getManagerId() {
-               return managerId;
-       }
-
-       public void setManagerId(Long managerId) {
-               this.managerId = managerId;
-       }
-
-       public String getFirstName() {
-               return firstName;
-       }
-
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-
-       public String getMiddleInitial() {
-               return middleInitial;
-       }
-
-       public void setMiddleInitial(String middleInitial) {
-               this.middleInitial = middleInitial;
-       }
-
-       public String getLastName() {
-               return lastName;
-       }
-
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-
-       public String getPhone() {
-               return phone;
-       }
-
-       public void setPhone(String phone) {
-               this.phone = phone;
-       }
-
-       public String getEmail() {
-               return email;
-       }
-
-       public void setEmail(String email) {
-               this.email = email;
-       }
-
-       public String getHrid() {
-               return hrid;
-       }
-
-       public void setHrid(String hrid) {
-               this.hrid = hrid;
-       }
-
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-
-       public void setOrgUserId(String orgUserId) {
-               if(this.orgUserId == null)
-                       this.orgUserId = orgUserId;
-       }
-
-       public String getOrgCode() {
-               return orgCode;
-       }
-
-       public void setOrgCode(String orgCode) {
-               this.orgCode = orgCode;
-       }
-
-       public String getOrgManagerUserId() {
-               return orgManagerUserId;
-       }
-
-       public void setOrgManagerUserId(String orgManagerUserId) {
-               this.orgManagerUserId = orgManagerUserId;
-       }
-
-       public String getJobTitle() {
-               return jobTitle;
-       }
-
-       public void setJobTitle(String jobTitle) {
-               this.jobTitle = jobTitle;
-       }
-
-       public String getLoginId() {
-               return loginId;
-       }
-
-       public void setLoginId(String loginId) {
-               this.loginId = loginId;
-       }
-
-       public Boolean getActive() {
-               return active;
-       }
-
-       public void setActive(Boolean active) {
-               this.active = active;
-       }
-
-       public List<RemoteRole> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<RemoteRole> roles) {
-               this.roles = roles;
-       }
-
-       @Override
-       public String toString() {
-               return "RemoteUserWithRoles [orgId=" + orgId + ", managerId=" + managerId + ", firstName=" + firstName
-                               + ", middleInitial=" + middleInitial + ", lastName=" + lastName + ", phone=" + phone + ", email="
-                               + email + ", hrid=" + hrid + ", orgUserId=" + orgUserId + ", orgCode=" + orgCode + ", orgManagerUserId="
-                               + orgManagerUserId + ", jobTitle=" + jobTitle + ", loginId=" + loginId + ", active=" + active
-                               + ", roles=" + roles + "]";
-       }
-       
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RoleInAppForUser.java
deleted file mode 100644 (file)
index 76018b3..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class RoleInAppForUser {
-
-
-       public RoleInAppForUser() {
-       }
-       
-       public RoleInAppForUser(Long id, String name) {
-               this.roleId = id;
-               this.roleName = name;
-       }
-
-       public Long roleId;
-
-       public String roleName;
-
-       public Boolean isApplied;
-
-       public Long getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-
-       public Boolean getIsApplied() {
-               return isApplied;
-       }
-
-       public void setIsApplied(Boolean isApplied) {
-               this.isApplied = isApplied;
-       }
-
-       @Override
-       public String toString() {
-               return "RoleInAppForUser [roleId=" + roleId + ", roleName=" + roleName + ", isApplied=" + isApplied + "]";
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((isApplied == null) ? 0 : isApplied.hashCode());
-               result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
-               result = prime * result + ((roleName == null) ? 0 : roleName.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               RoleInAppForUser other = (RoleInAppForUser) obj;
-               if (isApplied == null) {
-                       if (other.isApplied != null)
-                               return false;
-               } else if (!isApplied.equals(other.isApplied))
-                       return false;
-               if (roleId == null) {
-                       if (other.roleId != null)
-                               return false;
-               } else if (!roleId.equals(other.roleId))
-                       return false;
-               if (roleName == null) {
-                       if (other.roleName != null)
-                               return false;
-               } else if (!roleName.equals(other.roleName))
-                       return false;
-               return true;
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/RolesInAppForUser.java
deleted file mode 100644 (file)
index ea6f92b..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class RolesInAppForUser {
-
-       public String orgUserId;
-       
-       public Long appId;
-
-       public List<RoleInAppForUser> roles = new ArrayList<RoleInAppForUser>();
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/UserApplicationRoles.java
deleted file mode 100644 (file)
index b1af081..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * A specific application user and his application specific roles.
- *
- */
-public class UserApplicationRoles {
-
-       private Long appId;
-
-       private String orgUserId;
-
-       private String firstName;
-
-       private String lastName;
-
-       private List<RemoteRole> roles = new ArrayList<RemoteRole>();
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getOrgUserId() {
-               return orgUserId;
-       }
-
-       public void setOrgUserId(String orgUserId) {
-               this.orgUserId = orgUserId;
-       }
-
-       public String getFirstName() {
-               return firstName;
-       }
-
-       public void setFirstName(String firstName) {
-               this.firstName = firstName;
-       }
-
-       public String getLastName() {
-               return lastName;
-       }
-
-       public void setLastName(String lastName) {
-               this.lastName = lastName;
-       }
-
-       public List<RemoteRole> getRoles() {
-               return roles;
-       }
-
-       public void setRoles(List<RemoteRole> roles) {
-               this.roles = roles;
-       }
-       
-       @Override
-       public String toString() {
-               return "UserApplicationRoles [appId=" + appId + ", orgUserId=" + orgUserId + ", firstName=" + firstName
-                               + ", lastName=" + lastName + ", roles=" + roles + "]";
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitle.java
deleted file mode 100644 (file)
index b14fc8d..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class UserWithNameSurnameTitle {
-       
-       public String orgUserId;
-
-       public String firstName;
-
-       public String lastName;
-
-       public String jobTitle;
-       
-       public UserWithNameSurnameTitle(String orgUserId, String firstName, String lastName, String jobTitle) {
-               this.orgUserId = orgUserId;
-               this.firstName = firstName;
-               this.lastName = lastName;
-               this.jobTitle = jobTitle;
-       }
-
-       @Override
-       public int hashCode() {
-               final int prime = 31;
-               int result = 1;
-               result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
-               result = prime * result + ((jobTitle == null) ? 0 : jobTitle.hashCode());
-               result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
-               result = prime * result + ((orgUserId == null) ? 0 : orgUserId.hashCode());
-               return result;
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-               UserWithNameSurnameTitle other = (UserWithNameSurnameTitle) obj;
-               if (firstName == null) {
-                       if (other.firstName != null)
-                               return false;
-               } else if (!firstName.equals(other.firstName))
-                       return false;
-               if (jobTitle == null) {
-                       if (other.jobTitle != null)
-                               return false;
-               } else if (!jobTitle.equals(other.jobTitle))
-                       return false;
-               if (lastName == null) {
-                       if (other.lastName != null)
-                               return false;
-               } else if (!lastName.equals(other.lastName))
-                       return false;
-               if (orgUserId == null) {
-                       if (other.orgUserId != null)
-                               return false;
-               } else if (!orgUserId.equals(other.orgUserId))
-                       return false;
-               return true;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/WidgetCatalogPersonalization.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/transport/WidgetCatalogPersonalization.java
deleted file mode 100644 (file)
index bc39014..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-/**
- * Model for the object PUT to the controller when the user takes an action on
- * a widget in the catalog.
- */
-
-public class WidgetCatalogPersonalization {
-       
-               public Long widgetId;
-               public Boolean select;
-               // not needed as only 'SHOW' and 'HIDE' status_cd is expected from the micro service now
-               //public Boolean pending;
-
-               public Long getWidgetId() {
-                       return widgetId;
-               }
-
-               public void setWidgetId(Long widgetId) {
-                       this.widgetId = widgetId;
-               }
-
-               public Boolean getSelect() {
-                       return select;
-               }
-
-               public void setSelect(Boolean select) {
-                       this.select = select;
-               }
-
-               /*public Boolean getPending() {
-                       return pending;
-               }
-
-               public void setPending(Boolean pending) {
-                       this.pending = pending;
-               }*/
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java
deleted file mode 100644 (file)
index a56cfb6..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ueb;
-
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.Helper;
-import org.openecomp.portalsdk.core.onboarding.ueb.Publisher;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-@Component
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class EPUebHelper {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
-       
-       @Autowired
-       private EPAppService appsService;
-       
-       @Autowired
-       private SessionFactory sessionFactory;
-       
-       @SuppressWarnings("unused")
-       private Publisher epPublisher;
-       
-       public EPUebHelper() {
-               
-       }
-       //
-       // This should only be called by the ECOMP Portal App, other Apps have just one publisher and use appPublisher
-       //
-       @SuppressWarnings("unused")
-       @EPMetricsLog
-       public void refreshPublisherList()
-       {
-               Session localSession = null;
-           boolean addedPublisher = false;
-           
-               try {
-                       localSession = sessionFactory.openSession();
-               
-                       List<EcompApp> apps = appsService.getEcompAppAppsFullList();
-                       for (int i = 0; i < apps.size(); i++) 
-                       {
-                               if ((apps.get(i).isEnabled()) &&
-                                       (apps.get(i).getUebTopicName() != null) &&
-                                       !(apps.get(i).getUebTopicName().toUpperCase().contains("ECOMP-PORTAL-INBOX")))
-                               {
-                                       logger.debug(EELFLoggerDelegate.debugLogger, "UEBManager adding publisher for " + apps.get(i).getUebTopicName());
-                                       UebManager.getInstance().addPublisher(apps.get(i).getUebTopicName());
-                       addedPublisher = true;
-                           }
-                               else if ((apps.get(i).getId() != 1) && // App may have been disabled, remove the publisher
-                                                !(apps.get(i).isEnabled()))
-                               {
-                                       if(apps.get(i).getUebTopicName()!=null){
-                                               UebManager.getInstance().removePublisher(apps.get(i).getUebTopicName());
-                                       }
-                               }
-                       }
-               }
-               catch (Exception e)
-               {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebSystemError, e, "add/remove Publisher");
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while refreshing the publisher list", e);
-               }
-               
-               //publisherList.print();
-               
-               if (addedPublisher == true) // Give publishers time to initialize
-               {
-                       Helper.sleep(400);
-               }
-       }
-       
-       @PostConstruct
-       @EPMetricsLog
-       public void initUeb() {
-               try {
-                       epPublisher = new Publisher(PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY), 
-                                                           PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET), 
-                                                           PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, e);
-               }
-               
-               Thread thread = new Thread("EPUebManager: postConstructMethod - refreshPublisherList") {
-                   public void run(){
-                       refreshPublisherList();
-                   }
-               };
-               thread.start();
-               
-       }
-
-       @EPMetricsLog
-       public void addPublisher(EPApp app) {
-               // TODO Auto-generated method stub
-               try {
-                       UebManager.getInstance().addPublisher(app.getUebTopicName());
-               } catch (UebException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "addPublisher failed", e);
-               }
-       }
-       
-       public boolean checkAvailability() {
-               //
-               //  Test existence of topic at UEB url
-               //
-               //  (ie http://uebsb91kcdc.it.com:3904/topics/ECOMP-PORTAL-INBOX)
-               //
-               boolean available = true;
-               LinkedList<String> urlList = Helper.uebUrlList();
-               if (!urlList.isEmpty()) {
-                   String url = "http://" + urlList.getFirst() + ":3904/topics/" + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME);
-                   if (!url.isEmpty()) {
-                       try {
-                           URL siteURL = new URL(url);
-                           HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
-                           connection.setRequestMethod("GET");
-                           connection.connect();
-                    
-                           int code = connection.getResponseCode();
-                           if (code == 200) {
-                               available = true;
-                           }
-                           else {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebConnectionError, url);
-                               available = false;
-                               logger.warn(EELFLoggerDelegate.errorLogger, "Warning! UEB topic existence check failed, topic = " + url );
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Warning! UEB topic existence check failed, topic = " + url );
-                           }
-                       }
-                       catch (Exception e) {
-                           available = false;
-                                       logger.error(EELFLoggerDelegate.errorLogger, "checkAvailability failed", e);
-                       }
-                   }
-               }
-               return available;
-       }
-       
-    public boolean MessageCanBeSentToTopic() {
-    
-       boolean sentMsgSuccessfully = false;
-       
-           UebMsg msg = new UebMsg();
-           msg.putSourceTopicName(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
-           msg.putPayload("Pinging topic for health check");
-           msg.putMsgType(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK);
-       
-           try {
-                  // epPublisher.send(msg);
-                   sentMsgSuccessfully = true;
-           } 
-           catch (Exception e) {
-               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHealthCheckUebClusterError, e);
-                   sentMsgSuccessfully = false;
-                   logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to " 
-                                    + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME), e); 
-           } 
-           
-           return sentMsgSuccessfully;
-    }
-    
-}
-
-
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java
deleted file mode 100644 (file)
index 720e061..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ueb;
-
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsgTypes;
-
-public interface EPUebMsgTypes extends UebMsgTypes {
-
-       public static final String UEB_MSG_TYPE_HEALTH_CHECK = "uebHealthCheckPing";
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/CustomLoggingFilter.java
deleted file mode 100644 (file)
index ab41daa..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.spi.ILoggingEvent;
-import ch.qos.logback.core.filter.Filter;
-import ch.qos.logback.core.spi.FilterReply;
-
-/**
- * Custom Filter class bind with logback.xml
- * configuration file to strip out certain log messages
- * coming out of special packages or classes.
- *
- */
-public class CustomLoggingFilter extends Filter<ILoggingEvent> {
-
-       /**
-        * Custom Filter is added to strip out the continuous U-EB logging messages
-        * But make sure we log the ERROR & WARNING Level messages.
-        */
-       @Override
-       public FilterReply decide(ILoggingEvent event) {
-               try {
-                       if ((event.getLevel() != Level.ERROR || event.getLevel() != Level.WARN) && 
-                               (event.getThreadName().equalsIgnoreCase("UEBConsumerThread")) &&
-                               (event.getLoggerName().contains("org.openecomp.nsa") || event.getLoggerName().contains("org.apache.http"))
-                               ) {
-                               return FilterReply.DENY;
-                       } else {
-                               return FilterReply.NEUTRAL;
-                       }
-               } catch(Exception e) {
-                       return FilterReply.NEUTRAL;
-               } 
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EPCommonSystemProperties.java
deleted file mode 100644 (file)
index fd15634..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-public class EPCommonSystemProperties extends SystemProperties {
-
-       public static final String LOGIN_URL_NO_RET_VAL                         = "login_url_no_ret_val";
-       public static final String ECOMP_APP_ID                         = "ecomp_app_id";
-       public static final String SYS_ADMIN_ROLE_ID                    = "sys_admin_role_id";
-       public static final String DUBLICATED_FIELD_VALUE_ECOMP_ERROR   = "1201";
-       public static final String ACCOUNT_ADMIN_ROLE_ID                = "account_admin_role_id";
-       public static final String RESTRICTED_APP_ROLE_ID                               = "restricted_app_role_id";
-       public static final String FE_URL                                       = "frontend_url";
-       public static final String HEALTH_POLL_INTERVAL_SECONDS         = "health_poll_interval_seconds";
-       public static final String HEALTHFAIL_ALERT_EVERY_X_INTERVALS   = "health_fail_alert_every_x_intervals";
-       public static final String USER_GUIDE_URL                       = "user_guide_link";
-       
-       public static final String USER_FIRST_NAME                                              = "USER_FIRST_NAME";
-       public static final String USER_LAST_NAME                                               = "USER_LAST_NAME";
-       public static final String USER_EMAIL                                                   = "USER_EMAIL";
-       public static final String USER_ORG_USERID                                              = "USER_ORG_USERID";
-       
-       public static final String USH_TICKET_URL                                               = "ush_ticket_url"; 
-
-       public static final String EXTERNAL_API_RESPONSE_CODE                   = "External_API_ResponseCode";
-       public static final String COOKIE_DOMAIN                        = "cookie_domain";
-
-       public static final String FEEDBACK_EMAIL_ADDRESS                               = "feedback_email_address";
-       public static final String PORTAL_INFO_URL                                              = "portal_info_url";
-       
-       public static final String ONLINE_USER_UPDATE_RATE                              = "online_user_update_rate";
-       public static final String ONLINE_USER_UPDATE_DURATION                  = "online_user_update_duration";
-       
-       public static final String NOTIFICATION_UPDATE_RATE                             = "notification_update_rate";
-       public static final String NOTIFICATION_UPDATE_DURATION                 = "notification_update_duration";
-       
-       public static final String WINDOW_WIDTH_THRESHOLD_LEFT_MENU             = "window_width_threshold_left_menu";
-       public static final String WINDOW_WIDTH_THRESHOLD_RIGHT_MENU    = "window_width_threshold_right_menu";
-               
-       public static final String AUDITLOG_DEL_DAY_FROM                                = "auditlog_del_day_from";
-       public static final String AUDITLOG_DELETE_CRON                                 = "auditlog_delete_cron";
-       
-       public static final String AUTH_USER_SERVER                                     = "auth_user_server";
-       public static final String EXTERNAL_ACCESS_ENABLE                               = "external_access_enable";
-
-       public static final String EXTERNAL_SYSTEM_NOTIFICATION_URL             = "external_system_notification_url";
-       public static final String EXTERNAL_CENTRAL_AUTH_USER_NAME              = "ext_central_access_user_name";
-       public static final String EXTERNAL_CENTRAL_AUTH_PASSWORD       = "ext_central_access_password";
-       public static final String EXTERNAL_CENTRAL_ACCESS_URL              = "ext_central_access_url";
-       public static final String EXTERNAL_CENTRAL_ACCESS_USER_DOMAIN  = "ext_central_access_user_domain";
-       
-       public static final String WIDGET_MS_PROTOCOL                                   = "microservices.widget.protocol";
-       public static final String WIDGET_MS_HOSTNAME                                   = "microservices.widget.hostname";
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompPortalUtils.java
deleted file mode 100644 (file)
index 2d4d214..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.bind.DatatypeConverter;
-
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class EcompPortalUtils {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EcompPortalUtils.class);
-
-       // TODO: GLOBAL_LOGIN_URL is the same as in SessionTimeoutInterceptor.
-       // It should be defined in SystemProperties.
-       private static final String GLOBAL_LOGIN_URL = "global-login-url";
-
-       /**
-        * @param orgUserId
-        *            User ID to validate
-        * @return true if orgUserId is not empty and contains only alphanumeric, false
-        *         otherwise
-        */
-       public static boolean legitimateUserId(String orgUserId) {
-               return orgUserId.matches("^[a-zA-Z0-9]+$");
-       }
-
-       /**
-        * Splits the string into a list of tokens using the specified regular
-        * expression
-        * 
-        * @param source
-        *            String to split
-        * @param regex
-        *            tokens
-        * @return List of tokens split from the source
-        */
-       public static List<String> parsingByRegularExpression(String source, String regex) {
-               List<String> tokens = new ArrayList<String>();
-               if (source != null && source.length() > 0) {
-                       String[] parsed = source.split(regex);
-                       for (String token : parsed) {
-                               if (token.length() > 0) {
-                                       tokens.add(token);
-                               }
-                       }
-               }
-               return tokens;
-       }
-
-       /**
-        * Builds a JSON object with error code and message information.
-        * 
-        * @param errorCode
-        *            error code
-        * @param errorMessage
-        *            message
-        * @return JSON object as a String
-        */
-       public static String jsonErrorMessageResponse(int errorCode, String errorMessage) {
-               return "{\"error\":{\"code\":" + errorCode + "," + "\"message\":\"" + errorMessage + "\"}}";
-       }
-
-       /**
-        * Builds a JSON object with the specified message
-        * 
-        * @param message
-        *            Message to embed
-        * @return JSON object as a String
-        */
-       public static String jsonMessageResponse(String message) {
-               return String.format("{\"message\":\"%s\"}", message);
-       }
-
-       /**
-        * Serializes the specified object as JSON and writes the result to the debug
-        * log. If serialization fails, logs a message to the error logger.
-        * 
-        * @param logger
-        *            Logger for the class where the object was built; the logger
-        *            carries the class name.
-        * @param source
-        *            First portion of the log message
-        * @param msg
-        *            Second portion of the log message
-        * @param obj
-        *            Object to serialize as JSON
-        */
-       public static void logAndSerializeObject(EELFLoggerDelegate logger, String source, String msg, Object obj) {
-               try {
-                       String objectAsJson = new ObjectMapper().writeValueAsString(obj);
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       String.format("source= [%s]; %s [%s];", source, msg, objectAsJson));
-               } catch (JsonProcessingException e) {
-                       logger.warn(EELFLoggerDelegate.errorLogger, "logAndSerializedObject failed to serialize", e);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "logAndSerializedObject failed", e);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-               }
-       }
-
-       /**
-        * Serializes the specified object as JSON and writes the result to the debug
-        * log. If serialization fails, logs a message to the error logger.
-        * 
-        * @param source
-        *            First portion of the log message
-        * @param msg
-        *            Second portion of the log message
-        * @param obj
-        *            Object to serialize as JSON
-        */
-       public static void logAndSerializeObject(String source, String msg, Object obj) {
-               logAndSerializeObject(logger, source, msg, obj);
-       }
-
-       public static void rollbackTransaction(Transaction transaction, String errorMessage) {
-               logger.error(EELFLoggerDelegate.errorLogger, errorMessage);
-               try {
-                       if (transaction != null) {
-                               transaction.rollback();
-                       }
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeExecuteRollbackError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while performing a rollback transaction",
-                                       e);
-               }
-       }
-
-       public static void closeLocalSession(Session localSession, String errorMessage) {
-               logger.error(EELFLoggerDelegate.errorLogger, errorMessage);
-               try {
-                       if (localSession != null) {
-                               localSession.close();
-                       }
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoCloseSessionError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, errorMessage + ", closeLocalSession exception", e);
-               }
-       }
-
-       /**
-        * Set response status to Unauthorized if user == null and to Forbidden in all
-        * (!) other cases. Logging is not performed if invocator == null
-        * 
-        * @param user
-        *            User object
-        * @param response
-        *            HttpServletResponse
-        * @param invocator
-        *            may be null
-        */
-       public static void setBadPermissions(EPUser user, HttpServletResponse response, String invocator) {
-               if (user == null) {
-                       String loginUrl = SystemProperties.getProperty(EPCommonSystemProperties.LOGIN_URL_NO_RET_VAL);
-                       response.setHeader(GLOBAL_LOGIN_URL, loginUrl);
-                       response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_UNAUTHORIZED));
-               } else {
-                       response.setStatus(HttpServletResponse.SC_FORBIDDEN);
-                       MDC.put(EPCommonSystemProperties.RESPONSE_CODE, Integer.toString(HttpServletResponse.SC_FORBIDDEN));
-               }
-               if (invocator != null) {
-                       logger.warn(EELFLoggerDelegate.errorLogger,
-                                       invocator + ", permissions problem, response status = " + response.getStatus());
-               }
-       }
-
-       public static int getExternalAppResponseCode() {
-               String responseCode = MDC.get(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
-               int responseCodeInt = 0;
-               try {
-                       if (responseCode != null && responseCode != "") {
-                               responseCodeInt = Integer.valueOf(responseCode);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getExternalAppResponseCode failed", e);
-               }
-               return responseCodeInt;
-       }
-
-       // This method might be just for testing purposes.
-       public static void setExternalAppResponseCode(int responseCode) {
-               try {
-                       String responseCodeString = String.valueOf(responseCode);
-                       MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, responseCodeString);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "setExternalAppResponseCode failed", e);
-               }
-       }
-
-       public static String getHTTPStatusString(int httpStatusCode) {
-               String httpStatusString = "unknown_error";
-               try {
-                       httpStatusString = org.springframework.http.HttpStatus.valueOf(httpStatusCode).name();
-                       if (httpStatusString != null) {
-                               httpStatusString = httpStatusString.toLowerCase();
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getHTTPStatusString failed", e);
-               }
-               return httpStatusString;
-       }
-
-       public static String getFEErrorString(Boolean internal, int responseCode) {
-               // Return a String like the following:
-               // "Internal Ecomp Error: 500 internal_server_error" or
-               // "External App Error: 404 not_found"
-               // TODO: create our own Ecomp error codes, starting with 1000 and up.
-               String internalExternalString = internal ? "Ecomp Error: " : "App Error: ";
-               String httpStatusString = "unknown_error";
-               try {
-                       if (responseCode < 1000) {
-                               httpStatusString = getHTTPStatusString(responseCode);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getFEErrorString failed", e);
-               }
-               String responseString = internalExternalString + responseCode + " " + httpStatusString;
-               return responseString;
-       }
-
-       public static boolean isProductionBuild() {
-               boolean productionBuild = true;
-               String epVersion = EcompVersion.buildNumber;
-               if (epVersion != null) {
-                       int buildNum = epVersion.lastIndexOf('.');
-                       if (buildNum > 0) {
-                               int buildNumber = Integer.parseInt(epVersion.substring(buildNum + 1));
-                               if (buildNumber < 3000) // Production versions are 3000+, (ie
-                                                                               // 1.0.3003)
-                               {
-                                       productionBuild = false;
-                               }
-                       }
-               }
-               return productionBuild;
-       }
-
-       public static String getMyIpAdddress() {
-               InetAddress ip;
-               String localIp;
-               try {
-                       ip = InetAddress.getLocalHost();
-                       localIp = ip.getHostAddress();
-               } catch (UnknownHostException e) {
-                       localIp = "unknown";
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMyIpAdddress failed ", e);
-               }
-               return localIp;
-       }
-
-       public static String getMyHostName() {
-               InetAddress ip;
-               String hostName;
-               try {
-                       ip = InetAddress.getLocalHost();
-                       hostName = ip.getHostName();
-               } catch (UnknownHostException e) {
-                       hostName = "unknown";
-                       logger.error(EELFLoggerDelegate.errorLogger, "getMyHostName failed", e);
-               }
-               return hostName;
-       }
-
-       /**
-        * Returns a default property if the expected one is not available
-        * 
-        * @param property
-        *            Key
-        * @param defaultValue
-        *            default Value
-        * @return Default value if property is not defined or yields the empty string;
-        *         else the property value.
-        */
-       public static String getPropertyOrDefault(String property, String defaultValue) {
-               if (!SystemProperties.containsProperty(property))
-                       return defaultValue;
-               String value = SystemProperties.getProperty(property);
-               if (value == null || "".equals(value))
-                       return defaultValue;
-               return value;
-       }
-
-       /**
-        * Calculates the time duration of a function call for logging purpose. It
-        * stores the result by using "MDC.put(SystemProperties.MDC_TIMER,
-        * timeDifference);" It is important to call
-        * "MDC.remove(SystemProperties.MDC_TIMER);" after this method call to clean up
-        * the record in MDC
-        *
-        * @param beginDateTime
-        *            the given begin time for the call
-        * @param endDateTime
-        *            the given end time for the call
-        * 
-        */
-       public static void calculateDateTimeDifferenceForLog(String beginDateTime, String endDateTime) {
-               if (beginDateTime != null && endDateTime != null) {
-                       try {
-                               SimpleDateFormat ecompLogDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX");
-
-                               Date beginDate = ecompLogDateFormat.parse(beginDateTime);
-                               Date endDate = ecompLogDateFormat.parse(endDateTime);
-                               String timeDifference = String.format("%d", endDate.getTime() - beginDate.getTime());
-                               MDC.put(SystemProperties.MDC_TIMER, timeDifference);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "calculateDateTimeDifferenceForLog failed", e);
-                       }
-               }
-       }
-
-       /**
-        * Answers the protocol to use.
-        * 
-        * @return Protocol name from property file; defaults to https.
-        */
-       public static String widgetMsProtocol() {
-               return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_PROTOCOL, "https");
-       }
-
-       /**
-        * Answers the host to use.
-        * 
-        * @return Host name from property file; defaults to localhost.
-        */
-       public static String localOrDockerHost() {
-               return getPropertyOrDefault(EPCommonSystemProperties.WIDGET_MS_HOSTNAME, "localhost");
-       }
-
-       /**
-        * It returns headers where username and password of external central auth is
-        * encoded to base64
-        * 
-        * @return header which contains external central auth username and password
-        *         base64 encoded
-        * @throws Exception
-        *             if unable to decrypt the password
-        */
-       public static HttpHeaders base64encodeKeyForAAFBasicAuth() throws Exception {
-               String userName = "";
-               String decryptedPass = "";
-               if (EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME)
-                               && EPCommonSystemProperties.containsProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD)) {
-                       decryptedPass = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_PASSWORD);
-                       userName = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_AUTH_USER_NAME);
-               }
-               String decPass = decrypted(decryptedPass);
-               String usernamePass = userName + ":" + decPass;
-               String encToBase64 = String.valueOf((DatatypeConverter.printBase64Binary(usernamePass.getBytes())));
-               HttpHeaders headers = new HttpHeaders();
-               headers.add("Authorization", "Basic " + encToBase64);
-               headers.setContentType(MediaType.APPLICATION_JSON);
-               return headers;
-       }
-
-       private static String decrypted(String encrypted) throws Exception {
-               String result = "";
-               if (encrypted != null && encrypted.length() > 0) {
-                       try {
-                               result = CipherUtil.decrypt(encrypted, SystemProperties.getProperty(SystemProperties.Decryption_Key));
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "decryptedPassword failed", e);
-                               throw e;
-                       }
-               }
-               return result;
-       }
-
-       public static String truncateString(String originString, int size){
-               if(originString.length()>=size){
-                       StringBuilder stringBuilder = new StringBuilder();
-                       stringBuilder.append(originString);
-                       stringBuilder.setLength(size);
-                       stringBuilder.append("...");
-                       return stringBuilder.toString();
-               }
-               return originString;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/EcompVersion.java
deleted file mode 100644 (file)
index 9e9c5aa..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-//
-// Hardcoded for now, wanted to use maven and resource file.  Possibly just read
-// pom.properties file with version added, but spent several hours already running
-// into issues with that and other ideas not working.  So, for 1604 deadlines I 
-// am just putting the version in the code here... for now.
-//
-public final class EcompVersion {
-
-       // TODO - not used - manifest service reads from manifest
-    public static final String buildNumber="1610.1.999";
-    
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/HashMapFromList.java
deleted file mode 100644 (file)
index 5abc498..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- * 
- * @author Vladimir Turovets This class is used to create HashMap<String, T>
- *         from the list of T objects. We suppose that
- *         1) T object contains field 'parmName' or getter 'getParmName()'.
- *         The value of object.parmName or object.getParmName() is used as
- *         a key in created hashMap.
- *         2) for all objects in the list 'parmName' or getter
- *         'getParmName().toString' has to be unique and not null.
- *         This class has one function only:
- *         HashMap<String, T> hashMap(List<T> list, String name) and returns
- *         hash map created from list.
- *
- * @param <T>
- * Type 
- */
-public class HashMapFromList<T> {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HashMapFromList.class);
-       
-       public HashMap<String, T> hashMap(List<T> list, String name) {
-               HashMap<String, T> result = new HashMap<String, T>();
-               if (list == null || list.size() == 0 || name == null) {
-                       return result;
-               }
-               name = name.trim();
-               if (name.length() > 0) {
-                       T object = list.get(0);
-                       try {
-                               String parmName = name;
-                               Field field = object.getClass().getField(parmName);
-                               for (T obj : list) {
-                                       try {
-                                               Object o = field.get(obj);
-                                               if (o != null)
-                                                       result.put(o.toString(), obj);
-                                       } catch (Exception e1) {
-                                               logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 1: object of class " + object.getClass().getName() + ", field " + parmName, e1);
-                                               return new HashMap<String, T>();
-                                       }
-                               }
-                       } catch (Exception e) {
-                               String getterName = "get" + (name.length() == 1 ? name.toUpperCase() : (name.substring(0, 1).toUpperCase() + name.substring(1)));
-                               try {
-                                       Class<?>[] parmClasses = null;
-                                       Method method = object.getClass().getMethod(getterName, parmClasses);
-                                       Object[] parmValues = new Object[0];
-                                       for (T obj : list) {
-                                               try {
-                                                       Object o = method.invoke(obj, parmValues);
-                                                       if (o != null)
-                                                               result.put(o.toString(), obj);
-                                               } catch (Exception e2) {
-                                                       logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 2: object of class " + object.getClass().getName() + ", method " + getterName, e2);
-                                                       return new HashMap<String, T>();
-                                               }
-                                       }
-                               } catch (Exception e3) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "hashMap failed 3: object of class " + object.getClass().getName() + ", bad field '" + name + "' or method '" + getterName + "()", e3);
-                                       return new HashMap<String, T>();
-                               }
-                       }
-               }
-               if (list.size() != result.size()) {
-                       logger.warn(EELFLoggerDelegate.errorLogger, "Duplicated or empty keys were found!!!");
-               }
-               return result;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/ParallelExecutor.java
deleted file mode 100644 (file)
index 8dfacb5..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-public abstract class ParallelExecutor<T> {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ParallelExecutor.class);
-
-       protected static abstract class ThreadOperation<T> {
-               public abstract T execute(List<Object> parms);
-       }
-
-       protected abstract ThreadOperation<T> getThreadOperation();
-
-       private static class CallableOperationThread<T> implements Callable<T> {
-
-               List<Object> parms;
-
-               private ThreadOperation<T> operation;
-
-               public CallableOperationThread(ThreadOperation<T> operation, List<Object> parms) {
-                       this.parms = parms;
-                       this.operation = operation;
-               }
-
-               @Override
-               public T call() throws Exception {
-                       return this.operation.execute(this.parms);
-               }
-
-       }
-
-       public List<T> performAllOperations(int ThreadPoolSize, List<List<Object>> listOfParms) {
-               List<T> result = new ArrayList<T>();
-               if (ThreadPoolSize > 0 && listOfParms != null) {
-                       ExecutorService executor = Executors.newFixedThreadPool(ThreadPoolSize);
-                       List<Future<T>> list = new ArrayList<Future<T>>();
-                       for (List<Object> parms : listOfParms) {
-                               CallableOperationThread<T> getter = new CallableOperationThread<T>(this.getThreadOperation(), parms);
-                               Future<T> submit = executor.submit(getter);
-                               list.add(submit);
-                       }
-                       for (Future<T> future : list) {
-                               try {
-                                       if (future != null) {
-                                               result.add(future.get());
-                                       }
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "performAllOperations failed", e);
-                               }
-                       }
-                       executor.shutdown();
-               }
-               return result;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/PortalConstants.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/utils/PortalConstants.java
deleted file mode 100644 (file)
index 413b11a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-public interface PortalConstants {
-       public static final Long PORTAL_APP_ID = 1L;
-       public static final Long DEFAULT_NOTIFICATION_CREATOR = 1L;
-       public static final String REST_AUX_API = "/auxapi";
-       public static final Long ACCOUNT_ADMIN_ROLE_ID = 999L;
-       public static final Long SYS_ADMIN_ROLE_ID = 1L;
-       public static final String ADMIN_ROLE = "Account Administrator";
-       public static final String PORTAL_ADMIN_ROLE = "System Administrator";
-       public static final Integer AUDIT_LOG_COMMENT_SIZE = 990;
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/AdminAuthExtension.java
deleted file mode 100644 (file)
index fc88d4f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service;
-
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-
-@Service("adminAuthExtension")
-@Transactional
-public class AdminAuthExtension {
-       
-       public void saveUserExtension(EPUser user){
-               //app's developer implement their own logic here, like updating app's related tables
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/EPProfileService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/EPProfileService.java
deleted file mode 100644 (file)
index 54ce80b..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service;
-
-import java.util.List;
-
-import org.openecomp.portalsdk.core.domain.Profile;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-
-public interface EPProfileService {
-       List<Profile> findAll();
-       
-       Profile getProfile(int id);
-       
-       EPUser getUser(String id);
-       
-       void saveUser(EPUser user);
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/EPProfileServiceImpl.java
deleted file mode 100644 (file)
index 373b2b0..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.dao.ProfileDao;
-import org.openecomp.portalsdk.core.domain.Profile;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service("epProfileService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class EPProfileServiceImpl implements EPProfileService {
-
-       @Autowired
-       private ProfileDao profileDao;
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @SuppressWarnings("unchecked")
-       public List<Profile> findAll() {
-               return getDataAccessService().getList(Profile.class, null);
-       }
-
-       public EPUser getUser(String userId) {
-               return (EPUser) getDataAccessService().getDomainObject(EPUser.class, Long.parseLong(userId), null);
-       }
-
-       public void saveUser(EPUser user) {
-               getDataAccessService().saveDomainObject(user, null);
-       }
-
-       public Profile getProfile(int id) {
-               return profileDao.getProfile(id);
-       }
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallService.java
deleted file mode 100644 (file)
index be2fe7c..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service;
-
-public interface RemoteWebServiceCallService {
-
-       /**
-        * Answers whether the specified credentials match application information
-        * in the database.
-        * 
-        * @param secretKey
-        *            Key used to decrypt passwords; ignored if null.
-        * @param requestUebKey
-        *            UEB key that identifies the application
-        * @param requestUserName
-        *            User name for the application
-        * @param requestPassword
-        *            Password for the application
-        * @return True if the UEB key and the credentials match the database
-        *         entries; else false.
-        * @throws Exception
-        *             If decryption fails.
-        */
-       public boolean verifyRESTCredential(String secretKey, String requestUebKey, String requestUserName,
-                       String requestPassword) throws Exception;
-
-       /**
-        * 
-        * @param requestUebKey
-        *            UEB key
-        * @return boolean
-        * @throws Exception
-        *             on error
-        */
-       public boolean verifyAppKeyCredential(String requestUebKey) throws Exception;
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/CoreTimeoutHandler.java
deleted file mode 100644 (file)
index 152c68b..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service.sessionmgt;
-
-import java.util.Calendar;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.servlet.http.HttpSession;
-
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.domain.sessionmgt.TimeoutVO;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Service
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class CoreTimeoutHandler {
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CoreTimeoutHandler.class);
-
-       public static final Map<String, HttpSession> sessionMap = new Hashtable<String, HttpSession>();
-       public static final Integer repeatInterval = 15 * 60; // 15 minutes
-       ObjectMapper mapper = new ObjectMapper();
-
-       public static void sessionCreated(String portalJSessionId, String jSessionId, HttpSession session) {
-
-               storeMaxInactiveTime(session);
-
-               // this key is a combination of portal jsession id and app session id
-               session.setAttribute(PortalApiConstants.PORTAL_JSESSION_ID, jSessionKey(jSessionId, portalJSessionId));
-               sessionMap.put((String) session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID), session);
-
-       }
-
-       protected static void storeMaxInactiveTime(HttpSession session) {
-
-               if (session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME) == null)
-                       session.setAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME, session.getMaxInactiveInterval());
-       }
-
-       public static void sessionDestroyed(HttpSession session) {
-
-               try {
-                       sessionMap.remove((String) session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "sessionDestroyed failed on session " + session.getId(), e);
-               }
-
-       }
-
-       public String gatherSessionExtenstions() {
-
-               Map<String, TimeoutVO> sessionTimeoutMap = new Hashtable<String, TimeoutVO>();
-               String jsonMap = "";
-
-               for (String jSessionKey : sessionMap.keySet()) {
-
-                       try {
-                               // get the expirytime in seconds
-                               HttpSession session = sessionMap.get(jSessionKey);
-
-                               Long lastAccessedTimeMilliSec = session.getLastAccessedTime();
-                               Long maxIntervalMilliSec = session.getMaxInactiveInterval() * 1000L;
-                               // Long currentTimeMilliSec = Calendar.getInstance().getTimeInMillis() ;
-                               // (maxIntervalMilliSec - (currentTimeMilliSec - lastAccessedTimeMilliSec) + ;
-                               Calendar instance = Calendar.getInstance();
-                               instance.setTimeInMillis(session.getLastAccessedTime());
-                               logger.info(EELFLoggerDelegate.errorLogger,
-                                               "gatherSessionExtenstions: Session Management: Last Accessed time for " + jSessionKey + ": "
-                                                               + instance.getTime());
-
-                               Long sessionTimOutMilliSec = maxIntervalMilliSec + lastAccessedTimeMilliSec;
-
-                               sessionTimeoutMap.put(portalJSessionId(jSessionKey),
-                                               new TimeoutVO(jSessionId(jSessionKey), sessionTimOutMilliSec));
-
-                               jsonMap = mapper.writeValueAsString(sessionTimeoutMap);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "gatherSessionExtenstions failed", e);
-                       }
-               }
-
-               return jsonMap;
-
-       }
-
-       public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception {
-
-               Map<String, TimeoutVO> sessionTimeoutMap;
-               try {
-                       TypeReference<Hashtable<String, TimeoutVO>> typeRef = new TypeReference<Hashtable<String, TimeoutVO>>() {
-                       };
-
-                       sessionTimeoutMap = mapper.readValue(sessionTimeoutMapStr, typeRef);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "updateSessionExtensions failed 1", e);
-                       return;
-               }
-               for (String jPortalSessionId : sessionTimeoutMap.keySet()) {
-                       try {
-
-                               TimeoutVO extendedTimeoutVO = mapper
-                                               .readValue(mapper.writeValueAsString(sessionTimeoutMap.get(jPortalSessionId)), TimeoutVO.class);
-                               HttpSession session = sessionMap.get(jSessionKey(extendedTimeoutVO.getjSessionId(), jPortalSessionId));
-
-                               if (session == null) {
-                                       continue;
-                               }
-
-                               Long lastAccessedTimeMilliSec = session.getLastAccessedTime();
-                               Long maxIntervalMilliSec = session.getMaxInactiveInterval() * 1000L;
-                               Long sessionTimOutMilliSec = maxIntervalMilliSec + lastAccessedTimeMilliSec;
-
-                               Long maxTimeoutTimeMilliSec = extendedTimeoutVO.getSessionTimOutMilliSec();
-                               if (maxTimeoutTimeMilliSec > sessionTimOutMilliSec) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "updateSessionExtensions: Session Management: updated session max idle time");
-                                       session.setMaxInactiveInterval((int) (maxTimeoutTimeMilliSec - lastAccessedTimeMilliSec) / 1000);
-                               }
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               "updateSessionExtensions failed", e);
-                       }
-
-               }
-
-       }
-
-       protected static String jSessionKey(String jSessionId, String portalJSessionId) {
-               return portalJSessionId + "-" + jSessionId;
-       }
-
-       protected String portalJSessionId(String jSessionKey) {
-               return jSessionKey.split("-")[0];
-       }
-
-       protected String jSessionId(String jSessionKey) {
-               return jSessionKey.split("-")[1];
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/ManageService.java
deleted file mode 100644 (file)
index 2628cd8..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service.sessionmgt;
-
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.quartz.CronExpression;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-@Service("manageService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class ManageService implements PortalTimeoutHandler.SessionCommInf {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ManageService.class);
-       
-       @Autowired
-       private EPAppService appService;
-       
-       @Autowired
-       private SessionCommunication sessionCommunication;
-
-       public Integer fetchSessionSlotCheckInterval(String... params) throws Exception {
-
-               String defaultCronExpressionStr = "0 0/5 * * * ? *";
-               String cronExpressionStr = SystemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON);
-
-               if (cronExpressionStr == null) {
-                       cronExpressionStr = defaultCronExpressionStr;
-               }
-
-               CronExpression cal = new CronExpression(cronExpressionStr);
-               final Date nowTime = Calendar.getInstance().getTime();
-               Date nextTime = cal.getNextValidTimeAfter(nowTime);
-               Date nextNextTime = cal.getNextValidTimeAfter(nextTime);
-
-               final int timeDiff = (int)(nextNextTime.getTime()-nextTime.getTime());
-               logger.debug(EELFLoggerDelegate.debugLogger, "Time interval between subsequent session checks " + timeDiff);
-
-               return timeDiff;
-       }
-
-       public void extendSessionTimeOuts(String... params) throws Exception {
-               try {
-                       String sessionMap = params[3];
-       
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Extending the App sessions for last minute request: " + sessionMap);
-                       
-                       if (StringUtils.isEmpty(sessionMap)) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "extendSessionTimeOuts: Skipping session updates since the portal session value is empty.");
-                       } else {
-                               List<OnboardingApp> appList = appService.getEnabledNonOpenOnboardingApps();
-                               for (OnboardingApp onApp : appList) {
-                                       sessionCommunication.pingSession(onApp, sessionMap);
-                               }
-                               updateSessionExtensions(sessionMap);
-                               sessionCommunication.clear(false);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "extendSessionTimeOuts failed", e);
-               }
-       }
-
-       public String gatherSessionExtenstions() {
-               return PortalTimeoutHandler.gatherSessionExtensions();
-       }
-
-       public void updateSessionExtensions(String sessionTimeoutMapStr) throws Exception {
-               PortalTimeoutHandler.updateSessionExtensions(sessionTimeoutMapStr);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/SessionCommunication.java
deleted file mode 100644 (file)
index 13044c4..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service.sessionmgt;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.exception.UrlAccessRestrictedException;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.slf4j.MDC;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
-
-import com.att.eelf.configuration.Configuration;
-
-@Service("sessionCommunication")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class SessionCommunication {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCommunication.class);
-
-       @EPAuditLog
-       public String sendGet(OnboardingApp app) throws Exception {
-               String appResponse = "";
-               String appName = "";
-               int responseCode = 0;
-               if (app != null && app.name != null && app.name != "") {
-                       try {
-                               appName = app.name;
-                               String url = app.restUrl + "/sessionTimeOuts";
-                               String encriptedPwdDB = app.appPassword;
-                               String appUserName = app.username;
-
-                               setLocalMDCContext(app, "/sessionTimeOuts", url);
-
-                               URL obj = new URL(url);
-
-                               HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
-                               // optional default is GET
-                               con.setRequestMethod("GET");
-                               con.setConnectTimeout(3000);
-                               con.setReadTimeout(8000);
-                               // add request header
-                               con.setRequestProperty("username", appUserName);
-                               con.setRequestProperty("password", encriptedPwdDB);
-
-                               // con.set
-                               responseCode = con.getResponseCode();
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
-
-                               BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
-                               String inputLine;
-                               StringBuffer response = new StringBuffer();
-
-                               while ((inputLine = in.readLine()) != null) {
-                                       response.append(inputLine);
-                               }
-
-                               in.close();
-                               appResponse = response.toString();
-                       } catch (UrlAccessRestrictedException e) {
-                               responseCode = HttpServletResponse.SC_UNAUTHORIZED;
-                               logger.error(EELFLoggerDelegate.errorLogger, String.format(
-                                               "SessionCommunication.sendGet received an un-authorized exception. AppName: %s", appName));
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
-                       } catch (Exception e) {
-                               responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
-                               String message = String.format(
-                                               "SessionCommunication.sendGet encountered an Exception. AppName: %s, Details: %s", appName,
-                                               e.toString());
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
-                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
-                       } finally {
-                               EcompPortalUtils.setExternalAppResponseCode(responseCode);
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger, "SessionCommunication sendGet: app is null");
-               }
-               return appResponse;
-       }
-
-       @EPAuditLog
-       public Boolean pingSession(OnboardingApp app, String sessionTimeoutMap) throws Exception {
-               String appName = "";
-               int responseCode = 0;
-               try {
-                       if (app == null)
-                               throw new Exception("SessionCommunication.pingSession: app is null");
-                       if (app != null && app.name != null && app.name != "") {
-                               appName = app.name;
-                       }
-                       String url = app.restUrl + "/updateSessionTimeOuts";
-                       String encriptedPwdDB = app.appPassword;
-                       String appUserName = app.username;
-
-                       setLocalMDCContext(app, "/updateSessionTimeOuts", url);
-
-                       URL obj = new URL(url);
-
-                       HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
-                       // optional default is GET
-                       con.setRequestMethod("POST");
-                       con.setConnectTimeout(3000);
-                       con.setReadTimeout(15000);
-
-                       // add request header
-                       con.setRequestProperty("username", appUserName);
-                       con.setRequestProperty("password", encriptedPwdDB);
-
-                       con.setRequestProperty("sessionMap", sessionTimeoutMap);
-                       con.setDoInput(true);
-                       con.setDoOutput(true);
-                       con.getOutputStream().write(sessionTimeoutMap.getBytes());
-                       con.getOutputStream().flush();
-                       con.getOutputStream().close();
-
-                       responseCode = con.getResponseCode();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
-               } catch (UrlAccessRestrictedException e) {
-                       responseCode = HttpServletResponse.SC_UNAUTHORIZED;
-                       String message = String.format(
-                                       "SessionCommunication.pingSession received an un-authorized exception. AppName: %s", appName);
-                       logger.error(EELFLoggerDelegate.errorLogger, message);
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
-               } catch (Exception e) {
-                       responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
-                       String message = String.format(
-                                       "SessionCommunication.pingSession encountered an Exception. AppName: %s, Details: %s", appName, e.toString());
-                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
-                       logger.error(EELFLoggerDelegate.errorLogger, message, e);
-               } finally {
-                       EcompPortalUtils.setExternalAppResponseCode(responseCode);
-               }
-
-               return true;
-       }
-
-       @EPAuditLog
-       public Boolean timeoutSession(OnboardingApp app, String portalJSessionId) throws Exception {
-               String appName = "Unknwon";
-               int responseCode = 0;
-               if (app != null && app.name != null && app.name != "") {
-                       try {
-                               appName = app.name;
-                               String url = app.restUrl + "/timeoutSession" + "?portalJSessionId=" + portalJSessionId;
-
-                               String encriptedPwdDB = app.appPassword;
-                               String appUserName = app.username;
-                               // String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB,
-                               // SystemProperties.getProperty(SystemProperties.Decryption_Key));
-
-                               setLocalMDCContext(app, "/timeoutSession", url);
-
-                               URL obj = new URL(url);
-                               HttpURLConnection con = (HttpURLConnection) obj.openConnection();
-
-                               // optional default is GET
-                               con.setRequestMethod("POST");
-                               con.setConnectTimeout(3000);
-                               con.setReadTimeout(15000);
-
-                               // add request header
-                               con.setRequestProperty("username", appUserName);
-                               con.setRequestProperty("password", encriptedPwdDB);
-
-                               // con.setRequestProperty("portalJSessionId", portalJSessionId);
-                               con.setDoInput(true);
-                               con.setDoOutput(true);
-                               con.getOutputStream().flush();
-                               con.getOutputStream().close();
-
-                               responseCode = con.getResponseCode();
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Response Code : " + responseCode);
-                       } catch (UrlAccessRestrictedException e) {
-                               responseCode = HttpServletResponse.SC_UNAUTHORIZED;
-                               String message = String.format(
-                                               "SessionCommunication.timeoutSession received an un-authorized exception. AppName: %s",
-                                               appName);
-                               logger.error(EELFLoggerDelegate.errorLogger, message);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiAuthenticationError, e);
-                       } catch (Exception e) {
-                               responseCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
-                               String message = String.format(
-                                               "SessionCommunication.timeoutSession encountered an Exception. AppName: %s, Details: %s", 
-                                               appName, e.toString());
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeHttpConnectionError, e);
-                               logger.error(EELFLoggerDelegate.errorLogger, message, e);
-                       } finally {
-                               EcompPortalUtils.setExternalAppResponseCode(responseCode);
-                       }
-               } else {
-                       logger.error(EELFLoggerDelegate.errorLogger, "SessionCommunication pingSession: app is null");
-               }
-               return true;
-       }
-
-       @EPMetricsLog
-       private void setLocalMDCContext(OnboardingApp app, String restPath, String url) {
-               setRequestId();
-               MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTP);
-               if (url != null && url.contains("https")) {
-                       MDC.put(EPCommonSystemProperties.PROTOCOL, EPCommonSystemProperties.HTTPS);
-               }
-               MDC.put(EPCommonSystemProperties.FULL_URL, url);
-               MDC.put(EPCommonSystemProperties.TARGET_ENTITY, app.myLoginsAppName);
-               MDC.put(EPCommonSystemProperties.TARGET_SERVICE_NAME, restPath);
-       }
-
-       /**
-        * Generates request id, service name fields and loads them into MDC, as these
-        * values could be empty as these session timeout requests are generated at
-        * scheduled intervals using quartz scheduler.
-        */
-       @EPMetricsLog
-       public void setRequestId() {
-               String requestId = MDC.get(Configuration.MDC_KEY_REQUEST_ID);
-               if (StringUtils.isEmpty(requestId)) {
-                       MDC.put(Configuration.MDC_KEY_REQUEST_ID, UUID.randomUUID().toString());
-               }
-
-               MDC.put(Configuration.MDC_SERVICE_NAME, "/quartz/keepSessionAlive");
-               MDC.put(EPCommonSystemProperties.PARTNER_NAME, EPCommonSystemProperties.ECOMP_PORTAL_BE);
-       }
-
-       /**
-        * Remove the values from MDC as these requests are executed at regular
-        * intervals based on quartz rather incoming REST API requests.
-        * 
-        * @param bAll
-        */
-       @EPMetricsLog
-       public void clear(Boolean bAll) {
-               MDC.remove(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE);
-               if (bAll) {
-                       MDC.remove(Configuration.MDC_KEY_REQUEST_ID);
-                       MDC.remove(Configuration.MDC_SERVICE_NAME);
-                       MDC.remove(EPCommonSystemProperties.PARTNER_NAME);
-               }
-       }
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/service/sessionmgt/TimeoutHandler.java
deleted file mode 100644 (file)
index d7945c5..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service.sessionmgt;
-
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpSession;
-
-import org.quartz.DisallowConcurrentExecution;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.quartz.PersistJobDataAfterExecution;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.scheduling.quartz.QuartzJobBean;
-
-import org.openecomp.portalsdk.core.domain.sessionmgt.TimeoutVO;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import com.fasterxml.jackson.core.JsonParseException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.JsonMappingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Executed periodically by Quartz to discover remote application sessions and
- * update timeouts suitably.
- */
-@PersistJobDataAfterExecution
-@DisallowConcurrentExecution
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class TimeoutHandler extends QuartzJobBean {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(TimeoutHandler.class);
-       
-       private ObjectMapper mapper = new ObjectMapper();
-
-       /**
-        * Supports static call {@link #timeoutSessions(HttpSession)}
-        */
-       private static List<OnboardingApp> onboardedAppList = null;
-       
-       @Autowired
-       private SessionCommunication sessionCommunication;
-       
-       @Override
-       protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
-               try {
-                       //Create a request id if there is none available,
-                       //and which will internally be used when making
-                       //session extended timeout calls to the partner applications.
-                       if (getSessionCommunication()!=null) {
-                               getSessionCommunication().setRequestId();
-                       }
-                       logger.info(EELFLoggerDelegate.debugLogger, "Quartz Cronjob for Session Management begins");
-                       
-                       ManageService manageService = (ManageService) applicationContext.getBean("manageService");
-                       EPAppService appService = (EPAppService) applicationContext.getBean("epAppService");
-
-                       List<OnboardingApp> appList = appService.getEnabledNonOpenOnboardingApps();
-                       onboardedAppList = appList;
-                       TypeReference<Hashtable<String, TimeoutVO>> typeRef = new TypeReference<Hashtable<String, TimeoutVO>>() {
-                       };
-                       String portalJsonSessionStr;
-                       Map<String, TimeoutVO> portalSessionTimeoutMap = null;
-
-                       portalJsonSessionStr = manageService.gatherSessionExtenstions();
-                       if (portalJsonSessionStr == null || portalJsonSessionStr == "") {
-                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management: Portal session information is empty.");
-                               return;
-                       }
-                       
-                       try {
-                               portalSessionTimeoutMap = mapper.readValue(portalJsonSessionStr, typeRef);
-                       } catch (JsonMappingException | JsonParseException je) {
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
-                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management: JSON Mapping Exception occurred while gathering the Session", je);
-                               return;
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management: Error while gather Session from portal", e);
-                               return;
-                       }
-                       
-                       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);
-                                       continue;
-                               }
-                               logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Calling App " + app.name + " at URL " + app.restUrl);
-                               String jsonSessionStr = fetchAppSessions(app);
-                               logger.info(EELFLoggerDelegate.debugLogger, "Session Management: App " + app.name + " returned  " + jsonSessionStr);
-                               if (jsonSessionStr == null || jsonSessionStr.isEmpty())
-                                       continue;
-
-                               try {
-                                       Map<String, TimeoutVO> sessionTimeoutMap = mapper.readValue(jsonSessionStr, typeRef);
-                                       appSessionTimeOutMap.put(app.id, sessionTimeoutMap);
-                                       for (String portalJSessionId : sessionTimeoutMap.keySet()) {
-                                               final TimeoutVO maxTimeoutVO = portalSessionTimeoutMap.get(portalJSessionId);
-                                               final TimeoutVO compareTimeoutVO = sessionTimeoutMap.get(portalJSessionId);
-                                               if (maxTimeoutVO != null && compareTimeoutVO != null) {
-                                                       if (maxTimeoutVO.compareTo(compareTimeoutVO) < 0)
-                                                               portalSessionTimeoutMap.get(portalJSessionId)
-                                                                               .setSessionTimOutMilliSec(compareTimeoutVO.getSessionTimOutMilliSec());
-                                               }
-                                       }
-                               } catch (JsonParseException | JsonMappingException e) {
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e);
-                                       logger.error(EELFLoggerDelegate.errorLogger, 
-                                                       "JSON Mapping/Processing Exception occurred while mapping/parsing the jsonSessionStr", e);
-                                       continue;
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while mapping/parsing the jsonSessionStr", e);
-                                       continue;
-                               }
-
-                       }
-
-                       // 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);
-                                       continue;
-                               }
-
-                               Map<String, TimeoutVO> sessionTimeoutMap = appSessionTimeOutMap.get(app.id);
-                               if (sessionTimeoutMap == null || sessionTimeoutMap.isEmpty())
-                                       continue;
-
-                               for (String portalJSessionId : sessionTimeoutMap.keySet()) {
-                                       try {
-                                               final TimeoutVO maxTimeoutVO = portalSessionTimeoutMap.get(portalJSessionId);
-                                               final TimeoutVO setTimeoutVO = sessionTimeoutMap.get(portalJSessionId);
-                                               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);
-                                                       logger.warn(EELFLoggerDelegate.errorLogger, message);
-                                                       continue;
-                                               }
-                                               setTimeoutVO.setSessionTimOutMilliSec(maxTimeoutVO.getSessionTimOutMilliSec());
-                                       } catch (Exception e) {
-                                               logger.error(EELFLoggerDelegate.errorLogger, "Session Management:  error while updating the session timeout map", e);
-                                               continue;
-                                       }
-                               }
-                               logger.info(EELFLoggerDelegate.debugLogger, "Session Management: Updating App " + app.restUrl);
-                               String sessionTimeoutMapStr = "";
-                               try {
-                                       sessionTimeoutMapStr = mapper.writeValueAsString(sessionTimeoutMap);
-                               } catch (JsonProcessingException je) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "executeInternal failed while processing sessionTimeOutMap object to a String", je);
-                                       EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
-                               }
-                               pingAppSessions(app, sessionTimeoutMapStr);
-                       }
-                       String portalSessionTimeoutMapStr = "";
-                       try {
-                               portalSessionTimeoutMapStr = mapper.writeValueAsString(portalSessionTimeoutMap);
-                       } catch (JsonProcessingException je) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while processing portalSessionTimeOutMap object to a String", je);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, je);
-                       }
-                       manageService.updateSessionExtensions(portalSessionTimeoutMapStr);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "************************ Session Management:  error in managing session timeouts", e);
-               } finally {
-                       getSessionCommunication().clear(true);
-               }
-       }
-
-       private String fetchAppSessions(OnboardingApp app) throws Exception {
-               String jsonSessionValue = getSessionCommunication().sendGet(app);
-               getSessionCommunication().clear(false);
-               return jsonSessionValue;
-       }
-
-       private void pingAppSessions(OnboardingApp app, String sessionTimeoutMapStr) throws Exception {
-               getSessionCommunication().pingSession(app, sessionTimeoutMapStr);
-               getSessionCommunication().clear(false);
-       }
-
-       public void timeoutSessions(HttpSession session) throws Exception {
-               String portalJSessionId = portalJSessionId(session);
-               if (onboardedAppList == null)
-                       return;
-
-               for (OnboardingApp app : onboardedAppList) {
-                       getSessionCommunication().timeoutSession(app, portalJSessionId);
-                       getSessionCommunication().clear(false);
-               }
-       }
-
-       protected static String portalJSessionId(HttpSession session) {
-               final Object attribute = session.getAttribute(PortalApiConstants.PORTAL_JSESSION_ID);
-               if (attribute == null)
-                       return "";
-               String jSessionKey = (String) attribute;
-               return jSessionKey.split("-")[0];
-       }
-
-       private static ApplicationContext applicationContext;
-
-       public static void setApplicationContext(ApplicationContext _applicationContext) {
-               applicationContext = _applicationContext;
-       }
-
-       public SessionCommunication getSessionCommunication() {
-               if(sessionCommunication == null){
-                       if (applicationContext != null)                         
-                               sessionCommunication = (SessionCommunication)applicationContext.getBean("sessionCommunication");
-               }
-               
-               return sessionCommunication;
-       }
-
-       public void setSessionCommunication(SessionCommunication sessionCommunication) {
-               this.sessionCommunication = sessionCommunication;
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/util/EPUserUtils.java
deleted file mode 100644 (file)
index 4c3462a..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.util;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.exception.SessionExpiredException;
-import org.openecomp.portalsdk.core.lm.FusionLicenseManager;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.menu.MenuBuilder;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class EPUserUtils {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUserUtils.class);
-
-       private final static Long ACCOUNT_ADMIN_ROLE_ID = 999L;
-
-       public static final String ALL_ROLE_FUNCTIONS = "allRoleFunctions";
-
-       private static DataAccessService dataAccessService;
-
-       /**
-        * Gets the EPUser object from the session.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return EPUser object that was created upon login
-        * @throws SessionExpiredException
-        *             if no session exists.
-        */
-       public static EPUser getUserSession(HttpServletRequest request) {
-               HttpSession session = AppUtils.getSession(request);
-               if (session == null)
-                       throw new SessionExpiredException();
-               return (EPUser) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
-       }
-
-       /**
-        * Establishes the user's portal session
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @param user
-        *            EPUser
-        * @param applicationMenuData
-        *            Menu data
-        * @param businessDirectMenuData
-        *            Menu data
-        * @param loginMethod_ignored
-        *            How the user authenticated; ignored
-        * @param ePRoleFunctionService
-        *            role function service
-        */
-       @SuppressWarnings("rawtypes")
-       public static void setUserSession(HttpServletRequest request, EPUser user, Set applicationMenuData,
-                       Set businessDirectMenuData, String loginMethod_ignored, EPRoleFunctionService ePRoleFunctionService) {
-               HttpSession session = request.getSession(true);
-
-               // clear the current user session to avoid any conflicts
-               EPUserUtils.clearUserSession(request);
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
-               setAllRoleFunctions(ePRoleFunctionService.getRoleFunctions(), session);
-
-               ePRoleFunctionService.getRoleFunctions(request, user);
-
-               // truncate the role (and therefore the role function) data to save
-               // memory in the session
-               user.setEPRoles(null);
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_NAME), user.getFullName());
-
-               ServletContext context = session.getServletContext();
-               int licenseVerificationFlag = 3;
-               try {
-                       licenseVerificationFlag = (Integer) context.getAttribute("licenseVerification");
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "setUserSession failed to get licenseVerification attribute",
-                                       e);
-               }
-               switch (licenseVerificationFlag) {
-               case FusionLicenseManager.DEVELOPER_LICENSE:
-                       session.setAttribute(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME),
-                                       "My Portal [Development Version]");
-                       break;
-               case FusionLicenseManager.EXPIRED_LICENSE:
-                       session.setAttribute(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME),
-                                       "My Portal [LICENSE EXPIRED]");
-                       break;
-               case FusionLicenseManager.VALID_LICENSE:
-                       session.setAttribute(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME), "My Portal");
-                       break;
-               default:
-                       session.setAttribute(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME),
-                                       "My Portal [INVALID LICENSE]");
-                       break;
-               }
-
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME),
-                               MenuBuilder.filterMenu(applicationMenuData, request));
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_ATTRIBUTE_NAME),
-                               MenuBuilder.filterMenu(businessDirectMenuData, request));
-       }
-
-       /**
-        * Creates a set of role function names and stores the set as a session
-        * attribute.
-        * 
-        * @param allRoleFunctions
-        *            List of role functions.
-        * @param session
-        *            HttpSession
-        */
-       private static void setAllRoleFunctions(List<RoleFunction> allRoleFunctions, HttpSession session) {
-               if (allRoleFunctions == null)
-                       return;
-               Set<String> roleFnSet = new HashSet<String>();
-               for (RoleFunction roleFn : allRoleFunctions)
-                       roleFnSet.add(roleFn.getCode());
-               session.setAttribute(ALL_ROLE_FUNCTIONS, roleFnSet);
-       }
-
-       /**
-        * Removes all stored attributes from the user's session
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @throws SessionExpiredException
-        *             if no session exists
-        */
-       private static void clearUserSession(HttpServletRequest request) {
-               HttpSession session = AppUtils.getSession(request);
-               if (session == null)
-                       throw new SessionExpiredException();
-
-               // removes all stored attributes from the current user's session
-               session.removeAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
-               session.removeAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME));
-               session.removeAttribute(SystemProperties.getProperty(SystemProperties.BUSINESS_DIRECT_MENU_ATTRIBUTE_NAME));
-               session.removeAttribute(SystemProperties.getProperty(SystemProperties.ROLES_ATTRIBUTE_NAME));
-               session.removeAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME));
-       }
-
-       /**
-        * Gets role information from the user session, in the cached user object. As a
-        * side effect sets a session variable with the roles.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return Map of role ID to role object
-        */
-       @SuppressWarnings("rawtypes")
-       public static HashMap getRoles(HttpServletRequest request) {
-               HashMap roles = null;
-
-               HttpSession session = AppUtils.getSession(request);
-               roles = (HashMap) session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLES_ATTRIBUTE_NAME));
-
-               // if roles are not already cached, let's grab them from the user
-               // session
-               if (roles == null) {
-                       EPUser user = getUserSession(request);
-
-                       // get all user roles (including the tree of child roles)
-                       roles = getAllUserRoles(user);
-
-                       session.setAttribute(SystemProperties.getProperty(SystemProperties.ROLES_ATTRIBUTE_NAME), roles);
-               }
-
-               return roles;
-       }
-
-       /**
-        * Builds a map of role ID to role object.
-        * 
-        * @param user
-        *            EPUser
-        * @return Map of role ID to role object
-        */
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       private static HashMap getAllUserRoles(EPUser user) {
-               HashMap roles = new HashMap();
-               Iterator i = user.getEPRoles().iterator();
-
-               while (i.hasNext()) {
-                       EPRole role = (EPRole) i.next();
-
-                       if (role.getActive()) {
-                               roles.put(role.getId(), role);
-
-                               // let's take a recursive trip down the tree to add all child
-                               // roles
-                               addChildRoles(role, roles);
-                       }
-               }
-
-               // Additionally; the account admin role is overloaded between ecomp
-               // portal and partners; lets also include that
-               Iterator<EPUserApp> appRolesIterator = user.getEPUserApps().iterator();
-               while (appRolesIterator.hasNext()) {
-                       EPRole role = (EPRole) appRolesIterator.next().getRole();
-
-                       if (role.getActive() && role.getId().equals(ACCOUNT_ADMIN_ROLE_ID)) {
-                               roles.put(role.getId(), role);
-
-                               // let's take a recursive trip down the tree to add all child
-                               // roles
-                               addChildRoles(role, roles);
-                       }
-               }
-
-               return roles;
-       }
-
-       /**
-        * Adds all child roles of the specified role to the map of roles.
-        * 
-        * @param role
-        *            EPRole
-        * @param roles
-        *            Maps role id to role object
-        */
-       @SuppressWarnings({ "rawtypes", "unchecked" })
-       private static void addChildRoles(EPRole role, HashMap roles) {
-               Set childRoles = role.getChildRoles();
-
-               if (childRoles != null && childRoles.size() > 0) {
-                       Iterator j = childRoles.iterator();
-                       while (j.hasNext()) {
-                               EPRole childRole = (EPRole) j.next();
-
-                               if (childRole.getActive()) {
-                                       roles.put(childRole.getId(), childRole);
-
-                                       addChildRoles(childRole, roles);
-                               }
-                       }
-               }
-
-       }
-
-       public static boolean hasRole(EPUser user, String roleKey) {
-               return getAllUserRoles(user).keySet().contains(new Long(roleKey));
-       }
-
-       public static DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       @Autowired
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               EPUserUtils.dataAccessService = dataAccessService;
-       }
-
-       /**
-        * Gets the user's ID from the user object in the session
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return Integer ID of current user
-        */
-       public static int getUserId(HttpServletRequest request) {
-               return getUserIdAsLong(request).intValue();
-       }
-
-       /**
-        * Gets the user's ID from the user object in the session
-        * 
-        * @param request
-        *            HttpServletREquest
-        * @return Long ID of current user
-        */
-       public static Long getUserIdAsLong(HttpServletRequest request) {
-               Long userId = new Long(SystemProperties.getProperty(SystemProperties.APPLICATION_USER_ID));
-               if (request != null) {
-                       if (getUserSession(request) != null) {
-                               userId = getUserSession(request).getId();
-                       }
-               }
-               return userId;
-       }
-
-       /**
-        * Gets the request ID from the request.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return Request ID
-        */
-       public static String getRequestId(HttpServletRequest request) {
-               Enumeration<String> headerNames = request.getHeaderNames();
-
-               String requestId = "";
-               try {
-                       while (headerNames.hasMoreElements()) {
-                               String headerName = (String) headerNames.nextElement();
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "One header is " + headerName + " : " + request.getHeader(headerName));
-                               if (headerName.equalsIgnoreCase(SystemProperties.ECOMP_REQUEST_ID)) {
-                                       requestId = request.getHeader(headerName);
-                                       break;
-                               }
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRequestId failed", e);
-               }
-
-               return (requestId.isEmpty() ? UUID.randomUUID().toString() : requestId);
-       }
-
-       /**
-        * Gets the full URL from the request.
-        * 
-        * @param request
-        *            HttpServletRequest
-        * @return Full URL
-        */
-       public static String getFullURL(HttpServletRequest request) {
-               if (request != null) {
-                       StringBuffer requestURL = request.getRequestURL();
-                       String queryString = request.getQueryString();
-
-                       if (queryString == null) {
-                               return requestURL.toString();
-                       } else {
-                               return requestURL.append('?').append(queryString).toString();
-                       }
-               }
-               return "";
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/util/SystemType.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/util/SystemType.java
deleted file mode 100644 (file)
index 31d54fd..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.util;
-
-public enum SystemType {
-
-       APPLICATION,
-//     SYSTEM
-}
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalsdk/core/lm/FusionLicenseManagerUtils.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalsdk/core/lm/FusionLicenseManagerUtils.java
deleted file mode 100644 (file)
index ecfc0ea..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalsdk.core.lm;
-
-import java.util.Date;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-//import org.openecomp.portalapp.lm.FusionLicenseManagerImpl;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.servlet.support.RequestContextUtils;
-
-@Component
-public class FusionLicenseManagerUtils {
-       
-       @Autowired
-       private FusionLicenseManager licenseManager;
-
-       @Autowired
-       private EPCommonSystemProperties sysProps;
-       static {
-       }
-               
-       public int verifyLicense(ServletContext context) {
-               if(sysProps == null) {
-                       try {
-                               sysProps = new EPCommonSystemProperties();
-                               sysProps.setServletContext(context);
-//                             sysProps.load();
-//                             licenseManager = new FusionLicenseManagerImpl(new LicenseableClassImpl());
-                               System.out.println(licenseManager);
-                               licenseManager.installLicense();
-                       }
-                       catch(Exception ex) {
-                               ex.printStackTrace();
-                       }
-               }
-               
-               
-               
-//             WebApplicationContext ctx =RequestContextUtils.getWebApplicationContext(request);
-//             int flag = ((FusionLicenseManager)ctx.getBean("fusionLicenseManager")).verifyLicense(request);
-//             logger.debug("****************FLAG ******************** " + flag);
-//             return flag;
-//             return 2;
-               return licenseManager.verifyLicense(context);
-       }
-
-       public static Date getLicenseExpiryDate(HttpServletRequest request) {
-               WebApplicationContext ctx =RequestContextUtils.getWebApplicationContext(request);
-               return ((FusionLicenseManager)ctx.getBean("fusionLicenseManager")).getExpiredDate();
-       }
-}
index f8207a1..34995ae 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index fd810ae..2214b93 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 8fe369f..f82d2cb 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -41,7 +41,7 @@
         "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
 <!-- Publishes mappings and queries specific to the ECOMP Portal application. -->
         "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
 <!-- Publishes mappings and queries specific to the ECOMP Portal application. -->
-<hibernate-mapping package="org.openecomp.portalapp.portal.domain">
+<hibernate-mapping package="org.onap.portalapp.portal.domain">
 
        <!-- Widget class mapping details -->
        <class name="Widget" table="FN_WIDGET">
 
        <!-- Widget class mapping details -->
        <class name="Widget" table="FN_WIDGET">
                <property name="jobTitle" column="job_title" />
                <property name="siloStatus" column="silo_status" />
                <property name="financialLocCode" column="fin_loc_code" />
                <property name="jobTitle" column="job_title" />
                <property name="siloStatus" column="silo_status" />
                <property name="financialLocCode" column="fin_loc_code" />
+               <property name="costCenter" column="cost_center" />
 
                <property name="active" column="active_yn" type="yes_no" />
                <property name="internal" column="is_internal_yn" type="yes_no" />
 
                <property name="active" column="active_yn" type="yes_no" />
                <property name="internal" column="is_internal_yn" type="yes_no" />
                <set name="EPUserApps" table="FN_USER_ROLE" lazy="false" sort="natural"
                        inverse="true">
                        <key column="user_id" />
                <set name="EPUserApps" table="FN_USER_ROLE" lazy="false" sort="natural"
                        inverse="true">
                        <key column="user_id" />
-                       <one-to-many class="org.openecomp.portalapp.portal.domain.EPUserApp" />
+                       <one-to-many class="org.onap.portalapp.portal.domain.EPUserApp" />
                </set>
 
        </class>
                </set>
 
        </class>
                                <column name="user_id" precision="11" scale="0" />
                        </key-property>
                        <key-many-to-one name="app"
                                <column name="user_id" precision="11" scale="0" />
                        </key-property>
                        <key-many-to-one name="app"
-                               class="org.openecomp.portalapp.portal.domain.EPApp" column="app_id" />
+                               class="org.onap.portalapp.portal.domain.EPApp" column="app_id" />
                        <key-many-to-one name="role"
                        <key-many-to-one name="role"
-                               class="org.openecomp.portalapp.portal.domain.EPRole" column="role_id" />
+                               class="org.onap.portalapp.portal.domain.EPRole" column="role_id" />
                </composite-id>
                <property name="priority" type="java.lang.Short">
                        <column name="priority" precision="4" scale="0" />
                </composite-id>
                <property name="priority" type="java.lang.Short">
                        <column name="priority" precision="4" scale="0" />
                        sort="natural">
                        <key column="role_id" />
                        <many-to-many column="function_cd"
                        sort="natural">
                        <key column="role_id" />
                        <many-to-many column="function_cd"
-                               class="org.openecomp.portalsdk.core.domain.RoleFunction" />
+                               class="org.onap.portalsdk.core.domain.RoleFunction" />
                </set>
 
                <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false"
                        sort="natural">
                        <key column="parent_role_id" />
                        <many-to-many column="child_role_id"
                </set>
 
                <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false"
                        sort="natural">
                        <key column="parent_role_id" />
                        <many-to-many column="child_role_id"
-                               class="org.openecomp.portalapp.portal.domain.EPRole" />
+                               class="org.onap.portalapp.portal.domain.EPRole" />
                </set>
 
                <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false"
                        sort="natural">
                        <key column="child_role_id" />
                        <many-to-many column="parent_role_id"
                </set>
 
                <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false"
                        sort="natural">
                        <key column="child_role_id" />
                        <many-to-many column="parent_role_id"
-                               class="org.openecomp.portalapp.portal.domain.EPRole" />
+                               class="org.onap.portalapp.portal.domain.EPRole" />
                </set>
 
        </class>
                </set>
 
        </class>
                <property name="roleId" column="role_id"></property>
                <property name="appId" column="app_id"></property>
                <property name="code" column="function_cd"></property>
                <property name="roleId" column="role_id"></property>
                <property name="appId" column="app_id"></property>
                <property name="code" column="function_cd"></property>
+               <property name="roleAppId" column="role_app_id"></property>
        </class>
 
        <!-- CentralRoleFunction class mapping details -->
        </class>
 
        <!-- CentralRoleFunction class mapping details -->
-       <class name="CentralRoleFunction" table="ep_app_function">
+       <class name="CentralV2RoleFunction" table="ep_app_function">
                <composite-id>
                        <key-property name="appId" 
                                column="app_id" />
                <composite-id>
                        <key-property name="appId" 
                                column="app_id" />
                        lazy="false" cascade="save-update, persist" inverse="true" fetch="select">
                        <key column="req_id" />
                        <one-to-many
                        lazy="false" cascade="save-update, persist" inverse="true" fetch="select">
                        <key column="req_id" />
                        <one-to-many
-                               class="org.openecomp.portalapp.portal.domain.EPUserAppRolesRequestDetail" />
+                               class="org.onap.portalapp.portal.domain.EPUserAppRolesRequestDetail" />
                </set>
        </class>
 
                </set>
        </class>
 
                <property name="reqRoleId" column="requested_role_id" />
                <property name="reqType" column="request_type" />
                <many-to-one name="epRequestIdData" fetch="select"
                <property name="reqRoleId" column="requested_role_id" />
                <property name="reqType" column="request_type" />
                <many-to-one name="epRequestIdData" fetch="select"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest">
+                       class="org.onap.portalapp.portal.domain.EPUserAppRolesRequest">
                        <column name="req_id" not-null="true" />
                </many-to-one>
        </class>
                        <column name="req_id" not-null="true" />
                </many-to-one>
        </class>
        <!-- requires values for named parameters :searchQuery and :userId -->
        <sql-query name="searchPortal">
                <return alias="searchResult"
        <!-- requires values for named parameters :searchQuery and :userId -->
        <sql-query name="searchPortal">
                <return alias="searchResult"
-                       class="org.openecomp.portalapp.portal.ecomp.model.SearchResultItem" />
+                       class="org.onap.portalapp.portal.ecomp.model.SearchResultItem" />
                <![CDATA[
                        select @rn /*'*/:=/*'*/ @rn+1 AS rowId, CATEGORY, NAME, UUID, TARGET from
                                ( (
                <![CDATA[
                        select @rn /*'*/:=/*'*/ @rn+1 AS rowId, CATEGORY, NAME, UUID, TARGET from
                                ( (
                                upper( :searchQuery ) != ''
                                and (upper(first_name) like upper(CONCAT('%', :searchQuery, '%'))
                                or upper(last_name) like upper(CONCAT('%', :searchQuery, '%'))
                                upper( :searchQuery ) != ''
                                and (upper(first_name) like upper(CONCAT('%', :searchQuery, '%'))
                                or upper(last_name) like upper(CONCAT('%', :searchQuery, '%'))
-                               or upper(org_user_id) like upper(CONCAT('%', :searchQuery, '%')))
+                               or upper(org_user_id) like upper(CONCAT('%', :searchQuery, '%'))
+                               or 
+                       ((first_name LIKE (SELECT concat('%',trim(SUBSTRING(:searchQuery, 1, INSTR(:searchQuery,' '))),'%'))
+                       AND
+                      last_name LIKE (concat('%',(SELECT(SUBSTRING(:searchQuery, INSTR(:searchQuery,' ')+1, LENGTH(:searchQuery)))),'%')))
+                       OR
+                      (last_name LIKE (SELECT concat('%',trim(SUBSTRING(:searchQuery, 1, INSTR(:searchQuery,' '))),'%'))
+                        AND
+                      first_name LIKE (concat('%',(SELECT(SUBSTRING(:searchQuery, INSTR(:searchQuery,' ')+1, LENGTH(:searchQuery)))),'%')))))
                                and  upper(active_yn) = 'Y'
                                )
                                union
                                and  upper(active_yn) = 'Y'
                                )
                                union
        <!-- requires values for named parameters :searchQuery and :userId -->
        <sql-query name="getNotifications">
                <return alias="notificationResult"
        <!-- requires values for named parameters :searchQuery and :userId -->
        <sql-query name="getNotifications">
                <return alias="notificationResult"
-                       class="org.openecomp.portalapp.portal.transport.EpNotificationItem" />
+                       class="org.onap.portalapp.portal.transport.EpNotificationItem" />
                <![CDATA[
                        select @rn /*'*/:=/*'*/ @rn+1 AS rowId, notification_ID, is_for_online_users,is_for_all_roles, msg_header, msg_description,msg_source, start_Time, end_time, priority, created_date, creator_ID,notification_hyperlink, active_YN from
                        ( 
                <![CDATA[
                        select @rn /*'*/:=/*'*/ @rn+1 AS rowId, notification_ID, is_for_online_users,is_for_all_roles, msg_header, msg_description,msg_source, start_Time, end_time, priority, created_date, creator_ID,notification_hyperlink, active_YN from
                        ( 
                ]]>
 
        </sql-query>
                ]]>
 
        </sql-query>
-       
                <sql-query name="getUsersByOrgIdsNotifications">
                <sql-query name="getUsersByOrgIdsNotifications">
-               <return alias="getUsersByOrgIdsNotificationsResult" class="org.openecomp.portalapp.portal.domain.EPUser"/>
+               <return alias="getUsersByOrgIdsNotificationsResult" class="org.onap.portalapp.portal.domain.EPUser"/>
                <![CDATA[
                        SELECT * from fn_user where org_user_id in (:OrgIds)
                ]]>
                <![CDATA[
                        SELECT * from fn_user where org_user_id in (:OrgIds)
                ]]>
        <!-- Gets all Admin notification history; accepts no parameters -->
        <sql-query name="getAdminNotificationHistoryVO">
                <return alias="adminNotificationHistoryVOResult"
        <!-- Gets all Admin notification history; accepts no parameters -->
        <sql-query name="getAdminNotificationHistoryVO">
                <return alias="adminNotificationHistoryVOResult"
-                       class="org.openecomp.portalapp.portal.transport.EpNotificationItemVO" /> 
+                       class="org.onap.portalapp.portal.transport.EpNotificationItemVO" /> 
                <![CDATA[
                SELECT * from (
 SELECT 
                <![CDATA[
                SELECT * from (
 SELECT 
@@ -799,7 +808,7 @@ SELECT
 
        <sql-query name="getEpNotificationAppRoles">
                <return alias="notificationAppRoles"
 
        <sql-query name="getEpNotificationAppRoles">
                <return alias="notificationAppRoles"
-                       class="org.openecomp.portalapp.portal.domain.EcompAppRole" />
+                       class="org.onap.portalapp.portal.domain.EcompAppRole" />
                <!-- This query requires no parameters. -->
                <![CDATA[
 
                <!-- This query requires no parameters. -->
                <![CDATA[
 
@@ -819,7 +828,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets all notification history -->
        <sql-query name="getNotificationHistoryVO">
                <return alias="notificationHistoryVOResult"
        <!-- Gets all notification history -->
        <sql-query name="getNotificationHistoryVO">
                <return alias="notificationHistoryVOResult"
-                       class="org.openecomp.portalapp.portal.transport.EpNotificationItemVO" />
+                       class="org.onap.portalapp.portal.transport.EpNotificationItemVO" />
                <![CDATA[
                SELECT
                        notificationId, isForOnlineUsers, isForAllRoles, msgHeader,     msgDescription,msgSource,
                <![CDATA[
                SELECT
                        notificationId, isForOnlineUsers, isForAllRoles, msgHeader,     msgDescription,msgSource,
@@ -957,7 +966,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets role details for a specified notification -->
        <sql-query name="getNotificationRoles">
                <return alias="notificationRolesResult"
        <!-- Gets role details for a specified notification -->
        <sql-query name="getNotificationRoles">
                <return alias="notificationRolesResult"
-                       class="org.openecomp.portalapp.portal.transport.EpRoleNotificationItem" />
+                       class="org.onap.portalapp.portal.transport.EpRoleNotificationItem" />
                <![CDATA[
                        SELECT * 
                        FROM
                <![CDATA[
                        SELECT * 
                        FROM
@@ -970,7 +979,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets all applications, possibly with contact information -->
        <sql-query name="getAppsAndContacts">
                <return alias="appContactUs"
        <!-- Gets all applications, possibly with contact information -->
        <sql-query name="getAppsAndContacts">
                <return alias="appContactUs"
-                       class="org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem" />
+                       class="org.onap.portalapp.portal.ecomp.model.AppContactUsItem" />
                <!-- This query requires no parameters. -->
                <![CDATA[
                        select 
                <!-- This query requires no parameters. -->
                <![CDATA[
                        select 
@@ -992,7 +1001,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets all rows from the app-contact-us table, extended with app information -->
        <sql-query name="getAppContactUsItems">
                <return alias="appContactUs"
        <!-- Gets all rows from the app-contact-us table, extended with app information -->
        <sql-query name="getAppContactUsItems">
                <return alias="appContactUs"
-                       class="org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem" />
+                       class="org.onap.portalapp.portal.ecomp.model.AppContactUsItem" />
                <!-- This query requires no parameters. -->
                <![CDATA[
                        select 
                <!-- This query requires no parameters. -->
                <![CDATA[
                        select 
@@ -1013,7 +1022,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets one row for each app with the category and catenated functions. -->
        <sql-query name="getAppCategoryFunctions">
                <return alias="appCategoryFunctions"
        <!-- Gets one row for each app with the category and catenated functions. -->
        <sql-query name="getAppCategoryFunctions">
                <return alias="appCategoryFunctions"
-                       class="org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem" />
+                       class="org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem" />
                <!-- This query requires no parameters. -->
                <![CDATA[
                        SELECT @rn /*'*/:=/*'*/ @rn+1 AS rowId,
                <!-- This query requires no parameters. -->
                <![CDATA[
                        SELECT @rn /*'*/:=/*'*/ @rn+1 AS rowId,
@@ -1051,7 +1060,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets one row for each function-application-role combination. -->
        <sql-query name="getAppAccessFunctionRole">
                <return alias="appAccessFunctionRole"
        <!-- Gets one row for each function-application-role combination. -->
        <sql-query name="getAppAccessFunctionRole">
                <return alias="appAccessFunctionRole"
-                       class="org.openecomp.portalapp.portal.domain.GetAccessResult" />
+                       class="org.onap.portalapp.portal.domain.GetAccessResult" />
                <!-- This query requires one parameters. -->
                <![CDATA[
                        select @rn /*'*/:=/*'*/ @rn+1 AS row_id, t.role_id, t.ECOMP_FUNCTION, t.APP_NAME, t.APP_MOTS_ID, t.ROLE_NAME,
                <!-- This query requires one parameters. -->
                <![CDATA[
                        select @rn /*'*/:=/*'*/ @rn+1 AS row_id, t.role_id, t.ECOMP_FUNCTION, t.APP_NAME, t.APP_MOTS_ID, t.ROLE_NAME,
@@ -1099,21 +1108,21 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        </sql-query>
        
        <sql-query name="getActiveUsers">
        </sql-query>
        
        <sql-query name="getActiveUsers">
-               <return alias="EPUser" class="org.openecomp.portalapp.portal.domain.EPUser" />   
+               <return alias="EPUser" class="org.onap.portalapp.portal.domain.EPUser" />   
                <![CDATA[
                SELECT * FROM FN_USER WHERE active_yn='Y' 
                ]]>
        </sql-query>
 
        <sql-query name="getAppsAdmins">
                <![CDATA[
                SELECT * FROM FN_USER WHERE active_yn='Y' 
                ]]>
        </sql-query>
 
        <sql-query name="getAppsAdmins">
-               <return alias="adminUserApp" class="org.openecomp.portalapp.portal.domain.AdminUserApp" />   
+               <return alias="adminUserApp" class="org.onap.portalapp.portal.domain.AdminUserApp" />   
        <![CDATA[
        SELECT apps.APP_NAME, apps.APP_ID, user.USER_ID, user.FIRST_NAME, user.LAST_NAME, user.org_user_id FROM fn_user_role userrole INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID INNER JOIN fn_app apps ON apps.APP_ID = userrole.APP_ID  WHERE user.active_yn='Y' AND userrole.ROLE_ID = :accountAdminRoleId AND (apps.ENABLED = 'Y' OR apps.APP_ID=1)      
        ]]>
        </sql-query>
        
        <sql-query name="getPortalAdmins">
        <![CDATA[
        SELECT apps.APP_NAME, apps.APP_ID, user.USER_ID, user.FIRST_NAME, user.LAST_NAME, user.org_user_id FROM fn_user_role userrole INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID INNER JOIN fn_app apps ON apps.APP_ID = userrole.APP_ID  WHERE user.active_yn='Y' AND userrole.ROLE_ID = :accountAdminRoleId AND (apps.ENABLED = 'Y' OR apps.APP_ID=1)      
        ]]>
        </sql-query>
        
        <sql-query name="getPortalAdmins">
-               <return alias="portalAdmin" class="org.openecomp.portalapp.portal.transport.PortalAdmin" />   
+               <return alias="portalAdmin" class="org.onap.portalapp.portal.transport.PortalAdmin" />   
        <![CDATA[
                SELECT u.user_id, u.first_name, u.last_name, u.login_id FROM fn_user u, fn_user_role ur WHERE u.active_yn = 'Y' AND u.user_id = ur.user_id AND ur.role_id= :adminRoleId
        ]]>
        <![CDATA[
                SELECT u.user_id, u.first_name, u.last_name, u.login_id FROM fn_user u, fn_user_role ur WHERE u.active_yn = 'Y' AND u.user_id = ur.user_id AND ur.role_id= :adminRoleId
        ]]>
@@ -1121,7 +1130,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        
        <!-- Gets personalized list of enabled and accessible apps for regular user -->
        <sql-query name="getPersUserApps">
        
        <!-- Gets personalized list of enabled and accessible apps for regular user -->
        <sql-query name="getPersUserApps">
-               <return alias="persUserApps" class="org.openecomp.portalapp.portal.domain.EPApp" />
+               <return alias="persUserApps" class="org.onap.portalapp.portal.domain.EPApp" />
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                    select
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                    select
@@ -1149,7 +1158,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets personalized list of enabled and accessible apps for Portal (super) 
                admin -->
        <sql-query name="getPersAdminApps">
        <!-- Gets personalized list of enabled and accessible apps for Portal (super) 
                admin -->
        <sql-query name="getPersAdminApps">
-               <return alias="persAdminApps" class="org.openecomp.portalapp.portal.domain.EPApp" />
+               <return alias="persAdminApps" class="org.onap.portalapp.portal.domain.EPApp" />
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                    select
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                    select
@@ -1179,7 +1188,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <!-- Gets personalized list of enabled and accessible Admin apps by name -->
        <sql-query name="getPersAdminAppsOrderByName">
 
        <!-- Gets personalized list of enabled and accessible Admin apps by name -->
        <sql-query name="getPersAdminAppsOrderByName">
-               <return alias="AdminAppsOrderByName" class="org.openecomp.portalapp.portal.domain.EPApp" />
+               <return alias="AdminAppsOrderByName" class="org.onap.portalapp.portal.domain.EPApp" />
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[ 
                 select
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[ 
                 select
@@ -1202,15 +1211,25 @@ 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')
                        )
                                or
                                (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S')
                        )
-                       order by app_name
-                   ;
+                       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
+          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
+                 ;
                
                ]]>
        </sql-query>
 
        <!--Gets personalized list of enabled and accessible User apps by name -->
        <sql-query name="getPersUserAppsOrderByName">
                
                ]]>
        </sql-query>
 
        <!--Gets personalized list of enabled and accessible User apps by name -->
        <sql-query name="getPersUserAppsOrderByName">
-               <return alias="UserAppsOrderByName" class="org.openecomp.portalapp.portal.domain.EPApp" />
+               <return alias="UserAppsOrderByName" class="org.onap.portalapp.portal.domain.EPApp" />
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[ 
                select
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[ 
                select
@@ -1231,8 +1250,18 @@ 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'))
                        )
                        or
                                (a.OPEN = 'N' and r.USER_ID is not null and (p.STATUS_CD is null or p.STATUS_CD != 'H'))
                        )
-                       order by app_name
-                   ;
+                       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
+          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
+                ;
                
                ]]>
        </sql-query>
                
                ]]>
        </sql-query>
@@ -1241,8 +1270,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!--Gets personalized list of enabled and accessible Super Admin apps by 
                LastUsed -->
        <sql-query name="getAdminAppsOrderByLastUsed">
        <!--Gets personalized list of enabled and accessible Super Admin apps by 
                LastUsed -->
        <sql-query name="getAdminAppsOrderByLastUsed">
-               <return alias="AdminAppsOrderByLastUsed" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="AdminAppsOrderByLastUsed" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[
                    select 
                        *
                <![CDATA[
                    select 
                        *
@@ -1266,6 +1294,16 @@ 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')
                        )
                                or
                                (a.OPEN = 'N' and r.ROLE_ID is null and p.STATUS_CD = 'S')
                        )
+                       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
+          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 
                left outer join
                        (select  distinct
                        ) A 
                left outer join
                        (select  distinct
@@ -1279,8 +1317,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <!--Gets personalized list of enabled and accessible User apps by LastUsed -->
        <sql-query name="getUserAppsOrderByLastUsed">
 
        <!--Gets personalized list of enabled and accessible User apps by LastUsed -->
        <sql-query name="getUserAppsOrderByLastUsed">
-               <return alias="UserAppsOrderByLastUsed" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="UserAppsOrderByLastUsed" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[ 
                        select * from (select
                                distinct  -- multiple roles yield multiple rows
                <![CDATA[ 
                        select * from (select
                                distinct  -- multiple roles yield multiple rows
@@ -1299,7 +1336,18 @@ 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'))
                                (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'))
-                       )) A 
+                       )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
+          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 
                left outer join
                        (select  distinct
                        c.AFFECTED_RECORD_ID, c.AUDIT_DATE 
                left outer join
                        (select  distinct
                        c.AFFECTED_RECORD_ID, c.AUDIT_DATE 
@@ -1316,8 +1364,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!--Gets personalized list of enabled and accessible Super Admin apps by 
                Most Used -->
        <sql-query name="getAdminAppsOrderByMostUsed">
        <!--Gets personalized list of enabled and accessible Super Admin apps by 
                Most Used -->
        <sql-query name="getAdminAppsOrderByMostUsed">
-               <return alias="AdminAppsOrderByMostUsed" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="AdminAppsOrderByMostUsed" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[               
                        select 
                        *
                <![CDATA[               
                        select 
                        *
@@ -1340,7 +1387,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')
                                (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
+                  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
+          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 
                        left outer join
                        (select  FN_AUDIT_LOG.AFFECTED_RECORD_ID, COUNT(*) AS total_visits 
                        ) A 
                        left outer join
                        (select  FN_AUDIT_LOG.AFFECTED_RECORD_ID, COUNT(*) AS total_visits 
@@ -1359,8 +1415,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!--Gets personalized list of enabled and accessible NON Super Admin User 
                apps by Most Used -->
        <sql-query name="getUserAppsOrderByMostUsed">
        <!--Gets personalized list of enabled and accessible NON Super Admin User 
                apps by Most Used -->
        <sql-query name="getUserAppsOrderByMostUsed">
-               <return alias="UserAppsOrderByMostUsed" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="UserAppsOrderByMostUsed" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[ 
                        select * from 
                        (select
                <![CDATA[ 
                        select * from 
                        (select
@@ -1380,7 +1435,17 @@ 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'))
                                (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'))
-                       ))A 
+                       )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
+          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 
                        left outer join
                        (select  FN_AUDIT_LOG.AFFECTED_RECORD_ID, COUNT(*) AS total_visits 
                        from FN_APP LEFT JOIN FN_AUDIT_LOG 
                        left outer join
                        (select  FN_AUDIT_LOG.AFFECTED_RECORD_ID, COUNT(*) AS total_visits 
                        from FN_APP LEFT JOIN FN_AUDIT_LOG 
@@ -1397,8 +1462,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!--Gets personalized list of enabled and accessible Super Admin apps by 
                Manual -->
        <sql-query name="getAdminAppsOrderByManual">
        <!--Gets personalized list of enabled and accessible Super Admin apps by 
                Manual -->
        <sql-query name="getAdminAppsOrderByManual">
-               <return alias="AdminAppsOrderByManual" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="AdminAppsOrderByManual" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[ 
                        select * from                   
                        (select
                <![CDATA[ 
                        select * from                   
                        (select
@@ -1420,7 +1484,17 @@ 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')
                                (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')
-                       )) A
+                       )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
+          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
                        left outer join
                         (select m.app_id, m.sort_order 
                        from ep_pers_user_app_man_sort m
                        left outer join
                         (select m.app_id, m.sort_order 
                        from ep_pers_user_app_man_sort m
@@ -1436,8 +1510,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!--Gets personalized list of enabled and accessible NON Super admin User 
                apps by Manual -->
        <sql-query name="getUserAppsOrderByManual">
        <!--Gets personalized list of enabled and accessible NON Super admin User 
                apps by Manual -->
        <sql-query name="getUserAppsOrderByManual">
-               <return alias="UserAppsOrderByManual" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="UserAppsOrderByManual" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[ 
                                                        select * from   (select
                                distinct  -- multiple roles yield multiple rows
                <![CDATA[ 
                                                        select * from   (select
                                distinct  -- multiple roles yield multiple rows
@@ -1456,7 +1529,17 @@ 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'))
                                (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'))
-                       )) A
+                       )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
+          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
                        left outer join
                         (select m.app_id, m.sort_order 
                        from ep_pers_user_app_man_sort m
                        left outer join
                         (select m.app_id, m.sort_order 
                        from ep_pers_user_app_man_sort m
@@ -1472,7 +1555,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                statuses -->
        <sql-query name="getUserAppCatalog">
                <return alias="userAppCatalog"
                statuses -->
        <sql-query name="getUserAppCatalog">
                <return alias="userAppCatalog"
-                       class="org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem" />
+                       class="org.onap.portalapp.portal.ecomp.model.AppCatalogItem" />
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                                                select 
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                                                select 
@@ -1517,19 +1600,24 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        </sql-query>
 
        <sql-query name="getMyloginAppDetails">
        </sql-query>
 
        <sql-query name="getMyloginAppDetails">
-               <return alias="myloginAppDetails" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="myloginAppDetails" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[ 
                SELECT * FROM fn_app  where ml_app_name =:appName
                ;               
                ]]>
        </sql-query>
        
                <![CDATA[ 
                SELECT * FROM fn_app  where ml_app_name =:appName
                ;               
                ]]>
        </sql-query>
        
+       <sql-query name="getAppDetailsByAppName">
+               <return alias="appDetailsByAppName" class="org.onap.portalapp.portal.domain.EPApp" />
+               <![CDATA[ 
+               SELECT * FROM fn_app  where app_name =:appName
+               ;               
+               ]]>
+       </sql-query>
+       
                <sql-query name="getMyAppDetailsByUebKey">
                <sql-query name="getMyAppDetailsByUebKey">
-               <return alias="myAppDetailsByUebKey" class="org.openecomp.portalapp.portal.domain.EPApp" />
-               
+               <return alias="myAppDetailsByUebKey" class="org.onap.portalapp.portal.domain.EPApp" />
                <![CDATA[ 
                <![CDATA[ 
-                               
                SELECT * FROM fn_app  where ueb_key =:appKey
                ;               
                ]]>
                SELECT * FROM fn_app  where ueb_key =:appKey
                ;               
                ]]>
@@ -1565,19 +1653,56 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        </sql-query>
 
        <sql-query name="getAppRoles">
        </sql-query>
 
        <sql-query name="getAppRoles">
-               <return alias="appRoles" class="org.openecomp.portalapp.portal.domain.EPRole" />
-               
+               <return alias="appRoles" class="org.onap.portalapp.portal.domain.EPRole" />
                <![CDATA[ 
                SELECT * FROM fn_role where role_name =:roleName and app_id =:appId
                ;               
                ]]>
        </sql-query>
        
                <![CDATA[ 
                SELECT * FROM fn_role where role_name =:roleName and app_id =:appId
                ;               
                ]]>
        </sql-query>
        
+       <sql-query name="getPartnerAppRolesList">
+               <return alias="partnerAppRolesList" class="org.onap.portalapp.portal.domain.EPRole" />
+               <![CDATA[ 
+               SELECT * FROM fn_role where app_id =:appId
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getPortalAppRolesList">
+               <return alias="portalAppRolesList" class="org.onap.portalapp.portal.domain.EPRole" />
+               <![CDATA[ 
+               SELECT * FROM fn_role where app_id is null
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getPortalAppRoleByRoleId">
+               <return alias="portalAppByRoleId" class="org.onap.portalapp.portal.domain.EPRole" />
+               <![CDATA[ 
+               SELECT * FROM fn_role where role_id =:roleId and app_id is null
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getPartnerAppRoleByRoleId">
+               <return alias="portalAppByRoleId" class="org.onap.portalapp.portal.domain.EPRole" />
+               <![CDATA[ 
+               SELECT * FROM fn_role where app_role_id =:appRoleId and app_id =:appId
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getPartnerAppRoleById">
+               <return alias="portalAppByRoleId" class="org.onap.portalapp.portal.domain.EPRole" />
+               <![CDATA[ 
+               SELECT * FROM fn_role where role_id =:appRoleId and app_id =:appId
+               ;               
+               ]]>
+       </sql-query>
+       
        <sql-query name="getPortalAppRoles">
        <sql-query name="getPortalAppRoles">
-               <return alias="appRoles" class="org.openecomp.portalapp.portal.domain.EPRole" />
-               
+               <return alias="appRoles" class="org.onap.portalapp.portal.domain.EPRole" />
                <![CDATA[ 
                <![CDATA[ 
-                               
                SELECT * FROM fn_role where role_name =:appRoleName and app_id is null
                ;               
                ]]>
                SELECT * FROM fn_role where role_name =:appRoleName and app_id is null
                ;               
                ]]>
@@ -1585,7 +1710,6 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="deleteMicroserviceParameter">
                <![CDATA[ 
 
        <sql-query name="deleteMicroserviceParameter">
                <![CDATA[ 
-                               
                DELETE FROM ep_microservice_parameter WHERE service_id =:serviceId
                ;               
                ]]>
                DELETE FROM ep_microservice_parameter WHERE service_id =:serviceId
                ;               
                ]]>
@@ -1593,7 +1717,6 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        
        <sql-query name="deleteMicroserviceParameterById">
                <![CDATA[ 
        
        <sql-query name="deleteMicroserviceParameterById">
                <![CDATA[ 
-                               
                DELETE FROM ep_microservice_parameter WHERE id =:paramId
                ;               
                ]]>
                DELETE FROM ep_microservice_parameter WHERE id =:paramId
                ;               
                ]]>
@@ -1601,7 +1724,6 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        
        <sql-query name="deleteWidgetCatalogParameter">
                <![CDATA[ 
        
        <sql-query name="deleteWidgetCatalogParameter">
                <![CDATA[ 
-                               
                DELETE FROM ep_widget_catalog_parameter WHERE param_id =:paramId
                ;               
                ]]>
                DELETE FROM ep_widget_catalog_parameter WHERE param_id =:paramId
                ;               
                ]]>
@@ -1609,17 +1731,14 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="deleteMicroservice">
                <![CDATA[ 
 
        <sql-query name="deleteMicroservice">
                <![CDATA[ 
-                               
                DELETE FROM ep_microservice WHERE id =:serviceId
                ;               
                ]]>
        </sql-query>
 
        <sql-query name="epUserAppId">
                DELETE FROM ep_microservice WHERE id =:serviceId
                ;               
                ]]>
        </sql-query>
 
        <sql-query name="epUserAppId">
-               <return alias="userAppId" class="org.openecomp.portalapp.portal.domain.EPUser" />
-               
+               <return alias="userAppId" class="org.onap.portalapp.portal.domain.EPUser" />
                <![CDATA[ 
                <![CDATA[ 
-                               
                SELECT * FROM  FN_USER  where ORG_USER_ID = :orgUserIdValue
                ;               
                ]]>
                SELECT * FROM  FN_USER  where ORG_USER_ID = :orgUserIdValue
                ;               
                ]]>
@@ -1627,10 +1746,8 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="userAppsSortPreferenceQuery">
                <return alias="appsSortPreferenceQuery"
 
        <sql-query name="userAppsSortPreferenceQuery">
                <return alias="appsSortPreferenceQuery"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppsSortPreference" />
-               
+                       class="org.onap.portalapp.portal.domain.EPUserAppsSortPreference" />
                <![CDATA[ 
                <![CDATA[ 
-                               
                SELECT * from  EP_PERS_USER_APP_SORT e where e.USER_ID = :userId
                                
                ]]>
                SELECT * from  EP_PERS_USER_APP_SORT e where e.USER_ID = :userId
                                
                ]]>
@@ -1638,10 +1755,8 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="userAppsManualSortPrfQuery">
                <return alias="AppsManualSortPrfQuery"
 
        <sql-query name="userAppsManualSortPrfQuery">
                <return alias="AppsManualSortPrfQuery"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppsManualSortPreference" />
-               
+                       class="org.onap.portalapp.portal.domain.EPUserAppsManualSortPreference" />
                <![CDATA[ 
                <![CDATA[ 
-                               
                SELECT * from  EP_PERS_USER_APP_MAN_SORT where USER_ID =:userId
                                
                ]]>
                SELECT * from  EP_PERS_USER_APP_MAN_SORT where USER_ID =:userId
                                
                ]]>
@@ -1649,7 +1764,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="userWidgetManualSortPrfQuery">
                <return alias="widgetManualSortPrfQuery"
 
        <sql-query name="userWidgetManualSortPrfQuery">
                <return alias="widgetManualSortPrfQuery"
-                       class="org.openecomp.portalapp.portal.domain.EPWidgetsManualSortPreference" />
+                       class="org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference" />
                <![CDATA[ 
                SELECT * from  EP_PERS_USER_WIDGET_PLACEMENT where USER_ID =:userId
                ]]>
                <![CDATA[ 
                SELECT * from  EP_PERS_USER_WIDGET_PLACEMENT where USER_ID =:userId
                ]]>
@@ -1657,7 +1772,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="appRoles">
                <return alias="rolesForApp"
 
        <sql-query name="appRoles">
                <return alias="rolesForApp"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppRoles" />
+                       class="org.onap.portalapp.portal.domain.EPUserAppRoles" />
                <![CDATA[ 
                        SELECT ROLE_ID, APP_ID from FN_ROLE where APP_ROLE_ID = :appRoleId and app_id = :appId
                        ;
                <![CDATA[ 
                        SELECT ROLE_ID, APP_ID from FN_ROLE where APP_ROLE_ID = :appRoleId and app_id = :appId
                        ;
@@ -1666,7 +1781,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="userAppRolesRequestList">
                <return alias="appRolesRequestList"
 
        <sql-query name="userAppRolesRequestList">
                <return alias="appRolesRequestList"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest" />
+                       class="org.onap.portalapp.portal.domain.EPUserAppRolesRequest" />
                <![CDATA[ 
                        SELECT req_id, user_id, app_id, created_date, updated_date, request_status from  EP_USER_ROLES_REQUEST where user_id =:userId and app_id=:appId and request_status = 'P'
                        ;
                <![CDATA[ 
                        SELECT req_id, user_id, app_id, created_date, updated_date, request_status from  EP_USER_ROLES_REQUEST where user_id =:userId and app_id=:appId and request_status = 'P'
                        ;
@@ -1675,7 +1790,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="userAppRolesRequestDetailList">
                <return alias="appRolesRequestDetailList"
 
        <sql-query name="userAppRolesRequestDetailList">
                <return alias="appRolesRequestDetailList"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppRolesRequestDetail" />
+                       class="org.onap.portalapp.portal.domain.EPUserAppRolesRequestDetail" />
                <![CDATA[ 
                
                        SELECT  id, req_id, requested_role_id, request_type from  EP_USER_ROLES_REQUEST_DET where req_id =:reqId
                <![CDATA[ 
                
                        SELECT  id, req_id, requested_role_id, request_type from  EP_USER_ROLES_REQUEST_DET where req_id =:reqId
@@ -1686,7 +1801,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets list of enabled apps including accessible and select statuses -->
        <sql-query name="getAdminAppCatalog">
                <return alias="adminAppCatalog"
        <!-- Gets list of enabled apps including accessible and select statuses -->
        <sql-query name="getAdminAppCatalog">
                <return alias="adminAppCatalog"
-                       class="org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem" />
+                       class="org.onap.portalapp.portal.ecomp.model.AppCatalogItem" />
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                        select 
                <!-- This query requires one parameter: userId (number) -->
                <![CDATA[
                        select 
@@ -1735,7 +1850,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="userAppCatalogRoles">
                <return alias="epUserAppCatalogRoles"
 
        <sql-query name="userAppCatalogRoles">
                <return alias="epUserAppCatalogRoles"
-                       class="org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles" />
+                       class="org.onap.portalapp.portal.domain.EPUserAppCatalogRoles" />
                <![CDATA[ 
         select  a.req_id, B.requested_role_id ,  A.request_status  , A.app_id , (select role_name from fn_role where role_id = B.requested_role_id) as role_name
        from ep_user_roles_request A left join ep_user_roles_request_det B
                <![CDATA[ 
         select  a.req_id, B.requested_role_id ,  A.request_status  , A.app_id , (select role_name from fn_role where role_id = B.requested_role_id) as role_name
        from ep_user_roles_request A left join ep_user_roles_request_det B
@@ -1749,8 +1864,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
        <sql-query name="getUserApproles">
                <return alias="businessCardUserApplicationRoles"
 
        <sql-query name="getUserApproles">
                <return alias="businessCardUserApplicationRoles"
-                       class="org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole" />
-               
+                       class="org.onap.portalapp.portal.transport.BusinessCardApplicationRole" />
                <![CDATA[
                
                select   fr.role_name, fa.app_name 
                <![CDATA[
                
                select   fr.role_name, fa.app_name 
@@ -1764,7 +1878,6 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
      
     <!--delete the records from ep_notification table when the endtime is more than 3 months-->
        <sql-query name="deleteNotificationsFromEpNotificationTable">
      
     <!--delete the records from ep_notification table when the endtime is more than 3 months-->
        <sql-query name="deleteNotificationsFromEpNotificationTable">
-               
                <![CDATA[
                delete from ep_notification where  curdate() >= DATE_ADD(end_time,INTERVAL 3 MONTH)
                ]]>
                <![CDATA[
                delete from ep_notification where  curdate() >= DATE_ADD(end_time,INTERVAL 3 MONTH)
                ]]>
@@ -1773,7 +1886,6 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
 
                <!-- delete the records from ep_role_notification table when the endtime is more than 3 months -->
        <sql-query name="deleteNotificationsFromEpRoleNotificationTable">
 
                <!-- delete the records from ep_role_notification table when the endtime is more than 3 months -->
        <sql-query name="deleteNotificationsFromEpRoleNotificationTable">
-               
                <![CDATA[
        delete from ep_role_notification where  notification_id in (select notification_id from ep_notification where  curdate() >= DATE_ADD(end_time,INTERVAL 3 MONTH))
                ]]>
                <![CDATA[
        delete from ep_role_notification where  notification_id in (select notification_id from ep_notification where  curdate() >= DATE_ADD(end_time,INTERVAL 3 MONTH))
                ]]>
@@ -1781,7 +1893,6 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        
        <!-- delete the records from ep_user_notification table when the endtime is more than 3 months-->
        <sql-query name="deleteNotificationsFromEpUserNotificationTable">
        
        <!-- delete the records from ep_user_notification table when the endtime is more than 3 months-->
        <sql-query name="deleteNotificationsFromEpUserNotificationTable">
-               
                <![CDATA[
        delete from ep_user_notification where  notification_id in (select notification_id from ep_notification where  curdate() >= DATE_ADD(end_time,INTERVAL 3 MONTH))
                ]]>
                <![CDATA[
        delete from ep_user_notification where  notification_id in (select notification_id from ep_notification where  curdate() >= DATE_ADD(end_time,INTERVAL 3 MONTH))
                ]]>
@@ -1790,7 +1901,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets list of role functions and it requires two parameters appId and roleId-->
        <sql-query name="getAppRoleFunctionList">
                <return alias="appRoleFunctionList"
        <!-- Gets list of role functions and it requires two parameters appId and roleId-->
        <sql-query name="getAppRoleFunctionList">
                <return alias="appRoleFunctionList"
-                       class="org.openecomp.portalapp.portal.domain.CentralRoleFunction" />
+                       class="org.onap.portalapp.portal.domain.CentralV2RoleFunction" />
                <![CDATA[ 
                        
                        SELECT DISTINCT f.app_id , f.function_cd, f.function_name from ep_app_role_function rf, ep_app_function f  
                <![CDATA[ 
                        
                        SELECT DISTINCT f.app_id , f.function_cd, f.function_name from ep_app_role_function rf, ep_app_function f  
@@ -1803,7 +1914,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets list of all role functions -->
        <sql-query name="getAllRoleFunctions">
                <return alias="allRoleFunctions"
        <!-- Gets list of all role functions -->
        <sql-query name="getAllRoleFunctions">
                <return alias="allRoleFunctions"
-                       class="org.openecomp.portalapp.portal.domain.CentralRoleFunction" />
+                       class="org.onap.portalapp.portal.domain.CentralV2RoleFunction" />
                <![CDATA[ 
                        
                        SELECT * from ep_app_function where app_id =:appId
                <![CDATA[ 
                        
                        SELECT * from ep_app_function where app_id =:appId
@@ -1815,7 +1926,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Get ep_app_function records provided by single parameter -->
        <sql-query name="getRoleFunction">
                <return alias="RoleFunction"
        <!-- Get ep_app_function records provided by single parameter -->
        <sql-query name="getRoleFunction">
                <return alias="RoleFunction"
-                       class="org.openecomp.portalapp.portal.domain.CentralRoleFunction" />
+                       class="org.onap.portalapp.portal.domain.CentralV2RoleFunction" />
                        <![CDATA[
                        
                        SELECT * from ep_app_function where function_cd like CONCAT('%', :functionCode,'%') and app_id =:appId
                        <![CDATA[
                        
                        SELECT * from ep_app_function where function_cd like CONCAT('%', :functionCode,'%') and app_id =:appId
@@ -1827,7 +1938,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets the current user app roles records and requires two parameters  -->
        <sql-query name="getUserAppCurrentRoles">
                <return alias="userAppCurrentRoles"
        <!-- Gets the current user app roles records and requires two parameters  -->
        <sql-query name="getUserAppCurrentRoles">
                <return alias="userAppCurrentRoles"
-                       class="org.openecomp.portalapp.portal.transport.EPUserAppCurrentRoles" />
+                       class="org.onap.portalapp.portal.transport.EPUserAppCurrentRoles" />
                        <![CDATA[
                        
                        select distinct fu.role_id, fr.user_id, fu.role_name, fu.priority from fn_role fu left outer join fn_user_role fr ON fu.role_id = fr.role_id and fu.app_id = fr.app_id and fr.role_id != 999 where fu.app_id =:appId and fr.user_id =:userId
                        <![CDATA[
                        
                        select distinct fu.role_id, fr.user_id, fu.role_name, fu.priority from fn_role fu left outer join fn_user_role fr ON fu.role_id = fr.role_id and fu.app_id = fr.app_id and fr.role_id != 999 where fu.app_id =:appId and fr.user_id =:userId
@@ -1838,7 +1949,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets the current user app roles along with account administrator and requires two parameters  -->
        <sql-query name="getUserAppExistingRoles">
                <return alias="userAppExistingRoles"
        <!-- Gets the current user app roles along with account administrator and requires two parameters  -->
        <sql-query name="getUserAppExistingRoles">
                <return alias="userAppExistingRoles"
-                       class="org.openecomp.portalapp.portal.transport.EcompUserAppRoles" />
+                       class="org.onap.portalapp.portal.transport.EcompUserAppRoles" />
                        <![CDATA[
                        select fr.role_name, fu.app_id, fu.user_id, fu.priority, fu.role_id from fn_user_role fu 
                        left outer join fn_role fr on fu.role_id = fr.role_id 
                        <![CDATA[
                        select fr.role_name, fu.app_id, fu.user_id, fu.priority, fu.role_id from fn_user_role fu 
                        left outer join fn_role fr on fu.role_id = fr.role_id 
@@ -1850,7 +1961,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets the current user app roles records and requires two parameters  -->
        <sql-query name="getAllFunctions">
                <return alias="allFunctions"
        <!-- Gets the current user app roles records and requires two parameters  -->
        <sql-query name="getAllFunctions">
                <return alias="allFunctions"
-                       class="org.openecomp.portalsdk.core.domain.RoleFunction" />
+                       class="org.onap.portalsdk.core.domain.RoleFunction" />
                        <![CDATA[       
                        select * from fn_function
                        ;               
                        <![CDATA[       
                        select * from fn_function
                        ;               
@@ -1860,15 +1971,15 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        <!-- Gets the  all role functions and requires one parameters -->
        <sql-query name="uploadAllRoleFunctions">
                <return alias="allRoleFunctions"
        <!-- Gets the  all role functions and requires one parameters -->
        <sql-query name="uploadAllRoleFunctions">
                <return alias="allRoleFunctions"
-                       class="org.openecomp.portalapp.portal.transport.BulkUploadRoleFunction" />
+                       class="org.onap.portalapp.portal.transport.BulkUploadRoleFunction" />
                        <![CDATA[       
                                select fr.function_cd, fn.function_name from fn_role_function fr left outer join fn_function fn on fr.function_cd = fn.function_cd where role_id =:roleId
                                ;               
                        ]]>
        </sql-query>
 
                        <![CDATA[       
                                select fr.function_cd, fn.function_name from fn_role_function fr left outer join fn_function fn on fr.function_cd = fn.function_cd where role_id =:roleId
                                ;               
                        ]]>
        </sql-query>
 
-       <sql-query name="getRoletoUpdateAAF">
-               <return alias="getRoletoUpdateAAF" class="org.openecomp.portalapp.portal.domain.EPRole" />
+       <sql-query name="getRoletoUpdateInExternalAuthSystem">
+               <return alias="roletoUpdateInExternalAuthSystem" class="org.onap.portalapp.portal.domain.EPRole" />
                        <![CDATA[
                                        SELECT * FROM fn_role where role_name =:appRoleName and app_id =:appId
                        ;               
                        <![CDATA[
                                        SELECT * FROM fn_role where role_name =:appRoleName and app_id =:appId
                        ;               
@@ -1876,18 +1987,29 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        </sql-query>
 
        <sql-query name="getBulkUserRoles">
        </sql-query>
 
        <sql-query name="getBulkUserRoles">
-               <return alias="bulkUserRoles" class="org.openecomp.portalapp.portal.transport.BulkUploadUserRoles" />
+               <return alias="bulkUserRoles" class="org.onap.portalapp.portal.transport.BulkUploadUserRoles" />
                        <![CDATA[
                        select fr.role_name, fu.org_user_id, fa.auth_namespace from fn_user_role fur 
                        left outer join fn_role fr on fr.role_id = fur.role_id 
                        left outer join fn_app fa on fa.app_id = fur.app_id
                        <![CDATA[
                        select fr.role_name, fu.org_user_id, fa.auth_namespace from fn_user_role fur 
                        left outer join fn_role fr on fr.role_id = fur.role_id 
                        left outer join fn_app fa on fa.app_id = fur.app_id
-                       left outer join fn_user fu on fu.user_id = fur.user_id where fa.ueb_key =:uebKey and fu.org_user_id != 'su1234' 
+                       left outer join fn_user fu on fu.user_id = fur.user_id where fa.ueb_key =:uebKey
+                       ;       
+                       ]]>
+       </sql-query>
+       
+       <sql-query name="getBulkUsersForSingleRole">
+               <return alias="bulkUsersForSingleRole" class="org.onap.portalapp.portal.transport.BulkUploadUserRoles" />
+                       <![CDATA[
+                       select fr.role_name, fu.org_user_id, fa.auth_namespace from fn_user_role fur 
+                       left outer join fn_role fr on fr.role_id = fur.role_id 
+                       left outer join fn_app fa on fa.app_id = fur.app_id
+                       left outer join fn_user fu on fu.user_id = fur.user_id where fa.ueb_key =:uebKey and fr.role_id =:roleId
                        ;       
                        ]]>
        </sql-query>
        
        <sql-query name="getCentralizedApps">
                        ;       
                        ]]>
        </sql-query>
        
        <sql-query name="getCentralizedApps">
-               <return alias="centralizedApps" class="org.openecomp.portalapp.portal.domain.EPApp" />
+               <return alias="centralizedApps" class="org.onap.portalapp.portal.domain.EPApp" />
                        <![CDATA[
                        select * from fn_app where auth_central = 'Y' and open = 'N';
                        ;       
                        <![CDATA[
                        select * from fn_app where auth_central = 'Y' and open = 'N';
                        ;       
@@ -1895,8 +2017,7 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
        </sql-query>
        
        <sql-query name="getUserRoles">
        </sql-query>
        
        <sql-query name="getUserRoles">
-                       <return alias="getUserRolesList" class="org.openecomp.portalapp.portal.domain.UserRole" />
-       
+                       <return alias="getUserRolesList" class="org.onap.portalapp.portal.domain.UserRole" />
                <![CDATA[ 
                                
         SELECT DISTINCT user.USER_ID, role.ROLE_ID, user.org_user_id, user.FIRST_NAME, user.LAST_NAME, role.ROLE_NAME  FROM fn_user_role userrole INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID INNER JOIN fn_role role ON role.ROLE_ID = userrole.ROLE_ID WHERE user.org_user_id =:org_user_id and userrole.app_id = 1 
                <![CDATA[ 
                                
         SELECT DISTINCT user.USER_ID, role.ROLE_ID, user.org_user_id, user.FIRST_NAME, user.LAST_NAME, role.ROLE_NAME  FROM fn_user_role userrole INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID INNER JOIN fn_role role ON role.ROLE_ID = userrole.ROLE_ID WHERE user.org_user_id =:org_user_id and userrole.app_id = 1 
@@ -1910,12 +2031,20 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                        and fu.app_id = ep.app_id
                        and fu.user_id =:userId and ep.app_id = 1
                        and ea.function_cd = ep.function_cd
                        and fu.app_id = ep.app_id
                        and fu.user_id =:userId and ep.app_id = 1
                        and ea.function_cd = ep.function_cd
-                       ;       
+                   union
+            select distinct app_r_f.function_cd from ep_app_role_function app_r_f, ep_app_function a_f
+                       where role_id = 999
+                       and app_r_f.function_cd = a_f.function_cd
+                       and exists
+                       (
+                       select fa.app_id from fn_user fu, fn_user_role ur, fn_app fa where fu.user_id =:userId and fu.user_id = ur.user_id
+                       and ur.role_id = 999 and ur.app_id = fa.app_id and fa.enabled = 'Y'
+                       );
                        ]]>
        </sql-query>
        
        <sql-query name="getUserRolesForLeftMenu">
                        ]]>
        </sql-query>
        
        <sql-query name="getUserRolesForLeftMenu">
-                       <return alias="getUserRolesListForLeftMenu" class="org.openecomp.portalapp.portal.domain.UserRole" />
+                       <return alias="getUserRolesListForLeftMenu" class="org.onap.portalapp.portal.domain.UserRole" />
        
                <![CDATA[ 
                SELECT DISTINCT user.USER_ID, role.ROLE_ID, user.org_user_id, user.FIRST_NAME, user.LAST_NAME, role.ROLE_NAME  FROM fn_user_role userrole 
        
                <![CDATA[ 
                SELECT DISTINCT user.USER_ID, role.ROLE_ID, user.org_user_id, user.FIRST_NAME, user.LAST_NAME, role.ROLE_NAME  FROM fn_user_role userrole 
@@ -1927,6 +2056,19 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                ]]>
        </sql-query>
        
                ]]>
        </sql-query>
        
+       <sql-query name="getRolesForLeftMenu">
+                       <return alias="getUserRolesListForLeftMenu" class="org.onap.portalapp.portal.domain.UserRole" />
+       
+               <![CDATA[ 
+               SELECT DISTINCT user.USER_ID, role.ROLE_ID, user.org_user_id, user.FIRST_NAME, user.LAST_NAME, role.ROLE_NAME  FROM fn_user_role userrole 
+        INNER JOIN fn_user user ON user.USER_ID = userrole.USER_ID 
+        INNER JOIN fn_app app ON app.app_id= userrole.app_id
+        INNER JOIN fn_role role ON role.ROLE_ID = userrole.ROLE_ID 
+        WHERE user.org_user_id =:org_user_id and (userrole.app_id = 1 or role.role_id =   999) and ((app.enabled='Y' and auth_central='Y' ) or app.app_id=1)
+        ;
+               ]]>
+       </sql-query>
+       
        <!-- Gets all functions for an application along with global functions and requires single parameter -->
        <sql-query name="getMenuFunctions">
                <![CDATA[ 
        <!-- Gets all functions for an application along with global functions and requires single parameter -->
        <sql-query name="getMenuFunctions">
                <![CDATA[ 
@@ -1934,21 +2076,21 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                        where f.app_id =:appId
                        UNION
                        select epa.function_cd from fn_role fnr, ep_app_role_function epr, ep_app_function epa where epr.role_id = fnr.role_id
                        where f.app_id =:appId
                        UNION
                        select epa.function_cd from fn_role fnr, ep_app_role_function epr, ep_app_function epa where epr.role_id = fnr.role_id
-                       and epa.function_cd = epr.function_cd and fnr.role_name like 'global%'
+                       and epa.function_cd = epr.function_cd and fnr.role_name like 'global%' and fnr.app_id is null and epr.app_id = 1
                 ;
                ]]>
        </sql-query>
        
        <sql-query name="getRequestIdsForApp">
                 ;
                ]]>
        </sql-query>
        
        <sql-query name="getRequestIdsForApp">
-       <return alias="getRequestIdsForApp" class="org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest" />
+       <return alias="getRequestIdsForApp" class="org.onap.portalapp.portal.domain.EPUserAppRolesRequest" />
                <![CDATA[ 
                select * from ep_user_roles_request where app_id =:app_id
                ;
                ]]>
        </sql-query>
                <![CDATA[ 
                select * from ep_user_roles_request where app_id =:app_id
                ;
                ]]>
        </sql-query>
-       
+
        <sql-query name="ApplicationUserRoles">
        <sql-query name="ApplicationUserRoles">
-               <return alias="ApplicationUserRoles" class="org.openecomp.portalapp.portal.transport.EcompUserRoles" />
+               <return alias="ApplicationUserRoles" class="org.onap.portalapp.portal.transport.EcompUserRoles" />
                <![CDATA[ 
                    select distinct fu.org_id, fu.manager_id, fu.first_name, fu.middle_name, fu.last_name, fu.phone, fu.email, fu.hrid, fu.org_user_id, fu.org_code, fu.org_manager_userid, fu.job_title, fu.login_id, 
                        fu.active_yn , fr.app_role_id, fr.role_name
                <![CDATA[ 
                    select distinct fu.org_id, fu.manager_id, fu.first_name, fu.middle_name, fu.last_name, fu.phone, fu.email, fu.hrid, fu.org_user_id, fu.org_code, fu.org_manager_userid, fu.job_title, fu.login_id, 
                        fu.active_yn , fr.app_role_id, fr.role_name
@@ -1962,6 +2104,35 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                ]]>
        </sql-query>
        
                ]]>
        </sql-query>
        
+       <sql-query name="getCurrentAppRoleFunctions">
+               <return alias="ApplicationUserRoles" class="org.onap.portalapp.portal.transport.LocalRole" />
+               <![CDATA[ 
+               select distinct fr.role_id, fr.role_name  from fn_role fr, ep_app_function ef, ep_app_role_function epr where fr.role_id = epr.role_id and epr.function_cd = ef.function_cd
+               and ef.function_cd =:functionCd and epr.app_id =:appId
+               ;
+               ]]>
+       </sql-query>
+       
+       <sql-query name="deleteUserWidgetPlacement">
+               <![CDATA[ 
+               DELETE FROM ep_pers_user_widget_placement WHERE user_id =:userId AND widget_id =:widgetId
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getCentralizedAppsOfUser">     
+               <return alias="CentralizedAppsForRoles" class="org.onap.portalapp.portal.domain.CentralizedApp" />      
+               <![CDATA[
+               
+               select distinct fa.app_id, fa.app_name
+               from  fn_role fr, fn_user_role fur, fn_app fa, fn_user fu  
+               Where  fu.user_id =  fur.user_id and fur.role_id = fr.role_id and fa.app_id = fur.app_id 
+               and fu.org_user_id = :userId and (fur.role_id = 999 or fur.role_id = 1) and fr.active_yn='Y' and ((fa.enabled = 'Y' and fa.auth_central='Y') or fa.app_id =1) 
+               ;
+               ]]>
+       </sql-query>
+       
     <query name="getEPUserByOrgUserId">
        <![CDATA[
                FROM EPUser WHERE orgUserId = :org_user_id
     <query name="getEPUserByOrgUserId">
        <![CDATA[
                FROM EPUser WHERE orgUserId = :org_user_id
@@ -1979,5 +2150,193 @@ where fn_role.app_id = fn_app.app_id and fn_app.enabled='Y' and fn_role.active_y
                FROM EPUser WHERE loginId = :login_id and loginPwd = :login_pwd         
        ]]>
     </query>
                FROM EPUser WHERE loginId = :login_id and loginPwd = :login_pwd         
        ]]>
     </query>
-
+    
+    <sql-query name="getGlobalRoleWithApplicationRoleFunctions">       
+               <return alias="getGlobalRoleWithApplicationRoleFunctions" class="org.onap.portalapp.portal.transport.GlobalRoleWithApplicationRoleFunction" />          
+               <![CDATA[
+               
+               select distinct  d.role_id, d.role_name , c.function_cd , e.function_name , d.active_yn , d.priority , c.app_id, c.role_app_id
+               from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e
+               where 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 e.function_cd = c.function_cd and c.app_id= :appId and e.app_id=c.app_id
+               ;
+               ]]>
+       </sql-query>
+       
+     <sql-query name="getGlobalRolesOfPortal">
+               <return alias="getGlobalRolesOfPortal" class="org.onap.portalapp.portal.domain.EPRole" />
+               <![CDATA[ 
+               select * from fn_role where role_name  like 'global_%' and app_id is null and active_yn='Y'
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getAppRoleFunctionOnRoleIdandAppId">
+               <return alias="appRoleFunctionOnRoleIdandAppId" class="org.onap.portalapp.portal.domain.EPAppRoleFunction" />
+               <![CDATA[ 
+               select * from ep_app_role_function where app_id =:appId and role_id =:roleId 
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getAppFunctionOnCodeAndAppId">
+               <return alias="appFunctionOnCodeAndAppId" class="org.onap.portalapp.portal.domain.CentralV2RoleFunction" />
+               <![CDATA[ 
+               select * from ep_app_function where app_id =:appId and function_cd =:functionCd 
+               ;               
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getGlobalRoleForRequestedApp"> 
+               <return alias="getGlobalRoleForRequestedApp" class="org.onap.portalapp.portal.transport.GlobalRoleWithApplicationRoleFunction" />       
+               <![CDATA[
+               
+               select distinct  d.role_id, d.role_name , c.function_cd , e.function_name , d.active_yn , d.priority , c.app_id, c.role_app_id
+        from fn_user_role a, fn_app b, ep_app_role_function c , fn_role d , ep_app_function e
+        where 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 e.function_cd = c.function_cd and c.app_id=:requestedAppId and c.role_id =:roleId and e.app_id = c.app_id
+        ;
+               ]]>
+       </sql-query>
+       
+       <sql-query name="updateMenuFunctionalAndRoles"> 
+               <![CDATA[
+                 UPDATE fn_menu_functional m, fn_menu_functional_roles mr SET m.url='' WHERE m.menu_id=mr.menu_id AND mr.app_id=:app_id        
+                ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove any favorites associated with a menu item that is associated with this app -->
+       <sql-query name="removeAppFromMenuFavorites">   
+               <![CDATA[
+               DELETE FROM fn_menu_favorites using fn_menu_favorites inner join fn_menu_functional_roles where fn_menu_functional_roles.app_id=:app_id AND fn_menu_functional_roles.menu_id=fn_menu_favorites.menu_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove all role, appid records from fn_menu_functional_role that is associated with this app -->
+       <sql-query name="removeAppFromMenuFunctionalRoles">     
+               <![CDATA[
+               DELETE FROM fn_menu_functional_roles WHERE app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove all roles, rolefunctions, appid records from ep_app_role_function that is associated with this app -->
+       <sql-query name="removeAppFromEpAppRoleFunction">       
+               <![CDATA[
+               DELETE FROM ep_app_role_function WHERE app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove all rolefunctions, appid records from ep_app_function that is associated with this app -->
+       <sql-query name="removeAppFromEpAppFunction">   
+               <![CDATA[
+               DELETE FROM ep_app_function WHERE app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove all records from fn_user_role associated with this app that is associated with this app -->
+       <sql-query name="removeAppFromFnUserRole">      
+               <![CDATA[
+               DELETE FROM fn_user_role WHERE app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove any widgets that is associated with this app-->
+       <sql-query name="removeAppFromEpWidgetCatalogRole">     
+               <![CDATA[
+               DELETE FROM ep_widget_catalog_role WHERE app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove any notifications that is associated with this app-->
+       <sql-query name="removeAppFromEpRoleNotification">      
+               <![CDATA[
+               DELETE FROM ep_role_notification using ep_role_notification inner join fn_role 
+               where fn_role.app_id=:app_id and ep_role_notification.role_id= fn_role.role_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove all records from fn_role that is associated with this app-->
+       <sql-query name="removeAppFromFnRole">  
+               <![CDATA[
+               DELETE FROM fn_role where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove app contact us entries that is associated with this app-->
+       <sql-query name="removeAppFromAppContactUs">    
+               <![CDATA[
+               DELETE FROM fn_app_contact_us where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove app personalization entries that is associated with this app-->
+       <sql-query name="removeAppFromEpPersUserAppSel">        
+               <![CDATA[
+               DELETE FROM fn_pers_user_app_sel where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove app personalization sorting entries that is associated with this app-->
+       <sql-query name="removeAppFromEpPersUserAppManSort">    
+               <![CDATA[
+               DELETE FROM ep_pers_user_app_man_sort where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove rows from user role request table entries that is associated with this app-->
+       <sql-query name="removeAppFromEpUserRolesRequest">      
+               <![CDATA[
+               DELETE FROM ep_user_roles_request where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove rows from web analytics table entries that is associated with this app-->
+       <sql-query name="removeAppFromEpWebAnalytics">  
+               <![CDATA[
+               DELETE FROM ep_web_analytics_source where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <!-- Remove row from fn app table -->
+       <sql-query name="removeAppFromFnApp">   
+               <![CDATA[
+               DELETE FROM fn_app where app_id=:app_id
+               ;
+               ]]>
+       </sql-query>
+       
+       <sql-query name="getUserRoleOnUserIdAndRoleIdAndAppId"> 
+               <return alias="getUserRoleOnUserIdAndRoleIdAndAppId" class="org.onap.portalapp.portal.domain.EPUserApp" />      
+               <![CDATA[
+               
+               select * from fn_user_role where user_id= :userId 
+               and role_id= :roleId 
+               and app_id= :appId
+               ; 
+               ]]>
+       </sql-query>    
+       
+    <query name="getBasicauthAccount">
+      select id,password from BasicAuthCredentials
+    </query>
+    
+     <query name="getMicroserviceInfo">
+      select id,password from MicroserviceData
+    </query>
+       
 </hibernate-mapping>
 </hibernate-mapping>
index 1a72eae..819a521 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -45,7 +45,7 @@
 Publishes mappings and queries for EP SDK library features ONLY.
 Portal app mappings and features are in EP.hbm.xml.
 -->
 Publishes mappings and queries for EP SDK library features ONLY.
 Portal app mappings and features are in EP.hbm.xml.
 -->
-<hibernate-mapping package="org.openecomp.portalsdk.core.domain">
+<hibernate-mapping package="org.onap.portalsdk.core.domain">
 
      <!-- User class mapping details -->
     <class name="User" table="FN_USER">
 
      <!-- User class mapping details -->
     <class name="User" table="FN_USER">
@@ -104,12 +104,12 @@ Portal app mappings and features are in EP.hbm.xml.
                
         <set name="userApps" table="FN_USER_ROLE" lazy="false" sort="natural" inverse="true" cascade="all-delete-orphan">
             <key column="user_id"/>
                
         <set name="userApps" table="FN_USER_ROLE" lazy="false" sort="natural" inverse="true" cascade="all-delete-orphan">
             <key column="user_id"/>
-            <one-to-many class="org.openecomp.portalsdk.core.domain.UserApp" />
+            <one-to-many class="org.onap.portalsdk.core.domain.UserApp" />
         </set>
 
         <set name="pseudoRoles" table="FN_USER_PSEUDO_ROLE" lazy="false" sort="natural">
             <key column="user_id"/>
         </set>
 
         <set name="pseudoRoles" table="FN_USER_PSEUDO_ROLE" lazy="false" sort="natural">
             <key column="user_id"/>
-            <many-to-many column="pseudo_role_id" class="org.openecomp.portalsdk.core.domain.Role" />
+            <many-to-many column="pseudo_role_id" class="org.onap.portalsdk.core.domain.Role" />
         </set>
     </class>
 
         </set>
     </class>
 
@@ -118,8 +118,8 @@ Portal app mappings and features are in EP.hbm.xml.
             <key-property name="userId" type="long">
                 <column name="user_id" precision="11" scale="0" />
             </key-property>
             <key-property name="userId" type="long">
                 <column name="user_id" precision="11" scale="0" />
             </key-property>
-               <key-many-to-one name="app" class="org.openecomp.portalsdk.core.domain.App" column="app_id" />
-               <key-many-to-one name="role" class="org.openecomp.portalsdk.core.domain.Role" column="role_id" />
+               <key-many-to-one name="app" class="org.onap.portalsdk.core.domain.App" column="app_id" />
+               <key-many-to-one name="role" class="org.onap.portalsdk.core.domain.Role" column="role_id" />
         </composite-id>
         <property name="priority" type="java.lang.Short">
             <column name="priority" precision="4" scale="0" />
         </composite-id>
         <property name="priority" type="java.lang.Short">
             <column name="priority" precision="4" scale="0" />
@@ -149,17 +149,17 @@ Portal app mappings and features are in EP.hbm.xml.
 
         <set name="roleFunctions" table="FN_ROLE_FUNCTION" lazy="false" sort="natural">
             <key column="role_id"/>
 
         <set name="roleFunctions" table="FN_ROLE_FUNCTION" lazy="false" sort="natural">
             <key column="role_id"/>
-            <many-to-many column="function_cd" class="org.openecomp.portalsdk.core.domain.RoleFunction"/>
+            <many-to-many column="function_cd" class="org.onap.portalsdk.core.domain.RoleFunction"/>
         </set>
 
         <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
             <key column="parent_role_id"/>
         </set>
 
         <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
             <key column="parent_role_id"/>
-            <many-to-many column="child_role_id" class="org.openecomp.portalsdk.core.domain.Role"/>
+            <many-to-many column="child_role_id" class="org.onap.portalsdk.core.domain.Role"/>
         </set>
         
         <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
             <key column="child_role_id"/>
         </set>
         
         <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
             <key column="child_role_id"/>
-            <many-to-many column="parent_role_id" class="org.openecomp.portalsdk.core.domain.Role"/>
+            <many-to-many column="parent_role_id" class="org.onap.portalsdk.core.domain.Role"/>
         </set>
 
     </class>
         </set>
 
     </class>
@@ -277,14 +277,14 @@ Portal app mappings and features are in EP.hbm.xml.
     
     <!-- Lookup (id/value bean) class mapping details -->
     <class name="Lookup">
     
     <!-- Lookup (id/value bean) class mapping details -->
     <class name="Lookup">
-        <composite-id  name="nameValueId" class="org.openecomp.portalsdk.core.domain.support.NameValueId">
+        <composite-id  name="nameValueId" class="org.onap.portalsdk.core.domain.support.NameValueId">
           <key-property name="val"/>
           <key-property name="lab" />
         </composite-id>
     </class>
 
        <class name="UrlsAccessible" table="V_URL_ACCESS">
           <key-property name="val"/>
           <key-property name="lab" />
         </composite-id>
     </class>
 
        <class name="UrlsAccessible" table="V_URL_ACCESS">
-      <composite-id  name="urlsAccessibleKey" class="org.openecomp.portalsdk.core.domain.UrlsAccessibleKey">
+      <composite-id  name="urlsAccessibleKey" class="org.onap.portalsdk.core.domain.UrlsAccessibleKey">
        <key-property   name="url"      column="url"/>
        <key-property   name="functionCd"       column="function_cd"/>
       </composite-id>
        <key-property   name="url"      column="url"/>
        <key-property   name="functionCd"       column="function_cd"/>
       </composite-id>
@@ -309,6 +309,10 @@ Portal app mappings and features are in EP.hbm.xml.
       select email from User where id = :user_id
     </query>
 
       select email from User where id = :user_id
     </query>
 
+    <query name="getAppPassword">
+      select id,appPassword from App
+    </query>
+    
     <query name="getAllUsers">
       select id, firstName, lastName from User where active = true order by lastName, firstName
     </query>
     <query name="getAllUsers">
       select id, firstName, lastName from User where active = true order by lastName, firstName
     </query>
index 6a4118b..b85fa99 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -41,7 +41,7 @@
         "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
         "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
         "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
         "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
-<hibernate-mapping package="org.openecomp.portalsdk.workflow.domain">
+<hibernate-mapping package="org.onap.portalsdk.workflow.domain">
 
     
         <!-- WorkflowSchedule mapping details -->
 
     
         <!-- WorkflowSchedule mapping details -->
index ed3f0b9..ec93202 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 318ce4e..5cd8060 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 55fa344..613848c 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 58b9e3c..0b39db0 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/command/EPLoginBeanTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/command/EPLoginBeanTest.java
new file mode 100644 (file)
index 0000000..88ba024
--- /dev/null
@@ -0,0 +1,80 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.command;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+import org.onap.portalapp.command.EPLoginBean;
+
+public class EPLoginBeanTest {
+
+       
+public EPLoginBean ePLoginBean(){
+               
+       EPLoginBean ePLoginBean = new EPLoginBean();
+       ePLoginBean.setLoginId("guestT");
+       ePLoginBean.setLoginPwd("password");
+       ePLoginBean.setHrid("hrId");
+       ePLoginBean.setOrgUserId("guestT");
+       ePLoginBean.setBusinessDirectMenu(null);
+       ePLoginBean.setSiteAccess("site_test");
+       ePLoginBean.setLoginErrorMessage("error");
+       ePLoginBean.setUser(null);
+       ePLoginBean.setMenu(null);
+       return ePLoginBean;
+       }
+       
+       @Test
+       public void ePLoginBeanTest(){
+               EPLoginBean ePLoginBean = ePLoginBean();
+               
+               assertEquals(ePLoginBean.getLoginId(), "guestT");
+               assertEquals(ePLoginBean.getLoginPwd(), "password");
+               assertEquals(ePLoginBean.getHrid(), "hrId");
+               assertEquals(ePLoginBean.getOrgUserId(), "guestT");
+               assertNull(ePLoginBean.getBusinessDirectMenu());
+               assertEquals(ePLoginBean.getSiteAccess(), "site_test");
+               assertEquals(ePLoginBean.getLoginErrorMessage(), "error");
+               assertNull(ePLoginBean.getUser());
+               assertNull(ePLoginBean.getMenu());
+
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/command/PostSearchBeanTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/command/PostSearchBeanTest.java
new file mode 100644 (file)
index 0000000..2b09573
--- /dev/null
@@ -0,0 +1,150 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.command;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.onap.portalapp.command.PostSearchBean;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+
+public class PostSearchBeanTest {
+
+       @InjectMocks
+       PostSearchBean mockPostSearchBean = new PostSearchBean();
+       
+     MockEPUser mockUser = new MockEPUser();
+    public PostSearchBean mockPostSearchBean(){
+       
+       PostSearchBean postSearchBean = new PostSearchBean();
+       EPUser user = mockUser.mockEPUser();
+       postSearchBean.setUser(user);
+       postSearchBean.setUserOrig(null);
+       postSearchBean.setSelected(null);
+       postSearchBean.setHrid(null);
+       postSearchBean.setPostUserId(null);
+       postSearchBean.setPostFirstName(null);
+       postSearchBean.setPostLastName(null);
+       postSearchBean.setPostOrgCode(null);
+       postSearchBean.setPostPhone(null);
+       postSearchBean.setPostEmail(null);
+       postSearchBean.setPostAddress1(null);
+       postSearchBean.setPostAddress2(null);
+       postSearchBean.setPostCity(null);
+       postSearchBean.setPostState(null);
+       postSearchBean.setPostZipCode(null);
+       postSearchBean.setPostLocationClli(null);
+       postSearchBean.setPostBusinessCountryCode(null);
+       postSearchBean.setPostBusinessCountryName(null);
+       postSearchBean.setPostDepartment(null);
+       postSearchBean.setPostDepartmentName(null);
+       postSearchBean.setPostBusinessUnit(null);
+       postSearchBean.setPostBusinessUnitName(null);
+       postSearchBean.setPostJobTitle(null);
+       postSearchBean.setOrgManagerUserId(null);
+       postSearchBean.setPostCommandChain(null);
+       postSearchBean.setPostCompanyCode(null);
+       postSearchBean.setPostCostCenter(null);
+       postSearchBean.setPostSiloStatus(null);
+       postSearchBean.setPostFinancialLocCode(null);
+       postSearchBean.setPostManagerUserId(null);
+       return postSearchBean;
+       }
+    
+        @Test
+        public void postSearchBeanTest()
+        {
+        PostSearchBean postSearchBean = mockPostSearchBean();
+        EPUser user = mockUser.mockEPUser();
+        assertEquals(postSearchBean.getUser().getActive(), user.getActive());
+        assertNull(postSearchBean.getUserOrig());
+        assertNull(postSearchBean.getSelected());
+        assertNull(postSearchBean.getHrid());
+        assertNull(postSearchBean.getPostOrgUserId());
+        assertNull(postSearchBean.getPostFirstName());
+        assertNull(postSearchBean.getPostLastName());
+        assertNull(postSearchBean.getPostOrgCode());
+        assertNull(postSearchBean.getPostPhone());
+        assertNull(postSearchBean.getPostEmail());
+        assertNull(postSearchBean.getPostAddress1());
+        assertNull(postSearchBean.getPostAddress2());
+        assertNull(postSearchBean.getPostCity());
+        assertNull(postSearchBean.getPostState());
+        assertNull(postSearchBean.getPostZipCode());
+        assertNull(postSearchBean.getPostLocationClli());
+        assertNull(postSearchBean.getPostBusinessCountryCode());
+        assertNull(postSearchBean.getPostBusinessCountryName());
+        assertNull(postSearchBean.getPostDepartment());
+        assertNull(postSearchBean.getPostDepartmentName());
+        assertNull(postSearchBean.getPostBusinessUnit());
+        assertNull(postSearchBean.getPostBusinessUnitName());
+        assertNull(postSearchBean.getPostJobTitle());
+        assertNull(postSearchBean.getOrgManagerUserId());
+        assertNull(postSearchBean.getPostCommandChain());
+        assertNull(postSearchBean.getPostCompanyCode());
+        assertNull(postSearchBean.getPostCostCenter());
+        assertNull(postSearchBean.getPostSiloStatus());
+        assertNull(postSearchBean.getPostFinancialLocCode());
+        assertNull(postSearchBean.getPostManagerUserId());
+ }
+        
+        @Test
+        public void isCriteriaUpdatedIfUserNotNullTest()
+        {
+                assertFalse(mockPostSearchBean.isCriteriaUpdated());
+        }
+        
+        @Test
+        public void isCriteriaUpdatedIfUserNullTest()
+        {
+                mockPostSearchBean.setUser(null);
+                assertTrue(mockPostSearchBean.isCriteriaUpdated());
+        }
+        
+        
+        @Test
+        public void isCriteriaUpdatedIfUserTest()
+        {
+                mockPostSearchBean.setUser(null);
+                mockPostSearchBean.setUserOrig(null);
+                assertFalse(mockPostSearchBean.isCriteriaUpdated());
+        }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/config/NotificationCleanupTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/config/NotificationCleanupTest.java
new file mode 100644 (file)
index 0000000..8d37452
--- /dev/null
@@ -0,0 +1,86 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalapp.portal.service.UserNotificationServiceImpl;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.springframework.context.ApplicationContext;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(NotificationCleanupConfig.class)
+public class NotificationCleanupTest {
+       
+       
+       @InjectMocks
+       NotificationCleanup notificationCleanup = new NotificationCleanup();
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       @Mock
+       UserNotificationService  userNotificationService  = new UserNotificationServiceImpl();
+       @Mock
+       ApplicationContext applicationContext ;
+       
+       
+       @Test
+       public void runTest()
+       {
+                       PowerMockito.mockStatic(NotificationCleanupConfig.class);
+               Mockito.when(NotificationCleanupConfig.getApplicationContext()).thenReturn(applicationContext);
+       Mockito.when((applicationContext).getBean(UserNotificationService.class)).thenReturn(userNotificationService);
+               Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpUserNotificationTable();
+               Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpRoleNotificationTable();
+
+               Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpNotificationTable();
+               notificationCleanup.run();      
+
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/config/PortalCentralAccessConfigurationTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/config/PortalCentralAccessConfigurationTest.java
new file mode 100644 (file)
index 0000000..a472f05
--- /dev/null
@@ -0,0 +1,82 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.config;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.config.PortalCentralAccessConfiguration;
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
+import org.onap.portalapp.portal.service.EPRoleFunctionServiceImpl;
+
+public class PortalCentralAccessConfigurationTest {
+       
+       @InjectMocks
+       PortalCentralAccessConfiguration portalCentralAccessConfiguration = new PortalCentralAccessConfiguration();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       
+       @Mock
+       EPRoleFunctionService  ePRoleFunctionServiceImpl  = new EPRoleFunctionServiceImpl();
+       
+       @Mock
+       EPRoleFunctionService  ePRoleFunctionServiceCentralizedImpl = new EPRoleFunctionServiceCentralizedImpl();
+
+           @Test
+               public void ePRoleFunctionServiceImplTest()
+               {
+           EPRoleFunctionService  expectedPRoleFunctionServiceImpl  =   portalCentralAccessConfiguration.ePRoleFunctionServiceImpl();
+           assertEquals(expectedPRoleFunctionServiceImpl.getClass(), EPRoleFunctionServiceImpl.class);
+               }
+           
+           @Test
+               public void ePRoleFunctionServiceCentralImplTest()
+               {
+           EPRoleFunctionService  expectedPRoleFunctionServiceImpl  =   portalCentralAccessConfiguration.ePRoleFunctionServiceCentralizedImpl();
+           assertEquals(expectedPRoleFunctionServiceImpl.getClass(), EPRoleFunctionServiceCentralizedImpl.class);
+               }
+
+}
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
new file mode 100644 (file)
index 0000000..7b09982
--- /dev/null
@@ -0,0 +1,281 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+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.ecomp.model.AppCatalogItem;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.EPAppCommonServiceImpl;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.PersUserAppService;
+import org.onap.portalapp.portal.service.PersUserAppServiceImpl;
+import org.onap.portalapp.portal.transport.AppCatalogPersonalization;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FieldsValidator.FieldName;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.util.SystemProperties;
+
+public class AppCatalogControllerTest extends MockitoTestSuite {
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+
+       @Mock
+       EPAppService appService = new EPAppCommonServiceImpl();
+
+       @InjectMocks
+       AppCatalogController appCatalogController = new AppCatalogController();
+
+       PersUserAppService persUserAppService = Mockito.spy(new PersUserAppServiceImpl());
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       @Mock
+       EPUser epuser;
+
+       NullPointerException nullPointerException = new NullPointerException();
+
+       MockEPUser mockUser = new MockEPUser();
+
+       public AppCatalogItem mockAppCatalogItem() {
+               AppCatalogItem appCatalogItem = new AppCatalogItem();
+               appCatalogItem.setId((long) 1);
+               appCatalogItem.setName("Ecomp Portal");
+               appCatalogItem.setImageUrl("Test_URL");
+               appCatalogItem.setDescription("Testing");
+               appCatalogItem.setNotes("Test");
+               appCatalogItem.setUrl("test");
+               appCatalogItem.setAlternateUrl("test");
+               appCatalogItem.setRestricted(false);
+               appCatalogItem.setOpen(false);
+               appCatalogItem.setAccess(true);
+               appCatalogItem.setSelect(true);
+               appCatalogItem.setPending(false);
+
+               return appCatalogItem;
+       }
+
+       @Test
+       public void getAppCatalogTestIfUserNotAdmin() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppCatalogItem> actualAppCatalogList = null;
+
+               List<AppCatalogItem> expectedAppCatalog = new ArrayList<>();
+
+               AppCatalogItem appCatalogItem = mockAppCatalogItem();
+               expectedAppCatalog.add(appCatalogItem);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(appService.getUserAppCatalog(user)).thenReturn(expectedAppCatalog);
+               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
+
+               assertTrue(actualAppCatalogList.contains(appCatalogItem));
+
+       }
+
+       @Test
+       public void getAppCatalogTestIfUserIsAdmin() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppCatalogItem> actualAppCatalogList = null;
+
+               List<AppCatalogItem> expectedAppCatalog = new ArrayList<>();
+
+               AppCatalogItem appCatalogItem = mockAppCatalogItem();
+
+               expectedAppCatalog.add(appCatalogItem);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAdminAppCatalog(user)).thenReturn(expectedAppCatalog);
+               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
+
+               assertTrue(actualAppCatalogList.contains(appCatalogItem));
+
+       }
+
+       @Test
+       public void getAppCatalogTestIfUserisNull() throws IOException {
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+               List<AppCatalogItem> actualAppCatalogList = new ArrayList<>();
+               ;
+               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
+               assertNull(actualAppCatalogList);
+
+       }
+
+       @Test
+       public void getAppCatalogTestIfUserThrowsExceptionTest() throws IOException {
+               EPUser user = new EPUser();
+               user.setFirstName("test");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppCatalogItem> actualAppCatalogList = new ArrayList<>();
+               ;
+
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+
+               Mockito.when(appCatalogController.getAppCatalog(mockedRequest, mockedResponse)).thenThrow(nullPointerException);
+
+               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
+               assertNull(actualAppCatalogList);
+
+       }
+
+       @Test
+       public void putAppCatalogSelectionTestWhenAppIsNull() throws IOException {
+
+               AppCatalogPersonalization persRequest = new AppCatalogPersonalization();
+               persRequest.setAppId((long) 1);
+               persRequest.setPending(false);
+               persRequest.setSelect(false);
+
+               EPUser user = mockUser.mockEPUser();
+
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               ;
+
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(fields);
+               expectedFieldValidator.setErrorCode(null);
+
+               EPApp app = null;
+
+               Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app);
+
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               actualFieldValidator = appCatalogController.putAppCatalogSelection(mockedRequest, persRequest, mockedResponse);
+               assertEquals(expectedFieldValidator, actualFieldValidator);
+
+       }
+
+       @Test
+       public void putAppCatalogSelectionTest() throws IOException {
+
+               AppCatalogPersonalization persRequest = new AppCatalogPersonalization();
+               persRequest.setAppId((long) 1);
+               persRequest.setPending(false);
+               persRequest.setSelect(false);
+
+               EPUser user = mockUser.mockEPUser();
+
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               ;
+
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(fields);
+               expectedFieldValidator.setErrorCode(null);
+
+               EPApp app = new EPApp();
+
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(false);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+
+               Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app);
+
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.doNothing().when(persUserAppService).setPersUserAppValue(user, app, persRequest.getSelect(),
+                               persRequest.getPending());
+
+               actualFieldValidator = appCatalogController.putAppCatalogSelection(mockedRequest, persRequest, mockedResponse);
+
+               assertEquals(expectedFieldValidator, actualFieldValidator);
+
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppContactUsControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AppContactUsControllerTest.java
new file mode 100644 (file)
index 0000000..522ef7c
--- /dev/null
@@ -0,0 +1,338 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.AppContactUsController;
+import org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
+import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
+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.AppContactUsService;
+import org.onap.portalapp.portal.service.AppContactUsServiceImpl;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+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;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({SystemProperties.class, EPCommonSystemProperties.class})
+public class AppContactUsControllerTest extends MockitoTestSuite{
+
+       @Mock
+       AppContactUsService contactUsService = new AppContactUsServiceImpl();
+
+       @InjectMocks
+       AppContactUsController appContactUsController = new AppContactUsController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       public List<AppContactUsItem> mockResponse() {
+               List<AppContactUsItem> appContactUsItemList = new ArrayList<AppContactUsItem>();
+               AppContactUsItem appContactUsItem = new AppContactUsItem();
+               appContactUsItem.setAppId((long) 1);
+               appContactUsItem.setAppName("ECOMP Portal");
+               appContactUsItem.setDescription("Test");
+               appContactUsItem.setContactName("Test");
+               appContactUsItem.setContactEmail("person@onap.org");
+               appContactUsItem.setUrl("Test_URL");
+               appContactUsItem.setActiveYN("Y");
+               appContactUsItemList.add(appContactUsItem);
+
+               return appContactUsItemList;
+
+       }
+
+       public PortalRestResponse<List<AppContactUsItem>> successPortalRestResponse() {
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
+               List<AppContactUsItem> appContactUsItemList = mockResponse();
+               expectedportalRestResponse.setMessage("success");
+               expectedportalRestResponse.setResponse(appContactUsItemList);
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               return expectedportalRestResponse;
+
+       }
+
+       public PortalRestResponse<List<AppContactUsItem>> exceptionPortalRestResponse() {
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse(null);
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               return expectedportalRestResponse;
+
+       }
+
+       @Test
+       public void getAppContactUsList() throws Exception {
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = successPortalRestResponse();
+               List<AppContactUsItem> appContactUsItemList = mockResponse();
+               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
+               Mockito.when(contactUsService.getAppContactUs()).thenReturn(appContactUsItemList);
+               actualPortalRestResponse = appContactUsController.getAppContactUsList(mockedRequest);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void getAppContactUsListCatchesExeptionTest() throws Exception {
+
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
+               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
+               Mockito.when(contactUsService.getAppContactUs()).thenThrow(nullPointerException);
+               actualPortalRestResponse = appContactUsController.getAppContactUsList(mockedRequest);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void getAppsAndContactsTest() throws Exception {
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = successPortalRestResponse();
+               List<AppContactUsItem> appContactUsItemList = mockResponse();
+               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
+               Mockito.when(contactUsService.getAppsAndContacts()).thenReturn(appContactUsItemList);
+               actualPortalRestResponse = appContactUsController.getAppsAndContacts(mockedRequest);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+
+       }
+
+       @Test
+       public void getAppsAndContactsCatchesExceptionTest() throws Exception {
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
+               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
+               Mockito.when(contactUsService.getAppsAndContacts()).thenThrow(nullPointerException);
+               actualPortalRestResponse = appContactUsController.getAppsAndContacts(mockedRequest);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+
+       }
+
+       @Test
+       public void getAppCategoryFunctionsTest() throws Exception {
+               PortalRestResponse<List<AppCategoryFunctionsItem>> actualportalRestResponse = null;
+
+               List<AppCategoryFunctionsItem> contents = new ArrayList<AppCategoryFunctionsItem>();
+
+               AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem();
+               AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem();
+
+               appCategoryFunctionsItem.setRowId("1");
+               appCategoryFunctionsItem.setAppId("1");
+               appCategoryFunctionsItem.setApplication("Ecomp-portal");
+               appCategoryFunctionsItem.setCategory("test");
+               appCategoryFunctionsItem.setFunctions("test");
+
+               appCategoryFunctionsItem1.setRowId("2");
+               appCategoryFunctionsItem1.setAppId("2");
+               appCategoryFunctionsItem1.setApplication("Ecomp-portal-test");
+               appCategoryFunctionsItem1.setCategory("test");
+               appCategoryFunctionsItem1.setFunctions("test");
+               contents.add(appCategoryFunctionsItem);
+               contents.add(appCategoryFunctionsItem1);
+
+               PortalRestResponse<List<AppCategoryFunctionsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>();
+               expectedportalRestResponse.setMessage("success");
+               expectedportalRestResponse.setResponse(contents);
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
+
+               Mockito.when(contactUsService.getAppCategoryFunctions()).thenReturn(contents);
+               actualportalRestResponse = appContactUsController.getAppCategoryFunctions(mockedRequest);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+
+       }
+
+       @Test
+       public void getAppCategoryFunctionsCatchesExceptionTest() throws Exception {
+               PortalRestResponse<List<AppCategoryFunctionsItem>> actualportalRestResponse = null;
+               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
+               Mockito.when(contactUsService.getAppCategoryFunctions()).thenThrow(nullPointerException);
+               actualportalRestResponse = appContactUsController.getAppCategoryFunctions(mockedRequest);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+
+       }
+
+       @Test
+       public void saveTest() throws Exception {
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+
+               AppContactUsItem contactUs = new AppContactUsItem();
+               contactUs.setAppId((long) 1);
+               contactUs.setAppName("Ecomp Portal");
+               contactUs.setDescription("Test");
+               contactUs.setContactName("Test");
+               contactUs.setContactEmail("person@onap.org");
+               contactUs.setUrl("Test_URL");
+               contactUs.setActiveYN("Y");
+
+               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenReturn("SUCCESS");
+               actualSaveAppContactUS = appContactUsController.save(contactUs);
+               assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
+       }
+
+       @Test
+       public void saveExceptionTest() throws Exception {
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+
+               AppContactUsItem contactUs = new AppContactUsItem();
+               contactUs.setAppId((long) 1);
+               contactUs.setAppName("Ecomp Portal");
+               contactUs.setDescription("Test");
+               contactUs.setContactName("Test");
+               contactUs.setContactEmail("person@onap.org");
+               contactUs.setUrl("Test_URL");
+               contactUs.setActiveYN("Y");
+
+               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenThrow(new Exception());
+               actualSaveAppContactUS = appContactUsController.save(contactUs);
+               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
+       }
+
+       @Test
+       public void saveWhenAppContactUsItemNullTest() throws Exception {
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+               AppContactUsItem contactUs = null;
+               actualSaveAppContactUS = appContactUsController.save(contactUs);
+               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
+
+       }
+
+       @Test
+       public void saveAllTest() throws Exception {
+
+               List<AppContactUsItem> contactUs = mockResponse();
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenReturn("SUCCESS");
+               actualSaveAppContactUS = appContactUsController.save(contactUs);
+               assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
+       }
+
+       @Test
+       public void saveAllExceptionTest() throws Exception {
+
+               List<AppContactUsItem> contactUs = mockResponse();
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenThrow(new Exception());
+               actualSaveAppContactUS = appContactUsController.save(contactUs);
+               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
+       }
+
+       @Test
+       public void deleteTest() throws Exception {
+
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+               Long id = (long) 1;
+               String saveAppContactUs = "SUCCESS";
+               Mockito.when(contactUsService.deleteContactUs(id)).thenReturn(saveAppContactUs);
+               actualSaveAppContactUS = appContactUsController.delete(id);
+               assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
+       }
+
+       @Test
+       public void deleteExceptionTest() throws Exception {
+
+               PortalRestResponse<String> actualSaveAppContactUS = null;
+               Long id = (long) 1;
+               Mockito.when(contactUsService.deleteContactUs(id)).thenThrow(new Exception());
+               actualSaveAppContactUS = appContactUsController.delete(id);
+               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
+       }
+
+       @Test
+       public void getPortalDetailsTest(){
+               PortalRestResponse<String> actualResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setStatus(PortalRestStatusEnum.OK);
+               expectedResponse.setMessage("success");
+               expectedResponse.setResponse("\"ush_ticket_url\":\"http://todo_enter_ush_ticket_url\",\"portal_info_url\":\"https://todo_enter_portal_info_url\",\"feedback_email_address\":\"portal@lists.openecomp.org\"");
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL)).thenReturn("http://todo_enter_ush_ticket_url"); 
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL)).thenReturn("https://todo_enter_portal_info_url"); 
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS)).thenReturn("portal@lists.openecomp.org"); 
+               
+               actualResponse = appContactUsController.getPortalDetails(mockedRequest);
+               assertTrue(actualResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
+       }
+       
+       @Test
+       public void getPortalDetailsExceptionTest(){
+               PortalRestResponse<String> actualResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
+               expectedResponse.setMessage("failure");
+               expectedResponse.setResponse(null);
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL)).thenThrow(nullPointerException); 
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL)).thenReturn("https://todo_enter_portal_info_url"); 
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS)).thenReturn("portal@lists.openecomp.org"); 
+               
+               actualResponse = appContactUsController.getPortalDetails(mockedRequest);
+               assertEquals(actualResponse, expectedResponse);
+       }
+}
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
new file mode 100644 (file)
index 0000000..3a81a6f
--- /dev/null
@@ -0,0 +1,310 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.AppsControllerExternalRequest;
+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.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.PortalAdminService;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.portal.service.UserServiceImpl;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.util.EPUserUtils;
+
+public class AppsControllerExternalRequestTest extends MockitoTestSuite {
+
+       @Mock
+       AdminRolesService adminRolesService;
+
+       @Mock
+       EPAppService appService;
+
+       @Mock
+       PortalAdminService portalAdminService;
+
+       @Mock
+       UserService userService = new UserServiceImpl();
+
+       @InjectMocks
+       AppsControllerExternalRequest appsControllerExternalRequest = new AppsControllerExternalRequest();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       MockEPUser mockUser = new MockEPUser();
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       @Test
+       public void postPortalAdminIfUSerNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Missing required field: email, loginId, or loginPwd");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("guestT@test.portal.onap.org");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postPortalAdmin(mockedRequest, mockedResponse, user);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void postPortalAdminTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("java.lang.NullPointerException");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("guestT@test.portal.onap.org");
+               user.setLoginPwd("pwd");
+               user.setLoginId("Test");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenThrow(nullPointerException);
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postPortalAdmin(mockedRequest, mockedResponse, user);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void postPortalAdminCreateUserIfNotFoundTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("guestT@test.portal.onap.org");
+               user.setLoginPwd("pwd");
+               user.setLoginId("Test");
+               List<EPUser> expectedList = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
+               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postPortalAdmin(mockedRequest, mockedResponse, user);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void postPortalAdminCreateUserIfFoundTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("guestT@test.portal.onap.org");
+               user.setLoginPwd("pwd");
+               user.setLoginId("Test");
+               List<EPUser> expectedList = new ArrayList<EPUser>();
+               expectedList.add(user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
+               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postPortalAdmin(mockedRequest, mockedResponse, user);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void postPortalAdminCreateUserIfNotSuperAdminTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("guestT@test.portal.onap.org");
+               user.setLoginPwd("pwd");
+               user.setLoginId("Test");
+               List<EPUser> expectedList = new ArrayList<EPUser>();
+               expectedList.add(user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
+               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               Mockito.when(portalAdminService.createPortalAdmin(user.getOrgUserId())).thenReturn(expectedFieldValidator);
+
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postPortalAdmin(mockedRequest, mockedResponse, user);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void postPortalAdminCreateUserIfFieldValidatorErrorTest() throws Exception {
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 500);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("FieldsValidator [httpStatusCode=500, errorCode=null, fields=null]");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("guestT@test.portal.onap.org");
+               user.setLoginPwd("pwd");
+               user.setLoginId("Test");
+               List<EPUser> expectedList = new ArrayList<EPUser>();
+               expectedList.add(user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
+               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(portalAdminService.createPortalAdmin(user.getOrgUserId())).thenReturn(expectedFieldValidator);
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postPortalAdmin(mockedRequest, mockedResponse, user);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void getOnboardAppExternalTest() {
+               EPApp epApp = new EPApp();
+               Long appId = (long) 1;
+               Mockito.when(appService.getApp(appId)).thenReturn(epApp);
+               OnboardingApp expectedApp = new OnboardingApp();
+               Mockito.doNothing().when(appService).createOnboardingFromApp(epApp, expectedApp);
+               OnboardingApp actualApp = appsControllerExternalRequest.getOnboardAppExternal(mockedRequest, mockedResponse,
+                               appId);
+               assertEquals(expectedApp.getClass(), actualApp.getClass());
+       }
+
+       @Test
+       public void postOnboardAppExternalExceptionTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Unexpected field: id");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+
+               OnboardingApp expectedOnboardingApp = new OnboardingApp();
+               expectedOnboardingApp.id = (long) 1;
+
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void postOnboardAppExternalTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(
+                               "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+
+               OnboardingApp expectedOnboardingApp = new OnboardingApp();
+               expectedOnboardingApp.id = null;
+
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+
+       }
+
+       @Test
+       public void putOnboardAppExternalifAppNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Unexpected value for field: id");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               Long appId = null;
+               OnboardingApp expectedOnboardingApp = new OnboardingApp();
+               expectedOnboardingApp.id = null;
+
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void putOnboardAppExternalIfOnboardingAppDetailsNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(
+                               "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               Long appId = (long) 1;
+               OnboardingApp expectedOnboardingApp = new OnboardingApp();
+               expectedOnboardingApp.id = (long) 1;
+               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
+                               .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp);
+               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
+       }
+}
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
new file mode 100644 (file)
index 0000000..95f1d22
--- /dev/null
@@ -0,0 +1,955 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+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.controller.AppsController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.AdminUserApplications;
+import org.onap.portalapp.portal.domain.AppIdAndNameTransportModel;
+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.UserRole;
+import org.onap.portalapp.portal.domain.UserRoles;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.EPAppCommonServiceImpl;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.EPLeftMenuService;
+import org.onap.portalapp.portal.service.EPLeftMenuServiceImpl;
+import org.onap.portalapp.portal.transport.EPAppsManualPreference;
+import org.onap.portalapp.portal.transport.EPAppsSortPreference;
+import org.onap.portalapp.portal.transport.EPDeleteAppsManualSortPref;
+import org.onap.portalapp.portal.transport.EPWidgetsSortPreference;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.LocalRole;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.AppUtils;
+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.MediaType;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({SystemProperties.class,AppUtils.class, EPUserUtils.class, MediaType.class})
+public class AppsControllerTest extends MockitoTestSuite{
+
+       @InjectMocks
+       AppsController appsController = new AppsController();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+
+       @Mock
+       EPAppService appService = new EPAppCommonServiceImpl();
+
+       @Mock
+       EPLeftMenuService leftMenuService = new EPLeftMenuServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       @Mock
+       AppUtils appUtils = new AppUtils();
+
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void getUserAppsTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
+
+               EcompApp ecompApp = new EcompApp();
+               ecompApp.setId((long) 1);
+               ecompApp.setName("Test_app");
+               ecompApp.setUrl("Test_URL");
+               ecompApp.setUebKey("Test_key");
+               ecompApp.setAlternateUrl("Test_alt_URL");
+               expectedEcompApps.add(ecompApp);
+               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
+               Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenReturn(expectedEcompApps);
+               actualEcompApps = appsController.getUserApps(mockedRequest, mockedResponse);
+               assertEquals(expectedEcompApps, actualEcompApps);
+       }
+
+       @Test
+       public void getUserAppsNoUserTest() {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenReturn(null);
+               assertNull(appsController.getUserApps(mockedRequest, mockedResponse));
+
+       }
+
+       @Test
+       public void getUserAppsExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenThrow(nullPointerException);
+               assertNull(appsController.getUserApps(mockedRequest, mockedResponse));
+
+       }
+
+       @Test
+       public void getPersUserAppsIfUserIsAdminTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
+
+               EcompApp ecompApp = new EcompApp();
+               ecompApp.setId((long) 1);
+               ecompApp.setName("Test_app");
+               ecompApp.setUrl("Test_URL");
+               ecompApp.setUebKey("Test_key");
+               ecompApp.setAlternateUrl("Test_alt_URL");
+               expectedEcompApps.add(ecompApp);
+               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
+
+               List<EPApp> expectedApps = new ArrayList<EPApp>();
+
+               EPApp app = new EPApp();
+
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(false);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+
+               expectedApps.add(app);
+
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getPersAdminApps(user)).thenReturn(expectedApps);
+
+               Mockito.when(appService.transformAppsToEcompApps(expectedApps)).thenReturn(expectedEcompApps);
+               actualEcompApps = appsController.getPersUserApps(mockedRequest, mockedResponse);
+               assertEquals(expectedEcompApps, actualEcompApps);
+       }
+
+       @Test
+       public void getPersUserAppsIfUserNotAdminTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
+
+               EcompApp ecompApp = new EcompApp();
+               ecompApp.setId((long) 1);
+               ecompApp.setName("Test_app");
+               ecompApp.setUrl("Test_URL");
+               ecompApp.setUebKey("Test_key");
+               ecompApp.setAlternateUrl("Test_alt_URL");
+               expectedEcompApps.add(ecompApp);
+               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
+
+               List<EPApp> expectedApps = new ArrayList<EPApp>();
+
+               EPApp app = new EPApp();
+
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(false);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+
+               expectedApps.add(app);
+
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(appService.getPersUserApps(user)).thenReturn(expectedApps);
+               Mockito.when(appService.transformAppsToEcompApps(expectedApps)).thenReturn(expectedEcompApps);
+               actualEcompApps = appsController.getPersUserApps(mockedRequest, mockedResponse);
+               assertEquals(expectedEcompApps, actualEcompApps);
+       }
+
+       @Test
+       public void getPersUserAppsIfUserNullTest() throws IOException {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               assertNull(appsController.getPersUserApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getPersUserAppsExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getPersAdminApps(user)).thenThrow(nullPointerException);
+               assertNull(appsController.getPersUserApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAdminAppsIfNotAdminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               assertNull(appsController.getAdminApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAdminAppsTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppIdAndNameTransportModel> expectedAdminApps = new ArrayList<AppIdAndNameTransportModel>();
+               AppIdAndNameTransportModel appIdAndNameTransportModel = new AppIdAndNameTransportModel();
+               appIdAndNameTransportModel.setId((long) 1);
+               appIdAndNameTransportModel.setName("Test_app");
+               expectedAdminApps.add(appIdAndNameTransportModel);
+               List<AppIdAndNameTransportModel> actualAdminApps = new ArrayList<AppIdAndNameTransportModel>();
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAdminApps(user)).thenReturn(expectedAdminApps);
+               actualAdminApps = appsController.getAdminApps(mockedRequest, mockedResponse);
+               assertEquals(actualAdminApps, expectedAdminApps);
+
+       }
+
+       @Test
+       public void getAdminAppsExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAdminApps(user)).thenThrow(nullPointerException);
+               assertNull(appsController.getAdminApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsForSuperAdminAndAccountAdminifOnlyAccountAdminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               assertNull(appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsForSuperAdminAndAccountAdminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppIdAndNameTransportModel> expectedAdminApps = new ArrayList<AppIdAndNameTransportModel>();
+               AppIdAndNameTransportModel appIdAndNameTransportModel = new AppIdAndNameTransportModel();
+               appIdAndNameTransportModel.setId((long) 1);
+               appIdAndNameTransportModel.setName("Test_app");
+               expectedAdminApps.add(appIdAndNameTransportModel);
+               List<AppIdAndNameTransportModel> actualAdminApps = new ArrayList<AppIdAndNameTransportModel>();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAppsForSuperAdminAndAccountAdmin(user)).thenReturn(expectedAdminApps);
+               actualAdminApps = appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse);
+               assertEquals(actualAdminApps, expectedAdminApps);
+
+       }
+
+       @Test
+       public void getAppsForSuperAdminExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               Mockito.when(appService.getAppsForSuperAdminAndAccountAdmin(user)).thenThrow(nullPointerException);
+               assertNull(appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void putUserAppsSortingManualTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenReturn(expectedFieldValidator);
+               actualFieldValidator = appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference,
+                               mockedResponse);
+               assertEquals(actualFieldValidator, expectedFieldValidator);
+       }
+
+       @Test
+       public void putUserAppsSortingManualExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
+               Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenThrow(nullPointerException);
+               assertNull(appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference, mockedResponse));
+       }
+
+       @Test
+       public void putUserWidgetsSortManualTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Mockito.when(appService.saveWidgetsSortManual(ePWidgetsSortPreference, user))
+                               .thenReturn(expectedFieldValidator);
+               actualFieldValidator = appsController.putUserWidgetsSortManual(mockedRequest, ePWidgetsSortPreference,
+                               mockedResponse);
+               assertEquals(actualFieldValidator, expectedFieldValidator);
+       }
+
+       @Test
+       public void putUserWidgetsSortManualExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
+               Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenThrow(nullPointerException);
+               assertNull(appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference, mockedResponse));
+       }
+
+       @Test
+       public void putUserWidgetsSortPrefTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Mockito.when(appService.deleteUserWidgetSortPref(ePWidgetsSortPreference, user))
+                               .thenReturn(expectedFieldValidator);
+               actualFieldValidator = appsController.putUserWidgetsSortPref(mockedRequest, ePWidgetsSortPreference,
+                               mockedResponse);
+               assertEquals(actualFieldValidator, expectedFieldValidator);
+       }
+
+       @Test
+       public void putUserWidgetsSortPrefExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
+               Mockito.when(appService.deleteUserWidgetSortPref(ePWidgetsSortPreference, user))
+                               .thenThrow(nullPointerException);
+               assertNull(appsController.putUserWidgetsSortPref(mockedRequest, ePWidgetsSortPreference, mockedResponse));
+       }
+
+       @Test
+       public void deleteUserAppSortManualTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
+
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Mockito.when(appService.deleteUserAppSortManual(epDeleteAppsManualSortPref, user))
+                               .thenReturn(expectedFieldValidator);
+               actualFieldValidator = appsController.deleteUserAppSortManual(mockedRequest, epDeleteAppsManualSortPref,
+                               mockedResponse);
+               assertEquals(actualFieldValidator, expectedFieldValidator);
+       }
+
+       @Test
+       public void deleteUserAppSortManualExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
+               Mockito.when(appService.deleteUserAppSortManual(epDeleteAppsManualSortPref, user))
+                               .thenThrow(nullPointerException);
+               assertNull(appsController.deleteUserAppSortManual(mockedRequest, epDeleteAppsManualSortPref, mockedResponse));
+       }
+
+       @Test
+       public void putUserAppsSortingPreferenceTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               EPAppsSortPreference userAppsValue = new EPAppsSortPreference();
+
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Mockito.when(appService.saveAppsSortPreference(userAppsValue, user)).thenReturn(expectedFieldValidator);
+               actualFieldValidator = appsController.putUserAppsSortingPreference(mockedRequest, userAppsValue,
+                               mockedResponse);
+               assertEquals(actualFieldValidator, expectedFieldValidator);
+       }
+
+       @Test
+       public void putUserAppsSortingPreferenceExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               EPAppsSortPreference userAppsValue = new EPAppsSortPreference();
+               Mockito.when(appService.saveAppsSortPreference(userAppsValue, user)).thenThrow(nullPointerException);
+               assertNull(appsController.putUserAppsSortingPreference(mockedRequest, userAppsValue, mockedResponse));
+       }
+
+       @Test
+       public void getUserAppsSortTypePreferenceTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String expectedUserSortPreference = "TEST_DECE";
+               String actualUserSortPreference = new String();
+               Mockito.when(appService.getUserAppsSortTypePreference(user)).thenReturn(expectedUserSortPreference);
+               actualUserSortPreference = appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse);
+               assertEquals(actualUserSortPreference, expectedUserSortPreference);
+       }
+
+       @Test
+       public void getUserAppsSortTypePreferenceExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getUserAppsSortTypePreference(user)).thenThrow(nullPointerException);
+               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getUserAppsSortTypePreferenceIfUserNullTest() throws IOException {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getUserAppsSortTypePreference(user)).thenThrow(nullPointerException);
+               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsAdministratorsTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AdminUserApplications> expecteAdminUserApplications = new ArrayList<AdminUserApplications>();
+               List<AdminUserApplications> actualAdminUserApplications = new ArrayList<AdminUserApplications>();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAppsAdmins()).thenReturn(expecteAdminUserApplications);
+               actualAdminUserApplications = appsController.getAppsAdministrators(mockedRequest, mockedResponse);
+               assertEquals(expecteAdminUserApplications, actualAdminUserApplications);
+       }
+
+       @Test
+       public void getAppsAdministratorsIfUserNotSuperAdminTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsAdministratorsExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAppsAdmins()).thenThrow(nullPointerException);
+               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppsResponse> expectedApps = new ArrayList<AppsResponse>();
+               AppsResponse apps = new AppsResponse((long) 1, "test", true, true);
+               expectedApps.add(apps);
+
+               List<AppsResponse> atualApps = new ArrayList<AppsResponse>();
+
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAllApps(false)).thenReturn(expectedApps);
+               atualApps = appsController.getApps(mockedRequest, mockedResponse);
+               assertEquals(expectedApps, atualApps);
+       }
+
+       @Test
+       public void getAppsExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               assertNull(appsController.getApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsIfUserNotSuperAdminTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAllApps(false)).thenThrow(nullPointerException);
+               assertNull(appsController.getApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAllAppsTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<AppsResponse> expectedApps = new ArrayList<AppsResponse>();
+               AppsResponse apps = new AppsResponse((long) 1, "test", true, true);
+               expectedApps.add(apps);
+               List<AppsResponse> atualApps = new ArrayList<AppsResponse>();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAllApps(true)).thenReturn(expectedApps);
+               atualApps = appsController.getAllApps(mockedRequest, mockedResponse);
+               assertEquals(expectedApps, atualApps);
+       }
+
+       @Test
+       public void getAllAppsExceptionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               assertNull(appsController.getAllApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAllAppsIfUserNotSuperAdminTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getAllApps(true)).thenThrow(nullPointerException);
+               assertNull(appsController.getAllApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppsFullListTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
+
+               EcompApp ecompApp = new EcompApp();
+               ecompApp.setId((long) 1);
+               ecompApp.setName("Test_app");
+               ecompApp.setUrl("Test_URL");
+               ecompApp.setUebKey("Test_key");
+               ecompApp.setAlternateUrl("Test_alt_URL");
+               expectedEcompApps.add(ecompApp);
+               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
+               Mockito.when(appService.getEcompAppAppsFullList()).thenReturn(expectedEcompApps);
+               actualEcompApps = appsController.getAppsFullList(mockedRequest, mockedResponse);
+               assertEquals(expectedEcompApps, actualEcompApps);
+       }
+
+//     @Test
+//     public void getAppsFullListNoUserTest() {
+//             EPUser user = null;
+//             Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+//             Mockito.when(appService.getEcompAppAppsFullList()).thenReturn(null);
+//             assertNull(appsController.getAppsFullList(mockedRequest, mockedResponse));
+//
+//     }
+
+       @Test
+       public void getUserProfileTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+               UserRole userRole = new UserRole();
+               userRole.setUser_Id((long) 1);
+               userRole.setOrgUserId("guest");
+               userRole.setFirstName("Test_User_FirstName");
+               userRole.setLastName("Test_User_LastName");
+               userRole.setRoleId((long) 1);
+               userRole.setRoleName("test");
+
+               UserRoles unexpectedserAndRoles = new UserRoles(userRole);
+               unexpectedserAndRoles.setFirstName("Test_User_FirstName");
+               unexpectedserAndRoles.setLastName("Test_User_LastName");
+               unexpectedserAndRoles.setGuestSession(false);
+               unexpectedserAndRoles.setOrgUserId("guest");
+               List<String> roles = new ArrayList<String>();
+               roles.add("Test");
+               unexpectedserAndRoles.setRoles(roles);
+               Mockito.when(appService.getUserProfileNormalized(user)).thenReturn(unexpectedserAndRoles);
+               UserRoles actualUserAndRoles = appsController.getUserProfile(mockedRequest, mockedResponse);
+               assertEquals(unexpectedserAndRoles, actualUserAndRoles);
+       }
+
+       @Test
+       public void getUserProfileIfUserNullTest() throws IOException {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getUserProfileNormalized(user)).thenReturn(null);
+               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getUserProfileExcpetionTest() throws IOException {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getUserProfileNormalized(user)).thenThrow(nullPointerException);
+               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getAppRolesTest() {
+               List<LocalRole> expectedRoleList = new ArrayList<LocalRole>();
+               LocalRole localRole = new LocalRole();
+               localRole.setRoleId(1);
+               localRole.setRolename("test");
+               expectedRoleList.add(localRole);
+               long appId = 1;
+               Mockito.when(appService.getAppRoles(appId)).thenReturn(expectedRoleList);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isAccountAdminOfApplication(Matchers.anyObject(), Matchers.anyObject())).thenReturn(true);
+               List<LocalRole> actualRoleList = appsController.getAppRoles(mockedRequest, appId, mockedResponse);
+               assertEquals(actualRoleList, expectedRoleList);
+       }
+
+       @Test
+       public void getAppRolesExceptionTest() {
+               long appId = 1;
+               Mockito.when(appService.getAppRoles(appId)).thenThrow(nullPointerException);
+               assertNull(appsController.getAppRoles(mockedRequest, appId, mockedResponse));
+       }
+
+       @Test
+       public void getOnboardingAppsTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<OnboardingApp> expectedOnboardingApps = new ArrayList<OnboardingApp>();
+               OnboardingApp onboardingApp = new OnboardingApp();
+               onboardingApp.setUebKey("test");
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getOnboardingApps()).thenReturn(expectedOnboardingApps);
+               List<OnboardingApp> actualOnboardingApps = appsController.getOnboardingApps(mockedRequest, mockedResponse);
+               assertEquals(expectedOnboardingApps, actualOnboardingApps);
+       }
+
+       @Test
+       public void getOnboardingAppsifSuperAdiminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               assertNull(appsController.getOnboardingApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void getOnboardingAppsExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(!adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.getOnboardingApps()).thenThrow(nullPointerException);
+               assertNull(appsController.getOnboardingApps(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void putOnboardingAppTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               OnboardingApp OnboardingApp = new OnboardingApp();
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
+               FieldsValidator actualFieldValidator = appsController.putOnboardingApp(mockedRequest, OnboardingApp,
+                               mockedResponse);
+               assertEquals(expectedFieldValidator, actualFieldValidator);
+       }
+
+       @Test
+       public void putOnboardingAppIfSuperAdminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               FieldsValidator expectedFieldValidator = null;
+               OnboardingApp OnboardingApp = new OnboardingApp();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
+               assertNull(appsController.putOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
+       }
+
+       @Test
+       public void putOnboardingAppExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               OnboardingApp OnboardingApp = new OnboardingApp();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenThrow(nullPointerException);
+               assertNull(appsController.putOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
+       }
+       
+       @Test
+       public void postOnboardingAppTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               OnboardingApp OnboardingApp = new OnboardingApp();
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
+               FieldsValidator actualFieldValidator = appsController.postOnboardingApp(mockedRequest, OnboardingApp,
+                               mockedResponse);
+               assertEquals(expectedFieldValidator, actualFieldValidator);
+       }
+
+       @Test
+       public void postOnboardingAppIfSuperAdminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               FieldsValidator expectedFieldValidator = null;
+               OnboardingApp OnboardingApp = new OnboardingApp();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
+               assertNull(appsController.postOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
+       }
+
+       @Test
+       public void postOnboardingAppExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               OnboardingApp OnboardingApp = new OnboardingApp();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenThrow(nullPointerException);
+               assertNull(appsController.postOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
+       }
+       
+       @Test
+       public void deleteOnboardingAppTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               long appId = 1;
+               Mockito.when(appService.deleteOnboardingApp(user,appId )).thenReturn(expectedFieldValidator);
+               FieldsValidator actualFieldValidator = appsController.deleteOnboardingApp(mockedRequest,appId,
+                               mockedResponse);
+               assertEquals(expectedFieldValidator, actualFieldValidator);
+       }
+
+       @Test
+       public void deleteOnboardingAppIfSuperAdminTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               FieldsValidator expectedFieldValidator = null;
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               long appId = 1;
+        Mockito.when(appService.deleteOnboardingApp(user,appId)).thenReturn(expectedFieldValidator);
+               assertNull(appsController.deleteOnboardingApp(mockedRequest,appId,mockedResponse));
+       }
+
+       @Test
+       public void deleteOnboardingAppExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               long appId = 1;
+      Mockito.when(appService.deleteOnboardingApp(user,appId)).thenThrow(nullPointerException);
+               assertNull(appsController.deleteOnboardingApp(mockedRequest,appId,mockedResponse));
+       }
+       
+       @Test
+       public void getLeftMenuItemsTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               String menuList = "Test";
+               PowerMockito.mockStatic(EPUserUtils.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Set menuSet = new HashSet<>();
+               menuSet.add(1);
+               Mockito.when(AppUtils.getSession(mockedRequest)
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuSet);
+               Mockito.when(AppUtils.getSession(mockedRequest)
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME))).thenReturn(menuSet);
+               Mockito.when(leftMenuService.getLeftMenuItems(user, menuSet, menuSet)).thenReturn(menuList);
+               String response = appsController.getLeftMenuItems(mockedRequest, mockedResponse);
+               assertTrue(response.equals("Test"));
+       }
+       
+       @Test
+       public void getLeftMenuItemsExceptionTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               String menuList = "Test";
+               PowerMockito.mockStatic(EPUserUtils.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Set menuSet = new HashSet<>();
+               menuSet.add(1);
+               Mockito.when(AppUtils.getSession(mockedRequest)
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuSet);
+               Mockito.when(AppUtils.getSession(mockedRequest)
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME))).thenReturn(menuSet);
+               Mockito.when(leftMenuService.getLeftMenuItems(user, menuSet, menuSet)).thenThrow(nullPointerException);
+               assertNull(appsController.getLeftMenuItems(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void getAppThumbnailExceptionTest()
+       {
+               EPApp app = null;
+               assertNull(appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse));
+       }
+       
+       @Test
+       public void getAppThumbnailTest()
+       {
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppType(1);
+               app.setImageUrl("www.ecomp.com");
+               app.setThumbnail(new byte[] {1, 6, 3});
+               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
+               HttpEntity<byte[]> response = appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse);
+               assertEquals(response.getHeaders().getContentLength(), 3);
+       }
+       
+       @Test
+       public void getAppThumbnailForMediaTypePngTest()
+       {
+               
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppType(1);
+               app.setImageUrl("www.ecomp.png");
+               app.setThumbnail(new byte[] {1, 6, 3});
+               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
+               PowerMockito.mockStatic(MediaType.class);
+               HttpEntity<byte[]> response = appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse);
+               assertEquals(response.getHeaders().getContentLength(), 3);
+       }
+       
+       @Test
+       public void getUserAppsOrderBySortPrefIfUSerNullTest(){
+               List<EcompApp> listOfApps = new ArrayList<EcompApp>();
+               
+               EcompApp app = new EcompApp();
+               listOfApps.add(app);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+               assertNull(appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void getUserAppsOrderBySortPrefTest(){
+               List<EcompApp> listOfApps = new ArrayList<EcompApp>();
+               
+               EcompApp app = new EcompApp();
+               listOfApps.add(app);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(mockedRequest.getParameter("mparams")).thenReturn("");
+               Mockito.when(appService.transformAppsToEcompApps(appService.getAppsOrderByName(user))).thenReturn(listOfApps);
+               List<EcompApp> listOfActualApps =       appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse);
+               assertEquals(listOfActualApps.size(), 1);
+       }
+       
+       @Test
+       public void getUserAppsOrderBySortPrefIfusrSortPrefIsMTest(){
+               List<EcompApp> listOfApps = new ArrayList<EcompApp>();
+               
+               EcompApp app = new EcompApp();
+               listOfApps.add(app);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(mockedRequest.getParameter("mparams")).thenReturn("M");
+               Mockito.when(appService.transformAppsToEcompApps(appService.getAppsOrderByName(user))).thenReturn(listOfApps);
+               List<EcompApp> listOfActualApps =       appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse);
+               assertEquals(listOfActualApps.size(), 1);
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AuditLogControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/AuditLogControllerTest.java
new file mode 100644 (file)
index 0000000..27e72b6
--- /dev/null
@@ -0,0 +1,139 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.AuditLogController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.service.AuditService;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(EPUserUtils.class)
+public class AuditLogControllerTest {
+
+       
+       @Mock
+       AuditService auditService;
+       
+       @InjectMocks
+     AuditLogController auditLogController = new AuditLogController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       
+       
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+       @Test
+       public void auditLogTest()
+       {
+               PowerMockito.mockStatic(EPUserUtils.class);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
+               auditLogController.auditLog(mockedRequest, "1", "app", "test");
+       }
+       
+       @Test
+       public void auditLogTabTest()
+       {
+               PowerMockito.mockStatic(EPUserUtils.class);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
+               auditLogController.auditLog(mockedRequest, "1", "tab", "test");
+       }
+       
+       @Test
+       public void auditLogfunctionalTest()
+       {
+               PowerMockito.mockStatic(EPUserUtils.class);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
+               auditLogController.auditLog(mockedRequest, "1", "functional", "test");
+       }
+       
+       @Test
+       public void auditLogleftMenuTest()
+       {
+               PowerMockito.mockStatic(EPUserUtils.class);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
+               auditLogController.auditLog(mockedRequest, "1", "leftMenu", "test");
+       }
+       
+       @Test(expected = NumberFormatException.class)
+       public void auditLogExceptionTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
+               auditLogController.auditLog(mockedRequest, "1", "app", "test");
+       }
+       
+       @Test
+       public void auditLogerrorTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenThrow(nullPointerException);
+               auditLogController.auditLog(mockedRequest, "1", "app", "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/BEPropertyReaderControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/BEPropertyReaderControllerTest.java
new file mode 100644 (file)
index 0000000..3ece25f
--- /dev/null
@@ -0,0 +1,109 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.BEPropertyReaderController;
+import org.onap.portalapp.portal.domain.BEProperty;
+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.portalsdk.core.util.SystemProperties;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(SystemProperties.class)
+public class BEPropertyReaderControllerTest extends MockitoTestSuite {
+
+       @InjectMocks
+       BEPropertyReaderController bEPropertyReaderController = new BEPropertyReaderController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test
+       public void readPropertyTest() {
+               String key = "DOMAIN_CLASS_LOCATION";
+               BEProperty beProperty = new BEProperty("DOMAIN_CLASS_LOCATION", "domain_class_location");
+               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(beProperty);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               PortalRestResponse<BEProperty> actualPortalRestResponse = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty("DOMAIN_CLASS_LOCATION")).thenReturn("domain_class_location");
+               actualPortalRestResponse = bEPropertyReaderController.readProperty(mockedRequest, key);
+               assertTrue(actualPortalRestResponse.equals(ecpectedPortalRestResponse));
+
+       }
+       
+       @Test
+       public void readPropertyExceptionTest() {
+               String key =null;
+               //BEProperty beProperty = new BEProperty("DOMAIN_CLASS_LOCATION", "domain_class_location");
+               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
+               ecpectedPortalRestResponse.setMessage("java.lang.NullPointerException");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<BEProperty> actualPortalRestResponse = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(new BEProperty(key, SystemProperties.getProperty(key))).thenThrow(nullPointerException);
+               actualPortalRestResponse = bEPropertyReaderController.readProperty(mockedRequest, key);
+               assertTrue(actualPortalRestResponse.equals(ecpectedPortalRestResponse));
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/BasicAuthAccountControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/BasicAuthAccountControllerTest.java
new file mode 100644 (file)
index 0000000..bec28d5
--- /dev/null
@@ -0,0 +1,301 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.BasicAuthAccountController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.BasicAuthCredentials;
+import org.onap.portalapp.portal.domain.EPEndpoint;
+import org.onap.portalapp.portal.domain.EPUser;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.BasicAuthAccountService;
+import org.onap.portalapp.portal.service.BasicAuthAccountServiceImpl;
+import org.onap.portalapp.util.EPUserUtils;
+
+public class BasicAuthAccountControllerTest extends MockitoTestSuite {
+
+       @Mock
+       BasicAuthAccountService basicAuthAccountService = new BasicAuthAccountServiceImpl();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+
+       @InjectMocks
+       BasicAuthAccountController basicAuthAccountController = new BasicAuthAccountController();
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       MockEPUser mockUser = new MockEPUser();
+
+       public BasicAuthCredentials basicAuthCredentials() {
+               BasicAuthCredentials basicAuthCredentials = new BasicAuthCredentials();
+
+               basicAuthCredentials.setId((long) 1);
+               basicAuthCredentials.setApplicationName("test");
+               basicAuthCredentials.setUsername("Test");
+               basicAuthCredentials.setPassword("Password");
+               basicAuthCredentials.setIsActive("YES");
+
+               List<EPEndpoint> endpoints = new ArrayList<EPEndpoint>();
+
+               EPEndpoint ePEndpoint = new EPEndpoint();
+               ePEndpoint.setId((long) 1);
+               ePEndpoint.setName("Test");
+               endpoints.add(ePEndpoint);
+               basicAuthCredentials.setEndpoints(endpoints);
+
+               return basicAuthCredentials;
+
+       }
+
+       @Test
+       public void createBasicAuthAccountTest() throws Exception {
+               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
+
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("SUCCESS");
+               expectedResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.OK);
+               long accountd = 1;
+
+               Mockito.when(basicAuthAccountService.saveBasicAuthAccount(basicAuthCredentials)).thenReturn(accountd);
+
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
+                               mockedResponse, basicAuthCredentials);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void createBasicAuthAccountAdminTest() throws Exception {
+               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("Authorization Required");
+               expectedResponse.setResponse("Admin Only Operation! ");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
+
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
+                               mockedResponse, basicAuthCredentials);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void createBasicAuthAccountIfInputNullTest() throws Exception {
+               BasicAuthCredentials basicAuthCredentials = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("FAILURE");
+               expectedResponse.setResponse("newBasicAuthAccount cannot be null or empty");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
+                               mockedResponse, basicAuthCredentials);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void getBasicAuthAccountTest() throws Exception {
+               PortalRestResponse<List<BasicAuthCredentials>> expectedPortalResponse = new PortalRestResponse<List<BasicAuthCredentials>>();
+               List<BasicAuthCredentials> basicAuthCredentialsList = new ArrayList<BasicAuthCredentials>();
+               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
+               basicAuthCredentialsList.add(basicAuthCredentials);
+
+               expectedPortalResponse.setMessage("Success");
+               expectedPortalResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedPortalResponse.setStatus(portalRestStatusEnum.OK);
+
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(basicAuthAccountService.getAccountData()).thenReturn(null);
+               PortalRestResponse<List<BasicAuthCredentials>> actualResponse = basicAuthAccountController
+                               .getBasicAuthAccount(mockedRequest, mockedResponse);
+               assertEquals(expectedPortalResponse, actualResponse);
+       }
+
+       @Test
+       public void getBasicAuthAccountIfSuperAdminTest() throws Exception {
+               PortalRestResponse<List<BasicAuthCredentials>> expectedPortalResponse = new PortalRestResponse<List<BasicAuthCredentials>>();
+               List<BasicAuthCredentials> basicAuthCredentialsList = new ArrayList<BasicAuthCredentials>();
+               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
+               basicAuthCredentialsList.add(basicAuthCredentials);
+
+               expectedPortalResponse.setMessage("UnAuthorized! Admin Only Operation");
+               expectedPortalResponse.setResponse(new ArrayList<>());
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedPortalResponse.setStatus(portalRestStatusEnum.ERROR);
+
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(basicAuthAccountService.getAccountData()).thenReturn(null);
+               PortalRestResponse<List<BasicAuthCredentials>> actualResponse = basicAuthAccountController
+                               .getBasicAuthAccount(mockedRequest, mockedResponse);
+               assertEquals(expectedPortalResponse, actualResponse);
+       }
+
+       @Test
+       public void updateAccountTest() throws Exception {
+               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("SUCCESS");
+               expectedResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.OK);
+               long accountd = 1;
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
+                               mockedResponse, accountd, basicAuthCredentials);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void updateAccountIfSuperAdminTest() throws Exception {
+               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
+
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("Authorization Required");
+               expectedResponse.setResponse("Admin Only Operation! ");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
+               long accountd = 1;
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
+                               mockedResponse, accountd, basicAuthCredentials);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void updateAccountIfInputNullTest() throws Exception {
+               BasicAuthCredentials basicAuthCredentials = null;
+
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("FAILURE");
+               expectedResponse.setResponse("BasicAuthCredentials cannot be null or empty");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
+               long accountd = 1;
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
+                               mockedResponse, accountd, basicAuthCredentials);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void deleteAccountTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("SUCCESS");
+               expectedResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.OK);
+               long accountd = 1;
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.deleteAccount(mockedRequest,
+                               mockedResponse, accountd);
+               assertEquals(actualResponse, expectedResponse);
+       }
+
+       @Test
+       public void deleteAccountIfNotSuperAdminTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("Authorization Required");
+               expectedResponse.setResponse("Admin Only Operation! ");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
+               long accountd = 1;
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               PortalRestResponse<String> actualResponse = basicAuthAccountController.deleteAccount(mockedRequest,
+                               mockedResponse, accountd);
+               System.out.println(actualResponse);
+               assertEquals(actualResponse, expectedResponse);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/CommonWidgetControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/CommonWidgetControllerTest.java
new file mode 100644 (file)
index 0000000..76961f8
--- /dev/null
@@ -0,0 +1,121 @@
+
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.CommonWidgetController;
+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.DashboardSearchService;
+import org.onap.portalapp.portal.service.DashboardSearchServiceImpl;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+
+public class CommonWidgetControllerTest {
+
+       @Mock
+       DashboardSearchService dashboardSearchService = new DashboardSearchServiceImpl();
+
+       @InjectMocks
+       CommonWidgetController commonWidgetController = new CommonWidgetController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getWidgetDataTest() {
+               String resourceType = "Test";
+               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
+               @SuppressWarnings("rawtypes")
+               PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
+               ecpectedPortalRestResponse.setMessage("Unexpected resource type Test");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
+               assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
+
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getWidgetDataTestNew() {
+               String resourceType = "EVENTS";
+               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
+               @SuppressWarnings("rawtypes")
+               PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
+               assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
+
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getWidgetDataExceptionTest() {
+               String resourceType = "null";
+               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
+               @SuppressWarnings("rawtypes")
+               PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
+               ecpectedPortalRestResponse.setMessage("Unexpected resource type null");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
+               assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ConsulClientControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ConsulClientControllerTest.java
new file mode 100644 (file)
index 0000000..8481413
--- /dev/null
@@ -0,0 +1,179 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.ConsulClientController;
+import org.onap.portalapp.portal.domain.BEProperty;
+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.ConsulHealthService;
+import org.onap.portalapp.portal.service.ConsulHealthServiceImpl;
+
+import com.orbitz.consul.ConsulException;
+import com.orbitz.consul.model.health.ServiceHealth;
+
+import io.searchbox.client.config.exception.NoServerConfiguredException;
+
+public class ConsulClientControllerTest {
+
+       @Mock
+       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
+
+       @InjectMocks
+       ConsulClientController consulClientController = new ConsulClientController();
+
+       NoServerConfiguredException noServerConfiguredException = new NoServerConfiguredException(null);
+
+       String service = "Test";
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       ConsulException consulException = new ConsulException(nullPointerException);
+
+       @Test
+       public void getServiceLocationTest() {
+               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
+               ecpectedPortalRestResponse.setMessage("Success!");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
+               actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
+       }
+
+       @Test
+       public void getServiceLocationExceptionTest() {
+               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
+               ecpectedPortalRestResponse.setMessage("Warning!");
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.WARN);
+               PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
+               Mockito.when(consulHealthService.getServiceLocation(service, null)).thenThrow(noServerConfiguredException);
+               actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.getMessage().equals(ecpectedPortalRestResponse.getMessage()));
+               assertTrue(actualPortalRestRespone.getStatus().equals(ecpectedPortalRestResponse.getStatus()));
+
+       }
+
+       @Test
+       public void getServiceLocationExceptionConsulExceptionTest() {
+               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
+               ecpectedPortalRestResponse.setMessage("Error!");
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
+               Mockito.when(consulHealthService.getServiceLocation(service, null)).thenThrow(consulException);
+               actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.getMessage().equals(ecpectedPortalRestResponse.getMessage()));
+               assertTrue(actualPortalRestRespone.getStatus().equals(ecpectedPortalRestResponse.getStatus()));
+       }
+
+       public PortalRestResponse<List<ServiceHealth>> successResponse() {
+               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = new PortalRestResponse<List<ServiceHealth>>();
+               List<ServiceHealth> healths = new ArrayList<ServiceHealth>();
+               ecpectedPortalRestResponse.setMessage("Success!");
+               ecpectedPortalRestResponse.setResponse(healths);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               return ecpectedPortalRestResponse;
+       }
+
+       public PortalRestResponse<List<ServiceHealth>> errorResponse() {
+               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = new PortalRestResponse<List<ServiceHealth>>();
+               List<ServiceHealth> healths = new ArrayList<ServiceHealth>();
+               ecpectedPortalRestResponse.setMessage("Error!");
+               ecpectedPortalRestResponse.setResponse(healths);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               return ecpectedPortalRestResponse;
+       }
+
+       @Test
+       public void getAllHealthyNodesTest() {
+               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = successResponse();
+               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
+               actualPortalRestRespone = consulClientController.getAllHealthyNodes(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
+
+       }
+
+       @Test
+       public void getAllHealthyNodesExceptionTest() {
+               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = errorResponse();
+               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
+               Mockito.when(consulHealthService.getAllHealthyNodes(service)).thenThrow(consulException);
+               actualPortalRestRespone = consulClientController.getAllHealthyNodes(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
+       }
+
+       @Test
+       public void getAllNodesTest() {
+               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = successResponse();
+               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
+               actualPortalRestRespone = consulClientController.getAllNodes(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
+       }
+
+       @Test
+       public void getAllNodesExceptionTest() {
+               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = errorResponse();
+               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
+               Mockito.when(consulHealthService.getAllNodes(service)).thenThrow(consulException);
+               actualPortalRestRespone = consulClientController.getAllNodes(mockedRequest, mockedResponse, service);
+               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/DashboardControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/DashboardControllerTest.java
new file mode 100644 (file)
index 0000000..37f7f68
--- /dev/null
@@ -0,0 +1,467 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+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.controller.DashboardController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.service.DashboardSearchServiceImpl;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+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;
+
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({EPUserUtils.class, CollaborateList.class, SystemProperties.class, EPCommonSystemProperties.class})
+public class DashboardControllerTest {
+       
+       @Mock
+       DashboardSearchService searchService = new DashboardSearchServiceImpl();
+       
+       @InjectMocks
+       DashboardController dashboardController = new DashboardController();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       MockEPUser mockUser = new MockEPUser();
+       
+       public CommonWidgetMeta mockCommonWidgetMeta() {
+               CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta();
+               List<CommonWidget> widgetList = new ArrayList<>();
+               CommonWidget commonWidget = new CommonWidget();         
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("test");
+               commonWidget.setHref("testhref");
+               commonWidget.setTitle("testTitle");
+           commonWidget.setContent("testcontent");
+           commonWidget.setEventDate("testDate");
+           commonWidget.setSortOrder(1);                   
+               widgetList.add(commonWidget);           
+               commonWidgetMeta.setItems(widgetList);
+               
+               return commonWidgetMeta;
+       }
+       
+       public CommonWidget mockCommonWidget() {
+               
+               CommonWidget commonWidget = new CommonWidget();         
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("test");
+               commonWidget.setHref("testhref");
+               commonWidget.setTitle("testTitle");
+           commonWidget.setContent("testcontent");
+           commonWidget.setEventDate("testDate");
+           commonWidget.setSortOrder(1);
+           
+           return commonWidget;
+       }
+       
+       
+       @Test
+       public void getWidgetDataTest() throws IOException {
+               
+               String resourceType = null;
+               PortalRestResponse<CommonWidgetMeta> expectedData = new PortalRestResponse<CommonWidgetMeta>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("Unexpected resource type null");
+               expectedData.setResponse(null);
+               
+               PortalRestResponse<CommonWidgetMeta> actualResponse =   dashboardController.getWidgetData(mockedRequest, resourceType);
+               assertEquals(expectedData,actualResponse);              
+       }       
+       
+       @Test
+       public void getWidgetDataWithValidResourceTest() throws IOException {
+               String resourceType = "EVENTS";
+               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
+               commonWidgetMeta.setCategory(null);
+                               
+               Mockito.when(searchService.getWidgetData(resourceType)).thenReturn(commonWidgetMeta);
+               PortalRestResponse<CommonWidgetMeta> expectedData = new PortalRestResponse<CommonWidgetMeta>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse(commonWidgetMeta);
+               
+               PortalRestResponse<CommonWidgetMeta> actualResponse = dashboardController.getWidgetData(mockedRequest, resourceType);
+               assertEquals(expectedData,actualResponse);
+       }
+               
+       @Test
+       public void saveWidgetDataBulkNullTest() throws IOException {
+               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
+               commonWidgetMeta.setCategory(null);
+               
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("ERROR");
+               expectedData.setResponse("Category cannot be null or empty");
+               
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(expectedData,actualResponse);              
+       }
+       
+       @Test
+       public void saveWidgetUnexpectedDataBulkTest() throws IOException {
+               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
+               commonWidgetMeta.setCategory("Unexpected Data");
+               
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("Unexpected resource type Unexpected Data");
+               expectedData.setResponse(null);
+               
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(expectedData,actualResponse);
+               
+       }
+               
+       @Test
+       public void saveWidgetInvalidDataBulkTest() throws IOException {
+               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
+               commonWidgetMeta.setCategory("EVENTS");
+               
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("Invalid category: test");
+               expectedData.setResponse(null);
+               
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(expectedData,actualResponse);              
+       }
+       
+       @Test
+       public void saveWidgetDataBulkTest() throws IOException {
+               
+               List<CommonWidget> widgetList = new ArrayList<>();              
+               CommonWidget commonWidget = new CommonWidget("EVENTS", "http://test.com", "testTitle", "testcontent", "2017-07-01", 1);
+               widgetList.add(commonWidget);
+               CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta("EVENTS", widgetList);
+               
+                                   
+                               
+       /*      commonWidgetMeta.setItems(widgetList);
+               
+               commonWidgetMeta.setCategory("EVENTS");*/
+               
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse("success");
+               
+               Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn("success");
+               
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(expectedData,actualResponse);              
+       }
+       
+       @Test
+       public void saveWidgetDataNullTest() throws IOException {
+                               
+               CommonWidget commonWidget = mockCommonWidget(); 
+               commonWidget.setId((long)1);
+               commonWidget.setContent("test");
+               commonWidget.setCategory(null);
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("ERROR");
+               expectedData.setResponse("Category cannot be null or empty");
+               
+               Mockito.when(adminRolesService.isSuperAdmin(Matchers.anyObject())).thenReturn(true);
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget, mockedRequest, mockedResponse);
+               assertEquals(expectedData,actualResponse);
+               
+       }
+       
+       @Test
+       public void saveWidgetDataErrorTest() throws IOException {
+                               
+               CommonWidget commonWidget = mockCommonWidget();         
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("Invalid category: test");
+               expectedData.setResponse(null); 
+               Mockito.when(adminRolesService.isSuperAdmin(Matchers.anyObject())).thenReturn(true);
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget, mockedRequest, mockedResponse);
+               assertEquals(expectedData,actualResponse);              
+       }
+       
+       @Test
+       public void saveWidgetDataTest() throws IOException {
+                               
+               CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta();
+               List<CommonWidget> widgetList = new ArrayList<>();
+               CommonWidget commonWidget = new CommonWidget();         
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("EVENTS");
+               commonWidget.setHref("http://test.com");
+               commonWidget.setTitle("testTitle");
+           commonWidget.setContent("testcontent");
+           commonWidget.setEventDate("2017-07-01");
+           commonWidget.setSortOrder(1);                   
+               widgetList.add(commonWidget);           
+               commonWidgetMeta.setItems(widgetList);
+               
+               commonWidgetMeta.setCategory("EVENTS");
+               
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse("success"); 
+               Mockito.when(adminRolesService.isSuperAdmin(Matchers.anyObject())).thenReturn(true);
+               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn("success");
+               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget, mockedRequest, mockedResponse);
+               assertEquals(expectedData,actualResponse);
+               
+       }
+       
+       @Test
+       public void deleteWidgetDataTest() throws IOException {
+                               
+               CommonWidget commonWidget = mockCommonWidget();
+               
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse(null); 
+               
+               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn("success");
+               
+               PortalRestResponse<String> actualResponse = dashboardController.deleteWidgetData(commonWidget);
+               assertEquals(expectedData,actualResponse);
+               
+       }
+               
+       @Test
+       public void getActiveUsersTest(){
+               List<String> activeUsers = new ArrayList<>();
+               List<String> expectedUsersList = new ArrayList<>();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String userId = user.getOrgUserId();
+               Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(activeUsers);
+               expectedUsersList=      dashboardController.getActiveUsers(mockedRequest);
+               assertEquals(expectedUsersList, activeUsers);
+       }
+       
+       
+       @Test
+       public void getActiveUsersExceptionTest(){
+               List<String> activeUsers = new ArrayList<>();
+               List<String> expectedUsersList = new ArrayList<>();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String userId = user.getOrgUserId();
+               Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
+               expectedUsersList = dashboardController.getActiveUsers(mockedRequest);
+               assertEquals(expectedUsersList, activeUsers);
+       }
+               
+       @Test
+       public void getOnlineUserUpdateRateTest(){
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse("{onlineUserUpdateRate=1400000, onlineUserUpdateDuration=1400000}"); 
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE)).thenReturn("1400"); 
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION)).thenReturn("1400");
+               
+               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getOnlineUserUpdateRate(mockedRequest);
+               assertEquals(expectedData.getStatus(),actualResponse.getStatus());
+       }
+       
+       @Test
+       public void getOnlineUserUpdateRateExceptionTest(){
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("java.lang.NullPointerException");
+               expectedData.setResponse(null); 
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE)).thenThrow(nullPointerException); 
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION)).thenThrow(nullPointerException);
+               
+               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getOnlineUserUpdateRate(mockedRequest);
+               assertEquals(expectedData,actualResponse);
+       }
+       
+       @Test
+       public void getWindowWidthThresholdForRightMenuTest(){
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse("{windowWidth=1400}"); 
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU)).thenReturn("1400");
+               
+               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForRightMenu(mockedRequest);
+               assertEquals(expectedData.getStatus(),actualResponse.getStatus());
+       }
+       
+       @Test
+       public void getWindowWidthThresholdForRightMenuExceptionTest(){
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("java.lang.NullPointerException");
+               expectedData.setResponse(null); 
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU)).thenThrow(nullPointerException);
+               
+               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForRightMenu(mockedRequest);
+               assertEquals(expectedData,actualResponse);
+       }
+       
+       @Test
+       public void getWindowWidthThresholdForLeftMenuTest(){
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");             
+               expectedData.setResponse("{windowWidth=1400}"); 
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU)).thenReturn("1400");
+               
+               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForLeftMenu(mockedRequest);
+               assertEquals(expectedData.getStatus(),actualResponse.getStatus());
+       }
+       
+       @Test
+       public void getWindowWidthThresholdForLeftMenuExceptionTest(){
+               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("java.lang.NullPointerException");
+               expectedData.setResponse(null); 
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU)).thenThrow(nullPointerException);
+               
+               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForLeftMenu(mockedRequest);
+               assertEquals(expectedData,actualResponse);
+       }
+               
+       @Test
+       public void getActiveUsersNullTest(){
+               PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("User object is null? - check logs");
+               expectedData.setResponse(new ArrayList<>()); 
+
+               PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
+               assertEquals(expectedData,actualResponse);
+       }
+       
+       @Test
+       public void activeUsersTest(){
+               EPUser user = mockUser.mockEPUser();
+               PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
+               expectedData.setStatus(PortalRestStatusEnum.OK);
+               expectedData.setMessage("success");
+               expectedData.setResponse(new ArrayList<>()); 
+               PowerMockito.mockStatic(EPUserUtils.class);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
+               assertEquals(expectedData,actualResponse);
+       }
+       
+       @Test
+       public void activeUsersExceptionTest(){
+               EPUser user = mockUser.mockEPUser();
+               user.setLoginId("test");
+               PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
+               expectedData.setStatus(PortalRestStatusEnum.ERROR);
+               expectedData.setMessage("null - check logs.");
+               expectedData.setResponse(null);  
+               
+               PowerMockito.mockStatic(EPUserUtils.class);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
+               PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
+               assertTrue(actualResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java
new file mode 100644 (file)
index 0000000..229f1ba
--- /dev/null
@@ -0,0 +1,403 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.DashboardSearchResultController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.service.DashboardSearchServiceImpl;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalapp.util.EPUserUtils;
+
+public class DashboardSearchResultControllerTest {
+
+       @Mock
+       DashboardSearchService searchService = new DashboardSearchServiceImpl();
+
+       @InjectMocks
+       DashboardSearchResultController dashboardSearchResultController = new DashboardSearchResultController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void getWidgetDataTest() {
+               String resourceType = "test";
+               PortalRestResponse<CommonWidgetMeta> ecpectedPortalRestResponse = new PortalRestResponse<CommonWidgetMeta>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               Mockito.when(searchService.getWidgetData(resourceType)).thenReturn(null);
+               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = dashboardSearchResultController
+                               .getWidgetData(mockedRequest, resourceType);
+               assertEquals(acutualPoratlRestResponse, ecpectedPortalRestResponse);
+
+       }
+
+       @Test
+       public void saveWidgetDataBulkTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+
+               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+               commonWidgetMeta.setCategory("test");
+
+               List<CommonWidget> commonWidgetList = new ArrayList<CommonWidget>();
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("test");
+               commonWidget.setHref("test_href");
+               commonWidget.setTitle("test_title");
+               commonWidget.setContent("test_content");
+               commonWidget.setEventDate(null);
+               commonWidget.setSortOrder(1);
+
+               commonWidgetList.add(commonWidget);
+
+               commonWidgetMeta.setItems(commonWidgetList);
+
+               Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn(null);
+
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataBulkIfCategoryNullTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"1\"");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+
+               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+               commonWidgetMeta.setCategory("test");
+
+               List<CommonWidget> commonWidgetList = new ArrayList<CommonWidget>();
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId(null);
+               commonWidget.setCategory(null);
+               commonWidget.setHref(null);
+               commonWidget.setTitle(null);
+               commonWidget.setContent("test_content");
+               commonWidget.setEventDate("1");
+               commonWidget.setSortOrder(1);
+               commonWidgetList.add(commonWidget);
+               commonWidgetMeta.setItems(commonWidgetList);
+
+               Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn(null);
+
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("test");
+               commonWidget.setHref("test_href");
+               commonWidget.setTitle("test_title");
+               commonWidget.setContent("test_content");
+               commonWidget.setEventDate(null);
+               commonWidget.setSortOrder(1);
+
+               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
+
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetData(commonWidget);
+               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+
+       }
+
+       @Test
+       public void saveWidgetDataExceptionTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("ERROR");
+               ecpectedPortalRestResponse.setResponse("Cateogry cannot be null or empty");
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("");
+               commonWidget.setHref("test_href");
+               commonWidget.setTitle("test_title");
+               commonWidget.setContent("test_content");
+               commonWidget.setEventDate(null);
+               commonWidget.setSortOrder(1);
+
+               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
+
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetData(commonWidget);
+               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+
+       }
+
+       @Test
+       public void saveWidgetDataDateErrorTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"1\"");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("test");
+               commonWidget.setHref("test_href");
+               commonWidget.setTitle("test_title");
+               commonWidget.setContent("test_content");
+               commonWidget.setEventDate("1");
+               commonWidget.setSortOrder(1);
+
+               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
+
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetData(commonWidget);
+               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+
+       }
+
+       public void deleteWidgetDataTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setCategory("test");
+               commonWidget.setHref("test_href");
+               commonWidget.setTitle("test_title");
+               commonWidget.setContent("test_content");
+               commonWidget.setEventDate(null);
+               commonWidget.setSortOrder(1);
+               Mockito.when(searchService.deleteWidgetData(commonWidget)).thenReturn(null);
+
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .deleteWidgetData(commonWidget);
+               System.out.println(actualPortalRestResponse);
+               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
+       }
+
+       @Test
+       public void searchPortalIfUserIsNull() {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = "test";
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("searchPortal: User object is null? - check logs");
+               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+       }
+
+       @Test
+       public void searchPortalIfSearchStringNullTest() {
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = null;
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("searchPortal: String string is null");
+               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+       }
+
+       @Test
+       public void searchPortalIfSearchTest() {
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = "test";
+               List<SearchResultItem> searchResultItemList = new ArrayList<SearchResultItem>();
+               SearchResultItem searchResultItem = new SearchResultItem();
+
+               searchResultItem.setId((long) 1);
+               searchResultItem.setCategory("test");
+               searchResultItem.setName("test_name");
+               searchResultItem.setTarget("test_target");
+               searchResultItem.setUuid("test_UUId");
+               searchResultItemList.add(searchResultItem);
+               Map<String, List<SearchResultItem>> expectedResultMap = new HashMap<String, List<SearchResultItem>>();
+               expectedResultMap.put(searchString, searchResultItemList);
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("success");
+               expectedResult.setResponse(expectedResultMap);
+               expectedResult.setStatus(PortalRestStatusEnum.OK);
+
+               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenReturn(expectedResultMap);
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+
+       }
+
+       @Test
+       public void searchPortalIfSearchExcptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = "test";
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("null - check logs.");
+               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+
+               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenThrow(nullPointerException);
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+       }
+
+       @Test
+       public void getActiveUsersTest() {
+               List<String> expectedActiveUsers = new ArrayList<String>();
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String userId = user.getOrgUserId();
+               Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(expectedActiveUsers);
+               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
+               assertEquals(expectedActiveUsers, actualOnlineUsers);
+
+       }
+
+       @Test
+       public void getActiveUsersExceptionTest() {
+               List<String> expectedActiveUsers = new ArrayList<String>();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String userId = user.getOrgUserId();
+               Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
+               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
+               assertEquals(expectedActiveUsers, actualOnlineUsers);
+
+       }
+
+       @Test
+       public void activeUsersTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
+               expectedResult.setMessage("success");
+               expectedResult.setResponse(new ArrayList<>());
+               expectedResult.setStatus(PortalRestStatusEnum.OK);
+               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
+
+               assertEquals(actualResult, expectedResult);
+
+       }
+
+       @Test
+       public void activeUsersIfUserNullTest() {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
+               expectedResult.setMessage("User object is null? - check logs");
+               expectedResult.setResponse(new ArrayList<>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
+               assertEquals(actualResult, expectedResult);
+
+       }
+
+       @Test
+       public void activeUsersExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
+               expectedResult.setMessage("null - check logs.");
+               expectedResult.setResponse(new ArrayList<>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+               Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
+               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
+               assertEquals(actualResult, expectedResult);
+
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/EPFusionBaseControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/EPFusionBaseControllerTest.java
new file mode 100644 (file)
index 0000000..d7950e3
--- /dev/null
@@ -0,0 +1,151 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.EPFusionBaseController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.service.DashboardSearchServiceImpl;
+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.domain.MenuData;
+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;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({EPUserUtils.class, SystemProperties.class, EPCommonSystemProperties.class, EcompPortalUtils.class})
+public class EPFusionBaseControllerTest {
+
+       @Mock
+       DashboardSearchService searchService = new DashboardSearchServiceImpl();
+       
+       @InjectMocks
+       EPFusionBaseController epFusionBaseController = new EPFusionBaseController() {
+       };
+
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       MockEPUser mockUser = new MockEPUser();
+       
+       @Test
+       public void messagesExceptionTest(){
+               Map<String, Object> expectedData = new HashMap<String, Object>();
+               Map<String, Object> actualData = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).thenReturn("test"); 
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Set<MenuData> menuResult = null;
+               HttpSession  session = mockedRequest.getSession();
+               Mockito.when(session
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuResult);
+               actualData = epFusionBaseController.messages(mockedRequest);
+               assertEquals(expectedData,actualData );
+               System.out.println();
+               
+       }
+       
+       @Test
+       public void messagesTest(){
+               Map<String, Object> expectedData = new HashMap<String, Object>();
+               Map<String, Object> actualData = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).thenReturn("test"); 
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Set<MenuData> menuResult = new HashSet<>();
+               MenuData menuData= new MenuData();
+               menuResult.add(menuData);
+               menuData.setChildMenus(menuResult);
+               HttpSession  session = mockedRequest.getSession();
+               Mockito.when(session
+                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuResult);
+               actualData = epFusionBaseController.messages(mockedRequest);
+               assertEquals(actualData.size(), 2);
+       }
+       
+       @Test
+       public void isAccessibleTest()
+       {
+               assertTrue(epFusionBaseController.isAccessible());
+       }
+       @Test
+       public void isRESTfulCallTest()
+       {
+               assertTrue(epFusionBaseController.isRESTfulCall());
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/EPRestrictedBaseControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/EPRestrictedBaseControllerTest.java
new file mode 100644 (file)
index 0000000..ca41512
--- /dev/null
@@ -0,0 +1,70 @@
+
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+
+public class EPRestrictedBaseControllerTest {
+
+       @InjectMocks
+       EPRestrictedBaseController ePRestrictedBaseController = new EPRestrictedBaseController() ;
+
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+   @Test
+       public void isAccessibleTest()
+       {
+               assertFalse(ePRestrictedBaseController.isAccessible());
+       }
+       
+   @Test
+       public void isRESTfulCallTest()
+       {
+               assertFalse(ePRestrictedBaseController.isRESTfulCall());
+       }
+}
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
new file mode 100644 (file)
index 0000000..859cc4c
--- /dev/null
@@ -0,0 +1,711 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+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.CentralV2RoleFunction;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+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.ExternalAccessRolesService;
+import org.onap.portalapp.portal.service.ExternalAccessRolesServiceImpl;
+import org.onap.portalapp.portal.transport.CentralRoleFunction;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalsdk.core.domain.AuditLog;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
+import org.springframework.beans.BeanUtils;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.client.HttpClientErrorException;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class ExternalAccessRolesControllerTest {
+
+       @Mock
+       ExternalAccessRolesService externalAccessRolesService = new ExternalAccessRolesServiceImpl();
+
+       @InjectMocks
+       ExternalAccessRolesController externalAccessRolesController = new ExternalAccessRolesController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       @Mock
+       AuditLog auditLog = new AuditLog();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Failed");
+
+       MockEPUser mockUser = new MockEPUser();
+       String loginId = "guestT";
+       String uebKey = "testUebKey";
+
+       @Test
+       public void getUserTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               List<EPUser> userList = new ArrayList<>();
+               Mockito.when(externalAccessRolesService.getUser(loginId)).thenReturn(userList);
+               externalAccessRolesController.getUser(mockedRequest, mockedResponse, loginId);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getUserExceptionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               externalAccessRolesController.getUser(mockedRequest, mockedResponse, loginId);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+       
+       public EPApp mockApp()
+       {
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(false);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+               return app;
+       }
+       
+       @Test(expected = NullPointerException.class)
+       public void getRolesForAppTest() throws Exception {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               List<CentralV2Role> answer = new ArrayList<>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
+               Mockito.when(externalAccessRolesService.getRolesForApp(mockedRequest.getHeader(uebKey))).thenReturn(answer);
+               assertEquals(externalAccessRolesController.getRolesForApp(mockedRequest, mockedResponse), null);
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void getRolesForAppExceptionTest() throws Exception {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
+               externalAccessRolesController.getRolesForApp(mockedRequest,mockedResponse);
+               List<CentralV2Role> role = externalAccessRolesService.getRolesForApp(mockedRequest.getHeader(uebKey));
+               assertEquals(null,role);
+       }
+
+       @Test
+       public void getRoleFunctionsListTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               List<CentralV2RoleFunction> answer = null;
+               Mockito.when(externalAccessRolesService.getRoleFuncList(mockedRequest.getHeader(uebKey))).thenReturn(null);
+               assertEquals(externalAccessRolesController.getRoleFunctionsList(mockedRequest, mockedResponse), answer);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getRoleFunctionsListExceptionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               externalAccessRolesController.getRoleFunctionsList(mockedRequest, mockedResponse);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getRoleInfoTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);            
+               CentralV2Role answer = new CentralV2Role();
+               long roleId = 1;
+               Mockito.when(externalAccessRolesService.getRoleInfo(roleId, mockedRequest.getHeader(uebKey)))
+                               .thenReturn(answer);
+               externalAccessRolesController.getRoleInfo(mockedRequest, mockedResponse, roleId);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getRoleInfoExceptionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               long roleId = 1;
+               assertNull(externalAccessRolesController.getRoleInfo(mockedRequest, mockedResponse, roleId));
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getRoleFunctionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction();
+               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
+               String code = "test_menu";
+               Mockito.when(externalAccessRolesService.getRoleFunction(code, mockedRequest.getHeader(uebKey)))
+                               .thenReturn(centralV2RoleFunction);
+               CentralRoleFunction returnedValue = externalAccessRolesController.getRoleFunction(mockedRequest, mockedResponse, code);
+               BeanUtils.copyProperties(centralV2RoleFunction, centralRoleFunction, "type","action");
+               assertEquals(returnedValue,centralRoleFunction);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getRoleFunctionExceptionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               String code = "test_menu";
+               Mockito.when(externalAccessRolesService.getRoleFunction(code, mockedRequest.getHeader(uebKey)))
+                               .thenThrow(httpClientErrorException);
+               assertEquals(new CentralRoleFunction(),externalAccessRolesController.getRoleFunction(mockedRequest, mockedResponse, code));
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void saveRoleFunctionIfIsIsNotDeletedTest() throws Exception {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Invalid uebkey!");
+               expectedportalRestResponse.setResponse("Failed");
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               String data = null;
+               CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction();
+               Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralV2RoleFunction, app)).thenReturn(false);
+               portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+       
+       @Test(expected = NullPointerException.class)
+       public void saveRoleFunctionExceptionTest() throws Exception {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Invalid uebkey!");
+               expectedportalRestResponse.setResponse("Failed");
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, null);
+               System.out.println(portalRestResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+       
+       @Test(expected = NullPointerException.class)
+       public void saveRoleFunctionTest() throws Exception {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               String data = null;
+               CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction();
+               Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralV2RoleFunction, app)).thenReturn(true);
+               portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
+               System.out.println(portalRestResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       @Ignore
+       public void deleteRoleFunctionTest() throws Exception {
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully Deleted");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               EPUser user = mockUser.mockEPUser();
+               EPApp app = mockApp();
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               String code ="testNew";
+               Mockito.when(externalAccessRolesService.getUser(mockedRequest.getHeader("LOGIN_ID"))).thenReturn((List<EPUser>) user);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader("UEBKEY")).get(0)).thenReturn(app);
+               Mockito.when(externalAccessRolesService.deleteCentralRoleFunction(code, app)).thenReturn(true);
+               portalRestResponse = externalAccessRolesController.deleteRoleFunction(mockedRequest, mockedResponse, code);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void getActiveRolesTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               Mockito.when(externalAccessRolesService.getActiveRoles(mockedRequest.getHeader(uebKey))).thenReturn(null);
+               List<CentralV2Role> expectedCenRole = externalAccessRolesController.getActiveRoles(mockedRequest, mockedResponse);
+               assertNull(expectedCenRole);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getActiveRolesExceptionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               externalAccessRolesController.getActiveRoles(mockedRequest, mockedResponse);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       /**
+        * It return JSON string which has error information
+        * 
+        * @return JSON String
+        * @throws JsonProcessingException 
+        */
+       private String getInvalidKeyJson() throws JsonProcessingException {
+               final Map<String,String> uebkeyResponse = new HashMap<>();
+               String reason = "";
+               ObjectMapper mapper = new ObjectMapper();
+               uebkeyResponse.put("error","Invalid uebkey!");
+               reason = mapper.writeValueAsString(uebkeyResponse);
+               return reason;
+       }
+
+       @Test
+       public void deleteDependcyRoleRecordExceptionTest() throws Exception {
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Invalid uebkey!");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               long roleId = 123;
+               portalRestResponse = externalAccessRolesController.deleteDependencyRoleRecord(mockedRequest, mockedResponse, roleId);
+               assertEquals(expectedportalRestResponse, portalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadFunctionsTest() throws Exception {
+               Integer result = 0;
+               Mockito.when(externalAccessRolesService.bulkUploadFunctions(mockedRequest.getHeader(uebKey)))
+                               .thenReturn(result);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added: 0");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               portalRestResponse = externalAccessRolesController.bulkUploadFunctions(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadFunctionsExceptionTest() throws Exception {
+               Mockito.when(externalAccessRolesService.bulkUploadFunctions(mockedRequest.getHeader(uebKey)))
+                               .thenThrow(httpClientErrorException);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Failed to bulkUploadFunctions");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               portalRestResponse = externalAccessRolesController.bulkUploadFunctions(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadRolesTest() throws Exception {
+               Integer result = 0;
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added: 0");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               Mockito.when(externalAccessRolesService.bulkUploadRoles(mockedRequest.getHeader(uebKey))).thenReturn(result);
+               portalRestResponse = externalAccessRolesController.bulkUploadRoles(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadRolesTestException() throws Exception {
+               Mockito.when(externalAccessRolesService.bulkUploadRoles(mockedRequest.getHeader(uebKey)))
+                               .thenThrow(httpClientErrorException);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Failed to bulkUploadRoles");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               portalRestResponse = externalAccessRolesController.bulkUploadRoles(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadRoleFunctionsTest() throws Exception {
+               Integer result = 0;
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added: 0");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               Mockito.when(externalAccessRolesService.bulkUploadRolesFunctions(mockedRequest.getHeader(uebKey)))
+                               .thenReturn(result);
+               portalRestResponse = externalAccessRolesController.bulkUploadRoleFunctions(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadRoleFunctionsException() throws Exception {
+               Mockito.when(externalAccessRolesService.bulkUploadRolesFunctions(mockedRequest.getHeader(uebKey)))
+                               .thenThrow(httpClientErrorException);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Failed to bulkUploadRoleFunctions");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               portalRestResponse = externalAccessRolesController.bulkUploadRoleFunctions(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadUserRolesTest() throws Exception {
+               Integer result = 0;
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added: 0");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               Mockito.when(externalAccessRolesService.bulkUploadUserRoles(mockedRequest.getHeader(uebKey)))
+                               .thenReturn(result);
+               portalRestResponse = externalAccessRolesController.bulkUploadUserRoles(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadUserRolesExceptionTest() throws Exception {
+               Mockito.when(externalAccessRolesService.bulkUploadUserRoles(mockedRequest.getHeader(uebKey)))
+                               .thenThrow(httpClientErrorException);
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Failed to bulkUploadUserRoles");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               portalRestResponse = externalAccessRolesController.bulkUploadUserRoles(mockedRequest, mockedResponse);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void bulkUploadPartnerFunctionsTest() throws Exception {
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               portalRestResponse = externalAccessRolesController.bulkUploadPartnerFunctions(mockedRequest, mockedResponse, null);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+
+       @Test
+       public void bulkUploadPartnerRolesTest() throws Exception {
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               List<Role> upload = new ArrayList<>();
+               portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoles(mockedRequest, mockedResponse,
+                               upload);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+
+        @Test
+        public void bulkUploadPartnerRolesExceptionTest() throws Exception
+        {
+                ExternalAccessRolesService externalAccessRolesService = null;
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               List<Role> upload = new ArrayList<>();
+               portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoles(mockedRequest, mockedResponse,
+                               upload);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+        }
+
+       @Test
+       public void getMenuFunctionsTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               Mockito.when(externalAccessRolesService.getMenuFunctionsList(mockedRequest.getHeader(uebKey)))
+                               .thenReturn(null);
+               List<String> expectedFunctionsList = externalAccessRolesController.getMenuFunctions(mockedRequest,
+                               mockedResponse);
+               assertNull(expectedFunctionsList);
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       @Test
+       public void getMenuFunctionsExceptionTest() throws Exception {
+               String reason = getInvalidKeyJson();
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               Mockito.when(externalAccessRolesService.getMenuFunctionsList(mockedRequest.getHeader(uebKey)))
+                               .thenThrow(httpClientErrorException);
+               assertNull(externalAccessRolesController.getMenuFunctions(mockedRequest, mockedResponse));
+               String result = sw.getBuffer().toString().trim();
+               assertEquals(reason, result);
+       }
+
+       
+       @Test
+       public void saveRoleExceptionTest() throws Exception {
+               Role role = new Role();
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Invalid uebkey!");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               List<Role> upload = new ArrayList<>();
+               portalRestResponse = externalAccessRolesController.saveRole(mockedRequest, mockedResponse,role);
+               
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+       
+       @Test
+       public void deleteRoleExceptionTest() throws Exception {
+               String role = "TestNew";
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Invalid uebkey!");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               portalRestResponse = externalAccessRolesController.deleteRole(mockedRequest, mockedResponse,role);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+       
+       
+       @Test
+       public void bulkUploadPartnerRoleFunctionsTest() throws Exception {
+               PortalRestResponse<String> portalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully added");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               List<Role> upload = new ArrayList<>();
+               portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoleFunctions(mockedRequest, mockedResponse,upload);
+               assertEquals(portalRestResponse, expectedportalRestResponse);
+       }
+       
+       @Test
+       public void getUsersOfApplicationTest() throws Exception
+       {
+               List<EcompUser> users = new ArrayList<>();
+               EcompUser user = new EcompUser();
+               user.setOrgUserId("guestT");
+               users.add(user);
+               Mockito.when(externalAccessRolesService.getAllAppUsers(mockedRequest.getHeader(uebKey))).thenReturn(users);
+               List<EcompUser> expectedUsers =         externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse);
+               assertEquals(expectedUsers, users);
+       }
+       
+       @Test(expected = Exception.class)
+       public void getUsersOfApplicationExceptionTest() throws Exception
+       {
+               List<EcompUser> users = new ArrayList<>();
+               EcompUser user = new EcompUser();
+               user.setOrgUserId("guestT");
+               users.add(user);
+               Mockito.when(externalAccessRolesService.getAllAppUsers(mockedRequest.getHeader(uebKey))).thenThrow(nullPointerException);
+               assertNull(externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse));
+       }
+       
+       @Test(expected = NullPointerException.class)
+       public void deleteRoleV2Test() throws Exception
+       {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true, "Success");
+               Mockito.when(externalAccessRolesService.deleteDependencyRoleRecord(Matchers.anyLong(),Matchers.anyString(),Matchers.anyString())).thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Successfully Deleted");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               PortalRestResponse<String> actualResponse =     externalAccessRolesController.deleteRole(mockedRequest, mockedResponse, (long)1);
+               assertNull(actualResponse);
+       }
+       
+       @Test
+       public void deleteRoleV2InvalidUebKeyTest() throws Exception
+       {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenThrow(new Exception("Invalid uebkey!"));
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Invalid uebkey!");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               PortalRestResponse<String> actualResponse =     externalAccessRolesController.deleteRole(mockedRequest, mockedResponse, (long)1);
+               assertEquals(actualResponse, expectedportalRestResponse);
+       }
+       
+       @Test
+       public void deleteRoleV2InvalidUebKeyWithDiffErrorTest() throws Exception
+       {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenThrow(new Exception("test"));
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("test");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               PortalRestResponse<String> actualResponse =     externalAccessRolesController.deleteRole(mockedRequest, mockedResponse, (long)1);
+               assertEquals(actualResponse, expectedportalRestResponse);
+       }
+       
+       
+       @Test(expected = NullPointerException.class)
+       public void deleteRoleV2ExceptionTest() throws Exception
+       {
+               List<EPApp> applicationList = new ArrayList<EPApp>();
+               EPApp app = mockApp();
+               applicationList.add(app);
+               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false, "failed");
+               Mockito.when(externalAccessRolesService.deleteDependencyRoleRecord(Matchers.anyLong(),Matchers.anyString(),Matchers.anyString())).thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Failed to deleteRole");
+               expectedportalRestResponse.setResponse("Failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               PortalRestResponse<String> actualResponse =     externalAccessRolesController.deleteRole(mockedRequest, mockedResponse, (long)1);
+               assertEquals(actualResponse, null);
+       }
+}
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
new file mode 100644 (file)
index 0000000..ae2497e
--- /dev/null
@@ -0,0 +1,211 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.ExternalAppsRestfulController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPLoginServiceImpl;
+import org.onap.portalapp.portal.service.EPRoleService;
+import org.onap.portalapp.portal.service.EPRoleServiceImpl;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.service.FunctionalMenuServiceImpl;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalapp.portal.service.UserNotificationServiceImpl;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.DataAccessServiceImpl;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.slf4j.MDC;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ MDC.class, EPCommonSystemProperties.class })
+public class ExternalAppsRestfulControllerTest {
+
+       @InjectMocks
+       ExternalAppsRestfulController externalAppsRestfulController = new ExternalAppsRestfulController();
+       @Mock
+       FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
+
+       @Mock
+       EPLoginService epLoginService = new EPLoginServiceImpl();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+
+       @Mock
+       UserNotificationService userNotificationService = new UserNotificationServiceImpl();
+
+       @Mock
+       EPRoleService epRoleService = new EPRoleServiceImpl();
+
+       @Mock
+       EcompPortalUtils EcompPortalUtils = new EcompPortalUtils();
+       
+       @Mock
+       DataAccessService DataAccessService = new DataAccessServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       MockEPUser mockUser = new MockEPUser();
+
+        @Test(expected = Exception.class)
+        public void getFunctionalMenuItemsForUserIfUSerNullTest() throws
+        Exception
+        {
+        PowerMockito.mockStatic(EPCommonSystemProperties.class);
+        PowerMockito.mockStatic(MDC.class);
+        EPUser epUser = null;
+        String loginId = "guestT";
+        Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
+        Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+        externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+        mockedResponse);
+        }
+       
+       @Test
+       public void getFunctionalMenuItemsForUserIfSuperAdminTest() throws Exception {
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(MDC.class);
+               EPUser epUser = mockUser.mockEPUser();
+               epUser.setId((long) 1);
+               epUser.setLoginId("guestT");
+               String loginId = "guestT";
+               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+               List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
+               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+               expectedList.add(functionalMenuItem);
+               Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
+               Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(true);
+               Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(expectedList);
+               List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+                               mockedResponse);
+               assertNull(actualList.get(0).menuId);
+       }
+
+       @Test
+       public void getFunctionalMenuItemsForUserTest() throws Exception {
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(MDC.class);
+               EPUser epUser = mockUser.mockEPUser();
+               epUser.setId((long) 1);
+               epUser.setLoginId("guestT");
+               String loginId = "guestT";
+               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+               List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
+               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+               expectedList.add(functionalMenuItem);
+               Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
+               Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(false);
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId()))
+                               .thenReturn(expectedList);
+               List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+                               mockedResponse);
+               assertNull(actualList.get(0).menuId);
+       }
+
+       @Test(expected = Exception.class)
+       public void getFavoritesForUserIfUserNullTest() throws Exception {
+               List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
+               FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
+               favorites.add(favoritesFunctionalMenuItemJson);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(MDC.class);
+               Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
+               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               EPUser epUser = null;
+               externalAppsRestfulController.getFavoritesForUser(mockedRequest, mockedResponse);
+       }
+
+       @Test
+       public void getFavoritesForUserTest() throws Exception {
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(MDC.class);
+               EPUser epUser = mockUser.mockEPUser();
+               epUser.setId((long) 1);
+               epUser.setLoginId("guestT");
+               String loginId = "guestT";
+               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
+               FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
+               favorites.add(favoritesFunctionalMenuItemJson);
+               Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
+               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               Mockito.when(epLoginService.findUserWithoutPwd("Login_URL")).thenReturn(epUser);
+               Mockito.when(functionalMenuService.getFavoriteItems(epUser.getId())).thenReturn(favorites);
+               List<FavoritesFunctionalMenuItemJson> actaulFavorites = externalAppsRestfulController
+                               .getFavoritesForUser(mockedRequest, mockedResponse);
+               assertEquals(actaulFavorites.size(), 1);
+       }
+}
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
new file mode 100644 (file)
index 0000000..488717c
--- /dev/null
@@ -0,0 +1,607 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.portalapp.portal.controller.FunctionalMenuController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.service.FunctionalMenuServiceImpl;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRole;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRolesList;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuItemWithRoles;
+import org.onap.portalapp.portal.transport.FieldsValidator.FieldName;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.service.DataAccessService;
+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;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(SystemProperties.class)
+public class FunctionalMenuControllerTest extends MockitoTestSuite {
+
+       String userid = "ab1234";
+
+       @Mock
+       FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
+
+       @InjectMocks
+       FunctionalMenuController functionalMenuController = new FunctionalMenuController();
+
+       @Mock
+       private DataAccessService dataAccessService;
+       
+       @Mock
+       SearchService searchService;
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+       
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       @InjectMocks
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       @Mock
+       EPUser epuser;
+
+       MockEPUser mockUser = new MockEPUser();
+
+       List<BusinessCardApplicationRolesList> appRoles = new ArrayList<BusinessCardApplicationRolesList>();
+       List<BusinessCardApplicationRolesList> appRolesActual = new ArrayList<BusinessCardApplicationRolesList>();
+
+       List<BusinessCardApplicationRole> userAppRoleList = new ArrayList<BusinessCardApplicationRole>();
+
+       public List<BusinessCardApplicationRole> mockBusinessCardApplicationRole() {
+               List<BusinessCardApplicationRole> userAppRoleList = new ArrayList<BusinessCardApplicationRole>();
+
+               BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
+               businessCardApplicationRole.setRoleName("ADMIN");
+               businessCardApplicationRole.setAppName("ASDC");
+
+               BusinessCardApplicationRole businessCardApplicationRole1 = new BusinessCardApplicationRole();
+               businessCardApplicationRole1.setAppName("ASDC");
+               businessCardApplicationRole1.setRoleName("Tester");
+
+               userAppRoleList.add(businessCardApplicationRole);
+               userAppRoleList.add(businessCardApplicationRole1);
+               return userAppRoleList;
+       }
+
+       public List<BusinessCardApplicationRolesList> mockBusinessCardApplicationRolesList() {
+               List<BusinessCardApplicationRolesList> appRolesActual = new ArrayList<BusinessCardApplicationRolesList>();
+
+               BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
+               businessCardApplicationRolesList.setAppName("ASDC");
+
+               List<String> roleNames = new ArrayList<String>();
+               roleNames.add("ADMIN");
+               roleNames.add("Tester");
+               businessCardApplicationRolesList.setRoleNames(roleNames);
+
+               appRolesActual.add(businessCardApplicationRolesList);
+               return appRolesActual;
+       }
+
+       @Test
+       public void getAppListTestIfAppAlredyExistsBusinessCardApplicationRolesList() throws IOException {
+
+               userAppRoleList = mockBusinessCardApplicationRole();
+               appRolesActual = mockBusinessCardApplicationRolesList();
+
+               Mockito.when(functionalMenuService.getUserAppRolesList(userid)).thenReturn(userAppRoleList);
+
+               appRoles = functionalMenuController.getAppList(mockedRequest, userid);
+
+               assertEquals(appRolesActual.size(), appRoles.size());
+               assertEquals(appRolesActual.get(0).getAppName(), appRoles.get(0).getAppName());
+               assertEquals(appRolesActual.get(0).getRoleNames(), appRoles.get(0).getRoleNames());
+
+       }
+
+       @Test
+       public void getAppListTestIfAppDoesnotExistsInBusinessCardApplicationRolesList() throws IOException {
+
+               userAppRoleList = mockBusinessCardApplicationRole();
+               BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
+               businessCardApplicationRole.setAppName("CCD");
+               businessCardApplicationRole.setRoleName("ADMIN");
+               userAppRoleList.add(businessCardApplicationRole);
+               appRolesActual = mockBusinessCardApplicationRolesList();
+               BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
+               businessCardApplicationRolesList.setAppName("CCD");
+               List<String> roleNames1 = new ArrayList<String>();
+               roleNames1.add("ADMIN");
+               businessCardApplicationRolesList.setRoleNames(roleNames1);
+               appRolesActual.add(businessCardApplicationRolesList);
+               Mockito.when(functionalMenuService.getUserAppRolesList(userid)).thenReturn(userAppRoleList);
+               appRoles = functionalMenuController.getAppList(mockedRequest, userid);
+               assertEquals(appRolesActual.size(), appRoles.size());
+               assertEquals(appRolesActual.get(0).getAppName(), appRoles.get(0).getAppName());
+               assertEquals(appRolesActual.get(0).getRoleNames(), appRoles.get(0).getRoleNames());
+               assertEquals(appRolesActual.get(1).getAppName(), appRoles.get(1).getAppName());
+               assertEquals(appRolesActual.get(1).getRoleNames(), appRoles.get(1).getRoleNames());
+
+       }
+
+       @Test
+       public void regenerateAncestorTableTest() {
+               EPUser user = mockUser.mockEPUser();
+
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               FieldsValidator acutualFieldValidator = null;
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(fields);
+               expectedFieldValidator.setErrorCode(null);
+               Mockito.when(!adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(functionalMenuService.regenerateAncestorTable()).thenReturn(expectedFieldValidator);
+               acutualFieldValidator = functionalMenuController.regenerateAncestorTable(mockedRequest, mockedResponse);
+               assertTrue(acutualFieldValidator.equals(expectedFieldValidator));
+       }
+       
+       @Test
+       public void getMenuItemsExceptionTest(){
+               List<FunctionalMenuItem> actualmenuItems = null;
+               List<FunctionalMenuItem> expectedmenuItems = null;
+               
+               Mockito.when(functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse)).thenThrow(nullPointerException);
+               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
+               assertEquals(actualmenuItems, expectedmenuItems);
+       }
+       
+       @Test
+       public void getFunctionalMenuStaticInfoExceptionTest(){
+               String fnMenuStaticactualResponse = null;
+               String fnMenuStaticexpectedResponse = null;
+               String orgUserIdStr = null;
+               
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(searchService.searchUserByUserId(orgUserIdStr)).thenReturn(user);  
+               fnMenuStaticactualResponse = functionalMenuController.getFunctionalMenuStaticInfo(mockedRequest, mockedResponse);
+               
+               assertEquals(fnMenuStaticactualResponse, fnMenuStaticexpectedResponse);
+               
+       }
+       
+       @Test
+       public void getFunctionalMenuStaticInfoTest(){
+               String fnMenuStaticactualResponse = null;
+               String fnMenuStaticexpectedResponse = "{\"firstName\":\"test\",\"lastName\":\"test\",\"last_login\":\"09/08/2017 03:48:13-0400\",\"userId\":\"guestT\",\"email\":\"test\"}";
+               String orgUserIdStr = null;
+               
+               EPUser user = mockUser.mockEPUser();
+               user.setEmail("test");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(searchService.searchUserByUserId(orgUserIdStr)).thenReturn(user);  
+               fnMenuStaticactualResponse = functionalMenuController.getFunctionalMenuStaticInfo(mockedRequest, mockedResponse);
+               assertEquals(fnMenuStaticactualResponse.length(), fnMenuStaticexpectedResponse.length());               
+       }
+       
+       @Test
+       public void getMenuItemsForAuthUserNullTest(){
+               List<FunctionalMenuItem> actualmenuItems = null;
+               List<FunctionalMenuItem> expectedmenuItems = null;
+               
+               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
+               assertEquals(actualmenuItems, expectedmenuItems);
+       }
+       
+       @Test
+       public void getMenuItemsForAuthUserIsSuperAdminTest(){
+               List<FunctionalMenuItem> actualmenuItems = null;
+               List<FunctionalMenuItem> expectedmenuItems = new ArrayList<FunctionalMenuItem>();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               
+               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
+               assertEquals(actualmenuItems, expectedmenuItems);
+       }
+
+       @Test
+       public void getMenuItemsForAuthUserTest(){
+               List<FunctionalMenuItem> actualmenuItems = null;
+               List<FunctionalMenuItem> expectedmenuItems = new ArrayList<FunctionalMenuItem>();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);   
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               
+               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
+               assertEquals(actualmenuItems, expectedmenuItems);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemDetailsBadPermissionTest(){
+               Long menuId = 1234L;
+               FunctionalMenuItem actualmenuItem = null;
+               FunctionalMenuItem expectedmenuItem = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);   
+               
+               actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
+               assertEquals(actualmenuItem, expectedmenuItem);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemDetailsExceptionTest(){
+               Long menuId = 1234L;
+               FunctionalMenuItem actualmenuItem = null;
+               FunctionalMenuItem expectedmenuItem = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.getFunctionalMenuItemDetails(menuId)).thenThrow(nullPointerException);       
+               
+               actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
+               assertEquals(actualmenuItem, expectedmenuItem);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemDetailsTest(){
+               Long menuId = 1234L;
+               FunctionalMenuItem actualmenuItem = null;
+               FunctionalMenuItem expectedmenuItem = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.getFunctionalMenuItemDetails(menuId)).thenReturn(actualmenuItem);    
+               
+               actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
+               assertEquals(actualmenuItem, expectedmenuItem);
+       }
+       
+       @Test
+       public void getMenuItemsForEditingTest(){
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenReturn(actualMenuItems);   
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
+               assertEquals(actualMenuItems, expectedMenuItems);
+       }
+       
+       @Test
+       public void getMenuItemsForEditingBadPermissionsTest(){
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);   
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenReturn(actualMenuItems);   
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
+               assertEquals(actualMenuItems, expectedMenuItems);
+       }
+       
+       @Test
+       public void getMenuItemsForEditingExceptionTest(){
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenThrow(nullPointerException);
+               actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
+               assertEquals(actualMenuItems, expectedMenuItems);
+       }
+       
+       @Test
+       public void getMenuItemsForNotificationsExceptionTest(){
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForNotificationTree(true)).thenThrow(nullPointerException);    
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForNotifications(mockedRequest, mockedResponse);
+               assertEquals(actualMenuItems, expectedMenuItems);
+       }
+       @Test
+       public void getMenuItemsForNotificationsTest(){
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = new ArrayList<FunctionalMenuItem>();
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForNotificationTree(false)).thenReturn(actualMenuItems);       
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForNotifications(mockedRequest, mockedResponse);
+               assertEquals(actualMenuItems, expectedMenuItems);
+       }
+       
+       @Test
+       public void getMenuItemsForAppTest(){
+               Integer appId = 1234;
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForApp(appId)).thenReturn(actualMenuItems);
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForApp(mockedRequest, appId);
+               assertEquals(actualMenuItems, expectedMenuItems);               
+       }
+       
+       @Test
+       public void getMenuItemsForAppExceptionTest(){
+               Integer appId = 1234;
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForApp(appId)).thenThrow(nullPointerException);
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForApp(mockedRequest, appId);
+               assertEquals(actualMenuItems, expectedMenuItems);               
+       }
+       
+       @Test
+       public void getMenuItemsForUserTest(){
+               String orgUserId ="test";
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(orgUserId)).thenReturn(actualMenuItems);                
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForUser(mockedRequest, orgUserId);
+               assertEquals(actualMenuItems, expectedMenuItems);               
+       }
+       
+       @Test
+       public void getMenuItemsForUserExceptionTest(){
+               String orgUserId ="test";
+               List<FunctionalMenuItem> actualMenuItems = null;
+               List<FunctionalMenuItem> expectedMenuItems = null;
+               Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(orgUserId)).thenThrow(nullPointerException);                
+               
+               actualMenuItems = functionalMenuController.getMenuItemsForUser(mockedRequest, orgUserId);
+               assertEquals(actualMenuItems, expectedMenuItems);               
+       }
+       
+       @Test
+       public void createFunctionalMenuItemTest(){
+               FieldsValidator actualFieldsValidator = new FieldsValidator();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               expectedFieldsValidator.setHttpStatusCode((long) 200);
+               expectedFieldsValidator.setFields(fields);
+               expectedFieldsValidator.setErrorCode(null);
+               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(functionalMenuService.createFunctionalMenuItem(menuItemJson)).thenReturn(expectedFieldsValidator);
+               actualFieldsValidator = functionalMenuController.createFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void createFunctionalMenuItemBadPermisssionsTest(){
+               FieldsValidator actualFieldsValidator = null;
+               FieldsValidator expectedFieldsValidator = null;
+               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(functionalMenuService.createFunctionalMenuItem(menuItemJson)).thenReturn(expectedFieldsValidator);
+               actualFieldsValidator = functionalMenuController.createFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void getFavoritesForUserTest(){
+               List<FavoritesFunctionalMenuItemJson> actualFavoritesFunctionalMenuItemsJson = null;
+               List<FavoritesFunctionalMenuItemJson> expectedFunctionalMenuItemsJson = new ArrayList<FavoritesFunctionalMenuItemJson>();
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(functionalMenuService.getFavoriteItems(user.getId())).thenReturn(expectedFunctionalMenuItemsJson);
+               actualFavoritesFunctionalMenuItemsJson = functionalMenuController.getFavoritesForUser(mockedRequest, mockedResponse);
+               assertEquals(actualFavoritesFunctionalMenuItemsJson, expectedFunctionalMenuItemsJson);
+       }
+       
+       @Test
+       public void deleteFavoriteItemTest(){
+               Long userId = (long)1;
+               Long menuId = (long)1;
+               FieldsValidator actualFieldsValidator = new FieldsValidator();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               expectedFieldsValidator.setHttpStatusCode((long) 200);
+               expectedFieldsValidator.setFields(fields);
+               expectedFieldsValidator.setErrorCode(null);
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.removeFavoriteItem(user.getId(), menuId)).thenReturn(actualFieldsValidator);
+               actualFieldsValidator = functionalMenuController.deleteFavoriteItem(mockedRequest, menuId, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void addFavoriteItemTest(){
+               FavoritesFunctionalMenuItem menuItemJson = new FavoritesFunctionalMenuItem();
+               FieldsValidator actualFieldsValidator = new FieldsValidator();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               expectedFieldsValidator.setHttpStatusCode((long) 200);
+               expectedFieldsValidator.setFields(fields);
+               expectedFieldsValidator.setErrorCode(null);
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(functionalMenuService.setFavoriteItem(menuItemJson)).thenReturn(actualFieldsValidator);
+               actualFieldsValidator = functionalMenuController.addFavoriteItem(mockedRequest, menuItemJson, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void getMenuItemsTest(){
+               List<FunctionalMenuItem> actualFunctionalMenuItems = new ArrayList<FunctionalMenuItem>();
+               List<FunctionalMenuItem> expectedFunctionalMenuItems = new ArrayList<FunctionalMenuItem>();
+               List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
+               Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(menuItems);
+               actualFunctionalMenuItems = functionalMenuController.getMenuItems(mockedRequest, mockedResponse);
+               assertEquals(actualFunctionalMenuItems, expectedFunctionalMenuItems);
+       }
+       
+       @Test
+       public void deleteFunctionalMenuItemTest(){
+               Long menuId = (long)1;
+               FieldsValidator actualFieldsValidator = new FieldsValidator();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               expectedFieldsValidator.setHttpStatusCode((long) 200);
+               expectedFieldsValidator.setFields(fields);
+               expectedFieldsValidator.setErrorCode(null);
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(functionalMenuService.deleteFunctionalMenuItem(menuId)).thenReturn(actualFieldsValidator);
+               actualFieldsValidator = functionalMenuController.deleteFunctionalMenuItem(mockedRequest, menuId, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void deleteFunctionalMenuItemBadPermissionsTest(){
+               Long menuId = (long)1;
+               FieldsValidator actualFieldsValidator = null;
+               FieldsValidator expectedFieldsValidator = null;
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(functionalMenuService.deleteFunctionalMenuItem(menuId)).thenReturn(actualFieldsValidator);
+               actualFieldsValidator = functionalMenuController.deleteFunctionalMenuItem(mockedRequest, menuId, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void editFunctionalMenuItemTest(){
+               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
+               FieldsValidator actualFieldsValidator = new FieldsValidator();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+               expectedFieldsValidator.setHttpStatusCode((long) 200);
+               expectedFieldsValidator.setFields(fields);
+               expectedFieldsValidator.setErrorCode(null);
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); 
+               Mockito.when(functionalMenuService.editFunctionalMenuItem(menuItemJson)).thenReturn(actualFieldsValidator);
+               actualFieldsValidator = functionalMenuController.editFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void editFunctionalMenuItemBadPermissionsTest(){
+               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
+               FieldsValidator actualFieldsValidator = null;
+               FieldsValidator expectedFieldsValidator = null;
+               EPUser user = mockUser.mockEPUser();    
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false); 
+               Mockito.when(functionalMenuService.editFunctionalMenuItem(menuItemJson)).thenReturn(actualFieldsValidator);
+               actualFieldsValidator = functionalMenuController.editFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
+               assertEquals(actualFieldsValidator, expectedFieldsValidator);
+       }
+       
+       @Test
+       public void getECOMPTitleTest(){
+               PortalRestResponse<String> actualportalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               expectedportalRestResponse.setMessage("success");
+               expectedportalRestResponse.setResponse("Portal");
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)).thenReturn("Portal");
+               actualportalRestResponse = functionalMenuController.getECOMPTitle(mockedRequest, mockedResponse);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+       
+       @Test
+       public void getECOMPTitleExceptionTest(){
+               PortalRestResponse<String> actualportalRestResponse = null;
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse(null);
+               PowerMockito.mockStatic(SystemProperties.class);
+               
+               Mockito.when(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)).thenThrow(nullPointerException);
+               actualportalRestResponse = functionalMenuController.getECOMPTitle(mockedRequest, mockedResponse);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/GetAccessControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/GetAccessControllerTest.java
new file mode 100644 (file)
index 0000000..dbe4b7b
--- /dev/null
@@ -0,0 +1,108 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.GetAccessController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.GetAccessResult;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.GetAccessService;
+import org.onap.portalapp.portal.service.GetAccessServiceImpl;
+import org.onap.portalapp.util.EPUserUtils;
+
+public class GetAccessControllerTest {
+
+       @Mock
+       GetAccessService getAccessService = new GetAccessServiceImpl();
+
+       @InjectMocks
+       GetAccessController getAccessController = new GetAccessController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       MockEPUser mockUser = new MockEPUser();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       
+       @Test
+       public void getAppList() throws IOException
+       {
+               List<GetAccessResult> expectedAppsList = new ArrayList<GetAccessResult>();
+               EPUser user = mockUser.mockEPUser();
+               GetAccessResult getAccessResult = new GetAccessResult();
+               getAccessResult.setRowId("1");
+               getAccessResult.setRoleId((long) 1);
+               getAccessResult.setEcompFunction("test");
+               getAccessResult.setAppName("Test_App");
+               getAccessResult.setAppMotsId(1);
+               getAccessResult.setRoleName("Test_role");
+               getAccessResult.setRoleActive("N");
+               getAccessResult.setReqType("test");
+               
+               expectedAppsList.add(getAccessResult);
+               
+               List<GetAccessResult> actualAppsList = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(getAccessService.getAppAccessList(user)).thenReturn(expectedAppsList);
+               actualAppsList = getAccessController.getAppList(mockedRequest);
+               assertTrue(actualAppsList.contains(getAccessResult));
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ManifestControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/ManifestControllerTest.java
new file mode 100644 (file)
index 0000000..fdab815
--- /dev/null
@@ -0,0 +1,93 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.Attributes;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.ManifestController;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.ManifestService;
+import org.onap.portalapp.portal.service.ManifestServiceImpl;
+
+public class ManifestControllerTest extends MockitoTestSuite{
+
+       
+       @Mock
+       ManifestService manifestService = new ManifestServiceImpl();
+       
+       @InjectMocks
+       ManifestController  manifestController = new  ManifestController();
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       @Test
+       public void getManifestTest() throws IOException
+       {
+               Map<String, Object> expectedResponse = new HashMap<String, Object>();
+               Attributes attributes  = new Attributes();
+               expectedResponse.put("test", attributes);
+               Mockito.when(manifestService.getWebappManifest()).thenReturn(attributes);
+               Map<String, Object> actualResponse = manifestController.getManifest(mockedRequest);
+               assertTrue((actualResponse.keySet().toArray().length) == 1);
+               
+       }
+       
+       @Test
+       public void getManifestExceptionTest() throws IOException
+       {
+               Mockito.when(manifestService.getWebappManifest()).thenThrow(nullPointerException);
+               Map<String, Object> actualResponse = manifestController.getManifest(mockedRequest);
+               assertTrue((actualResponse.keySet().toArray().length) == 1);
+               assertTrue(actualResponse.get("error").equals("failed to get manifest: java.lang.NullPointerException"));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceControllerTest.java
new file mode 100644 (file)
index 0000000..e6e9f75
--- /dev/null
@@ -0,0 +1,272 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.MicroserviceController;
+import org.onap.portalapp.portal.domain.MicroserviceData;
+import org.onap.portalapp.portal.domain.WidgetCatalog;
+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.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.ConsulHealthService;
+import org.onap.portalapp.portal.service.ConsulHealthServiceImpl;
+import org.onap.portalapp.portal.service.MicroserviceService;
+import org.onap.portalapp.portal.service.MicroserviceServiceImpl;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+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.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.RestTemplate;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({WidgetServiceHeaders.class, EcompPortalUtils.class})
+public class MicroserviceControllerTest extends MockitoTestSuite{
+
+       @InjectMocks
+       MicroserviceController microserviceController = new MicroserviceController();
+
+       @Mock
+       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
+
+       @Mock
+       MicroserviceService microserviceService = new MicroserviceServiceImpl();
+
+       @Mock
+       RestTemplate template = new RestTemplate();
+
+       @Mock
+       MicroserviceData microserviceData = new MicroserviceData();
+
+       @SuppressWarnings("rawtypes")
+       @Mock
+       ResponseEntity<List<WidgetCatalog>> ans = new ResponseEntity<List<WidgetCatalog>>(HttpStatus.OK);
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @Mock
+       EcompPortalUtils EcompPortalUtils = new EcompPortalUtils();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test
+       public void createMicroserviceIfServiceDataNullTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("FAILURE");
+               expectedportalRestResponse.setResponse("MicroserviceData cannot be null or empty");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               MicroserviceData microserviceData = null;
+               PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
+                               mockedResponse, microserviceData);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void createMicroserviceTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("SUCCESS");
+               expectedportalRestResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
+                               mockedResponse, microserviceData);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void createMicroserviceExceptionTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("FAILURE");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               Mockito.when(microserviceService.saveMicroservice(microserviceData)).thenReturn((long) 1);
+               Mockito.when(microserviceData.getParameterList()).thenThrow(nullPointerException);
+               PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
+                               mockedResponse, microserviceData);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void getMicroserviceTest() throws Exception {
+               Mockito.when(microserviceService.getMicroserviceData()).thenReturn(null);
+               List<MicroserviceData> list = microserviceController.getMicroservice(mockedRequest, mockedResponse);
+               assertEquals(list, null);
+       }
+
+       @Test
+       public void updateMicroserviceIfServiceISNullTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("FAILURE");
+               expectedportalRestResponse.setResponse("MicroserviceData cannot be null or empty");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               MicroserviceData microserviceData = null;
+               PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
+                               mockedResponse, 1, microserviceData);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void updateMicroserviceTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("SUCCESS");
+               expectedportalRestResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
+                               mockedResponse, 1, microserviceData);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void updateMicroserviceExceptionTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("FAILURE");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               Mockito.when(microserviceController.updateMicroservice(mockedRequest, mockedResponse, 1, microserviceData))
+                               .thenThrow(nullPointerException);
+               PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
+                               mockedResponse, 1, microserviceData);
+               assertEquals(actualportalRestResponse, expectedportalRestResponse);
+       }
+
+       @Test
+       public void deleteMicroserviceExceptionTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("FAILURE");
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               expectedportalRestResponse.setResponse(
+                               "I/O error on GET request for \""  + EcompPortalUtils.widgetMsProtocol() + "://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               PowerMockito.mockStatic(WidgetServiceHeaders.class);
+               PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
+                               mockedResponse, 1);
+               assertEquals(actuaPportalRestResponse.getStatus(), expectedportalRestResponse.getStatus());
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void deleteMicroserviceTest() throws Exception {
+               String HTTPS = "https://";
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("SOME WIDGETS ASSOICATE WITH THIS SERVICE");
+               expectedportalRestResponse.setResponse("'null' ,'null' ");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.WARN);
+               List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
+               WidgetCatalog widgetCatalog = new WidgetCatalog();
+               widgetCatalog.setId(1);
+               WidgetCatalog widgetCatalog1 = new WidgetCatalog();
+               widgetCatalog.setId(2);
+               List.add(widgetCatalog);
+               List.add(widgetCatalog1);
+               PowerMockito.mockStatic(WidgetServiceHeaders.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               String whatService = "widgets-service";
+               Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
+               Mockito.when(ans.getBody()).thenReturn(List);
+               ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
+               };
+               Mockito.when(template.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+                                               + "/widget/microservices/widgetCatalog/service/" + 1,
+                               HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
+
+               PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
+                               mockedResponse, 1);
+               assertEquals(actuaPportalRestResponse, expectedportalRestResponse);
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void deleteMicroserviceWhenNoWidgetsAssociatedTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("SUCCESS");
+               expectedportalRestResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
+               PowerMockito.mockStatic(WidgetServiceHeaders.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               String whatService = "widgets-service";
+               Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
+               Mockito.when(ans.getBody()).thenReturn(List);
+               ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
+               };
+               Mockito.when(template.exchange(
+                               EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
+                                               + "/widget/microservices/widgetCatalog/service/" + 1,
+                               HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
+               PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
+                               mockedResponse, 1);
+               assertEquals(actuaPportalRestResponse, expectedportalRestResponse);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceProxyControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/MicroserviceProxyControllerTest.java
new file mode 100644 (file)
index 0000000..446c11c
--- /dev/null
@@ -0,0 +1,143 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.onap.portalapp.portal.controller.MicroserviceProxyController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.MicroserviceProxyService;
+import org.onap.portalapp.portal.service.MicroserviceProxyServiceImpl;
+import org.onap.portalapp.util.EPUserUtils;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.client.HttpClientErrorException;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+
+
+public class MicroserviceProxyControllerTest extends MockitoTestSuite {
+
+       @Mock
+       MicroserviceProxyService microserviceProxyService = new MicroserviceProxyServiceImpl();
+
+       @InjectMocks
+       MicroserviceProxyController microserviceProxyController = new MicroserviceProxyController();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+       @Mock
+       ObjectMapper objectMapper = new ObjectMapper();
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void getMicroserviceProxyTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest)).thenReturn("Success");
+               String acutualString = microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
+               assertTrue(acutualString.equals("{\"error\":\"Success\"}"));
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void getMicroserviceProxyNullPoniterExceptionTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest))
+                               .thenThrow(nullPointerException);
+               microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
+       }
+
+       @Test
+       public void getMicroserviceProxyExceptionTest() throws Exception {
+               HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.OK, "Success");
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest))
+                               .thenThrow(httpClientErrorException);
+               String acutualString = microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
+               assertTrue(acutualString.equals("{\"error\":\"\"}"));
+       }
+
+       @Test
+       public void getMicroserviceProxyByWidgetIdTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
+                               .thenReturn("Success");
+               String acutualString = microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest,
+                               getMockedResponse(), 1);
+               assertTrue(acutualString.equals("{\"error\":\"Success\"}"));
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void getMicroserviceProxyByWidgetIdNullPointerExceptionTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
+                               .thenThrow(nullPointerException);
+               microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest, getMockedResponse(), 1);
+       }
+
+       @Test
+       public void getMicroserviceProxyByWidgetIdExceptionTest() throws Exception {
+               HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.OK, "Success");
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
+                               .thenThrow(httpClientErrorException);
+               String acutualString = microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest,
+                               getMockedResponse(), 1);
+               assertTrue(acutualString.equals("{\"error\":\"\"}"));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/PolicyControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/PolicyControllerTest.java
new file mode 100644 (file)
index 0000000..9c1cbee
--- /dev/null
@@ -0,0 +1,148 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.BadRequestException;
+
+import org.json.simple.JSONObject;
+import org.junit.Assert;
+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.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.scheduler.SchedulerProperties;
+import org.onap.portalapp.portal.scheduler.SchedulerRestInterface;
+import org.onap.portalapp.portal.scheduleraux.RestObject;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxResponseWrapper;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxRestInterfaceFactory;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxRestInterfaceIfc;
+import org.onap.portalapp.portal.scheduleraux.SchedulerAuxUtil;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ UserUtils.class, SchedulerProperties.class, SchedulerAuxRestInterfaceFactory.class,SchedulerAuxUtil.class })
+public class PolicyControllerTest {
+       @Mock
+       SchedulerRestInterface schedulerRestInterface;
+
+       @InjectMocks
+       SchedulerAuxController policyController = new SchedulerAuxController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockEPUser mockUser = new MockEPUser();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Before
+       public void setUp() {
+
+               PowerMockito.mockStatic(SchedulerProperties.class);
+
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_GET_CONFIG_VAL)).thenReturn("/api/getConfig");
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_CLIENT_MECHID_VAL))
+                               .thenReturn("m06814@controller.dcae.ecomp.att.com");
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_CLIENT_PASSWORD_VAL))
+                               .thenReturn("OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0");
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_USERNAME_VAL)).thenReturn("testpdp");
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_PASSWORD_VAL))
+                               .thenReturn("OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt");
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_ENVIRONMENT_VAL)).thenReturn("TEST");
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_SERVER_URL_VAL))
+                               .thenReturn("https://policypdp-conexus-e2e.ecomp.cci.att.com:8081/pdp");
+
+       }
+
+       @SuppressWarnings({ "unchecked" })
+       @Test
+       public void getPolicyInfoTest1() throws Exception {
+
+               JSONObject jsonObject = Mockito.mock(JSONObject.class);
+               PowerMockito.mockStatic(SchedulerAuxRestInterfaceFactory.class);
+               PowerMockito.mockStatic(SchedulerProperties.class);
+               SchedulerAuxRestInterfaceIfc policyRestInterface = Mockito.mock(SchedulerAuxRestInterfaceIfc.class);
+               PowerMockito.mockStatic(SchedulerAuxUtil.class);
+               // RestObject restObj=Mockito.mock(RestObject.class);
+               SchedulerAuxResponseWrapper policyWrapper = Mockito.mock(SchedulerAuxResponseWrapper.class);
+               PowerMockito.when(SchedulerAuxUtil.wrapResponse(Matchers.any(RestObject.class))).thenReturn(policyWrapper);
+               Mockito.when(policyWrapper.getResponse()).thenReturn("Success");
+               Mockito.when(policyWrapper.getStatus()).thenReturn(200);
+
+               PowerMockito.when(SchedulerAuxRestInterfaceFactory.getInstance()).thenReturn(policyRestInterface);
+               Mockito.doNothing().when(policyRestInterface).Post(Matchers.anyString(), Matchers.anyObject(),
+                               Matchers.anyString(), Matchers.anyString(), Matchers.anyObject());
+
+               ResponseEntity<String> responsePolicy = policyController.getPolicyInfo(mockedRequest);
+               Assert.assertEquals(responsePolicy.getStatusCode(), HttpStatus.OK);
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getPolicyInfoTestexpected() throws Exception {
+
+               JSONObject jsonObject = Mockito.mock(JSONObject.class);
+               PowerMockito.mockStatic(SchedulerAuxRestInterfaceFactory.class);
+               PowerMockito.mockStatic(SchedulerProperties.class);
+               Mockito.when(SchedulerProperties.getProperty(SchedulerProperties.SCHEDULERAUX_GET_CONFIG_VAL)).thenThrow(nullPointerException);
+               ResponseEntity<String> responsePolicy = policyController.getPolicyInfo(mockedRequest);
+               Assert.assertEquals(responsePolicy.getStatusCode(), HttpStatus.INTERNAL_SERVER_ERROR);
+
+       }
+       
+
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerTest.java
new file mode 100644 (file)
index 0000000..0c48f17
--- /dev/null
@@ -0,0 +1,192 @@
+
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.PortalAdminController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.exceptions.NoHealthyServiceException;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.PortalAdminService;
+import org.onap.portalapp.portal.service.PortalAdminServiceImpl;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.PortalAdmin;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.service.AuditServiceImpl;
+
+public class PortalAdminControllerTest extends MockitoTestSuite{
+
+       @InjectMocks
+       PortalAdminController portalAdminController = new PortalAdminController();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+       
+       @Mock
+       PortalAdminService portalAdminService = new PortalAdminServiceImpl();
+
+       @Mock
+       AuditService auditService = new AuditServiceImpl();
+
+        
+       @Mock
+       EcompPortalUtils ecompPortalUtils = new EcompPortalUtils();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       MockEPUser mockUser = new MockEPUser();
+       
+       
+       @Test
+       public void getPortalAdminsTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<PortalAdmin> expectedPortalAdminsList = new ArrayList<PortalAdmin>();
+               PortalAdmin portalAdmin= new PortalAdmin();
+               
+               portalAdmin.setUserId((long) 1);
+               portalAdmin.setLoginId("guestT");
+               portalAdmin.setFirstName("Test_FirstName");
+               portalAdmin.setLastName("Test_LastName");
+               
+               expectedPortalAdminsList.add(portalAdmin);
+               
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               
+         Mockito.when(portalAdminService.getPortalAdmins()).thenReturn(expectedPortalAdminsList);
+         List<PortalAdmin> actualPortalAdminsList =  portalAdminController.getPortalAdmins(mockedRequest, mockedResponse);
+         assertEquals(actualPortalAdminsList,expectedPortalAdminsList);
+
+       }
+//     @Test
+//     public void getPortalAdminsIfUserIsNullTest()
+//     {
+//             EPUser user = null;
+//             Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+//
+//         assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
+//
+//     }
+       
+       @Test
+       public void getPortalAdminsIfUserIsSuperAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+                assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
+
+       }
+       
+       
+       
+       @Test
+       public void createPortalAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+       
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               String sbcid = "Test";
+               
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(portalAdminService.createPortalAdmin(sbcid)).thenReturn(expectedFieldValidator);
+               actualFieldValidator = portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse);
+        assertEquals(actualFieldValidator,expectedFieldValidator);
+
+       }
+               
+//     @Test
+//     public void createPortalAdminIfUserIsNullTest()
+//     {
+//             //EPUser user = null;
+//             Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+//             String sbcid = "null";
+//             assertNull(portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse));
+//
+//     }
+       
+       @Test
+       public void createPortalAdminIfUserIsSuperAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               String sbcid = "Test";
+               assertNull(portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse));
+
+       }
+                       
+}
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
new file mode 100644 (file)
index 0000000..e63ea43
--- /dev/null
@@ -0,0 +1,525 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.core.RoleController;
+import org.onap.portalapp.controller.core.RoleFunctionListController;
+import org.onap.portalapp.controller.core.RoleListController;
+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.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.ExternalAccessRolesService;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.service.AuditService;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.servlet.ModelAndView;
+
+public class RoleManageControllerTest {
+
+       @Mock
+        RoleController roleController;
+
+       @Mock
+    RoleListController roleListController;
+
+       @Mock
+    RoleFunctionListController roleFunctionListController;
+
+
+       @Mock
+       ExternalAccessRolesService externalAccessRolesService;
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+       
+       @Mock
+       ExternalAccessRolesService externalAccessRolesService1 = null;
+       
+       @InjectMocks
+       RoleManageController roleManageController = new RoleManageController(); 
+       
+       @Mock
+       EPAppService appService;
+
+       @Mock
+       AuditService auditService;
+       
+       @Mock
+       AdminRolesService adminRolesService;
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+       
+       
+       @Test
+       public void removeRoleRoleFunctionTest() throws Exception
+       {
+               
+               ModelAndView modelandView = new ModelAndView("login.htm");
+               Mockito.when(roleController.removeRoleFunction(mockedRequest, mockedResponse)).thenReturn(modelandView);
+               ModelAndView expectedModelandView =     roleManageController.removeRoleRoleFunction(mockedRequest, mockedResponse);
+               assertEquals(expectedModelandView, modelandView);
+       }
+       
+       @Test
+       public void addRoleRoRoleFunctionTest() throws Exception
+       {
+               ModelAndView modelandView = new ModelAndView("login.htm");
+               Mockito.when(roleController.addRoleFunction(mockedRequest, mockedResponse)).thenReturn(modelandView);
+               ModelAndView expectedModelandView =     roleManageController.addRoleRoRoleFunction(mockedRequest, mockedResponse);
+               assertEquals(expectedModelandView, modelandView);
+       }
+       
+       @Test
+       public void removeChildRoleTest() throws Exception
+       {
+               ModelAndView modelandView = new ModelAndView("login.htm");
+               Mockito.when(roleController.removeChildRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
+               ModelAndView expectedModelandView =     roleManageController.removeChildRole(mockedRequest, mockedResponse);
+               assertEquals(expectedModelandView, modelandView);
+       }
+       
+       
+       @Test
+       public void getRoleIfRoleIdNullTest() throws Exception
+       {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               CentralV2Role answer = new CentralV2Role();
+               Mockito.when(externalAccessRolesService.getRoleInfo((long) 1, "test")).thenReturn(answer);
+               List<CentralV2RoleFunction> finalRoleFunctionList = new ArrayList<>();
+               Mockito.when(externalAccessRolesService.getRoleFuncList("test")).thenReturn(finalRoleFunctionList);
+               Mockito.when(externalAccessRolesService.getRolesForApp("test")).thenReturn(null);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+          roleManageController.getRole(mockedRequest, mockedResponse, (long)1,null);
+         
+}
+       
+       @Test(expected = Exception.class)
+       public void getRoleExceptionTest() throws Exception
+       {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(mockApp());
+               CentralV2Role answer = new CentralV2Role();
+               Mockito.when(externalAccessRolesService.getRoleInfo((long) 1, "test")).thenReturn(answer);
+               Mockito.when(externalAccessRolesService.getRoleFuncList("test")).thenThrow(nullPointerException);
+          roleManageController.getRole(mockedRequest, mockedResponse, (long)1,null);
+         
+}
+       @Test
+       public void getRoleIfRoleIdNotNullTest() throws Exception
+       {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               CentralV2Role answer = new CentralV2Role();
+               Mockito.when(externalAccessRolesService.getRoleInfo((long) 1, "test")).thenReturn(answer);
+               List<CentralV2RoleFunction> finalRoleFunctionList = new ArrayList<>();
+               Mockito.when(externalAccessRolesService.getRoleFuncList("test")).thenReturn(finalRoleFunctionList);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);    
+               CentralV2Role currentRole = new CentralV2Role();
+           SortedSet<CentralV2Role> parentRoles = new TreeSet<>();
+               CentralV2Role centralV2Role = new CentralV2Role();
+               centralV2Role.setName("test");     
+               parentRoles.add(centralV2Role);
+               currentRole.setParentRoles(parentRoles);
+               Mockito.when(externalAccessRolesService.getRoleInfo((long) 1, "test")).thenReturn(currentRole);
+               List<CentralV2Role> availableChildRoles = new ArrayList<>();
+               availableChildRoles.add(currentRole);
+               Mockito.when(externalAccessRolesService.getRolesForApp("test")).thenReturn(availableChildRoles);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+          roleManageController.getRole(mockedRequest, mockedResponse, (long)1,(long)1);
+}
+       
+       public EPApp mockApp()
+       {
+               EPApp app = new EPApp();
+
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(false);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+               return app;
+               
+       }
+       @Test
+       public void getRolesTest() throws Exception {
+               EPApp app = mockApp();
+               app.setCentralAuth(true);
+               List<CentralV2Role> answer = new ArrayList<>();
+               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
+               Mockito.when(externalAccessRolesService.getRolesForApp("test")).thenReturn(answer);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               roleManageController.getRoles(mockedRequest, mockedResponse, (long) 1);
+       }
+
+       @Test
+       public void getRolesExceptionTest() throws Exception {
+               EPApp app = CentralApp();
+               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
+               Mockito.when(externalAccessRolesService.getRolesForApp("test")).thenThrow(new java.lang.Exception());
+               roleManageController.getRoles(mockedRequest, mockedResponse, (long) 1);
+
+       }
+
+       @Test
+       public void getRoleFunctionListTest() throws Exception {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               List<CentralV2RoleFunction> answer = new ArrayList<>();
+               Mockito.when(externalAccessRolesService.getRoleFuncList("test")).thenReturn(answer);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               roleManageController.getRoleFunctionList(mockedRequest, mockedResponse, (long) 1);
+       }
+
+       @Test(expected = Exception.class)
+       public void getRoleFunctionListExceptionTest() throws Exception {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(NonCentralApp());
+               roleManageController.getRoleFunctionList(mockedRequest, mockedResponse, (long) 1);
+       }
+
+       @Test
+       public void saveRoleFunctionTest() throws Exception {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               Mockito.doNothing().when(roleFunctionListController).saveRoleFunction(mockedRequest, mockedResponse, "test");
+               CentralV2RoleFunction addNewFunc = new CentralV2RoleFunction();
+               addNewFunc.setCode("Test");
+               addNewFunc.setName("Test");
+               CentralV2RoleFunction roleFunction = mockCentralRoleFunction();
+               Mockito.when(externalAccessRolesService.getRoleFunction("Test", "test")).thenReturn(roleFunction);
+               Mockito.when(externalAccessRolesService.saveCentralRoleFunction(Matchers.anyObject(), Matchers.anyObject()))
+                               .thenReturn(true);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPUser> userList = new ArrayList<>();
+               userList.add(user);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               Mockito.when(externalAccessRolesService.getUser("guestT")).thenReturn(userList);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               roleManageController.saveRoleFunction(mockedRequest, mockedResponse, addNewFunc, (long) 1);
+       }
+
+       @Test
+       public void saveRoleFunctionExceptionTest() throws Exception {
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               Mockito.doNothing().when(roleFunctionListController).saveRoleFunction(mockedRequest, mockedResponse, "test");
+               CentralV2RoleFunction addNewFunc = new CentralV2RoleFunction();
+               addNewFunc.setCode("Test");
+               addNewFunc.setName("Test");
+               Mockito.when(externalAccessRolesService.getRoleFunction("Test", "test")).thenReturn(null);
+               roleManageController.saveRoleFunction(mockedRequest, mockedResponse, addNewFunc, (long) 1);
+       }
+
+       @Test
+       public void saveRoleFunctionIfAppNotCentralizedTest() throws Exception {
+               CentralV2RoleFunction addNewFunc = new CentralV2RoleFunction();
+               addNewFunc.setCode("Test");
+               addNewFunc.setName("Test");
+               Mockito.when(appService.getApp((long) 1)).thenReturn(NonCentralApp());
+               String roleFun = "{\"name\":\"Test\",\"code\":\"Test\"}";
+               roleManageController.saveRoleFunction(mockedRequest, mockedResponse, addNewFunc, (long) 1);
+       }
+
+       @Test
+       public void removeRoleFunctionTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               String roleFun = "{\"name\":\"Test\",\"code\":\"Test\"}";
+               CentralV2RoleFunction roleFunction = mockCentralRoleFunction();
+               Mockito.when(externalAccessRolesService.getRoleFunction("Test", "test")).thenReturn(roleFunction);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               Mockito.when(externalAccessRolesService.deleteCentralRoleFunction(Matchers.anyString(), Matchers.anyObject()))
+                               .thenReturn(true);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               roleManageController.removeRoleFunction(mockedRequest, mockedResponse, roleFun, (long) 1);
+       }
+
+       @Test
+       public void removeRoleFunctionExceptionTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               String roleFun = "{\"name\":\"Test\",\"code\":\"Test\"}";
+               CentralV2RoleFunction roleFunction = mockCentralRoleFunction();
+               Mockito.when(externalAccessRolesService.getRoleFunction("Test", "test")).thenReturn(roleFunction);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               Mockito.when(externalAccessRolesService.deleteCentralRoleFunction(Matchers.anyString(), Matchers.anyObject()))
+                               .thenReturn(false);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               roleManageController.removeRoleFunction(mockedRequest, mockedResponse, roleFun, (long) 1);
+       }
+
+       @Test
+       public void removeRoleFunctionIfAppNotCentralizedTest() throws Exception {
+               EPApp app = mockApp();
+               app.setCentralAuth(false);
+               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
+               String roleFun = "{\"name\":\"Test\",\"code\":\"Test\"}";
+               roleManageController.removeRoleFunction(mockedRequest, mockedResponse, roleFun, (long) 1);
+       }
+
+       @Test
+       public void syncRolesTest() throws Exception {
+               EPApp app = mockApp();
+               app.setId((long) 1);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(appService.getApp(1l)).thenReturn(app);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(Matchers.anyObject())).thenReturn(true);
+               Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               PortalRestResponse<String> actual = roleManageController.syncRoles(mockedRequest, mockedResponse, 1l);
+               PortalRestResponse<String> portalRestResponse = new PortalRestResponse<>();
+               portalRestResponse.setMessage("Sync roles completed successfully!");
+               portalRestResponse.setResponse("Success");
+               portalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               assertEquals(portalRestResponse, actual);
+       }
+
+       @Test
+       public void syncRolesException() throws Exception {
+               Mockito.when(appService.getAppDetailByAppName("test")).thenThrow(nullPointerException);
+               PortalRestResponse<String> actual = roleManageController.syncRoles(mockedRequest, mockedResponse, 1l);
+               PortalRestResponse<String> portalRestResponse = new PortalRestResponse<>();
+               portalRestResponse.setMessage(null);
+               portalRestResponse.setResponse("Failed");
+               portalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               assertEquals(portalRestResponse, actual);
+       }
+       
+       @Test
+       public void syncRolesFunctionsTest() throws Exception {
+               EPApp app = mockApp();
+               app.setId((long) 1);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(appService.getApp(1l)).thenReturn(app);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(Matchers.anyObject())).thenReturn(true);
+               Mockito.doNothing().when(externalAccessRolesService).syncRoleFunctionFromExternalAccessSystem(app);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               PortalRestResponse<String> actual = roleManageController.syncFunctions(mockedRequest, mockedResponse, 1l);
+               PortalRestResponse<String> portalRestResponse = new PortalRestResponse<>();
+               portalRestResponse.setMessage("Sync Functions completed successfully!");
+               portalRestResponse.setResponse("Success");
+               portalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               assertEquals(portalRestResponse, actual);
+       }
+
+       @Test
+       public void syncRolesFunctionsException() throws Exception {
+               Mockito.when(appService.getAppDetailByAppName("test")).thenThrow(nullPointerException);
+               PortalRestResponse<String> actual = roleManageController.syncFunctions(mockedRequest, mockedResponse, 1l);
+               PortalRestResponse<String> portalRestResponse = new PortalRestResponse<>();
+               portalRestResponse.setMessage(null);
+               portalRestResponse.setResponse("Failed");
+               portalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               assertEquals(portalRestResponse, actual);
+       }
+       
+       @Test
+       public void addeChildRoleTest() throws Exception
+       {
+               ModelAndView modelandView = new ModelAndView("login.htm");
+               Mockito.when(roleController.addChildRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
+               ModelAndView expectedModelandView =     roleManageController.addChildRole(mockedRequest, mockedResponse);
+               assertEquals(expectedModelandView, modelandView);
+       }
+       
+       @Test
+       public void removeRoleTest() throws Exception {
+               List<EPUser> epuserList = new ArrayList<>();
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(CentralApp());
+               EPUser user = mockUser.mockEPUser();
+               epuserList.add(user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getApp((long) 1)).thenReturn(CentralApp());
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               ExternalRequestFieldsValidator res = new ExternalRequestFieldsValidator(true, "success");
+               Mockito.when(externalAccessRolesService.deleteDependencyRoleRecord(Matchers.anyLong(), Matchers.anyString(),
+                               Matchers.anyString())).thenReturn(res);
+               Mockito.when(externalAccessRolesService.getUser(Matchers.anyString())).thenReturn(epuserList);
+               Mockito.when(externalAccessRolesService.getApp(Matchers.anyString())).thenReturn(appList);
+               ResponseEntity<String> response = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when( externalAccessRolesService.getNameSpaceIfExists(Matchers.anyObject())).thenReturn(response);
+               Map<String, Object> expedtedResponse = new HashMap<String, Object>();
+               expedtedResponse.put("restCallStatus", " Unauthorized user");
+               Map<String, Object> actualResponse =    roleManageController.removeRole(mockedRequest, mockedResponse, (long) 1, (long) 1);
+               assertEquals(actualResponse.size(), expedtedResponse.size());
+
+       }
+       
+       @Test(expected = Exception.class)
+       public void removeRoleExceptionTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(appService.getApp((long) 1)).thenThrow(nullPointerException);
+               StringWriter sw = new StringWriter();
+               PrintWriter writer = new PrintWriter(sw);
+               Mockito.when(mockedResponse.getWriter()).thenReturn(writer);
+               roleManageController.removeRole(mockedRequest, mockedResponse, (long) 1, (long) 1);
+       }
+       
+       public CentralV2RoleFunction mockCentralRoleFunction()
+       {
+               CentralV2RoleFunction roleFunction = new CentralV2RoleFunction();
+               roleFunction.setCode("Test");
+               roleFunction.setName("Test");
+               roleFunction.setAppId((long) 1);
+               return roleFunction;
+       }
+       
+       public EPApp CentralApp()
+       {
+               EPApp app =  mockApp();
+               app.setCentralAuth(true);
+               app.setNameSpace("com.test");
+               return app;
+       }
+       
+       public EPApp NonCentralApp()
+       {
+               EPApp app =  mockApp();
+               app.setCentralAuth(false);
+               return app;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RolesApprovalSystemControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/RolesApprovalSystemControllerTest.java
new file mode 100644 (file)
index 0000000..281a0cb
--- /dev/null
@@ -0,0 +1,373 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemUser;
+import org.onap.portalapp.portal.controller.RolesApprovalSystemController;
+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.UserRolesService;
+import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
+
+public class RolesApprovalSystemControllerTest extends MockitoTestSuite {
+
+       @Mock
+       UserRolesService userRolesService;
+
+       @InjectMocks
+       RolesApprovalSystemController rolesApprovalSystemController = new RolesApprovalSystemController();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @Test
+       public void postUserProfileIfRolesNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Request has no roles");
+               expectedportalRestResponse.setResponse("save user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = null;
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void postUserProfileTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Saved Successfully");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
+                               "Saved Successfully");
+
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST"))
+                               .thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void postUserProfileFailureTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Received Bad String");
+               expectedportalRestResponse.setResponse("save user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
+                               "Received Bad String");
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST"))
+                               .thenReturn(externalRequestFieldsValidator);
+
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void postUserProfileExceptionTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse("save user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST")).thenThrow(nullPointerException);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void putUserProfileIfLoginIdNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Request has no login ID");
+               expectedportalRestResponse.setResponse("save user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId(null);
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void putUserProfileTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Updated Successfully");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
+                               "Updated Successfully");
+
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT"))
+                               .thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void putUserProfileFailureTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Received Bad String");
+               expectedportalRestResponse.setResponse("save user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
+                               "Received Bad String");
+
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT"))
+                               .thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
+
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void putUserProfileExceptionTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse("save user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT")).thenThrow(nullPointerException);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
+
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void deleteUserProfileIfApplicationNameNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Request has no application name");
+               expectedportalRestResponse.setResponse("delete user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName(null);
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
+
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void deleteUserProfileIfMyloginrequestIdNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Request has no request ID");
+               expectedportalRestResponse.setResponse("delete user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId(null);
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void deleteUserProfileTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Deleted Successfully");
+               expectedportalRestResponse.setResponse("Success");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
+                               "Success");
+
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE"))
+                               .thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
+
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void deleteUserProfileFailureTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("failed");
+               expectedportalRestResponse.setResponse("delete user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
+                               "failed");
+
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE"))
+                               .thenReturn(externalRequestFieldsValidator);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
+
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+
+       @Test
+       public void deleteUserProfileExceptionTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse("delete user profile failed");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               ExternalSystemUser extSysUser = new ExternalSystemUser();
+               extSysUser.setApplicationName("Test_App");
+               extSysUser.setLoginId("1");
+               extSysUser.setMyloginrequestId("Test");
+               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
+               extSysUser.setRoles(externalSystemRoleApprovalList);
+               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE")).thenThrow(nullPointerException);
+               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
+                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
+
+               assertEquals(expectedportalRestResponse, actualportalRestResponse);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SchedulerControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SchedulerControllerTest.java
new file mode 100644 (file)
index 0000000..bafcb1c
--- /dev/null
@@ -0,0 +1,110 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.simple.JSONObject;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.SchedulerController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.scheduler.SchedulerProperties;
+import org.onap.portalapp.portal.scheduler.SchedulerRestInterface;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({UserUtils.class,SystemProperties.class})
+
+public class SchedulerControllerTest {
+
+       @Mock
+       SchedulerRestInterface schedulerRestInterface;
+       
+       
+
+       @InjectMocks
+       SchedulerController schedulerController = new SchedulerController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockEPUser mockUser = new MockEPUser();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test
+       public void  getTimeSlotsTest() throws Exception{
+               schedulerController.getTimeSlots(mockedRequest, "12");
+               
+       }
+       
+       @Test
+       public void postCreateNewVNFChangeTest() throws Exception{
+               //String testJsonData="{\"domain\":\"ChangeManagement\",\"scheduleName\":\"VnfUpgrade/DWF\",\"userId\":\"su7376\",\"domainData\":[{\"WorkflowName\":\"HEAT Stack Software Update for vNFs\",\"CallbackUrl\":\"http://127.0.0.1:8989/scheduler/v1/loopbacktest/vid\",\"CallbackData\":\"testing\"}],\"schedulingInfo\":{\"normalDurationInSeconds\":60,\"additionalDurationInSeconds\":60,\"concurrencyLimit\":60,\"policyId\":\"SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml\",\"vnfDetails\":[{\"groupId\":\"group1\",\"node\":[\"satmo415vbc\",\"satmo455vbc\"]}]}}";
+               JSONObject jsonObject =Mockito.mock(JSONObject.class);
+               
+               schedulerController.postCreateNewVNFChange(mockedRequest, jsonObject);
+       }
+       
+       @Test
+       public void postSubmitVnfChangeTimeslotsTest() throws Exception{
+               JSONObject jsonObject =Mockito.mock(JSONObject.class);
+               Mockito.when(jsonObject.get("scheduleId")).thenReturn("12");
+        PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.when(SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SUBMIT_NEW_VNF_CHANGE)).thenReturn("/v1/ChangeManagement/schedules/{scheduleId}/approvals");
+               schedulerController.postSubmitVnfChangeTimeslots(mockedRequest, jsonObject);
+       }
+       
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SessionCommunicationControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SessionCommunicationControllerTest.java
new file mode 100644 (file)
index 0000000..c991ded
--- /dev/null
@@ -0,0 +1,96 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.drools.core.command.assertion.AssertEquals;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.sessionmgt.SessionCommunicationController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.service.sessionmgt.ManageService;
+
+public class SessionCommunicationControllerTest {
+       
+
+       @Mock
+       ManageService manageService;
+
+       @InjectMocks
+       SessionCommunicationController SessionCommunicationController = new SessionCommunicationController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       NullPointerException nullPointerException = new NullPointerException();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+       MockEPUser mockUser = new MockEPUser();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       
+       @Test
+       public void getSessionSlotCheckIntervalTest() throws Exception
+       {
+               Mockito.when(manageService.fetchSessionSlotCheckInterval()).thenReturn(1);
+               int result = SessionCommunicationController.getSessionSlotCheckInterval(mockedRequest, mockedResponse);
+               assertEquals(result, 1);
+               
+       }
+
+       @Test
+       public void extendSessionTimeOutsTest() throws Exception
+       {
+               Mockito.doNothing().when(manageService).extendSessionTimeOuts("test");
+               Boolean result = SessionCommunicationController.extendSessionTimeOuts(mockedRequest, mockedResponse, "test");
+               assertEquals(result, true);
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextRestClient.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextRestClient.java
new file mode 100644 (file)
index 0000000..a6f0dcd
--- /dev/null
@@ -0,0 +1,299 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.net.URI;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLContext;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.http.Consts;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.utils.URIBuilder;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.ssl.SSLContexts;
+import org.apache.http.ssl.TrustStrategy;
+import org.apache.http.util.EntityUtils;
+
+/**
+ * Provides reusable features for test cases to get or post from an REST
+ * endpoint, allowing use of HTTPS connections to servers that use self-signed
+ * certificates.
+ */
+public class SharedContextRestClient {
+
+       private static final Log logger = LogFactory.getLog(SharedContextRestClient.class);
+
+       /**
+        * Convenience method that builds and sends a GET request using properties
+        * to build the URI and populate header with credentials.
+        * 
+        * @param task
+        *            last component(s) of REST endpoint name; e.g., "get".
+        * @param contextId
+        * @param contextKey
+        * @return JSON string fetched
+        * @throws Exception
+        *             if the HTTP response code is anything other than OK.
+        */
+       public static String getJson(final SharedContextTestProperties properties, final String task,
+                       final String contextId, final String contextKey) throws Exception {
+               String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) //
+                               + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) //
+                               + '/' + task;
+               return getJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), //
+                               properties.getProperty(SharedContextTestProperties.PORT, -1), //
+                               properties.getProperty(SharedContextTestProperties.SECURE, true), //
+                               properties.getProperty(SharedContextTestProperties.UEBKEY), //
+                               properties.getProperty(SharedContextTestProperties.USERNAME), //
+                               properties.getProperty(SharedContextTestProperties.COUNTERSIGN), requestPath, //
+                               contextId, //
+                               contextKey);
+       }
+
+       /**
+        * Constructs and sends a GET request using the specified values.
+        * 
+        * @param hostname
+        * @param port
+        *            ignored if negative
+        * @param secure
+        *            If true, uses https; else http.
+        * @param headerUebkey
+        * @param headerUsername
+        * @param headerPassword
+        * @param requestPath
+        *            full path of the REST endpoint
+        * @param contextId
+        * @param contextKey
+        * Ignored if null
+        * @return JSON result
+        */
+       public static String getJson(final String hostname, final int port, boolean secure, final String headerUebkey,
+                       final String headerUsername, final String headerPassword, final String requestPath, final String contextId,
+                       final String contextKey) throws Exception {
+
+               URIBuilder uriBuilder = new URIBuilder();
+               if (secure)
+                       uriBuilder.setScheme("https");
+               else
+                       uriBuilder.setScheme("http");
+               uriBuilder.setHost(hostname);
+               if (port > 0)
+                       uriBuilder.setPort(port);
+               uriBuilder.setPath(requestPath);
+               uriBuilder.addParameter("context_id", contextId);
+               if (contextKey != null)
+                       uriBuilder.addParameter("ckey", contextKey);
+               final URI uri = uriBuilder.build();
+
+               CloseableHttpClient httpClient;
+               if (secure) {
+                       // Tell HttpClient to accept any server certificate for HTTPS.
+                       // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error
+                       SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
+                               @Override
+                               public boolean isTrusted(final X509Certificate[] chain, final String authType)
+                                               throws CertificateException {
+                                       return true;
+                               }
+                       }).build();
+                       SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,
+                                       NoopHostnameVerifier.INSTANCE);
+                       httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
+               } else {
+                       httpClient = HttpClients.createDefault();
+               }
+
+               HttpGet httpGet = new HttpGet(uri);
+               httpGet.setHeader("uebkey", headerUebkey);
+               httpGet.setHeader("username", headerUsername);
+               httpGet.setHeader("password", headerPassword);
+
+               String json = null;
+               CloseableHttpResponse response = null;
+               try {
+                       logger.debug("GET from " + uri);
+                       response = httpClient.execute(httpGet);
+                       logger.info("Status is " + response.getStatusLine());
+                       if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK)
+                               throw new Exception("Status is " + response.getStatusLine().toString());
+                       HttpEntity entity = response.getEntity();
+                       if (entity == null) {
+                               logger.warn("Entity is null!");
+                       } else {
+                               // entity content length is never set.
+                               // this naively tries to read everything.
+                               json = EntityUtils.toString(entity);
+                               EntityUtils.consume(entity);
+                       }
+               } finally {
+                       if (response != null)
+                               response.close();
+               }
+               return json;
+       }
+
+       /**
+        * Convenience method that builds and sends a POST request using properties
+        * to build the URI and populate header with credentials.
+        * 
+        * @param path
+        *            last component(s) of REST endpoint name; e.g., "users" or
+        *            "user/ab1234/roles".
+        * @return JSON string fetched
+        * @throws Exception
+        *             if the HTTP response code is anything other than OK.
+        */
+       public static String postJson(final SharedContextTestProperties properties, final String path, final String json)
+                       throws Exception {
+               String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) //
+                               + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) //
+                               + '/' + path;
+               return postJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), //
+                               properties.getProperty(SharedContextTestProperties.PORT, -1), //
+                               properties.getProperty(SharedContextTestProperties.SECURE, true), //
+                               properties.getProperty(SharedContextTestProperties.UEBKEY), //
+                               properties.getProperty(SharedContextTestProperties.USERNAME), //
+                               properties.getProperty(SharedContextTestProperties.COUNTERSIGN), //
+                               requestPath, //
+                               json);
+       }
+
+       /**
+        * Constructs and sends a POST request using the specified values.
+        * 
+        * @param hostname
+        * @param port
+        * @param secure
+        *            If true, uses https; else http.
+        * @param requestPath
+        *            full path of the REST endpoint
+        * @param headerUebkey
+        * @param headerUsername
+        * @param headerPassword
+        * @param json
+        *            Content to post
+        * @return JSON result
+        * @throws Exception
+        */
+       public static String postJson(final String hostname, final int port, boolean secure, final String headerUebkey,
+                       final String headerUsername, final String headerPassword, final String requestPath, final String json)
+                       throws Exception {
+
+               URIBuilder builder = new URIBuilder();
+               if (secure)
+                       builder.setScheme("https");
+               else
+                       builder.setScheme("http");
+               builder.setHost(hostname);
+               if (port > 0)
+                       builder.setPort(port);
+               builder.setPath(requestPath);
+               final URI uri = builder.build();
+
+               CloseableHttpClient httpClient;
+               if (secure) {
+                       // Tell HttpClient to accept any server certificate for HTTPS.
+                       // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error
+                       SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
+                               @Override
+                               public boolean isTrusted(final X509Certificate[] chain, final String authType)
+                                               throws CertificateException {
+                                       return true;
+                               }
+                       }).build();
+                       SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,
+                                       NoopHostnameVerifier.INSTANCE);
+                       httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
+               } else {
+                       httpClient = HttpClients.createDefault();
+               }
+               HttpPost httpPost = new HttpPost(uri);
+               httpPost.setHeader("uebkey", headerUebkey);
+               httpPost.setHeader("username", headerUsername);
+               httpPost.setHeader("password", headerPassword);
+
+               StringEntity postEntity = new StringEntity(json, ContentType.create("application/json", Consts.UTF_8));
+               httpPost.setEntity(postEntity);
+
+               String responseJson = null;
+               CloseableHttpResponse response = null;
+               try {
+                       logger.debug("POST to " + uri);
+                       response = httpClient.execute(httpPost);
+                       logger.info("Status is " + response.getStatusLine());
+                       if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK)
+                               throw new Exception("Status is " + response.getStatusLine().toString());
+
+                       HttpEntity entity = response.getEntity();
+                       if (entity == null) {
+                               logger.warn("Entity is null!");
+                       } else {
+                               long len = entity.getContentLength();
+                               if (len < 0)
+                                       logger.warn("Content length is -1");
+                               if (len < 2048) {
+                                       responseJson = EntityUtils.toString(entity);
+                                       logger.debug(responseJson);
+                               } else {
+                                       logger.warn("Not implemented - stream content");
+                               }
+                               EntityUtils.consume(entity);
+                       }
+               } finally {
+                       if (response != null)
+                               response.close();
+               }
+               return responseJson;
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextRestControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextRestControllerTest.java
new file mode 100644 (file)
index 0000000..05604fd
--- /dev/null
@@ -0,0 +1,144 @@
+package org.onap.portalapp.portal.controller;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.Assert;
+import org.onap.portalapp.portal.controller.SharedContextRestClient;
+import org.onap.portalapp.portal.controller.SharedContextTestProperties;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+/**
+ * Tests the endpoints exposed by the Shared Context controller in Portal.
+ */
+public class SharedContextRestControllerTest {
+
+       private final Log logger = LogFactory.getLog(getClass());
+
+       private final SharedContextTestProperties properties;
+
+       private final String ckey = "ckey";
+       private final String cvalue = "cvalue";
+       
+       // Supposed to be a Portal session ID
+       private final String cxid = UUID.randomUUID().toString();
+
+       private final String key = "key123";
+       private final String value1 = "first value";
+       private final String value2 = "second value";
+
+       public SharedContextRestControllerTest() throws IOException {
+               properties = new SharedContextTestProperties();
+       }
+
+       @SuppressWarnings("unchecked")
+       //@Test
+       public void test() throws Exception {
+               String response = null, val = null;
+               ObjectMapper mapper = new ObjectMapper();
+               Map<String, Object> responseMap, jsonMap;
+
+               logger.info("Get on empty context");
+               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
+               // Should not exist - just generated the UUID
+               Map<String, Object> responseMap1 = mapper.readValue(response, Map.class);
+               response = (String) responseMap1.get("response");
+               Assert.assertNull(response);
+
+               logger.info("Set a new context");
+               response = setContext(cxid, key, value1);
+               Assert.assertNotNull(response);
+               responseMap = mapper.readValue(response, Map.class);
+               String responseValue = (String) responseMap.get("response");
+               Assert.assertNotNull(responseValue);
+               Assert.assertEquals("added", responseValue);
+
+               logger.info("Get existing context");
+               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
+               responseMap = mapper.readValue(response, Map.class);
+               jsonMap = (Map<String,Object>) responseMap.get("response");
+               Assert.assertNotNull(jsonMap);
+               val = (String) jsonMap.get(cvalue);
+               Assert.assertEquals(val, value1);
+
+               logger.info("Overwrite exiting context");
+               response = setContext(cxid, key, value2);
+               Assert.assertNotNull(response);
+               responseMap = mapper.readValue(response, Map.class);
+               response = (String) responseMap.get("response");
+               Assert.assertNotNull(responseValue);
+               // Assert.assertEquals("replaced", responseValue);
+
+               logger.info("Get existing context to verify overwrite");
+               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
+               responseMap = mapper.readValue(response, Map.class);
+               jsonMap = (Map<String,Object>) responseMap.get("response");
+               Assert.assertNotNull(jsonMap);
+               val = (String) jsonMap.get(cvalue);
+               Assert.assertEquals(val, value2);
+
+               logger.info("Delete one context");
+               response = SharedContextRestClient.getJson(properties, "remove", cxid, key);
+               responseMap = mapper.readValue(response, Map.class);
+               response = (String) responseMap.get("response");
+               Assert.assertEquals(response, "removed");
+
+               logger.info("Clear the context");
+               response = SharedContextRestClient.getJson(properties, "clear", cxid, null);
+               Assert.assertEquals("", response);
+       }
+
+       private String setContext(String context, String id, String value) throws Exception {
+               ObjectMapper mapper = new ObjectMapper();
+               HashMap<String,String> stringMap = new HashMap<String,String>();
+               stringMap.put("context_id", cxid);
+               stringMap.put(ckey, key);
+               stringMap.put(cvalue, value2);
+               String json = mapper.writeValueAsString(stringMap);
+               String response = SharedContextRestClient.postJson(properties, "set", json);
+               return response;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextTestProperties.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/SharedContextTestProperties.java
new file mode 100644 (file)
index 0000000..49eae75
--- /dev/null
@@ -0,0 +1,99 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * Trivial extension of Properties that populates itself from a known source.
+ */
+public class SharedContextTestProperties extends Properties {
+
+       private static final long serialVersionUID = -4064100267979036550L;
+
+       // property names
+       public static final String HOSTNAME = "hostname";
+       public static final String PORT = "port";
+       public static final String SECURE = "secure";
+       public static final String APPNAME = "appname";
+       public static final String RESTPATH = "restpath";
+       public static final String UEBKEY = "uebkey";
+       public static final String USERNAME = "username";
+       public static final String COUNTERSIGN = "countersign";
+
+       /**
+        * Expected on the classpath
+        */
+       private static final String propertiesFileName = "shared-context-test.properties";
+
+       /**
+        * Constructor populates itself from properties file found in same package.
+        * 
+        * @throws Exception
+        */
+       public SharedContextTestProperties() throws IOException {
+               InputStream inStream = getClass().getResourceAsStream(propertiesFileName);
+               if (inStream == null)
+                       throw new IOException("Failed to find file on classpath: " + propertiesFileName);
+               super.load(inStream);
+               inStream.close();
+       }
+
+       public int getProperty(final String name, final int defVal) throws NumberFormatException {
+               String prop = getProperty(name);
+               if (prop == null)
+                       return defVal;
+               return Integer.parseInt(prop);
+       }
+       
+       public boolean getProperty(final String name, final boolean defVal) {
+               String prop = getProperty(name);
+               if (prop == null)
+                       return false;
+               return Boolean.parseBoolean(prop);
+       }
+       
+       // Test this class
+       public static void main(String[] args) throws Exception {
+               SharedContextTestProperties p = new SharedContextTestProperties();
+               System.out.println("Property " + SharedContextTestProperties.HOSTNAME + " = "
+                               + p.getProperty(SharedContextTestProperties.HOSTNAME));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/TicketEventControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/TicketEventControllerTest.java
new file mode 100644 (file)
index 0000000..2b3598c
--- /dev/null
@@ -0,0 +1,207 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.TicketEventController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+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.TicketEventService;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(UserUtils.class)
+public class TicketEventControllerTest {
+
+       @Mock
+       UserNotificationService userNotificationService;
+       
+       @Mock
+       TicketEventService ticketEventService;
+       
+       @InjectMocks
+       TicketEventController ticketEventController = new TicketEventController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockEPUser mockUser = new MockEPUser();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test
+       public void saveUserValidationTest() throws Exception {
+               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               expectedPortalRestResponse.setMessage("Invalid Org User ID");
+               expectedPortalRestResponse.setResponse(null);
+               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site."
+                               + " The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  "
+                               + "\"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,"
+                               + "\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; "
+                               + "ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\","
+                               + "\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\","
+                               + "\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": "
+                               + "{\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      "
+                               + "\"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},"
+                               + "\"SubscriberInfo\": {\"UserList\": [\"guest\"] }}";
+
+               actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+                               mockedResponse, ticketEventJson);
+               assertEquals(actualPortalRestResponse, expectedPortalRestResponse);
+       }
+       
+       @Test
+       public void saveTest() throws Exception {
+               String UserIds[] = new String[1];
+               UserIds[0] = "guest";
+               ArrayList<EPUser> users = new ArrayList<>();
+               EPUser user = new EPUser();
+               user.setOrgUserId("guest");
+               user.setId((long)1);
+               users.add(user);
+               List<String> userIdlist = new ArrayList<>();
+               userIdlist.add("guest");
+               JsonNode application = null ;
+               String ticketEventJson = "{\"application\":\"cbus\",\"event\":{\"body\":{\"ticketStatePhrase\":\"We recently detected a problem with the equipment at your site. "
+                               + "The event is in queue for immediate work.\",\"ivrNotificationFlag\":\"1\",\"expectedRestoreDate\":0,\"bridgeTransport\":\"AOTS\",\"reptRequestType\":0,"
+                               + "\"ticketNum\":\"000002000857405\",\"assetID\":\"CISCO_1921C1_ISR_G2\",\"eventDate\":1490545134601,"
+                               + "\"eventAbstract\":\"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; "
+                               + "ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\","
+                               + "\"severity\":\"2 - Major\",\"ticketPriority\":\"3\",\"reportedCustomerImpact\":0,\"testAutoIndicator\":0,"
+                               + "\"supportGroupName\":\"US-TEST-ORT\",\"lastModifiedDate\":\"1487687703\",\"messageGroup\":\"SNMP\",\"csi\":0,\"mfabRestoredTime\":0},"
+                               + "\"header\":{\"timestamp\":\"2017-02-21T14:35:05.219+0000\",\"eventSource\":\"aotstm\",\"entityId\":\"000002000857405\",\"sequenceNumber\":2},"
+                               + "\"blinkMsgId\":\"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\":\"130.4.165.158\"},\"SubscriberInfo\":{\"UserList\":[\"guest\"]}}";
+               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               expectedPortalRestResponse.setMessage("processEventNotification: notification created");
+               expectedPortalRestResponse.setResponse("NotificationId");
+               
+               
+               Mockito.when(userNotificationService.getUsersByOrgIds(userIdlist)).thenReturn(users);
+               Mockito.when(ticketEventService.getNotificationHyperLink(application, "", "")).thenReturn("");
+               actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+                               mockedResponse, ticketEventJson);
+               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
+       }
+
+       @Test
+       public void saveTestForException() throws Exception {
+               String ticketEventJson = "\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+                               mockedResponse, ticketEventJson);
+               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+       }
+
+//     @Test
+//     public void saveTestForApplicationValid() throws Exception {
+//             String ticketEventJson = "{\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+//             PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+//                             mockedResponse, ticketEventJson);
+//             assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+//             assertEquals(actualPortalRestResponse.getMessage(), "application is mandatory");
+//
+//     }
+
+       @Test
+       public void saveTestForBodyValid() throws Exception {
+               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",\"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+                               mockedResponse, ticketEventJson);
+               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+               assertEquals(actualPortalRestResponse.getMessage(), "body is mandatory");
+       }
+
+       @Test
+       public void saveTestForEventSourceValid() throws Exception {
+               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+                               mockedResponse, ticketEventJson);
+               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+               assertEquals(actualPortalRestResponse.getMessage(), "Message Source is mandatory");
+       }
+
+       @Test
+       public void saveTestForUserListValid() throws Exception {
+               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {}}";
+               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+                               mockedResponse, ticketEventJson);
+               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+               assertEquals(actualPortalRestResponse.getMessage(), "At least one user Id is mandatory");
+       }
+       
+       @Test
+       public void saveTestForApplicationValid() throws Exception {
+       String ticketEventJson = "{\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+       PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
+       mockedResponse, ticketEventJson);
+       assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
+       assertEquals(actualPortalRestResponse.getMessage(), "Application is mandatory");
+
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserControllerTest.java
new file mode 100644 (file)
index 0000000..205b235
--- /dev/null
@@ -0,0 +1,176 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.UserController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+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.UserService;
+import org.onap.portalapp.portal.service.UserServiceImpl;
+import org.onap.portalapp.portal.transport.ProfileDetail;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(CipherUtil.class)
+public class UserControllerTest extends MockitoTestSuite {
+
+       @InjectMocks
+       UserController userController = new UserController();
+
+       @Mock
+       UserService userService = new UserServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void getLoggedinUserExceptionTest() {
+               EPUser epUser = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
+               PortalRestResponse<ProfileDetail> expectedResponse = new PortalRestResponse<ProfileDetail>();
+               expectedResponse.setMessage(null);
+               expectedResponse.setResponse(null);
+               PortalRestStatusEnum enu = null;
+               expectedResponse.setStatus(enu.ERROR);
+               PortalRestResponse<ProfileDetail> response = userController.getLoggedinUser(mockedRequest);
+               assertEquals(response, expectedResponse);
+       }
+
+       @Test
+       public void getLoggedinUserTest() throws Exception {
+               EPUser epUser = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
+               PortalRestResponse<ProfileDetail> expectedResponse = new PortalRestResponse<ProfileDetail>();
+               expectedResponse.setMessage("success");
+               ProfileDetail profileDetail = new ProfileDetail();
+               expectedResponse.setResponse(profileDetail);
+               PortalRestStatusEnum enu = null;
+               expectedResponse.setStatus(enu.OK);
+               PowerMockito.mockStatic(CipherUtil.class);
+               Mockito.when(CipherUtil.decryptPKC(epUser.getLoginPwd())).thenReturn("Password");
+               PortalRestResponse<ProfileDetail> response = userController.getLoggedinUser(mockedRequest);
+               assertEquals(response.getMessage(), expectedResponse.getMessage());
+               assertEquals(response.getStatus(), expectedResponse.getStatus());
+       }
+
+       @Test
+       public void modifyLoggedinUserIfProfileNullTest() {
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("java.lang.NullPointerException");
+               expectedResponse.setResponse(null);
+               PortalRestStatusEnum enu = null;
+               expectedResponse.setStatus(enu.ERROR);
+               ProfileDetail profileDetail = null;
+               PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
+               assertEquals(actualResponse, expectedResponse);
+               assertEquals(actualResponse.getStatus(), expectedResponse.getStatus());
+       }
+
+       @Test
+       public void modifyLoggedinUserExceptionTest() {
+               EPUser epUser = null;
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("java.lang.NullPointerException");
+               expectedResponse.setResponse(null);
+               PortalRestStatusEnum enu = null;
+               expectedResponse.setStatus(enu.ERROR);
+               ProfileDetail profileDetail = new ProfileDetail();
+               profileDetail.setFirstName("Test_FirstName");
+               profileDetail.setLastName("Test_LastName");
+               profileDetail.setEmail("Test_Email");
+               profileDetail.setLoginId("Test_LoginId");
+               profileDetail.setLoginPassword("Test_LoginPassword");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
+               PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
+               assertEquals(actualResponse, expectedResponse);
+
+       }
+
+       /*@Test
+       public void modifyLoggedinUserTest() throws Exception {
+               EPUser epUser = mockUser.mockEPUser();
+               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
+               expectedResponse.setMessage("success");
+               expectedResponse.setResponse(null);
+               PortalRestStatusEnum enu = null;
+               expectedResponse.setStatus(enu.OK);
+               ProfileDetail profileDetail = new ProfileDetail();
+               profileDetail.setFirstName("Test_FirstName");
+               profileDetail.setLastName("Test_LastName");
+               profileDetail.setEmail("Test_Email");
+               profileDetail.setLoginId("Test_LoginId");
+               profileDetail.setLoginPassword("Test_LoginPassword");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
+               PowerMockito.mockStatic(CipherUtil.class);
+               Mockito.when(CipherUtil.decrypt(epUser.getLoginPwd())).thenReturn("Password");
+               PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
+               System.out.println(actualResponse);
+       }*/
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserNotificationControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserNotificationControllerTest.java
new file mode 100644 (file)
index 0000000..d829b60
--- /dev/null
@@ -0,0 +1,281 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+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.controller.UserNotificationController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+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.FunctionalMenuService;
+import org.onap.portalapp.portal.service.FunctionalMenuServiceImpl;
+import org.onap.portalapp.portal.service.UserNotificationService;
+import org.onap.portalapp.portal.service.UserNotificationServiceImpl;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+import org.onap.portalapp.portal.transport.EpNotificationItemVO;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.UserUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(UserUtils.class)
+public class UserNotificationControllerTest {
+
+       @Mock
+       FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
+
+       @Mock
+       UserNotificationService userNotificationService = new UserNotificationServiceImpl();
+
+       @InjectMocks
+       UserNotificationController userNotificationController = new UserNotificationController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockEPUser mockUser = new MockEPUser();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test
+       public void getMenuIdRoleIdTest() {
+               List<FunctionalMenuRole> expectedMenuRoleList = new ArrayList<FunctionalMenuRole>();
+               FunctionalMenuRole functionalMenuRole = new FunctionalMenuRole();
+               functionalMenuRole.setId(new Integer(99999999));
+               functionalMenuRole.setMenuId((long) 137);
+               functionalMenuRole.setAppId(new Integer(456));
+               functionalMenuRole.setRoleId(new Integer(6214));
+               expectedMenuRoleList.add(functionalMenuRole);
+               List<FunctionalMenuRole> actualFunctionalMenuRoleList = null;
+               Mockito.when(functionalMenuService.getFunctionalMenuRole()).thenReturn(expectedMenuRoleList);
+               actualFunctionalMenuRoleList = userNotificationController.getMenuIdRoleId(mockedRequest, mockedResponse);
+               assertTrue(actualFunctionalMenuRoleList.equals(expectedMenuRoleList));
+
+       }
+
+       @Test
+       public void getNotificationsTest() {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EpNotificationItem> expectedEpNotificationList = new ArrayList<EpNotificationItem>();
+               EpNotificationItem epNotificationItem = new EpNotificationItem();
+               epNotificationItem.setNotificationId((long) 200);
+               expectedEpNotificationList.add(epNotificationItem);
+               PortalRestResponse<List<EpNotificationItem>> expectedportalRestResponse = new PortalRestResponse<List<EpNotificationItem>>();
+               expectedportalRestResponse.setMessage("success");
+               expectedportalRestResponse.setResponse(expectedEpNotificationList);
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               PortalRestResponse<List<EpNotificationItem>> actualPortalRestResponse = null;
+               Mockito.when(userNotificationService.getNotifications(user.getId())).thenReturn(expectedEpNotificationList);
+               actualPortalRestResponse = userNotificationController.getNotifications(mockedRequest, mockedResponse);
+               assertTrue(expectedportalRestResponse.equals(actualPortalRestResponse));
+
+       }
+
+       @Test
+       public void getNotificationsCatchesExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EpNotificationItem> expectedEpNotificationList = null;
+               PortalRestResponse<List<EpNotificationItem>> expectedportalRestResponse = new PortalRestResponse<List<EpNotificationItem>>();
+               expectedportalRestResponse.setMessage(null);
+               expectedportalRestResponse.setResponse(expectedEpNotificationList);
+               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<List<EpNotificationItem>> actualPortalRestResponse = null;
+               Mockito.when(userNotificationService.getNotifications(user.getId())).thenThrow(new NullPointerException());
+               actualPortalRestResponse = userNotificationController.getNotifications(mockedRequest, mockedResponse);
+               assertTrue(expectedportalRestResponse.equals(actualPortalRestResponse));
+       }
+
+       @Test
+       public void getAdminNotificationsTest() {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EpNotificationItemVO> actualEpNotificationsList = new ArrayList<EpNotificationItemVO>();
+               List<EpNotificationItemVO> expectedEpNotificationsList = new ArrayList<EpNotificationItemVO>();
+               EpNotificationItemVO epNotificationItemVO = new EpNotificationItemVO();
+               epNotificationItemVO.setId((long) 1);
+               expectedEpNotificationsList.add(epNotificationItemVO);
+               Mockito.when(userNotificationService.getAdminNotificationVOS(Matchers.anyLong())).thenReturn(expectedEpNotificationsList);
+               actualEpNotificationsList = userNotificationController.getAdminNotifications(mockedRequest, mockedResponse);
+               assertTrue(actualEpNotificationsList.equals(expectedEpNotificationsList));
+       }
+
+       @Test
+       public void saveTestWhenNotificationIsNull() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+               expectedPortalRestResponse.setMessage("FAILURE");
+               expectedPortalRestResponse.setResponse("Notification Header cannot be null or empty");
+               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+
+               EpNotificationItem notificationItem = null;
+               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
+               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
+       }
+
+       @Test
+       public void saveTestWhenEndTimeIsGreater() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+               expectedPortalRestResponse.setMessage("FAILURE");
+               expectedPortalRestResponse.setResponse("End Time should be greater than  start time");
+               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               EpNotificationItem notificationItem = new EpNotificationItem();
+               notificationItem.setNotificationId((long) 1);
+               notificationItem.setMsgHeader("Test");
+               Date currentDate = new Date();
+               Calendar c = Calendar.getInstance();
+               c.setTime(currentDate);
+               c.add(Calendar.DATE, 1);
+               Date currentDatePlusOne = c.getTime();
+               notificationItem.setStartTime(currentDatePlusOne);
+               notificationItem.setEndTime(currentDate);
+
+               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
+               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
+
+       }
+
+       @Test
+       public void saveTestWhenNoRoleIDExists() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+               expectedPortalRestResponse.setMessage("FAILURE");
+               expectedPortalRestResponse.setResponse("No Roles Ids Exist for the selected Roles");
+               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               EpNotificationItem notificationItem = new EpNotificationItem();
+               notificationItem.setNotificationId((long) 1);
+               notificationItem.setMsgHeader("Test");
+               notificationItem.setIsForAllRoles("N");
+               Date currentDate = new Date();
+               Calendar c = Calendar.getInstance();
+               c.setTime(currentDate);
+               c.add(Calendar.DATE, 1);
+               Date currentDatePlusOne = c.getTime();
+               notificationItem.setStartTime(currentDate);
+               notificationItem.setEndTime(currentDatePlusOne);
+               List<Long> roleList = new ArrayList<Long>();
+               notificationItem.setRoleIds(roleList);
+               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
+               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
+       }
+
+       @Test
+       public void saveTest() throws Exception {
+               EPUser user = mockUser.mockEPUser();
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute("user", user);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
+               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
+               expectedPortalRestResponse.setMessage("SUCCESS");
+               expectedPortalRestResponse.setResponse("");
+               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               EpNotificationItem notificationItem = new EpNotificationItem();
+               notificationItem.setNotificationId((long) 1);
+               notificationItem.setMsgHeader("Test");
+               notificationItem.setIsForAllRoles("Y");
+               Date currentDate = new Date();
+               Calendar c = Calendar.getInstance();
+               c.setTime(currentDate);
+               c.add(Calendar.DATE, 1);
+               Date currentDatePlusOne = c.getTime();
+               notificationItem.setStartTime(currentDate);
+               notificationItem.setEndTime(currentDatePlusOne);
+               List<Long> roleList = new ArrayList<Long>();
+               Long role1 = (long) 1;
+               roleList.add(role1);
+               notificationItem.setRoleIds(roleList);
+               HttpServletRequest request = mockitoTestSuite.getMockedRequest();
+               PowerMockito.mockStatic(UserUtils.class);
+               Mockito.when(UserUtils.getUserIdAsLong(request)).thenReturn((long) 1);
+               Mockito.when(userNotificationService.saveNotification(notificationItem)).thenReturn("Test");
+               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
+               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserRolesControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/UserRolesControllerTest.java
new file mode 100644 (file)
index 0000000..2897413
--- /dev/null
@@ -0,0 +1,326 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.UserRolesController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EcompAuditLog;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.portal.service.UserRolesService;
+import org.onap.portalapp.portal.transport.AppWithRolesForUser;
+import org.onap.portalapp.portal.transport.AppsListWithAdminRole;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.RoleInAppForUser;
+import org.onap.portalapp.portal.transport.FieldsValidator.FieldName;
+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.service.AuditService;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({EcompPortalUtils.class, EPCommonSystemProperties.class, EcompAuditLog.class, SystemProperties.class})
+public class UserRolesControllerTest extends MockitoTestSuite {
+
+       String userid = "ab1234";
+
+       @Mock
+       UserRolesService userRolesService;
+       
+       @Mock
+       SearchService searchService;
+       
+       @Mock
+       AuditService auditService;
+       
+       @Mock
+       AdminRolesService adminRolesService;
+
+       @Mock
+       FieldsValidator fieldsValidator;
+
+       @InjectMocks
+       UserRolesController userRolesController = new UserRolesController();
+
+       @Mock
+       private DataAccessService dataAccessService;
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       @Mock
+       EPUser epuser;
+
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void putAppWithUserRoleRequestTest() {
+
+               FieldsValidator actualFieldsValidator = null;
+
+               AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser();
+               List<RoleInAppForUser> listofRoles = new ArrayList<RoleInAppForUser>();
+
+               appWithRolesForUser.setOrgUserId("guest");
+               appWithRolesForUser.setAppId((long) 550);
+               appWithRolesForUser.setAppName("D2 Services Analytics Dashboard");
+               appWithRolesForUser.setAppRoles(listofRoles);
+
+               RoleInAppForUser roleInAppForUser = new RoleInAppForUser();
+               roleInAppForUser.setIsApplied(false);
+               roleInAppForUser.setRoleId((long) 1);
+               roleInAppForUser.setRoleName("System Administrator");
+
+               RoleInAppForUser roleInAppForUser1 = new RoleInAppForUser();
+               roleInAppForUser1.setIsApplied(true);
+               roleInAppForUser1.setRoleId((long) 16);
+               roleInAppForUser1.setRoleName("Standard User");
+
+               listofRoles.add(roleInAppForUser);
+               listofRoles.add(roleInAppForUser1);
+               EPUser user = mockUser.mockEPUser();
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               List<FieldName> fields = new ArrayList<>();
+
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(fields);
+               expectedFieldValidator.setErrorCode(null);
+               HttpSession session = mockedRequest.getSession();
+               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(userRolesService.putUserAppRolesRequest(appWithRolesForUser, user))
+                               .thenReturn(expectedFieldValidator);
+
+               actualFieldsValidator = userRolesController.putAppWithUserRoleRequest(mockedRequest, appWithRolesForUser,
+                               mockedResponse);
+               assertEquals(expectedFieldValidator.getHttpStatusCode(), actualFieldsValidator.getHttpStatusCode());
+               assertEquals(expectedFieldValidator.getErrorCode(), actualFieldsValidator.getErrorCode());
+               assertEquals(expectedFieldValidator.getFields(), actualFieldsValidator.getFields());
+
+       }
+       
+       @Test
+       public void getPhoneBookSearchResultBadPermissionsTest() {
+               String searchString = "test";
+               String actualResult = null;
+               String expectedResult = null;
+               
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
+               
+               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
+               assertEquals(expectedResult, actualResult);
+       
+       }
+       
+       @Test
+       public void getPhoneBookSearchResultValidationTest() {
+               String searchString = " t";
+               String actualResult = null;
+               String expectedResult = null;
+               
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
+               
+               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
+               assertEquals(expectedResult, actualResult);
+       
+       }
+       
+       @Test
+       public void getPhoneBookSearchResultTest() {
+               String searchString = "test";
+               String actualResult = null;
+               String expectedResult = null;
+               
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
+               
+               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
+               assertEquals(expectedResult, actualResult);
+       
+       }
+       
+       @Test
+       public void getAppsWithAdminRoleStateForUserTest(){
+               
+               String orgUserId = "hb123f";
+               AppsListWithAdminRole actualResult = new AppsListWithAdminRole();
+               AppsListWithAdminRole expectedResult = new AppsListWithAdminRole();
+               EPUser user = mockUser.mockEPUser();
+       //      PowerMockito.mockStatic(EcompPortalUtils.class);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId)).thenReturn(actualResult);
+               
+               actualResult = userRolesController.getAppsWithAdminRoleStateForUser(mockedRequest, orgUserId, mockedResponse);
+               assertEquals(expectedResult, actualResult);
+       }
+       
+       /*@Test
+       public void getAppsWithAdminRoleStateForUserBadRequestTest(){
+               
+               String orgUserId = "hb123f";
+               AppsListWithAdminRole actualResult = null;
+               AppsListWithAdminRole expectedResult = null;
+               EPUser user = mockUser.mockEPUser();
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               PowerMockito.when(EcompPortalUtils.legitimateUserId(orgUserId)).thenReturn(false);
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId)).thenReturn(actualResult);
+               
+               actualResult = userRolesController.getAppsWithAdminRoleStateForUser(mockedRequest, orgUserId, mockedResponse);
+               assertEquals(expectedResult, actualResult);
+       }*/
+       
+       @Test
+       public void putAppsWithAdminRoleStateForUserBadStatusCodeTest(){
+               FieldsValidator actualFieldsValidator = null;
+               AppsListWithAdminRole newAppsListWithAdminRoles = new  AppsListWithAdminRole();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fieldNames = new ArrayList<FieldName>();
+               expectedFieldsValidator.setErrorCode(null);
+               expectedFieldsValidator.setFields(fieldNames);
+               expectedFieldsValidator.setHttpStatusCode((long)200);
+               
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               
+               actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
+               assertEquals(expectedFieldsValidator, actualFieldsValidator);
+       }
+       
+       
+       /*@Test
+       public void putAppsWithAdminRoleStateForUserTest() {
+               
+               FieldsValidator actualFieldsValidator = null;
+               AppsListWithAdminRole newAppsListWithAdminRoles = new  AppsListWithAdminRole();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(EcompAuditLog.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN)).thenReturn("1400");
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)).thenReturn("1400");
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP)).thenReturn("1400");
+               Mockito.when(SystemProperties.getProperty(SystemProperties.MDC_TIMER)).thenReturn("1400");
+               
+               actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
+
+               System.out.println(actualFieldsValidator);
+               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
+               
+               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
+               assertEquals(expectedResult, actualResult);
+       
+       }*/
+       
+       /*@Test
+       public void putAppsWithAdminRoleStateForUserTest(){
+               FieldsValidator actualFieldsValidator = null;
+               AppsListWithAdminRole newAppsListWithAdminRoles = new  AppsListWithAdminRole();
+               FieldsValidator expectedFieldsValidator = new FieldsValidator();
+               List<FieldName> fieldNames = new ArrayList<FieldName>();
+               expectedFieldsValidator.setErrorCode(null);
+               expectedFieldsValidator.setFields(fieldNames);
+               expectedFieldsValidator.setHttpStatusCode((long)200);
+               
+               EPUser user = mockUser.mockEPUser();
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               PowerMockito.mockStatic(EcompAuditLog.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles));
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+
+       //      Mockito.call(auditService.logActivity(auditLog, null));
+//             Mockito.when(SystemProperties.getProperty(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN)).thenReturn("1400");
+//             Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)).thenReturn("1400");
+//             Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP)).thenReturn("1400");
+//             Mockito.when(SystemProperties.getProperty(SystemProperties.MDC_TIMER)).thenReturn("1400");
+               
+               actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
+               assertEquals(expectedFieldsValidator, actualFieldsValidator);
+       }*/
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WebAnalyticsExtAppControllerTest.java
new file mode 100644 (file)
index 0000000..b65c442
--- /dev/null
@@ -0,0 +1,147 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.IOUtils;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.WebAnalyticsExtAppController;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.AppsCacheService;
+import org.onap.portalapp.portal.service.AppsCacheServiceImple;
+import org.onap.portalapp.portal.transport.Analytics;
+import org.onap.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.service.AuditServiceImpl;
+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;
+
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({SystemProperties.class,IOUtils.class,Object.class})
+public class WebAnalyticsExtAppControllerTest {
+
+       
+       
+       @InjectMocks
+       WebAnalyticsExtAppController webAnalyticsExtAppController = new WebAnalyticsExtAppController();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+       
+       @Mock
+       AppsCacheService appCacheService = new AppsCacheServiceImple();
+
+       @Mock
+       AuditService auditService = new AuditServiceImpl();
+
+//     @Mock 
+//     InputStream analyticsFileStream;
+
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       /*@Test
+       public void getAnalyticsScriptTest() throws Exception
+       {
+               String expectedResponse = "http://www.ecomp.com";
+
+               InputStream analyticsFileStream = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(IOUtils.class);
+               Mockito.when(IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name())).thenReturn("PORTAL_ENV_URL");
+               Mockito.when(SystemProperties.getProperty("frontend_url")).thenReturn("http://www.ecomp.com/test");
+               String actualResponse = webAnalyticsExtAppController.getAnalyticsScript(mockedRequest);
+//     assertNull(webAnalyticsExtAppController.getAnalyticsScript(mockedRequest));
+               
+       //      System.out.println(actualResponse);
+               assertTrue(actualResponse.equals(expectedResponse));    
+       }*/
+
+       /*@Test
+       public void getAnalyticsScriptExceptionTest() throws Exception
+       {
+               String expectedResponse = "";
+               InputStream analyticsFileStream = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(IOUtils.class);
+               Mockito.when(IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name())).thenThrow(nullPointerException);
+               Mockito.when(SystemProperties.getProperty("frontend_url")).thenReturn("http://www.ecomp.com/test");
+       String actualResponse = webAnalyticsExtAppController.getAnalyticsScript(mockedRequest);
+         assertEquals(actualResponse,expectedResponse);
+       }*/
+
+       @Test
+       public void storeAnalyticsScriptIfAnalyticsNullTest() throws Exception
+       {
+               PortalAPIResponse       expectedPortalAPIResponse = new PortalAPIResponse(true, "error");
+               Analytics analytics= null;
+               Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(null);
+               PortalAPIResponse       actualPortalAPIResponse =       webAnalyticsExtAppController.storeAnalyticsScript(mockedRequest, analytics);
+               assertTrue(expectedPortalAPIResponse.getMessage().equals(actualPortalAPIResponse.getMessage()));
+               assertTrue(expectedPortalAPIResponse.getStatus().equals(actualPortalAPIResponse.getStatus()));  
+       }
+               
+}
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
new file mode 100644 (file)
index 0000000..50291f0
--- /dev/null
@@ -0,0 +1,139 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+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.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.WidgetsCatalogController;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.domain.WidgetCatalog;
+import org.onap.portalapp.portal.domain.WidgetServiceHeaders;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.ConsulHealthService;
+import org.onap.portalapp.portal.service.ConsulHealthServiceImpl;
+import org.onap.portalapp.portal.service.MicroserviceService;
+import org.onap.portalapp.portal.service.MicroserviceServiceImpl;
+import org.onap.portalapp.portal.service.WidgetParameterService;
+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.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.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+
+@Ignore
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({EPUserUtils.class, EcompPortalUtils.class, SystemProperties.class, EPCommonSystemProperties.class})
+public class WidgetsCatalogControllerTest {
+
+       @Mock
+       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
+       
+       @Mock
+       MicroserviceService microserviceService = new MicroserviceServiceImpl();
+       
+       @Mock
+       WidgetParameterService widgetParameterService = new WidgetParameterServiceImpl();
+       
+       @InjectMocks
+       WidgetsCatalogController widgetsCatalogController = new WidgetsCatalogController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       @Mock
+       WidgetServiceHeaders widgetServiceHeaders ;
+       
+       
+       @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();
+       
+       @Mock
+       HttpEntity mockHttpEntity; 
+       
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getUserWidgetCatalogTest() throws RestClientException, Exception{
+               
+               String resourceType = null;
+               List<WidgetCatalog> widgets = new ArrayList<>();
+        PowerMockito.mockStatic(EcompPortalUtils.class);       
+        PowerMockito.mockStatic(SystemProperties.class);
+        PowerMockito.mockStatic(EPCommonSystemProperties.class);
+        Mockito.when(EcompPortalUtils.widgetMsProtocol()).thenReturn("test1");
+        Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WIDGET_MS_PROTOCOL)).thenReturn("https");
+//        Mockito.when(WidgetServiceHeaders.getInstance()).thenReturn(HttpHeaders.ACCEPT);
+        Mockito.when(SystemProperties.getProperty("microservices.widget.local.port")).thenReturn("test");
+        Mockito.when(consulHealthService.getServiceLocation("widgets-service",
+                                                       "test")).thenReturn("test.com");
+        Mockito.when(new HttpEntity(WidgetServiceHeaders.getInstance())).thenReturn(mockHttpEntity);
+//        HttpEntity<String> entity = new HttpEntity<String>("helloWorld");
+//             ResponseEntity<ArrayList> ans = new ResponseEntity<>(statusCode);
+//             Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.GET),
+//                             Matchers.<HttpEntity<?>>any(), Matchers.eq(ArrayList.class))).thenReturn(ans);
+//             List<WidgetCatalog> expectedWidgets  =  widgetsCatalogController.getUserWidgetCatalog(mockedRequest, mockedResponse, "guestT");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/WidgetsCatalogMarkupControllerTest.java
new file mode 100644 (file)
index 0000000..03031b4
--- /dev/null
@@ -0,0 +1,110 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertTrue;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.WidgetsCatalogMarkupController;
+import org.onap.portalapp.portal.domain.WidgetServiceHeaders;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.ConsulHealthService;
+import org.onap.portalapp.portal.service.ConsulHealthServiceImpl;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+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.web.client.RestClientException;
+import org.springframework.web.client.RestTemplate;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({WidgetServiceHeaders.class, EcompPortalUtils.class})
+public class WidgetsCatalogMarkupControllerTest extends MockitoTestSuite {
+       
+       @InjectMocks
+       WidgetsCatalogMarkupController widgetsCatalogMarkupController = new WidgetsCatalogMarkupController();
+       
+       @Mock
+       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
+       
+       @Mock
+       RestTemplate template = new RestTemplate();
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+    @Mock
+    CipherUtil cipherUtil= new CipherUtil();
+    
+    @Mock
+    EcompPortalUtils ecompPortalUtils =new EcompPortalUtils();
+       
+       @Mock
+       WidgetServiceHeaders WidgetServiceHeaders ;
+       
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       @SuppressWarnings("static-access")
+       @Test
+       public void getWidgetMarkupTest() throws RestClientException, Exception
+       {
+               String whatService = "widgets-service";
+               PowerMockito.mockStatic(WidgetServiceHeaders.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               Mockito.when(template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
+                               WidgetServiceHeaders.getInstance())).thenReturn("Success");
+               String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
+               assertTrue(response.equals("Success")); 
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/shared-context-test.properties b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/controller/shared-context-test.properties
new file mode 100644 (file)
index 0000000..56e5907
--- /dev/null
@@ -0,0 +1,28 @@
+###
+# ================================================================================
+# ECOMP Portal
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property
+# ================================================================================
+# 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.
+# ================================================================================
+###
+
+hostname= www.portal.onap.org
+# port = 80
+secure = true
+appname = ecompportal
+restpath = context
+uebkey = xgnLrmNmkfCRnIwa
+username = username
+countersign = pwd
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/MockEPUser.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/MockEPUser.java
new file mode 100644 (file)
index 0000000..c523544
--- /dev/null
@@ -0,0 +1,102 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.core;
+
+import java.util.Date;
+
+import org.onap.portalapp.portal.domain.EPUser;
+
+public class MockEPUser {
+
+       public EPUser mockEPUser() {
+
+               EPUser ePUser = new EPUser();
+               ePUser.setOrgId(null);
+               ePUser.setManagerId(null);
+               ePUser.setFirstName("test");
+               ePUser.setLastName("test");
+               ePUser.setMiddleInitial(null);
+               ePUser.setPhone(null);
+               ePUser.setFax(null);
+               ePUser.setCellular(null);
+               ePUser.setEmail(null);
+               ePUser.setAddressId(null);
+               ePUser.setAlertMethodCd(null);
+               ePUser.setHrid(null);
+               ePUser.setOrgUserId("guestT");
+               ePUser.setOrgCode(null);
+               ePUser.setAddress1(null);
+               ePUser.setAddress2(null);
+               ePUser.setCity(null);
+               ePUser.setState(null);
+               ePUser.setZipCode(null);
+               ePUser.setCountry(null);
+               ePUser.setOrgManagerUserId(null);
+               ePUser.setLocationClli(null);
+               ePUser.setBusinessCountryCode(null);
+               ePUser.setBusinessCountryName(null);
+               ePUser.setBusinessUnit(null);
+               ePUser.setBusinessUnitName(null);
+               ePUser.setDepartment(null);
+               ePUser.setDepartmentName(null);
+               ePUser.setCompanyCode(null);
+               ePUser.setCompany(null);
+               ePUser.setZipCodeSuffix(null);
+               ePUser.setJobTitle(null);
+               ePUser.setCommandChain(null);
+               ePUser.setSiloStatus(null);
+               ePUser.setCostCenter(null);
+               ePUser.setFinancialLocCode(null);
+
+               ePUser.setLoginId(null);
+               ePUser.setLoginPwd(null);
+               Date date = new Date();
+               ePUser.setLastLoginDate(date);
+               ePUser.setActive(true);
+               ePUser.setInternal(false);
+               ePUser.setSelectedProfileId(null);
+               ePUser.setTimeZoneId(null);
+               ePUser.setOnline(true);
+               ePUser.setChatId(null);
+               ePUser.setUserApps(null);
+               ePUser.setPseudoRoles(null);
+
+               ePUser.setId((long) -1);
+               return ePUser;
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/PopulateSampleTestData.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/PopulateSampleTestData.java
new file mode 100644 (file)
index 0000000..e3eeaa5
--- /dev/null
@@ -0,0 +1,85 @@
+package org.onap.portalapp.portal.core;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+//package org.openecomp.portalapp.portal.core;
+//
+//import java.sql.Connection;
+//import java.sql.SQLException;
+//
+//import javax.sql.DataSource;
+//
+//import org.junit.Before;
+//import org.junit.Test;
+//import org.openecomp.portalapp.framework.ApplicationCommonContextTestSuite;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.core.io.ClassPathResource;
+//import org.springframework.jdbc.datasource.DataSourceUtils;
+//import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
+//
+//public class PopulateSampleTestData extends ApplicationCommonContextTestSuite {
+//
+//     @Autowired
+//     DataSource dataSource;
+//
+//     @Before
+//     public void populateTestData() throws SQLException {
+//
+//             String sql = "PopulateTestData.sql";
+//             createConnection(sql);
+//     }
+//
+//     public void createConnection(String sql) {
+//             Connection connection = null;
+//             ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
+//             populator.addScript(new ClassPathResource(sql));
+//             try {
+//                     connection = DataSourceUtils.getConnection(dataSource);
+//                     populator.populate(connection);
+//             } finally {
+//                     if (connection != null) {
+//                             DataSourceUtils.releaseConnection(connection, dataSource);
+//                     }
+//             }
+//     }
+//
+//     @Test
+//     public void populateTest() {
+//             assert (true);
+//     }
+//
+//}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/RemoveSampleTestData.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/RemoveSampleTestData.java
new file mode 100644 (file)
index 0000000..1fa6c7d
--- /dev/null
@@ -0,0 +1,84 @@
+package org.onap.portalapp.portal.core;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+//package org.openecomp.portalapp.portal.core;
+//
+//import java.sql.Connection;
+//import java.sql.SQLException;
+//
+//import javax.sql.DataSource;
+//
+//import org.junit.After;
+//import org.junit.Test;
+//import org.openecomp.portalapp.framework.ApplicationCommonContextTestSuite;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.core.io.ClassPathResource;
+//import org.springframework.jdbc.datasource.DataSourceUtils;
+//import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
+//
+//public class RemoveSampleTestData extends ApplicationCommonContextTestSuite {
+//     @Autowired
+//     DataSource dataSource;
+//
+//     public static int count = 0;
+//
+//     @After
+//     public void removeTestData() throws SQLException {
+//             String sql = "RemoveTestData.sql";
+//             createConnection(sql);
+//     }
+//
+//     public void createConnection(String sql) {
+//             Connection connection = null;
+//             ResourceDatabasePopulator populator = new ResourceDatabasePopulator();
+//             populator.addScript(new ClassPathResource(sql));
+//             try {
+//                     connection = DataSourceUtils.getConnection(dataSource);
+//                     populator.populate(connection);
+//             } finally {
+//                     if (connection != null) {
+//                             DataSourceUtils.releaseConnection(connection, dataSource);
+//                     }
+//             }
+//     }
+//
+//     @Test
+//     public void removeTest() {
+//             assert (true);
+//     }
+//}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/RestURLsTestSuite.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/core/RestURLsTestSuite.java
new file mode 100644 (file)
index 0000000..8bb2181
--- /dev/null
@@ -0,0 +1,353 @@
+package org.onap.portalapp.portal.core;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+//package org.openecomp.portalapp.portal.core;
+//
+//import static org.junit.Assert.assertEquals;
+//import static org.junit.Assert.assertTrue;
+//
+//import java.io.IOException;
+//import java.nio.charset.Charset;
+//import java.util.ArrayList;
+//
+//import org.junit.Assert;
+//import org.junit.Test;
+//import org.openecomp.portalapp.framework.ApplicationCommonContextTestSuite;
+//import org.openecomp.portalapp.portal.domain.EPUser;
+//import org.openecomp.portalapp.portal.test.core.MockEPUser;
+//import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
+//import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
+//import org.openecomp.portalsdk.core.util.SystemProperties;
+//import org.springframework.http.MediaType;
+//import org.springframework.test.web.servlet.ResultActions;
+//import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
+//import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+//
+//import com.fasterxml.jackson.annotation.JsonInclude;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//
+///**
+// * 
+// * Use RestURLsTestSuite to test Rest API URL's
+// */
+//public class RestURLsTestSuite extends ApplicationCommonContextTestSuite {
+//
+//     public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(MediaType.APPLICATION_JSON.getType(),
+//                     MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));
+//
+//     String url = null;
+//
+//     MockEPUser mockUser = new MockEPUser();
+//
+//     public byte[] convertObjectToJsonBytes(Object object) throws IOException {
+//             ObjectMapper mapper = new ObjectMapper();
+//             mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+//             return mapper.writeValueAsBytes(object);
+//     }
+//
+//     public void requestBuilder(String url) throws Exception {
+//             EPUser user = mockUser.mockEPUser();
+//
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get(url);
+//             requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertData(ra);
+//     }
+//
+//     public void assertData(ResultActions ra) {
+//             Assert.assertEquals("application/json", ra.andReturn().getResponse().getContentType());
+//             Assert.assertEquals(200, ra.andReturn().getResponse().getStatus());
+//
+//     }
+//
+//     @Test
+//     public void getMenuItemsTest() throws Exception {
+//             url = "/portalApi/functionalMenu";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getMenuItemsForNotificationsTest() throws Exception {
+//             url = "/portalApi/functionalMenuForNotificationTree";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getUserAppsTestnew() throws Exception {
+//             url = "/portalApi/userApps";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getPersUserAppsTest() throws Exception {
+//             url = "/portalApi/persUserApps";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getAppCatalogTest() throws Exception {
+//             url = "/portalApi/appCatalog";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getAppListNewTest() throws Exception {
+//             ResultActions ra = getMockMvc()
+//                             .perform(MockMvcRequestBuilders.get("/portalApi/userApplicationRoles").param("userId", "guest"));
+//             assertData(ra);
+//     }
+//
+//     @Test
+//     public void getAvailableAppListTest() throws Exception {
+//             url = "/portalApi/availableApps";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getAllAppsTest() throws Exception {
+//             url = "/portalApi/allAvailableApps";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getUserProfileTest() throws Exception {
+//             url = "/portalApi/userProfile";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getRolesByAppTest() throws Exception {
+//             EPUser user = mockUser.mockEPUser();
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/adminAppsRoles/550");
+//             requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertData(ra);
+//     }
+//
+//     @Test
+//     public void getAppsWithAdminRoleStateForUserTest() throws Exception {
+//             url = "/portalApi/adminAppsRoles?user=guest";
+//             requestBuilder(url);
+//
+//     }
+//
+//     @Test
+//     public void getUsersFromAppEndpointTest() throws Exception {
+//             url = "/portalApi/app/550/users";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getOnboardingAppsTest() throws Exception {
+//             url = "/portalApi/onboardingApps";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getMenuItemsForAuthUserTest() throws Exception {
+//             url = "/portalApi/functionalMenuForAuthUser";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getMenuItemsForEditingTest() throws Exception {
+//             url = "/portalApi/functionalMenuForEditing";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getAppRolesTest() throws Exception {
+//             url = "/portalApi/appRoles/455";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void regenerateAncestorTableTest() throws Exception {
+//
+//             EPUser user = mockUser.mockEPUser();
+//
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders
+//                             .get("/portalApi/regenerateFunctionalMenuAncestors");
+//             requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertEquals("application/json;charset=UTF-8", ra.andReturn().getResponse().getContentType());
+//             Assert.assertEquals(200, ra.andReturn().getResponse().getStatus());
+//
+//     }
+//
+//     @Test
+//     public void getAppListTest() throws Exception {
+//             url = "/portalApi/getAppList";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getFavoritesForUserTest() throws Exception {
+//             url = "/portalApi/getFavoriteItems";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getManifestTest() throws Exception {
+//             url = "/portalApi/manifest";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getActiveUsersTest() throws Exception {
+//             url = "/portalApi/dashboard/activeUsers";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void searchPortalTest() throws Exception {
+//             EPUser user = mockUser.mockEPUser();
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/dashboard/search")
+//                             .param("searchString", "guest");
+//             requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertData(ra);
+//     }
+//
+//     @Test
+//     public void getWidgetDataTest() throws Exception {
+//             EPUser user = mockUser.mockEPUser();
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.get("/portalApi/dashboard/widgetData")
+//                             .param("resourceType", "guest");
+//             requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertData(ra);
+//     }
+//
+//     @Test
+//     public void getAppsAndContactsTest() throws Exception {
+//             url = "/portalApi/contactus/allapps";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getPortalDetailsTest() throws Exception {
+//             url = "/portalApi/contactus/feedback";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getAppCategoryFunctionsTest() throws Exception {
+//             url = "/portalApi/contactus/functions";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getOnlineUserUpdateRateTest() throws Exception {
+//             url = "/portalApi/dashboard/onlineUserUpdateRate";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getMenuIdRoleIdTest() throws Exception {
+//             url = "/portalApi/getFunctionalMenuRole";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getNotificationsTest() throws Exception {
+//             url = "/portalApi/getNotifications";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getAdminNotificationsTest() throws Exception {
+//             url = "/portalApi/getAdminNotifications";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getNotificationAppRolesTest() throws Exception {
+//             url = "/portalApi/getNotificationAppRoles";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void getNotificationUpdateRateTest() throws Exception {
+//             url = "/portalApi/notificationUpdateRate";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void notificationReadTest() throws Exception {
+//             url = "/portalApi/notificationRead?notificationId=262";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void testGetRolesTest() throws Exception {
+//             url = "/portalApi/notificationRole/248/roles";
+//             requestBuilder(url);
+//     }
+//
+//     @Test
+//     public void putAppsWithAdminRoleStateForUserTest() throws Exception {
+//
+//             AppsListWithAdminRole appsListWithAdminRole = new AppsListWithAdminRole();
+//             appsListWithAdminRole.setOrgUserId("guest");
+//             ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
+//             AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
+//             appNameIdIsAdmin.setId((long) 455);
+//             appNameIdIsAdmin.setAppName("CCD");
+//             appNameIdIsAdmin.setIsAdmin(true);
+//             appNameIdIsAdmin.setRestrictedApp(false);
+//             appsRoles.add(appNameIdIsAdmin);
+//             appsListWithAdminRole.setAppsRoles(appsRoles);
+//             EPUser user = mockUser.mockEPUser();
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.put("/portalApi/adminAppsRoles")
+//                             .contentType(APPLICATION_JSON_UTF8).content(convertObjectToJsonBytes(appsListWithAdminRole));
+//
+//             requestBuilder.sessionAttr(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertData(ra);
+//     }
+//
+//     @Test
+//     public void ticketEventControllerForExternalSystem() throws Exception {
+//             String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
+//             MockHttpServletRequestBuilder requestBuilder = MockMvcRequestBuilders.post("/auxapi/ticketevent")
+//                             .contentType(APPLICATION_JSON_UTF8).content(ticketEventJson);
+//             ResultActions ra = getMockMvc().perform(requestBuilder);
+//             assertTrue(ra.andReturn().getResponse().getContentType().contains("application/json"));
+//     }
+//}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AdminUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AdminUserAppTest.java
new file mode 100644 (file)
index 0000000..f93fe4a
--- /dev/null
@@ -0,0 +1,73 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.AdminUserApp;
+
+public class AdminUserAppTest {
+
+       public AdminUserApp mockAdminUserApp(){
+               
+               AdminUserApp adminUserApp = new AdminUserApp();
+       
+               adminUserApp.setUserId((long)1);
+               adminUserApp.setFirstName("test");
+               adminUserApp.setLastName("test");
+               adminUserApp.setOrgUserId("test");
+               adminUserApp.setAppId((long)1);
+               adminUserApp.setAppName("test");
+               
+               return adminUserApp;
+       }
+       
+       @Test
+       public void adminUserAppTest(){
+               AdminUserApp adminUserApp = mockAdminUserApp();
+               
+               assertEquals(adminUserApp.getUser_Id(), new Long(1));
+               assertEquals(adminUserApp.getFirstName(), "test");
+               assertEquals(adminUserApp.getLastName(), "test");
+               assertEquals(adminUserApp.getOrgUserId(), "test");
+               assertEquals(adminUserApp.getAppName(), "test");
+               assertEquals(adminUserApp.getAppId(), new Long(1));
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AdminUserApplicationsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AdminUserApplicationsTest.java
new file mode 100644 (file)
index 0000000..b01efb8
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.AdminUserApp;
+import org.onap.portalapp.portal.domain.AdminUserApplications;
+
+public class AdminUserApplicationsTest {
+
+       public AdminUserApplications mockAdminUserApplications(){
+               
+               AdminUserApp adminUserApp = new AdminUserApp();
+               
+               adminUserApp.setUserId((long)1);
+               adminUserApp.setFirstName("test");
+               adminUserApp.setLastName("test");
+               adminUserApp.setOrgUserId("test");
+               adminUserApp.setAppId((long)1);
+               adminUserApp.setAppName("test");
+               
+               AdminUserApplications adminUserApplications = new AdminUserApplications(adminUserApp);
+               
+               adminUserApplications.setUser_Id((long)1);
+               adminUserApplications.setFirstName("test");
+               adminUserApplications.setLastName("test");
+               adminUserApplications.setOrgUserId("test");     
+               return adminUserApplications;
+       }
+       
+       @Test
+       public void adminUserAppTest(){
+               AdminUserApplications adminUserApplications = mockAdminUserApplications();
+           AdminUserApp adminUserApp = new AdminUserApp();
+               
+               adminUserApp.setUserId((long)1);
+               adminUserApp.setFirstName("test");
+               adminUserApp.setLastName("test");
+               adminUserApp.setOrgUserId("test");
+               adminUserApp.setAppId((long)1);
+               adminUserApp.setAppName("test");
+               AdminUserApplications adminUserApplications1 = new AdminUserApplications(adminUserApp);
+               
+               assertEquals(adminUserApplications.getUser_Id(), new Long(1));
+               assertEquals(adminUserApplications.getFirstName(), "test");
+               assertEquals(adminUserApplications.getLastName(), "test");
+               assertEquals(adminUserApplications.getOrgUserId(), "test");
+               
+               
+               assertEquals(adminUserApplications1.getApps().get(0).getAppId(),adminUserApp.getAppId());
+               assertEquals(adminUserApplications1.getApps().get(0).getAppName(),adminUserApp.getAppName());
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AppContactUsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/AppContactUsTest.java
new file mode 100644 (file)
index 0000000..ec24c6e
--- /dev/null
@@ -0,0 +1,69 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.AppContactUs;
+
+public class AppContactUsTest {
+
+       public AppContactUs  mockAppContactUs(){
+               AppContactUs appContactUs = new AppContactUs();
+               appContactUs.setDescription("test");
+               appContactUs.setContactEmail("test");
+               appContactUs.setContactName("test");
+               appContactUs.setUrl("test");
+               appContactUs.setActiveYN("test");
+                               
+               return appContactUs;
+       }
+       
+       @Test
+       public void mockAppContactUsTest(){
+               AppContactUs appContactUs = mockAppContactUs();
+               
+               assertEquals(appContactUs.getDescription(), "test");
+               assertEquals(appContactUs.getContactEmail(), "test");
+               assertEquals(appContactUs.getContactName(), "test");
+               assertEquals(appContactUs.getUrl(), "test");
+               assertEquals(appContactUs.getActiveYN(), "test");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/CentralRoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/CentralRoleFunctionTest.java
new file mode 100644 (file)
index 0000000..d91ed84
--- /dev/null
@@ -0,0 +1,67 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.CentralRoleFunction;
+
+public class CentralRoleFunctionTest {
+
+       public CentralRoleFunction mockCentralRoleFunction(){
+               
+               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
+                  
+               centralRoleFunction.setCode("test");
+               centralRoleFunction.setName("test");
+               centralRoleFunction.setId(null);
+               centralRoleFunction.setEditUrl("test");
+               return centralRoleFunction;
+       }
+       
+       @Test
+       public void centralRoleFunctionTest(){
+               CentralRoleFunction centralRoleFunction = mockCentralRoleFunction();
+               
+               assertEquals(centralRoleFunction.getId(), null);
+               assertEquals(centralRoleFunction.getCode(), "test");
+               assertEquals(centralRoleFunction.getName(), "test");
+               assertEquals(centralRoleFunction.getEditUrl(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/CentralV2RoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/CentralV2RoleFunctionTest.java
new file mode 100644 (file)
index 0000000..345f457
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class CentralV2RoleFunctionTest {
+
+       public CentralV2RoleFunction mockCentralRoleFunction(){
+               
+               CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction();
+                  
+                  centralV2RoleFunction.setCode("test");
+                  centralV2RoleFunction.setName("test");
+                  centralV2RoleFunction.setAppId((long)1);
+                  centralV2RoleFunction.setEditUrl("test");
+                  centralV2RoleFunction.setType("testType");
+                  centralV2RoleFunction.setAction("testAction");
+                  
+               return centralV2RoleFunction;
+       }
+       
+       @Test
+       public void centralRoleFunctionTest(){
+               CentralV2RoleFunction centralV2RoleFunction = mockCentralRoleFunction();
+               
+               assertEquals(centralV2RoleFunction.getAppId(), new Long(1));
+               assertEquals(centralV2RoleFunction.getCode(), "test");
+               assertEquals(centralV2RoleFunction.getName(), "test");
+               assertEquals(centralV2RoleFunction.getEditUrl(), "test");
+               assertEquals(centralV2RoleFunction.getAction(), "testAction");
+               assertEquals(centralV2RoleFunction.getType(), "testType");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppRoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPAppRoleFunctionTest.java
new file mode 100644 (file)
index 0000000..cb93691
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPAppRoleFunction;
+
+public class EPAppRoleFunctionTest {
+
+       public EPAppRoleFunction mockEPAppRoleFunction(){
+               EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
+               epAppRoleFunction.setRoleId((long)1);
+               epAppRoleFunction.setAppId((long)1);
+               epAppRoleFunction.setCode("test");
+               
+               return epAppRoleFunction;
+       }
+       
+       @Test
+       public void epAppRoleFunctionTest(){
+               EPAppRoleFunction epAppRoleFunction = mockEPAppRoleFunction();
+               
+               assertEquals(epAppRoleFunction.getRoleId(), new Long(1));
+               assertEquals(epAppRoleFunction.getAppId(), new Long(1));
+               assertEquals(epAppRoleFunction.getCode(), "test");
+       }
+}
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
new file mode 100644 (file)
index 0000000..7537ccf
--- /dev/null
@@ -0,0 +1,98 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPApp;
+
+public class EPAppTest {
+
+       public EPApp mockEPApp(){
+               EPApp epApp = new EPApp();
+                               
+               epApp.setName("test");
+               epApp.setImageUrl("test");
+               epApp.setDescription("test");
+               epApp.setNotes("test");
+               epApp.setUrl("test");
+               epApp.setAlternateUrl("test");
+               epApp.setAppRestEndpoint("test");
+               epApp.setMlAppName("test");
+               epApp.setMlAppAdminId("test");
+               epApp.setMotsId((long)1);
+               epApp.setUsername("test");
+               epApp.setAppPassword("test");
+               epApp.setOpen(false);
+               epApp.setEnabled(false);
+               epApp.setUebTopicName("test");
+               epApp.setUebSecret("test");
+               epApp.setAppType(1);
+               epApp.setCentralAuth(false);
+               epApp.setNameSpace("test");
+               
+               return epApp;
+       }
+       
+       @Test
+       public void epAppTest(){
+               EPApp epApp = mockEPApp();
+               
+               assertEquals(epApp.getName(), "test");
+               assertEquals(epApp.getImageUrl(), "test");
+               assertEquals(epApp.getDescription(), "test");
+               assertEquals(epApp.getNotes(), "test");
+               assertEquals(epApp.getUrl(), "test");
+               assertEquals(epApp.getAlternateUrl(), "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.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.getNameSpace(), "test");
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPEndpointAccountTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPEndpointAccountTest.java
new file mode 100644 (file)
index 0000000..d01860a
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPEndpointAccount;
+
+public class EPEndpointAccountTest {
+
+       public EPEndpointAccount mockEPEndpointAccount(){
+               EPEndpointAccount epEndpointAccount = new EPEndpointAccount();
+               
+               epEndpointAccount.setEp_id((long)1);
+               epEndpointAccount.setAccount_id((long)1);
+               epEndpointAccount.setId((long)1);
+               
+               return epEndpointAccount;
+       }
+       
+       @Test
+       public void epEndpointAccount(){
+               EPEndpointAccount epEndpointAccount = mockEPEndpointAccount();
+               assertEquals(epEndpointAccount.getEp_id(), new Long(1));
+               assertEquals(epEndpointAccount.getAccount_id(), new Long(1));
+               assertEquals(epEndpointAccount.getId(), new Long(1));
+               
+               assertEquals(epEndpointAccount.toString(), "EPEndpointAccount [id=1, ep_id=1, account_id=1]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPEndpointTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPEndpointTest.java
new file mode 100644 (file)
index 0000000..79915f2
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPEndpoint;
+
+public class EPEndpointTest {
+
+       public EPEndpoint mockEPEndpoint(){
+               EPEndpoint epEndpoint = new EPEndpoint();
+               
+               epEndpoint.setId((long)1);
+               epEndpoint.setName("test");
+               
+               return epEndpoint;
+       }
+       
+       @Test
+       public void epEndpointTest(){
+               EPEndpoint epEndpoint = mockEPEndpoint();
+               
+               assertEquals(epEndpoint.getId(), new Long(1));
+               assertEquals(epEndpoint.getName(), "test");
+               assertEquals("EPEndpoint [id=1, name=test]", epEndpoint.toString());
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPRoleTest.java
new file mode 100644 (file)
index 0000000..0b51b3d
--- /dev/null
@@ -0,0 +1,73 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPRole;
+
+public class EPRoleTest {
+
+       public EPRole mockEPRole(){
+               EPRole epRole = new EPRole();
+               
+               epRole.setName("test");
+               epRole.setActive(false);
+               epRole.setPriority(1);
+               epRole.setAppId((long)1);
+               epRole.setAppRoleId((long)1);
+                  
+               return epRole;
+       }
+       
+       @Test
+       public void epRoleTest(){
+               EPRole epRole = mockEPRole();
+               
+               assertEquals(epRole.getName(), "test");
+               assertEquals(epRole.getActive(), false);
+               assertEquals(epRole.getPriority().toString(),"1");
+               assertEquals(epRole.getAppId(), new Long(1));
+               assertEquals(epRole.getAppRoleId(), new Long(1));
+               
+               assertEquals(epRole.toString(), "[Id = null, name = test]");
+
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppCatalogRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppCatalogRolesTest.java
new file mode 100644 (file)
index 0000000..e90f74f
--- /dev/null
@@ -0,0 +1,69 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUserAppCatalogRoles;
+
+public class EPUserAppCatalogRolesTest {
+
+       public EPUserAppCatalogRoles mockEPUserAppCatalogRoles(){
+               EPUserAppCatalogRoles epUserAppCatalogRoles = new EPUserAppCatalogRoles();
+                               
+               epUserAppCatalogRoles.setRequestedRoleId((long)1);
+               epUserAppCatalogRoles.setRolename("test");
+               epUserAppCatalogRoles.setRequestStatus("status");
+               epUserAppCatalogRoles.setAppId((long)1);
+               
+               return epUserAppCatalogRoles;
+       }
+       
+       @Test
+       public void epUserAppCatalogRolesTest(){
+               EPUserAppCatalogRoles epUserAppCatalogRoles = mockEPUserAppCatalogRoles();
+               
+               assertEquals(epUserAppCatalogRoles.getRequestedRoleId(), new Long(1));
+               assertEquals(epUserAppCatalogRoles.getRolename(), "test");
+               assertEquals(epUserAppCatalogRoles.getRequestStatus(), "status");
+               assertEquals(epUserAppCatalogRoles.getAppId(), new Long(1));
+               
+               assertEquals("EPUserAppCatalogRoles [requestedRoleId=1, rolename=test, requestStatus=status, appId=1]", epUserAppCatalogRoles.toString());
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequestDetailTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppRolesRequestDetailTest.java
new file mode 100644 (file)
index 0000000..31efff3
--- /dev/null
@@ -0,0 +1,88 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUserAppRolesRequest;
+import org.onap.portalapp.portal.domain.EPUserAppRolesRequestDetail;
+
+public class EPUserAppRolesRequestDetailTest {
+
+       public EPUserAppRolesRequestDetail mockEPUserAppRolesRequestDetail(){
+               
+               EPUserAppRolesRequest epUserAppRolesRequest = new EPUserAppRolesRequest();
+               epUserAppRolesRequest.setUserId((long)1);
+               epUserAppRolesRequest.setAppId((long)1);
+               epUserAppRolesRequest.setCreated(new Date());
+               epUserAppRolesRequest.setUpdatedDate(new Date());
+               epUserAppRolesRequest.setRequestStatus("test");
+                       
+               EPUserAppRolesRequestDetail epUserAppRolesRequestDetail = new EPUserAppRolesRequestDetail();
+               epUserAppRolesRequestDetail.setReqRoleId((long)1);
+               epUserAppRolesRequestDetail.setReqType("test");
+               epUserAppRolesRequestDetail.setEpRequestIdData(epUserAppRolesRequest);
+               
+               return epUserAppRolesRequestDetail;
+       }
+       
+       @Test
+       public void epUserAppRolesRequestDetailTest(){
+               
+               EPUserAppRolesRequest epUserAppRolesRequest = new EPUserAppRolesRequest();
+               epUserAppRolesRequest.setUserId((long)1);
+               epUserAppRolesRequest.setAppId((long)1);
+               epUserAppRolesRequest.setCreated(new Date());
+               epUserAppRolesRequest.setUpdatedDate(new Date());
+               epUserAppRolesRequest.setRequestStatus("test");
+               
+               EPUserAppRolesRequestDetail epUserAppRolesRequestDetail = mockEPUserAppRolesRequestDetail();
+               
+               EPUserAppRolesRequestDetail epUserAppRolesRequestDetail1 = new EPUserAppRolesRequestDetail();
+               epUserAppRolesRequestDetail1.setReqRoleId((long)1);
+               epUserAppRolesRequestDetail1.setReqType("test");
+               epUserAppRolesRequestDetail1.setEpRequestIdData(epUserAppRolesRequest);
+               
+               assertEquals(epUserAppRolesRequestDetail.getReqRoleId(), new Long(1));
+               assertEquals(epUserAppRolesRequestDetail.getReqType(), "test");
+       }               
+               
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppRolesTest.java
new file mode 100644 (file)
index 0000000..98b2d7b
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUserAppRoles;
+
+public class EPUserAppRolesTest {
+
+       public EPUserAppRoles mockEPUserAppRoles(){
+               EPUserAppRoles epUserAppRoles = new EPUserAppRoles();
+               
+               epUserAppRoles.setRoleId((long)1);
+               epUserAppRoles.setAppId((long)1); 
+               
+               return epUserAppRoles;
+       }
+       
+       @Test
+       public void epUserAppRolesTest(){
+               EPUserAppRoles epUserAppRoles = mockEPUserAppRoles();
+               
+               assertEquals(epUserAppRoles.getRoleId(), new Long(1));
+               assertEquals(epUserAppRoles.getAppId(), new Long(1));
+               assertEquals("EpUserAppRoles [roleId=1, appId=1]", epUserAppRoles.toString());
+       }
+}
+
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
new file mode 100644 (file)
index 0000000..72c5002
--- /dev/null
@@ -0,0 +1,122 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUserApp;
+
+public class EPUserAppTest {
+
+       public EPUserApp mockEPUserApp(){
+               
+               EPApp epApp = new EPApp();
+               epApp.setName("test");
+               epApp.setImageUrl("test");
+               epApp.setDescription("test");
+               epApp.setNotes("test");
+               epApp.setUrl("test");
+               epApp.setAlternateUrl("test");
+               epApp.setAppRestEndpoint("test");
+               epApp.setMlAppName("test");
+               epApp.setMlAppAdminId("test");
+               epApp.setMotsId((long)1);
+               epApp.setUsername("test");
+               epApp.setAppPassword("test");
+                       
+               
+               //Role
+               EPRole epRole = new EPRole();
+               epRole.setName("test");
+               epRole.setActive(false);
+               epRole.setPriority(1);
+               epRole.setAppId((long)1);
+               epRole.setAppRoleId((long)1);
+               
+               EPUserApp user = new EPUserApp();
+               user.setUserId((long)1);
+               user.setApp(epApp);
+               user.setRole(epRole);
+               user.setPriority((short)32767);
+               
+               
+               return user;
+       }
+       
+       @Test
+       public void userTest(){
+               EPUserApp user = mockEPUserApp();
+               
+               EPApp epApp = new EPApp();
+               epApp.setName("test");
+               epApp.setImageUrl("test");
+               epApp.setDescription("test");
+               epApp.setNotes("test");
+               epApp.setUrl("test");
+               epApp.setAlternateUrl("test");
+               epApp.setAppRestEndpoint("test");
+               epApp.setMlAppName("test");
+               epApp.setMlAppAdminId("test");
+               epApp.setMotsId((long)1);
+               epApp.setUsername("test");
+               epApp.setAppPassword("test");
+               user.setApp(epApp);
+               
+               //Role
+               EPRole epRole = new EPRole();
+               epRole.setName("test");
+               epRole.setActive(false);
+               epRole.setPriority(1);
+               epRole.setAppId((long)1);
+               epRole.setAppRoleId((long)1);
+               
+               
+        assertEquals(user.getUserId(),Long.valueOf(1));
+               assertEquals(user.getApp(), epApp); 
+               assertEquals(user.getPriority().getClass(), Short.class);
+       
+               assertEquals(user.toString(), "[u: 1; a: null, r: null; appRoleId: 1]");
+               
+               assertEquals(user.hashCode(), user.hashCode());
+               
+               
+               }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppsManualSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppsManualSortPreferenceTest.java
new file mode 100644 (file)
index 0000000..2923eb2
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUserAppsManualSortPreference;
+
+public class EPUserAppsManualSortPreferenceTest {
+
+       public EPUserAppsManualSortPreference mockEPUserAppsManualSortPreference(){
+               
+               EPUserAppsManualSortPreference epUserAppsManualSortPreference = new EPUserAppsManualSortPreference();
+               epUserAppsManualSortPreference.setUserId(1);
+               epUserAppsManualSortPreference.setAppId((long)1);
+               epUserAppsManualSortPreference.setAppManualSortOrder(1);
+               
+               return epUserAppsManualSortPreference;
+       }
+       
+       @Test
+       public void epUserAppsManualSortPreferenceTest(){
+       
+               EPUserAppsManualSortPreference epUserAppsManualSortPreference = mockEPUserAppsManualSortPreference();
+               
+               assertEquals(epUserAppsManualSortPreference.getUserId(), 1);
+               assertEquals(epUserAppsManualSortPreference.getAppId(), new Long(1));
+               assertEquals(epUserAppsManualSortPreference.getAppManualSortOrder(), 1);
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppsSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserAppsSortPreferenceTest.java
new file mode 100644 (file)
index 0000000..e2b49f0
--- /dev/null
@@ -0,0 +1,80 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUserAppsSortPreference;
+
+public class EPUserAppsSortPreferenceTest {
+
+       public EPUserAppsSortPreference mockEPUserAppsSortPreferenceTest(){
+
+               EPUserAppsSortPreference epUserAppsSortPreference = new EPUserAppsSortPreference();
+               epUserAppsSortPreference.setUserId(1);
+               epUserAppsSortPreference.setSortPref("test");
+               epUserAppsSortPreference.setId((long)1);
+               epUserAppsSortPreference.setCreated(new Date());
+               epUserAppsSortPreference.setModified(new Date());
+               epUserAppsSortPreference.setModifiedId((long)1);
+               epUserAppsSortPreference.setRowNum((long)1);
+               epUserAppsSortPreference.setAuditTrail(null);
+               
+               return epUserAppsSortPreference;
+       }
+       
+       @Test
+       public void epUserAppsSortPreferenceTest() {
+               EPUserAppsSortPreference epUserAppsSortPreference = mockEPUserAppsSortPreferenceTest();
+               
+               assertEquals(epUserAppsSortPreference.getUserId(), 1);
+               assertEquals(epUserAppsSortPreference.getSortPref(), "test");
+               assertEquals(epUserAppsSortPreference.getId(), new Long(1));
+//             assertEquals(epUserAppsSortPreference.getCreated(), new Date());
+//             assertEquals(epUserAppsSortPreference.getModified(), new Date());
+               assertEquals(epUserAppsSortPreference.getModifiedId(), new Long(1));
+               assertEquals(epUserAppsSortPreference.getRowNum(), new Long(1));
+               assertEquals(epUserAppsSortPreference.getAuditTrail(), null);
+               
+               
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserNotificationTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserNotificationTest.java
new file mode 100644 (file)
index 0000000..9aa9a37
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUserNotification;
+
+public class EPUserNotificationTest {
+
+       public EPUserNotification mockEPUserNotification(){
+               
+               EPUserNotification epUserNotification = new EPUserNotification();
+                               
+               epUserNotification.setUserId((long)1);
+               epUserNotification.setNotificationId((long)1);
+               epUserNotification.setViewed("test");
+               epUserNotification.setUpdateTime(new Date());           
+               
+               return epUserNotification;
+       }
+       
+       @Test
+       public void epUserNotificationTest(){
+               EPUserNotification epUserNotification = mockEPUserNotification();
+               
+               assertEquals(epUserNotification.getUserId(), new Long(1));
+               assertEquals(epUserNotification.getNotificationId(), new Long(1));
+               assertEquals(epUserNotification.getViewed(), "test");
+       //      assertEquals(epUserNotification.getUpdateTime(), new Date());
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPUserTest.java
new file mode 100644 (file)
index 0000000..cf1703d
--- /dev/null
@@ -0,0 +1,151 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPUser;
+
+public class EPUserTest {
+
+       public EPUser mockEPUser(){
+               
+               EPUser epUser = new EPUser();
+               
+               epUser.setId((long)1);
+               epUser.setManagerId((long) 1234);
+               epUser.setFirstName("test");
+               epUser.setLastName("test");
+               epUser.setMiddleInitial("test");
+               epUser.setPhone("test");
+               epUser.setFax("test");
+               epUser.setCellular("test");
+               epUser.setEmail("test");
+               epUser.setAddressId((long) 123); 
+               epUser.setAlertMethodCd("test");
+               epUser.setHrid("test");
+               epUser.setOrgUserId("test");
+               epUser.setOrgCode("test");
+               epUser.setAddress1("test");
+               epUser.setAddress2("test");
+               epUser.setCity("test");
+               epUser.setState("test");
+               epUser.setZipCode("test");
+               epUser.setCountry("test");
+               epUser.setOrgManagerUserId("test");
+               epUser.setLocationClli("test");
+               epUser.setBusinessCountryCode("test");
+               epUser.setBusinessCountryName("test");
+               epUser.setBusinessUnit("test");
+               epUser.setBusinessUnitName("test");
+               epUser.setDepartment("test");
+               epUser.setDepartmentName("test");
+               epUser.setCompanyCode("test");
+               epUser.setCompany("test");
+               epUser.setZipCodeSuffix("test");
+               epUser.setJobTitle("test");
+               epUser.setCommandChain("test");
+               epUser.setSiloStatus("test");
+               epUser.setCostCenter("test");
+               epUser.setFinancialLocCode("test");
+               epUser.setLoginId("test");
+               epUser.setLoginPwd("test");
+               epUser.setLastLoginDate(new Date());
+               epUser.setActive(false);
+               epUser.setInternal(false);
+               epUser.setSelectedProfileId((long) 12345);
+               epUser.setTimeZoneId((long) 12345);
+               epUser.setOnline(false);
+               epUser.setChatId("test");
+               return epUser;
+                                   
+       }
+       
+       @Test
+       public void userTest(){
+               EPUser user = mockEPUser();
+               
+               assertEquals(user.getId(), new Long(1));
+               assertEquals(user.getManagerId(), new Long(1234));
+               assertEquals(user.getFirstName(), "test");
+               assertEquals(user.getLastName(), "test");
+               assertEquals(user.getMiddleInitial(), "test");
+               assertEquals(user.getPhone(), "test");
+               assertEquals(user.getFax(), "test");
+               assertEquals(user.getCellular(), "test");               
+               assertEquals(user.getEmail(), "test");
+               assertEquals(user.getAddressId(), new Long(123) );
+               assertEquals(user.getAlertMethodCd(), "test");
+               assertEquals(user.getHrid(), "test");
+               assertEquals(user.getOrgUserId(), "test");
+               assertEquals(user.getOrgCode(), "test");
+               assertEquals(user.getAddress1(), "test");
+               assertEquals(user.getAddress2(), "test");
+               assertEquals(user.getState(), "test");
+               assertEquals(user.getZipCode(), "test");
+               assertEquals(user.getCountry(), "test");
+               assertEquals(user.getOrgManagerUserId(), "test");
+               assertEquals(user.getLocationClli(), "test");
+               assertEquals(user.getBusinessCountryCode(), "test");
+               assertEquals(user.getBusinessCountryName(), "test");
+               assertEquals(user.getBusinessUnit(), "test");
+               assertEquals(user.getBusinessUnitName(), "test");
+               assertEquals(user.getDepartment(), "test");
+               assertEquals(user.getDepartmentName(), "test");
+               assertEquals(user.getCompanyCode(), "test");
+               assertEquals(user.getCompany(), "test");
+               assertEquals(user.getZipCodeSuffix(), "test");
+               assertEquals(user.getJobTitle(), "test");
+               assertEquals(user.getCommandChain(), "test");
+               assertEquals(user.getSiloStatus(), "test");
+               assertEquals(user.getFinancialLocCode(), "test");
+               assertEquals(user.getLoginId(), "test");
+               assertEquals(user.getLoginPwd(), "test");
+               assertEquals(user.getActive(), false);
+               assertEquals(user.getInternal(), false);
+               assertEquals(user.getSelectedProfileId(), new Long (12345));
+               assertEquals(user.getTimeZoneId(), new Long (12345));
+               assertEquals(user.getChatId(), "test");
+               
+               //assertEquals(user.toString(), "EPUser [orgId=null, managerId=1234, firstName=test, middleInitial=test, lastName=test, phone=test, fax=test, cellular=test, email=test, addressId=123, alertMethodCd=test, hrid=test, orgUserId=test, orgCode=test, address1=test, address2=test, city=test, state=test, zipCode=test, country=test, orgManagerUserId=test, locationClli=test, businessCountryCode=test, businessCountryName=test, businessUnit=test, businessUnitName=test, department=test, departmentName=test, companyCode=test, company=test, zipCodeSuffix=test, jobTitle=test, commandChain=test, siloStatus=test, costCenter=test, financialLocCode=test, loginId=test, loginPwd=test, lastLoginDate=Tue Sep 05 11:04:49 EDT 2017, active=false, internal=false, selectedProfileId=12345, timeZoneId=12345, online=false, chatId=test, isGuest=false, userApps=[], pseudoRoles=[]]");
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPWidgetsManualSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EPWidgetsManualSortPreferenceTest.java
new file mode 100644 (file)
index 0000000..b4b4780
--- /dev/null
@@ -0,0 +1,73 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPWidgetsManualSortPreference;
+
+public class EPWidgetsManualSortPreferenceTest {
+
+       public EPWidgetsManualSortPreference mockEPWidgetsManualSortPreference(){
+               EPWidgetsManualSortPreference epWidgetsManualSortPreference = new EPWidgetsManualSortPreference();
+                               
+               epWidgetsManualSortPreference.setUserId(1);
+               epWidgetsManualSortPreference.setWidgetId((long)1);
+               epWidgetsManualSortPreference.setWidgetRow(1);
+               epWidgetsManualSortPreference.setWidgetCol(1);
+               epWidgetsManualSortPreference.setWidgetWidth(1);
+               epWidgetsManualSortPreference.setWidgetHeight(1);
+                               
+               return epWidgetsManualSortPreference;
+       }
+       
+       @Test
+       public void epWidgetsManualSortPreferenceTest(){
+               EPWidgetsManualSortPreference epWidgetsManualSortPreference = mockEPWidgetsManualSortPreference();
+               
+               assertEquals(epWidgetsManualSortPreference.getWidgetId(), new Long(1));
+               assertEquals(epWidgetsManualSortPreference.getUserId(), 1);
+               assertEquals(epWidgetsManualSortPreference.getWidgetRow(), 1);
+               assertEquals(epWidgetsManualSortPreference.getWidgetCol(), 1);
+               assertEquals(epWidgetsManualSortPreference.getWidgetHeight(), 1);
+               assertEquals(epWidgetsManualSortPreference.getWidgetWidth(), 1);
+               
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EcompAppRoleIdTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EcompAppRoleIdTest.java
new file mode 100644 (file)
index 0000000..96ebcb4
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EcompAppRoleId;
+
+public class EcompAppRoleIdTest {
+       
+       public EcompAppRoleId mockEcompAppRoleId(){
+               
+               EcompAppRoleId ecompAppRoleId = new EcompAppRoleId();
+               
+               ecompAppRoleId.setAppId((long)1);
+               ecompAppRoleId.setAppName("test");
+               ecompAppRoleId.setRoleId(1);
+               ecompAppRoleId.setRoleName("test");
+                               
+               return ecompAppRoleId;
+       }
+       
+       @Test
+       public void ecompAppRoleIdTest(){
+               
+       EcompAppRoleId ecompAppRoleId = mockEcompAppRoleId();
+       
+       assertEquals(ecompAppRoleId.getAppId(), new Long(1));
+       assertEquals(ecompAppRoleId.getAppName(), "test");
+       assertEquals(ecompAppRoleId.getRoleId().toString(), "1");
+       assertEquals(ecompAppRoleId.getRoleName(), "test");
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EcompAppRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/EcompAppRoleTest.java
new file mode 100644 (file)
index 0000000..614588d
--- /dev/null
@@ -0,0 +1,68 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EcompAppRole;
+
+public class EcompAppRoleTest {
+
+       public EcompAppRole mockEcompAppRole(){
+               EcompAppRole ecompAppRole = new EcompAppRole();
+               
+               ecompAppRole.setAppId((long)1);
+               ecompAppRole.setAppName("test");
+               ecompAppRole.setRoleId(1);
+               ecompAppRole.setRoleName("test");
+               
+               return ecompAppRole;
+       }
+       
+       @Test
+       public void ecompAppRoleTest(){
+               EcompAppRole ecompAppRole = mockEcompAppRole();
+               
+               assertEquals(ecompAppRole.getAppId(), new Long(1));
+               assertEquals(ecompAppRole.getAppName(), "test");
+               assertEquals(ecompAppRole.getRoleId().toString(), "1");
+               assertEquals(ecompAppRole.getRoleName(), "test");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalRoleDetailsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalRoleDetailsTest.java
new file mode 100644 (file)
index 0000000..9c999ae
--- /dev/null
@@ -0,0 +1,96 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.EPAppRoleFunction;
+import org.onap.portalapp.portal.domain.ExternalRoleDetails;
+
+public class ExternalRoleDetailsTest {
+
+       public ExternalRoleDetails mockExternalRoleDetails(){
+               
+               List<EPAppRoleFunction> epAppRoleFunctionList = new ArrayList<EPAppRoleFunction>();
+               
+               EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
+               epAppRoleFunction.setRoleId((long)1);
+               epAppRoleFunction.setAppId((long)1);
+               epAppRoleFunction.setCode("test");
+               
+               epAppRoleFunctionList.add(epAppRoleFunction);
+               
+               ExternalRoleDetails externalRoleDetails = new ExternalRoleDetails();
+               
+               externalRoleDetails.setName("test");
+               externalRoleDetails.setActive(false);
+               externalRoleDetails.setPriority(1);
+               externalRoleDetails.setAppId((long)1);
+               externalRoleDetails.setAppRoleId((long)1);
+               externalRoleDetails.setPerms(epAppRoleFunctionList);
+               
+               return externalRoleDetails;
+       }
+       
+       @Test
+       public void externalRoleDetailsTest(){
+               
+               List<EPAppRoleFunction> epAppRoleFunctionList = new ArrayList<EPAppRoleFunction>();
+               
+               EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
+               epAppRoleFunction.setRoleId((long)1);
+               epAppRoleFunction.setAppId((long)1);
+               epAppRoleFunction.setCode("test");
+               
+               epAppRoleFunctionList.add(epAppRoleFunction);
+               
+               ExternalRoleDetails externalRoleDetails = mockExternalRoleDetails();
+               
+               assertEquals(externalRoleDetails.getAppId(), new Long(1));
+               assertEquals(externalRoleDetails.getAppRoleId(), new Long(1));
+               assertEquals(externalRoleDetails.getPriority().toString(), "1");
+               assertEquals(externalRoleDetails.getName(), "test");
+               assertEquals(externalRoleDetails.getPriority().toString(),  "1");
+               assertEquals(externalRoleDetails.getPerms().size(), epAppRoleFunctionList.size());
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemAccessTest.java
new file mode 100644 (file)
index 0000000..e818e76
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.ExternalSystemAccess;
+
+public class ExternalSystemAccessTest {
+       
+       public ExternalSystemAccess mockExternalSystemAccess(){
+               ExternalSystemAccess externalSystemAccess = new ExternalSystemAccess("test", false);
+       
+               externalSystemAccess.setKey("test");
+               externalSystemAccess.setAccessValue(false);
+               
+               return externalSystemAccess;
+       }
+
+       @Test
+       public void externalSystemAccessTest(){
+               ExternalSystemAccess externalSystemAccess = mockExternalSystemAccess();
+               
+               assertEquals(externalSystemAccess.getKey(), "test");
+               assertEquals(externalSystemAccess.getAccessValue(), false);
+       }
+}
+
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemRoleApprovalTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ExternalSystemRoleApprovalTest.java
new file mode 100644 (file)
index 0000000..ace2dd8
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
+
+public class ExternalSystemRoleApprovalTest {
+
+       public ExternalSystemRoleApproval mockExternalSystemRoleApproval(){
+               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
+               externalSystemRoleApproval.setRoleName("test");
+               
+               return externalSystemRoleApproval;              
+       }
+       
+       @Test
+       public void externalSystemRoleApprovalTest(){
+               ExternalSystemRoleApproval externalSystemRoleApproval = mockExternalSystemRoleApproval();
+               
+               assertEquals(externalSystemRoleApproval.getRoleName(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppIDTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/FunctionalMenuItemWithAppIDTest.java
new file mode 100644 (file)
index 0000000..488bbd9
--- /dev/null
@@ -0,0 +1,65 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.FunctionalMenuItemWithAppID;
+
+public class FunctionalMenuItemWithAppIDTest {
+
+       public FunctionalMenuItemWithAppID mockFunctionalMenuItemWithAppID(){
+               FunctionalMenuItemWithAppID functionalMenuItemWithAppID = new FunctionalMenuItemWithAppID();
+       
+               functionalMenuItemWithAppID.setRestrictedApp(false);
+               functionalMenuItemWithAppID.setUrl("test");
+               
+               
+               return functionalMenuItemWithAppID;
+       }
+       
+       @Test
+       public void functionalMenuItemWithAppIDTest(){
+               FunctionalMenuItemWithAppID functionalMenuItemWithAppID = mockFunctionalMenuItemWithAppID();
+
+               assertEquals(functionalMenuItemWithAppID.toString(), "FunctionalMenuItem [menuId=null, column=null, text=null, parentMenuId=null, url=test, active_yn=null, appid=null, roles=null, restrictedApp=false]");
+       
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/GetAccessResultIdTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/GetAccessResultIdTest.java
new file mode 100644 (file)
index 0000000..5a05949
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.GetAccessResultId;
+
+public class GetAccessResultIdTest {
+       
+       public GetAccessResultId mockGetAccessResultId(){
+               
+               GetAccessResultId getAccessResultIdObj = new GetAccessResultId();
+               getAccessResultIdObj.setEcompFunction("test");
+               getAccessResultIdObj.setAppName("test");
+               getAccessResultIdObj.setRoleName("test");
+               
+               return getAccessResultIdObj;
+       }
+
+       @Test
+       public void getAccessResultIdObjTest(){
+               GetAccessResultId getAccessResultIdObj = mockGetAccessResultId();
+               
+               assertEquals(getAccessResultIdObj.getEcompFunction(), "test");
+               assertEquals(getAccessResultIdObj.getAppName(), "test");
+               assertEquals(getAccessResultIdObj.getRoleName(), "test");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/MicroserviceDataTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/MicroserviceDataTest.java
new file mode 100644 (file)
index 0000000..8f85639
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import java.util.ArrayList;
+import java.util.List;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.MicroserviceData;
+import org.onap.portalapp.portal.domain.MicroserviceParameter;
+
+public class MicroserviceDataTest {
+
+       public MicroserviceData mockMicroserviceData(){
+               
+               MicroserviceData microserviceData= new MicroserviceData();
+               
+               List<MicroserviceParameter> parameterList = new ArrayList<MicroserviceParameter>();
+               
+               MicroserviceParameter microserviceParameter = new MicroserviceParameter();
+               microserviceParameter.setId((long)1);
+               microserviceParameter.setServiceId((long)1);
+               microserviceParameter.setPara_key("test");
+               microserviceParameter.setPara_value("test");
+               parameterList.add(microserviceParameter);
+               
+               microserviceData.setId((long)1);
+               microserviceData.setName("test");
+               microserviceData.setActive("test");
+               microserviceData.setDesc("test");
+               microserviceData.setAppId((long)1);
+               microserviceData.setUrl("test");
+               microserviceData.setSecurityType("test");
+               microserviceData.setUsername("test");
+               microserviceData.setPassword("test");
+               
+               
+               return microserviceData;
+       }
+       
+       @Test
+       public void microserviceDataTest(){
+               MicroserviceData microserviceData= mockMicroserviceData();
+               
+               assertEquals(microserviceData.getId(), new Long(1));
+               assertEquals(microserviceData.getName(), "test");
+               assertEquals(microserviceData.getActive(), "test");
+               assertEquals(microserviceData.getDesc(), "test");
+       //      assertEquals(microserviceData.getAppId(), new long(1));
+               assertEquals(microserviceData.getUrl(), "test");
+               assertEquals(microserviceData.getSecurityType(), "test");
+               assertEquals(microserviceData.getUsername(), "test");
+               assertEquals(microserviceData.getPassword(), "test");
+               
+               assertEquals(microserviceData.toString(), "MicroserviceData [id=1, name=test, desc=test, appId=1, "
+                               + "url=test, securityType=test, username=test, password=test, parameterList=null]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/MicroserviceParameterTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/MicroserviceParameterTest.java
new file mode 100644 (file)
index 0000000..a214738
--- /dev/null
@@ -0,0 +1,68 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.MicroserviceParameter;
+
+public class MicroserviceParameterTest {
+       
+       public MicroserviceParameter mockMicroserviceParameter(){
+               MicroserviceParameter microserviceParameter = new MicroserviceParameter();
+                               
+               microserviceParameter.setId((long)1);
+               microserviceParameter.setServiceId((long)1);
+               microserviceParameter.setPara_key("test");
+               microserviceParameter.setPara_value("test");
+               
+               return microserviceParameter;
+       }
+
+       @Test
+       public void microserviceParameterTest(){
+               MicroserviceParameter microserviceParameter = mockMicroserviceParameter();
+               assertEquals(microserviceParameter.getId(), new Long(1));
+               assertEquals(microserviceParameter.getServiceId(),(long)1);
+               assertEquals(microserviceParameter.getPara_key(), "test");
+               assertEquals(microserviceParameter.getPara_value(), "test");
+               
+               assertEquals(microserviceParameter.toString(), "MicroserviceParameter [id=1, serviceId=1, para_key=test, para_value=test]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/PersUserAppSelectionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/PersUserAppSelectionTest.java
new file mode 100644 (file)
index 0000000..dd397b4
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.PersUserAppSelection;
+
+public class PersUserAppSelectionTest {
+
+       public PersUserAppSelection mockPersUserAppSelection(){
+               
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setUserId((long)1);
+               persUserAppSelection.setAppId((long)1);
+               persUserAppSelection.setStatusCode("test");
+               
+               return persUserAppSelection;
+       }
+       
+       @Test
+       public void persUserAppSelectionTest(){
+               
+               PersUserAppSelection persUserAppSelection1 = new PersUserAppSelection((long)1, (long)1, (long)1,"test");
+               
+               PersUserAppSelection persUserAppSelection = mockPersUserAppSelection();
+               
+               assertEquals(persUserAppSelection.getUserId(), new Long(1));
+               assertEquals(persUserAppSelection.getAppId(), new Long(1));
+               assertEquals(persUserAppSelection.getStatusCode(), "test");
+               assertEquals(persUserAppSelection1.hashCode(), new PersUserAppSelection((long)1, (long)1, (long)1,"test").hashCode());
+               assertEquals(persUserAppSelection1, new PersUserAppSelection((long)1, (long)1, (long)1,"test"));
+               assertTrue(persUserAppSelection1.equals(new PersUserAppSelection((long)1, (long)1, (long)1,"test")));
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/PersUserWidgetSelectionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/PersUserWidgetSelectionTest.java
new file mode 100644 (file)
index 0000000..0b78715
--- /dev/null
@@ -0,0 +1,73 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.PersUserWidgetSelection;
+
+public class PersUserWidgetSelectionTest {
+
+       public PersUserWidgetSelection mockPersUserWidgetSelection(){
+               
+               PersUserWidgetSelection persUserWidgetSelection = new PersUserWidgetSelection();
+               
+               persUserWidgetSelection.setUserId((long)1);
+               persUserWidgetSelection.setWidgetId((long)1);
+               persUserWidgetSelection.setStatusCode("test");
+               
+               return persUserWidgetSelection;
+       }
+       
+       @Test
+       public void persUserWidgetSelectionTest(){
+               PersUserWidgetSelection persUserWidgetSelection = mockPersUserWidgetSelection();
+               
+               PersUserWidgetSelection persUserWidgetSelection1 = new PersUserWidgetSelection((long)1, (long)1, (long)1, "test");
+               
+               assertEquals(persUserWidgetSelection.getUserId(), new Long(1));
+               assertEquals(persUserWidgetSelection.getWidgetId(), new Long(1));
+               assertEquals(persUserWidgetSelection.getStatusCode(), "test");
+               assertEquals(persUserWidgetSelection1,  new PersUserWidgetSelection((long)1, (long)1, (long)1, "test"));
+               assertTrue(persUserWidgetSelection1.equals(new PersUserWidgetSelection((long)1, (long)1, (long)1,"test")));
+               assertEquals(persUserWidgetSelection.hashCode(), persUserWidgetSelection1.hashCode());
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ResultTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/ResultTest.java
new file mode 100644 (file)
index 0000000..3cdfeee
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.model.Result;
+
+public class ResultTest {
+       
+       public Result mockResult(){
+               
+               Result result= new Result("test");
+               
+               result.setResult("test");
+               return result;
+       }
+
+       @Test
+       public void resultTest(){
+               
+               Result result = mockResult();           
+               result.setResult("test");
+               
+               assertEquals(result.getResult(), "test");
+               
+       }
+       
+                               
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/SharedContextTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/SharedContextTest.java
new file mode 100644 (file)
index 0000000..4c7b464
--- /dev/null
@@ -0,0 +1,73 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.SharedContext;
+
+public class SharedContextTest {
+
+       public SharedContext mockSharedContext(){
+               
+               SharedContext sharedContext = new SharedContext();
+               sharedContext.setId((long)1);
+               sharedContext.setCreate_time(new Date());
+               sharedContext.setContext_id("test");
+               sharedContext.setCkey("test");
+               sharedContext.setCvalue("test");
+               
+               return sharedContext;
+       }
+       
+       @Test
+       public void sharedContextTest(){
+               SharedContext sharedContext = mockSharedContext();
+               
+               assertEquals(sharedContext.getId(), new Long(1));
+       //      assertEquals(sharedContext.getCreate_time(), new Date());
+               assertEquals(sharedContext.getContext_id(), "test");
+               assertEquals(sharedContext.getCkey(), "test");
+               assertEquals(sharedContext.getCvalue(), "test");
+               
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/UserIdRoleIdTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/UserIdRoleIdTest.java
new file mode 100644 (file)
index 0000000..d391288
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.UserIdRoleId;
+
+public class UserIdRoleIdTest {
+
+       public UserIdRoleId mockUserIdRoleId(){
+               UserIdRoleId userIdRoleId = new UserIdRoleId();
+               userIdRoleId.setUser_Id("test");
+               userIdRoleId.setRoleId("test");
+               userIdRoleId.setOrgUserId("test");
+               userIdRoleId.setAppId("test");
+               
+               return userIdRoleId;
+       }
+       
+       @Test
+       public void userIdRoleIdTest(){
+               UserIdRoleId userIdRoleId = mockUserIdRoleId();
+               
+               assertEquals(userIdRoleId.getUser_Id(), "test");
+               assertEquals(userIdRoleId.getRoleId(), "test");
+               assertEquals(userIdRoleId.getOrgUserId(), "test");
+               assertEquals(userIdRoleId.getAppId(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetCatalogParameterTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetCatalogParameterTest.java
new file mode 100644 (file)
index 0000000..31d484d
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.WidgetCatalogParameter;
+
+public class WidgetCatalogParameterTest {
+
+       public WidgetCatalogParameter mockWidgetCatalogParameter(){
+               WidgetCatalogParameter widgetCatalogParameter = new WidgetCatalogParameter();
+               
+               widgetCatalogParameter.setId((long)1);
+               widgetCatalogParameter.setWidgetId((long)1);
+               widgetCatalogParameter.setUserId((long)1);
+               widgetCatalogParameter.setParamId((long)1);
+               widgetCatalogParameter.setUser_value("test");
+               
+               return widgetCatalogParameter;
+       }
+       
+       @Test
+       public void widgetCatalogParameterTest(){
+               WidgetCatalogParameter widgetCatalogParameter = mockWidgetCatalogParameter();
+               
+               assertEquals(widgetCatalogParameter.getId(), new Long(1));
+               assertEquals(widgetCatalogParameter.getWidgetId(), new Long(1));
+               assertEquals(widgetCatalogParameter.getUserId(), new Long(1));
+               assertEquals(widgetCatalogParameter.getParamId(), new Long(1));
+               assertEquals(widgetCatalogParameter.getUser_value(), "test");
+               assertEquals(widgetCatalogParameter.toString(), "WidgetCatalogParameter [id=1, widgetId=1, userId=1, paramId=1, user_value=test]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetCatalogTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetCatalogTest.java
new file mode 100644 (file)
index 0000000..ce90e49
--- /dev/null
@@ -0,0 +1,121 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.App;
+import org.onap.portalapp.portal.domain.RoleApp;
+import org.onap.portalapp.portal.domain.WidgetCatalog;
+
+public class WidgetCatalogTest {
+
+       public WidgetCatalog mockWidgetCatalog() {
+
+               WidgetCatalog widgetCatalog = new WidgetCatalog();
+
+               Set<RoleApp> roleAppSet = new HashSet<RoleApp>();
+               // App
+               App app = new App();
+               app.setAppId((long) 1);
+               app.setAppName("test");
+
+               // RoleApp
+               RoleApp roleApp = new RoleApp();
+               roleApp.setRoleId((long) 1);
+               roleApp.setRoleName("test");
+               roleApp.setApp(app);
+               roleApp.setWidgets(null);
+
+               roleAppSet.add(roleApp);
+
+               widgetCatalog.setId((long) 1);
+               widgetCatalog.setName("test");
+               widgetCatalog.setDesc("test");
+               widgetCatalog.setFileLocation("test");
+               widgetCatalog.setAllowAllUser("test");
+               widgetCatalog.setServiceId((long) 1);
+               widgetCatalog.setSortOrder("test");
+               widgetCatalog.setStatusCode("test");
+
+               widgetCatalog.setWidgetRoles(roleAppSet);
+
+               return widgetCatalog;
+
+       }
+       
+       @Test
+       public void widgetCatalogTest() {
+
+               // App
+               App app = new App();
+               app.setAppId((long) 1);
+               app.setAppName("test");
+
+               Set<RoleApp> roleAppSet = new HashSet<RoleApp>();
+               // RoleApp
+               RoleApp roleApp = new RoleApp();
+               roleApp.setRoleId((long) 1);
+               roleApp.setRoleName("test");
+               roleApp.setApp(app);
+               roleApp.setWidgets(null);
+
+               roleAppSet.add(roleApp);
+
+               WidgetCatalog widgetCatalog = mockWidgetCatalog();
+
+       
+               assertEquals(widgetCatalog.getId(), (long)1);
+               assertEquals(widgetCatalog.getName(), "test");
+               assertEquals(widgetCatalog.getDesc(), "test");
+               assertEquals(widgetCatalog.getFileLocation(), "test");
+               assertEquals(widgetCatalog.getAllowAllUser(), "test");
+               assertEquals(widgetCatalog.getServiceId(), new Long (1));
+               assertEquals(widgetCatalog.getSortOrder(), "test");
+               assertEquals(widgetCatalog.getStatusCode(), "test");
+               assertEquals(widgetCatalog.getWidgetRoles().size(),1);
+               
+               assertEquals("WidgetCatalog [id=1, name=test, desc=test, fileLocation=test, allowAllUser=test]", widgetCatalog.toString());
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetParameterResultTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetParameterResultTest.java
new file mode 100644 (file)
index 0000000..354255b
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.WidgetParameterResult;
+
+public class WidgetParameterResultTest {
+
+       public WidgetParameterResult mockWidgetParameterResult(){
+                               
+               WidgetParameterResult widgetParameterResult = new WidgetParameterResult();
+               widgetParameterResult.setParam_id((long)1);
+               widgetParameterResult.setParam_key("test");
+               widgetParameterResult.setUser_value("test");
+               widgetParameterResult.setDefault_value("test");
+               
+               return widgetParameterResult;
+       }
+       
+       @Test
+       public void widgetParameterResultTest(){
+               
+               WidgetParameterResult widgetParameterResult = mockWidgetParameterResult();
+               
+               assertEquals(widgetParameterResult.getParam_key(), "test");
+               assertEquals(widgetParameterResult.getParam_id(), new Long(1));
+               assertEquals(widgetParameterResult.getUser_value(), "test");
+               assertEquals(widgetParameterResult.getDefault_value(), "test");
+               
+               assertEquals("WidgetParameterResult [param_id=1, param_key=test, user_value=test, default_value=test]", widgetParameterResult.toString());
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/domain/WidgetTest.java
new file mode 100644 (file)
index 0000000..3821c9c
--- /dev/null
@@ -0,0 +1,71 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.domain;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.domain.Widget;
+
+public class WidgetTest {
+
+       public Widget mockWidget(){
+               
+               Widget widget = new Widget();
+               widget.setName("test");
+               widget.setWidth(100);
+               widget.setHeight(100);
+               widget.setUrl("test");
+               widget.setAppId((long)1);
+                               
+               return widget;
+       }
+        
+       @Test
+       public void widgetTest(){
+               Widget widget = mockWidget();
+               
+               assertEquals(widget.getName(), "test");
+               assertTrue(widget.getWidth() == 100);
+               assertTrue(widget.getHeight() == 100);
+               assertEquals(widget.getUrl(), "test");
+               assertEquals(widget.getAppId(), new Long(1)); 
+               
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NoHealthyServiceExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/exceptions/NoHealthyServiceExceptionTest.java
new file mode 100644 (file)
index 0000000..62c75cf
--- /dev/null
@@ -0,0 +1,60 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.exceptions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.exceptions.NoHealthyServiceException;
+
+public class NoHealthyServiceExceptionTest {
+
+       public NoHealthyServiceException mockNoHealthyServiceException(){
+               NoHealthyServiceException noHealthyServiceException = new NoHealthyServiceException("test");
+               
+               return noHealthyServiceException;
+       }
+       
+       @Test
+       public void noHealthyServiceExceptionTest(){
+               NoHealthyServiceException noHealthyServiceException = mockNoHealthyServiceException();
+               
+       //      assertEquals(noHealthyServiceException, new NoHealthyServiceException("test"));
+               assertEquals(noHealthyServiceException.toString(), "NoHealthyServiceException [] test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/framework/ApplicationCommonContextTestSuite.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/framework/ApplicationCommonContextTestSuite.java
new file mode 100644 (file)
index 0000000..764ceba
--- /dev/null
@@ -0,0 +1,191 @@
+package org.onap.portalapp.portal.framework;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+//package org.openecomp.portalapp.portal.framework;
+//
+//import java.io.IOException;
+//
+//import org.junit.Before;
+//import org.junit.runner.RunWith;
+//import org.openecomp.portalsdk.core.conf.AppConfig;
+////import org.openecomp.portalapp.conf.ExternalAppConfig;
+////import org.openecomp.portalapp.conf.HibernateMappingLocations;
+//import org.openecomp.portalsdk.core.conf.HibernateConfiguration;
+//import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
+//import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
+//import org.openecomp.portalsdk.core.util.CacheManager;
+//import org.openecomp.portalsdk.core.util.SystemProperties;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.context.annotation.Bean;
+//import org.springframework.context.annotation.ComponentScan;
+//import org.springframework.context.annotation.Configuration;
+//import org.springframework.context.annotation.FilterType;
+//import org.springframework.context.annotation.Profile;
+//import org.springframework.core.io.ClassPathResource;
+//import org.springframework.core.io.Resource;
+//import org.springframework.test.context.ActiveProfiles;
+//import org.springframework.test.context.ContextConfiguration;
+//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+//import org.springframework.test.context.web.AnnotationConfigWebContextLoader;
+//import org.springframework.test.context.web.WebAppConfiguration;
+//import org.springframework.test.web.servlet.MockMvc;
+//import org.springframework.test.web.servlet.setup.MockMvcBuilders;
+//import org.springframework.web.context.WebApplicationContext;
+//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+//
+///**
+// * 
+// * In order to write a unit test, 1. inherit this class 2. place the "war"
+// * folder on your test class's classpath 3. run the test with the following VM
+// * argument; This is important because when starting the application from
+// * Container, the System Properties file (SystemProperties.java) can have the
+// * direct path but, when running from the Mock Junit container, the path should
+// * be prefixed with "classpath" to enable the mock container to search for the
+// * file in the classpath -Dcontainer.classpath="classpath:"
+// */
+//
+//@SuppressWarnings("deprecation")
+//@RunWith(SpringJUnit4ClassRunner.class)
+//@WebAppConfiguration
+//@ContextConfiguration(loader = AnnotationConfigWebContextLoader.class, classes = { MockAppConfig.class })
+//@ActiveProfiles(value = "test")
+//public class ApplicationCommonContextTestSuite {
+//
+//     @Autowired
+//     public WebApplicationContext wac;
+//
+//     private MockMvc mockMvc;
+//
+//     @Before
+//     public void setup() {
+//             if (mockMvc == null) {
+//                     this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
+//
+//             }
+//     }
+//
+//     public Object getBean(String name) {
+//             return this.wac.getBean(name);
+//     }
+//
+//     public MockMvc getMockMvc() {
+//             return mockMvc;
+//     }
+//
+//     public void setMockMvc(MockMvc mockMvc) {
+//             this.mockMvc = mockMvc;
+//     }
+//
+//     public WebApplicationContext getWebApplicationContext() {
+//             return wac;
+//     }
+//
+//}
+//
+//@Configuration
+//@ComponentScan(basePackages = "org.openecomp", excludeFilters = {
+//             // the following source configurations should not be scanned; instead of
+//             // using Exclusion filter, we can use the @Profile annotation to exclude
+//             // them
+//             @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.LogoutController*"),
+//             @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalsdk.core.controller.SDKLoginController*"),
+//             @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.portalapp.conf.ExternalAppConfig*"),
+//             @ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openecomp.*.*InitUebHandler*") })
+//@Profile("test")
+//class MockAppConfig extends AppConfig {
+//
+//     @Bean
+//     HibernateMappingLocatable locatable() {
+//             return new MockHibernateMappingLocations();
+//     }
+//
+//     @Bean
+//     HibernateConfiguration hibConfiguration() {
+//             return new HibernateConfiguration();
+//     }
+//
+//     @Bean
+//     public SystemProperties systemProperties() {
+//             return new MockSystemProperties();
+//     }
+//
+//     @Bean
+//     public AbstractCacheManager cacheManager() {
+//             return new CacheManager() {
+//
+//                     public void configure() throws IOException {
+//
+//                     }
+//             };
+//     }
+//
+//     public String[] tileDefinitions() {
+//             return new String[] { "classpath:/WEB-INF/fusion/defs/definitions.xml",
+//                             "classpath:/WEB-INF/defs/definitions.xml" };
+//     }
+//
+//     public void addInterceptors(InterceptorRegistry registry) {
+//             // registry.addInterceptor(new
+//             // SessionTimeoutInterceptor()).excludePathPatterns(getExcludeUrlPathsForSessionTimeout());
+//             // registry.addInterceptor(resourceInterceptor());
+//     }
+//
+//     public static class MockSystemProperties extends SystemProperties {
+//
+//             public MockSystemProperties() {
+//             }
+//
+//     }
+//
+//}
+//
+//@Profile("test")
+//class MockHibernateMappingLocations implements HibernateMappingLocatable {
+//
+//     public Resource[] getMappingLocations() {
+//             return new Resource[] { new ClassPathResource("WEB-INF/fusion/orm/Fusion.hbm.xml"),
+//                             new ClassPathResource("WEB-INF/fusion/orm/EP.hbm.xml"),
+//                             new ClassPathResource("WEB-INF/fusion/orm/Workflow.hbm.xml") };
+//
+//     }
+//
+//     public String[] getPackagesToScan() {
+//             return new String[] { "org.openecomp", "src" };
+//     }
+//
+//}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java
new file mode 100644 (file)
index 0000000..84356f7
--- /dev/null
@@ -0,0 +1,94 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.framework;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class MockitoTestSuite {
+
+
+       public MockHttpServletRequestWrapper mockedRequest = new MockHttpServletRequestWrapper(
+                       Mockito.mock(HttpServletRequest.class));
+       public HttpServletResponse mockedResponse = Mockito.mock(HttpServletResponse.class);
+
+       public MockHttpServletRequestWrapper getMockedRequest() {
+               return mockedRequest;
+       }
+
+       public HttpServletResponse getMockedResponse() {
+               return mockedResponse;
+       }
+
+       public class MockHttpServletRequestWrapper extends HttpServletRequestWrapper {
+
+               HttpSession session = Mockito.mock(HttpSession.class);
+
+               public MockHttpServletRequestWrapper(HttpServletRequest request) {
+                       super(request);
+
+               }
+
+               @Override
+               public HttpSession getSession() {
+
+                       return session;
+               }
+
+               @Override
+               public HttpSession getSession(boolean create) {
+
+                       return session;
+               }
+
+       }
+    
+       @Test
+       public void test()
+       {
+               assert(true);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java
new file mode 100644 (file)
index 0000000..929c8e3
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.listener;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.listener.HealthMonitor;
+
+public class HealthMonitorTest {
+
+       @Test
+       public void initialFlagsTest() {
+               assertEquals(false, HealthMonitor.isBackEndUp());
+               assertEquals(false, HealthMonitor.isFrontEndUp());
+               assertEquals(false, HealthMonitor.isDatabaseUp());
+               assertEquals(false, HealthMonitor.isUebUp());
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppCatalogItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppCatalogItemTest.java
new file mode 100644 (file)
index 0000000..819262d
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.model;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.ecomp.model.AppCatalogItem;
+
+public class AppCatalogItemTest {
+
+       public AppCatalogItem mockAppCatalogItem(){
+               AppCatalogItem appCatalogItem = new AppCatalogItem();
+               
+               appCatalogItem.setAlternateUrl("test");
+               appCatalogItem.setMlAppName("test");
+               
+               return appCatalogItem;
+       }
+       
+       @Test
+       public void appCatalogItemTest(){
+               AppCatalogItem appCatalogItem = mockAppCatalogItem();
+               
+               AppCatalogItem appCatalogItem1 = new AppCatalogItem();
+               appCatalogItem1.setAlternateUrl("test");
+               appCatalogItem1.setMlAppName("test");
+               
+               assertEquals(appCatalogItem.getAlternateUrl(), appCatalogItem1.getAlternateUrl());
+               assertEquals(appCatalogItem.getMlAppName(), appCatalogItem1.getMlAppName());
+
+               assertEquals(appCatalogItem.toString(), "AppCatalogItem [id=null, name=null, access=null, select=null, pending=null]");
+               assertEquals(appCatalogItem.hashCode(), appCatalogItem1.hashCode());
+               assertTrue(appCatalogItem.equals(appCatalogItem1));
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppCategoryFunctionsItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppCategoryFunctionsItemTest.java
new file mode 100644 (file)
index 0000000..346b427
--- /dev/null
@@ -0,0 +1,79 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
+
+public class AppCategoryFunctionsItemTest {
+
+       public AppCategoryFunctionsItem mockAppCategoryFunctionsItem(){
+               AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem();
+               
+               appCategoryFunctionsItem.setRowId("test");
+               appCategoryFunctionsItem.setAppId("test");
+               appCategoryFunctionsItem.setApplication("test");
+               appCategoryFunctionsItem.setFunctions("test");
+               
+               return appCategoryFunctionsItem;
+       }
+       
+       @Test
+       public void appCategoryFunctionsItemTest(){
+               AppCategoryFunctionsItem appCategoryFunctionsItem = mockAppCategoryFunctionsItem();
+               
+               AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem();
+               
+               appCategoryFunctionsItem1.setRowId("test");
+               appCategoryFunctionsItem1.setAppId("test");
+               appCategoryFunctionsItem1.setApplication("test");
+               appCategoryFunctionsItem1.setFunctions("test");
+               
+               assertEquals(appCategoryFunctionsItem.getRowId(), appCategoryFunctionsItem1.getRowId());
+               assertEquals(appCategoryFunctionsItem.getAppId(), appCategoryFunctionsItem1.getAppId());
+               assertEquals(appCategoryFunctionsItem.getApplication(), appCategoryFunctionsItem1.getApplication());
+               assertEquals(appCategoryFunctionsItem.getFunctions(), appCategoryFunctionsItem1.getFunctions());
+               assertEquals(appCategoryFunctionsItem.toString(), "AppCategoryFunctionsItem [rowId=test, appId=test, application=test, category=null, functions=test]");
+               assertEquals(appCategoryFunctionsItem.hashCode(), appCategoryFunctionsItem1.hashCode());
+               assertTrue(appCategoryFunctionsItem.equals(appCategoryFunctionsItem1));
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppContactUsItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/AppContactUsItemTest.java
new file mode 100644 (file)
index 0000000..898bd98
--- /dev/null
@@ -0,0 +1,86 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.model;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
+
+public class AppContactUsItemTest {
+       
+       public AppContactUsItem mockAppContactUsItem(){
+               AppContactUsItem appContactUsItem = new AppContactUsItem();
+                               
+               appContactUsItem.setAppId((long)1);
+               appContactUsItem.setAppName("test");
+               appContactUsItem.setDescription("test");
+               appContactUsItem.setContactName("test");
+               appContactUsItem.setContactEmail("test");
+               appContactUsItem.setUrl("test");
+               appContactUsItem.setActiveYN("test");
+               
+               return appContactUsItem;
+       }
+
+       @Test
+       public void appContactUsItemTest(){
+               AppContactUsItem appContactUsItem = mockAppContactUsItem();
+               
+               AppContactUsItem appContactUsItem1 = new AppContactUsItem();
+               appContactUsItem1.setAppId((long)1);
+               appContactUsItem1.setAppName("test");
+               appContactUsItem1.setDescription("test");
+               appContactUsItem1.setContactName("test");
+               appContactUsItem1.setContactEmail("test");
+               appContactUsItem1.setUrl("test");
+               appContactUsItem1.setActiveYN("test");
+               
+               assertEquals(appContactUsItem.getAppId(), appContactUsItem1.getAppId());
+               assertEquals(appContactUsItem.getAppName(), appContactUsItem1.getAppName());
+               assertEquals(appContactUsItem.getDescription(), appContactUsItem1.getDescription());
+               assertEquals(appContactUsItem.getContactName(), appContactUsItem1.getContactName());
+               assertEquals(appContactUsItem.getContactEmail(), appContactUsItem1.getContactEmail());
+               assertEquals(appContactUsItem.getUrl(), appContactUsItem1.getUrl());
+               assertEquals(appContactUsItem.getActiveYN(), appContactUsItem1.getActiveYN());
+               assertEquals(appContactUsItem.toString(), "AppContactUsItem [appId=1, appName=test, description=test, contactName=test, contactEmail=test, url=test, activeYN=test]");
+               assertEquals(appContactUsItem.hashCode(), appContactUsItem1.hashCode());
+               assertTrue(appContactUsItem.equals(appContactUsItem1));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/SearchResultItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/model/SearchResultItemTest.java
new file mode 100644 (file)
index 0000000..fac3ecf
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.model;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+
+public class SearchResultItemTest {
+
+       public SearchResultItem mockSearchResultItem(){
+               SearchResultItem searchResultItem = new SearchResultItem();
+                               
+               searchResultItem.setRowId("test");
+               searchResultItem.setCategory("test");
+               searchResultItem.setName("test");
+               searchResultItem.setTarget("test");
+               searchResultItem.setUuid("test");
+               
+               return searchResultItem;
+       }
+       
+       @Test
+       public void searchResultItemTest(){
+               SearchResultItem searchResultItem = mockSearchResultItem();
+               
+               SearchResultItem searchResultItem1 = new SearchResultItem();
+               searchResultItem1.setRowId("test");
+               searchResultItem1.setCategory("test");
+               searchResultItem1.setName("test");
+               searchResultItem1.setTarget("test");
+               searchResultItem1.setUuid("test");
+               
+               assertEquals(searchResultItem.getRowId(), searchResultItem.getRowId());
+               assertEquals(searchResultItem.getCategory(), searchResultItem.getCategory());
+               assertEquals(searchResultItem.getName(), searchResultItem.getName());
+               assertEquals(searchResultItem.getTarget(), searchResultItem.getTarget());
+               assertEquals(searchResultItem.getUuid(), searchResultItem.getUuid());
+               assertEquals(searchResultItem.toString(), searchResultItem.toString());
+
+       }
+}
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
new file mode 100644 (file)
index 0000000..aaadbe0
--- /dev/null
@@ -0,0 +1,184 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+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.ecomp.model.AppCategoryFunctionsItem;
+import org.onap.portalapp.portal.ecomp.model.AppContactUsItem;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AppContactUsService;
+import org.onap.portalapp.portal.service.AppContactUsServiceImpl;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.DataAccessServiceImpl;
+
+public class AppContactUsServiceImplTest {
+
+       
+     @Mock
+        DataAccessService dataAccessService = new DataAccessServiceImpl();
+    
+     @Mock
+     AppContactUsService AppContactUsService = new AppContactUsServiceImpl();
+     
+     @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       
+     @InjectMocks
+     AppContactUsServiceImpl appContactUsServiceImpl = new AppContactUsServiceImpl();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       
+       public EPApp getApp() {
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(true);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+               return app;
+       }
+       @Test
+       public void getAppContactUsTest() throws Exception
+       {
+               
+               List<AppContactUsItem> contactUsItemList  = new ArrayList<>();
+               AppContactUsItem appContactUsItem= new AppContactUsItem();
+               appContactUsItem.setAppName("testNew");
+               contactUsItemList.add(appContactUsItem);
+               AppContactUsItem appContactUsItem1= new AppContactUsItem();
+               appContactUsItem1.setAppName("test");
+               contactUsItemList.add(appContactUsItem1);
+               Mockito.when(dataAccessService.executeNamedQuery("getAppContactUsItems", null, null)).thenReturn(contactUsItemList);
+               List<AppContactUsItem> expectedcontactUsItemList = appContactUsServiceImpl.getAppContactUs();
+               assertEquals(expectedcontactUsItemList, contactUsItemList);             
+       }
+       
+       @Test
+       public void getAppsAndContactsTest() throws Exception
+       {
+               List<AppContactUsItem> contactUsItemList  = new ArrayList<>();
+               AppContactUsItem appContactUsItem= new AppContactUsItem();
+               appContactUsItem.setAppName("testNew");
+               contactUsItemList.add(appContactUsItem);
+               AppContactUsItem appContactUsItem1= new AppContactUsItem();
+               appContactUsItem1.setAppName("test");
+               contactUsItemList.add(appContactUsItem1);
+               Mockito.when(dataAccessService.executeNamedQuery("getAppsAndContacts", null, null)).thenReturn(contactUsItemList);
+               List<AppContactUsItem> expectedcontactUsItemList = appContactUsServiceImpl.getAppsAndContacts();
+               assertEquals(expectedcontactUsItemList, contactUsItemList);             
+       }
+       
+       @Test
+       public void getAppCategoryFunctionsTest() throws Exception
+       {
+               List<AppCategoryFunctionsItem> list  = new ArrayList<>();
+               Mockito.when(dataAccessService.executeNamedQuery("getAppCategoryFunctions", null, null)).thenReturn(list);
+               List<AppCategoryFunctionsItem> expectedlist = appContactUsServiceImpl.getAppCategoryFunctions();
+               assertEquals(list, expectedlist); 
+       }
+       
+       @Test(expected = java.lang.Exception.class)
+       public void saveAppContactUsTest() throws Exception
+       {
+               HashMap<String, Object> map = new HashMap<String, Object>();
+               List<AppContactUsItem> contactUsModelList = new ArrayList<>();
+               AppContactUsItem appContactUsItem= new AppContactUsItem();
+               appContactUsItem.setAppId((long) 1);
+               contactUsModelList.add(appContactUsItem);
+               AppContactUs appContact = new AppContactUs();
+               Mockito.when(dataAccessService.getDomainObject(AppContactUs.class, 1, map)).thenReturn(appContact);
+               EPApp app = getApp();
+               Mockito.when(dataAccessService.getDomainObject(EPApp.class, 1, new HashMap<String, Object>())).thenReturn(app);
+               AppContactUs contactUs  = new AppContactUs();
+               contactUs.setApp(app);
+               contactUs.setDescription(appContactUsItem.getDescription());
+               contactUs.setContactName(appContactUsItem.getContactName());
+               contactUs.setContactEmail(appContactUsItem.getContactEmail());
+               contactUs.setActiveYN(appContactUsItem.getActiveYN());
+               contactUs.setUrl(appContactUsItem.getUrl());
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(contactUs,map);
+               appContactUsServiceImpl.saveAppContactUs(contactUsModelList);
+       }
+       
+       @Test(expected = java.lang.NullPointerException.class)
+       public void deleteContactUsTest() throws Exception
+       {
+               HashMap<String, Object> map = new HashMap<String, Object>();
+               AppContactUs contactUs = new AppContactUs();
+               Mockito.when((AppContactUs) dataAccessService.getDomainObject(AppContactUs.class, 1, map)).thenReturn(contactUs);
+               appContactUsServiceImpl.deleteContactUs((long) 1);
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/DashboardSearchServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/DashboardSearchServiceImplTest.java
new file mode 100644 (file)
index 0000000..13f04ae
--- /dev/null
@@ -0,0 +1,151 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.core.MockEPUser;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.DashboardSearchServiceImpl;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+public class DashboardSearchServiceImplTest {
+       
+       @Mock
+       DataAccessService dataAccessService;
+       
+       @InjectMocks
+       DashboardSearchServiceImpl dashboardSearchServiceImpl = new DashboardSearchServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       NullPointerException nullPointerException = new NullPointerException();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+       MockEPUser mockUser = new MockEPUser();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+    
+       @Test
+       public void searchResultsTest()
+       {
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", "guestT");
+               params.put("searchQuery", "test");
+               
+               List<SearchResultItem> list = new ArrayList<>();
+               SearchResultItem searchResultItem= new SearchResultItem();
+               searchResultItem.setCategory("test");
+               list.add(searchResultItem);
+               Mockito.when(dataAccessService.executeNamedQuery("searchPortal", params, null)).thenReturn(list);
+               Map<String, List<SearchResultItem>> result  =   dashboardSearchServiceImpl.searchResults("guestT", "test");
+               assertTrue(result.keySet().contains("test"));
+       }
+       
+       @Test
+       public void getRelatedUsersTest()
+       {
+               List<String> activeUsers = new ArrayList<>();
+               Map<String, String> params = new HashMap<>();
+               params.put("userId", "guestT");
+               Mockito.when(dataAccessService.executeNamedQuery("relatedUsers", params, null)).thenReturn(activeUsers);
+               List<String> expectedActiveUsers  =     dashboardSearchServiceImpl.getRelatedUsers("guestT");
+               assertEquals(expectedActiveUsers,activeUsers);
+       }
+       @Test
+       public void getWidgetDataTest()
+       {
+               CommonWidgetMeta CommonWidgetMeta = null;
+               Map<String, String> params = new HashMap<>();
+               params.put("cat", "test");
+               @SuppressWarnings("unchecked")
+               List<CommonWidget> widgetItems = new ArrayList<>();
+               CommonWidget commonWidget = new CommonWidget();
+               widgetItems.add(commonWidget);
+               Mockito.when(dataAccessService.executeNamedQuery("getCommonWidgetItem", params, null)).thenReturn(widgetItems);
+               CommonWidgetMeta expectedCommonWidgetMeta =dashboardSearchServiceImpl.getWidgetData("test");
+               assertEquals(expectedCommonWidgetMeta.getCategory(), "test");
+       }
+       
+       @Test
+       public void saveWidgetDataBulkTest()
+       {
+               CommonWidgetMeta CommonWidgetMeta = new CommonWidgetMeta();
+               List<CommonWidget> widgetList = new ArrayList<>();
+               CommonWidget commonWidget = new CommonWidget();
+               widgetList.add(commonWidget);
+               CommonWidgetMeta.setItems(widgetList);
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(commonWidget, null);
+        assertEquals(dashboardSearchServiceImpl.saveWidgetDataBulk(CommonWidgetMeta), "success");
+       }
+       
+       @Test
+       public void saveWidgetDataTest()
+       {
+               CommonWidget commonWidget = new CommonWidget();
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(commonWidget, null);
+                assertEquals(dashboardSearchServiceImpl.saveWidgetData(commonWidget), "success");
+       }
+       
+       @Test
+       public void deleteWidgetDataTest()
+       {
+               CommonWidget commonWidget = new CommonWidget();
+               Mockito.doNothing().when(dataAccessService).deleteDomainObject(commonWidget, null);
+                assertEquals(dashboardSearchServiceImpl.deleteWidgetData(commonWidget), "success");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceCentralizedImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceCentralizedImplTest.java
new file mode 100644 (file)
index 0000000..345ae3b
--- /dev/null
@@ -0,0 +1,130 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.codec.DecoderException;
+import org.hibernate.SessionFactory;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+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.CentralV2RoleFunction;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.exceptions.RoleFunctionException;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(SystemProperties.class)
+@Ignore
+public class EPRoleFunctionServiceCentralizedImplTest {
+
+       
+       @Mock
+       DataAccessService dataAccessService;
+       
+       @Mock
+       SessionFactory sessionFactory;
+
+       @InjectMocks
+       EPRoleFunctionServiceCentralizedImpl ePRoleFunctionServiceCentralizedImpl = new EPRoleFunctionServiceCentralizedImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       NullPointerException nullPointerException = new NullPointerException();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+       MockEPUser mockUser = new MockEPUser();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       
+       @Test(expected = NullPointerException.class)
+       public void getRoleFunctions()
+       {
+               List<CentralV2RoleFunction> getRoleFuncList = new ArrayList<>();
+               CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction();
+               getRoleFuncList.add(centralV2RoleFunction);
+               List<RoleFunction> getRoleFuncListOfPortal = new ArrayList<>();
+               RoleFunction roleFunction = new RoleFunction();
+               getRoleFuncListOfPortal.add(roleFunction);
+               final Map<String, Long> params = new HashMap<>();
+               params.put("appId", (long) 1);
+               Mockito.when(dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null)).thenReturn(getRoleFuncList);
+               List<RoleFunction> expectedGetRoleFuncListOfPortal = ePRoleFunctionServiceCentralizedImpl.getRoleFunctions();
+               assertEquals(expectedGetRoleFuncListOfPortal.size(),getRoleFuncListOfPortal.size());
+       }
+       
+       @Test
+       public void getRoleFunctionsNewTest() throws RoleFunctionException
+       {
+               HttpSession session = mockedRequest.getSession();
+               EPUser user = mockUser.mockEPUser();
+               user.setId((long) 1);
+               String userId = user.getId().toString();
+               final Map<String, String> params = new HashMap<>();
+               params.put("userId", userId);           
+               @SuppressWarnings("unused")
+               List getRoleFuncListOfPortal = new ArrayList<>();
+               Mockito.when(dataAccessService.executeNamedQuery("getRoleFunctionsOfUser", params, null)).thenReturn(getRoleFuncListOfPortal);
+               Set<String> getRoleFuncListOfPortalSet = ePRoleFunctionServiceCentralizedImpl.getRoleFunctions(mockedRequest, user);
+               assertTrue(getRoleFuncListOfPortalSet.size() == 0);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleFunctionServiceImplTest.java
new file mode 100644 (file)
index 0000000..b7bffea
--- /dev/null
@@ -0,0 +1,135 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+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.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.EPRoleFunctionServiceImpl;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.service.DataAccessService;
+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;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ SystemProperties.class, EPUserUtils.class })
+public class EPRoleFunctionServiceImplTest {
+
+       @Mock
+       DataAccessService dataAccessService;
+
+       @InjectMocks
+       EPRoleFunctionServiceImpl ePRoleFunctionServiceImpl = new EPRoleFunctionServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       NullPointerException nullPointerException = new NullPointerException();
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+       MockEPUser mockUser = new MockEPUser();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+
+       @Test
+       public void getRoleFunctionsTest() {
+               List<RoleFunction> functions = new ArrayList<>();
+               Mockito.when(dataAccessService.getList(RoleFunction.class, null)).thenReturn(functions);
+               List<RoleFunction> expectedFunctions = ePRoleFunctionServiceImpl.getRoleFunctions();
+               assertEquals(expectedFunctions, functions);
+       }
+
+       @Test
+       public void getRoleFunctionsRequestTest() {
+               EPUser user = mockUser.mockEPUser();
+               HashSet roleFunctions = new HashSet<>();
+               PowerMockito.mockStatic(SystemProperties.class);
+               HttpSession session = mockedRequest.getSession();
+               Mockito.when(session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)))
+                               .thenReturn(roleFunctions);
+               HashSet expectedRoleFunctions = (HashSet) ePRoleFunctionServiceImpl.getRoleFunctions(mockedRequest, user);
+               assertEquals(expectedRoleFunctions, roleFunctions);
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getRoleFunctionsRequestIfNullTest() {
+               EPUser user = mockUser.mockEPUser();
+               HashSet roleFunctions = null;
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPUserUtils.class);
+               HttpSession session = mockedRequest.getSession();
+               Mockito.when(session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)))
+                               .thenReturn(roleFunctions);
+               HashMap roles = new HashMap<>();
+               EPRole role = new EPRole();
+               SortedSet<RoleFunction> roleFunctionSet = new TreeSet<RoleFunction>();
+               RoleFunction rolefun = new RoleFunction();
+               roleFunctionSet.add(rolefun);
+               role.setRoleFunctions(roleFunctionSet);
+               roles.put((long) 1, role);
+               Mockito.when(EPUserUtils.getRoles(mockedRequest)).thenReturn(roles);
+               HashSet expectedRoleFunctions = (HashSet) ePRoleFunctionServiceImpl.getRoleFunctions(mockedRequest, user);
+               assertTrue(expectedRoleFunctions.size() == 1);
+
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPRoleServiceImplTest.java
new file mode 100644 (file)
index 0000000..4c97b6d
--- /dev/null
@@ -0,0 +1,245 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+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.EPRole;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.EPRoleServiceImpl;
+import org.onap.portalsdk.core.domain.RoleFunction;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+public class EPRoleServiceImplTest {
+
+       @Mock
+       DataAccessService dataAccessService;
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @InjectMocks
+       EPRoleServiceImpl ePRoleServiceImpl = new EPRoleServiceImpl();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void getRoleFunctionsTest() {
+               List<RoleFunction> roleFunctionList = new ArrayList<>();
+               Mockito.when(dataAccessService.getList(RoleFunction.class, null)).thenReturn(roleFunctionList);
+               List<RoleFunction> expectedRoleFunctionList = ePRoleServiceImpl.getRoleFunctions();
+               assertEquals(roleFunctionList, expectedRoleFunctionList);
+       }
+
+       @Test
+       public void getAvailableChildRolesIfRoleIdIsNullTest() {
+               List<EPRole> roleList = new ArrayList<>();
+               EPRole role = new EPRole();
+               EPRole role1 = new EPRole();
+               role.addChildRole(role1);
+               roleList.add(role);
+               Mockito.when(dataAccessService.getList(EPRole.class, null)).thenReturn(roleList);
+               List<EPRole> expectedRoleList = ePRoleServiceImpl.getAvailableChildRoles(null);
+               assertEquals(roleList, expectedRoleList);
+       }
+
+       // @Test
+       // public void getAvailableChildRolesIfRoleIdNotNullTest()
+       // {
+       // List<EPRole> roleList = new ArrayList<>();
+       // EPRole role = new EPRole();
+       // EPRole role1= new EPRole();
+       // role.addChildRole(role1);
+       // roleList.add(role);
+       // Mockito.when(dataAccessService.getDomainObject(EPRole.class, 1,
+       // null)).thenReturn(role);
+       // Mockito.when(dataAccessService.getList(EPRole.class,
+       // null)).thenReturn(roleList);
+       //
+       // List<EPRole> expectedRoleList =
+       // ePRoleServiceImpl.getAvailableChildRoles((long) 1);
+       // System.out.println(expectedRoleList);
+       // assertEquals(roleList,expectedRoleList);
+       // }
+       //
+       @Test
+       public void getRoleFunctionTest() {
+               RoleFunction roleFunction = new RoleFunction();
+               Mockito.when(dataAccessService.getDomainObject(RoleFunction.class, "test", null)).thenReturn(roleFunction);
+               RoleFunction expectedRoleFunction = ePRoleServiceImpl.getRoleFunction("test");
+               assertEquals(expectedRoleFunction, roleFunction);
+       }
+
+       @Test
+       public void saveRoleFunctionTest() {
+               EPRole role = new EPRole();
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(role, null);
+               ePRoleServiceImpl.saveRole(role);
+       }
+
+       @Test
+       public void deleteRoleFunctionTest() {
+               RoleFunction roleFunction = new RoleFunction();
+               Mockito.doNothing().when(dataAccessService).deleteDomainObject(roleFunction, null);
+               ePRoleServiceImpl.deleteRoleFunction(roleFunction);
+       }
+
+       @Test
+       public void getRoleTest() {
+               EPRole role = null;
+               Mockito.when(dataAccessService.getDomainObject(EPRole.class, 1, null)).thenReturn(role);
+               EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1);
+               assertEquals(expectedRole, role);
+       }
+
+       @Test
+       public void getRoleIfappIdNullTest() {
+               assertNull(ePRoleServiceImpl.getRole(null, null));
+
+       }
+
+       @Test
+       public void getRoleIfappIdNotNullTest() {
+               List<EPRole> roles = new ArrayList<>();
+               EPRole role = new EPRole();
+               roles.add(role);
+               String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
+               Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
+               EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1, (long) 1);
+               assertEquals(expectedRole, role);
+
+       }
+
+       @Test
+       public void getRoleIfListSizeIsMoreThan1Test() {
+               List<EPRole> roles = new ArrayList<>();
+               EPRole role = new EPRole();
+               EPRole role1 = new EPRole();
+               roles.add(role);
+               roles.add(role1);
+               String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
+               Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
+               EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1, (long) 1);
+               assertEquals(expectedRole, role);
+
+       }
+
+       @Test
+       public void getRoleIfListSizeIsEmptyTest() {
+               List<EPRole> roles = new ArrayList<>();
+               String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
+               Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
+               assertNull(ePRoleServiceImpl.getRole((long) 1, (long) 1));
+
+       }
+
+       @Test
+       public void saveRoleTest() {
+               EPRole role = new EPRole();
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(role, null);
+               ePRoleServiceImpl.saveRole(role);
+       }
+
+       @Test
+       public void deleteRoleTest() {
+               EPRole role = new EPRole();
+               Mockito.doNothing().when(dataAccessService).deleteDomainObject(role, null);
+               ePRoleServiceImpl.deleteRole(role);
+       }
+
+       @Test
+       public void getAvailableRolesTest() {
+               List<EPRole> roleList = new ArrayList<>();
+               Mockito.when(dataAccessService.getList(EPRole.class, null)).thenReturn(roleList);
+               List<EPRole> expectedRoleList = ePRoleServiceImpl.getAvailableRoles();
+               assertEquals(expectedRoleList, roleList);
+       }
+
+       @Test
+       public void getAppRolesTest() {
+               final Map<String, String> portalParams = null;
+               List<EPRole> roleList = new ArrayList<>();
+               Mockito.when(dataAccessService.executeNamedQuery("getPortalAppRoles", portalParams, null)).thenReturn(roleList);
+               assertNull(ePRoleServiceImpl.getAppRole("test", (long) 1));
+
+       }
+
+       @SuppressWarnings("unchecked")
+       @Test
+       public void getAppRolesIfNotPortalTest() {
+               final Map<String, String> params = null;
+               List<EPRole> roleList = new ArrayList<>();
+               EPRole role = new EPRole();
+               EPRole role1 = new EPRole();
+               roleList.add(role);
+               roleList.add(role1);
+               Mockito.when((List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles", params, null))
+                               .thenReturn(roleList);
+               List<EPRole> expectedRoleList = (List<EPRole>) ePRoleServiceImpl.getAppRole("test", (long) 10);
+               System.out.println(expectedRoleList);
+
+       }
+
+       @Test
+       public void saveRoleFunction() {
+               RoleFunction domainRoleFunction = new RoleFunction();
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(domainRoleFunction, null);
+               ePRoleServiceImpl.saveRoleFunction(domainRoleFunction);
+       }
+}
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
new file mode 100644 (file)
index 0000000..66cfdd3
--- /dev/null
@@ -0,0 +1,456 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+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.CentralV2RoleFunction;
+import org.onap.portalapp.portal.domain.EPApp;
+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.exceptions.InactiveApplicationException;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.transport.EcompUserRoles;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.domain.Role;
+import org.onap.portalsdk.core.restful.domain.EcompUser;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.DataAccessServiceImpl;
+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.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.client.HttpClientErrorException;
+import org.springframework.web.client.RestTemplate;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ EcompPortalUtils.class, SystemProperties.class, EPCommonSystemProperties.class })
+public class ExternalAccessRolesServiceImplTest {
+       @Mock
+       DataAccessService dataAccessService1 = new DataAccessServiceImpl();
+
+       @Mock
+       RestTemplate template = new RestTemplate();
+
+       @InjectMocks
+       ExternalAccessRolesServiceImpl externalAccessRolesServiceImpl = new ExternalAccessRolesServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+       String uebKey = "test-ueb-key";
+
+       public EPApp mockApp() {
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 10);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(false);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+               return app;
+       }
+
+       @Test
+       public void getAppRolesIfAppIsPortalTest() throws Exception {
+               List<EPRole> applicationRoles = new ArrayList<>();
+               Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
+               List<EPRole> expectedApplicationRoles = externalAccessRolesServiceImpl.getAppRoles((long) 1);
+               assertEquals(expectedApplicationRoles, applicationRoles);
+       }
+
+       @Test
+       public void getAppRolesTest() throws Exception {
+               List<EPRole> applicationRoles = new ArrayList<>();
+               Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
+               List<EPRole> expectedApplicationRoles = externalAccessRolesServiceImpl.getAppRoles((long) 10);
+               assertEquals(expectedApplicationRoles, applicationRoles);
+       }
+
+       // @SuppressWarnings("null")
+       // @Test(expected = java.lang.Exception.class)
+       // public void getAppRolesExceptionTest() throws Exception{
+       // List<EPRole> applicationRoles = new ArrayList<>();
+       // DataAccessService dataAccessService = null ;
+       // Mockito.when(dataAccessService.getList(EPRole.class, "where app_id = 10",
+       // null, null)).thenThrow(nullPointerException);
+       // List<EPRole> expectedApplicationRoles =
+       // externalAccessRolesServiceImpl.getAppRoles((long) 10);
+       // assertEquals(expectedApplicationRoles,applicationRoles);
+       // }
+
+       @Test
+       public void getAppExceptionTest() throws Exception {
+               List<EPApp> app = new ArrayList<>();
+               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
+                               .thenReturn(app);
+               List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
+               assertEquals(app, expectedapp);
+       }
+
+       @Test(expected = InactiveApplicationException.class)
+       public void getAppErrorTest() throws Exception {
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = mockApp();
+               appList.add(app);
+               final Map<String, String> appUebkeyParams = new HashMap<>();
+               appUebkeyParams.put("appKey", "test-ueb-key");
+               Mockito.when(dataAccessService1.executeNamedQuery("getMyAppDetailsByUebKey", appUebkeyParams, null))
+               .thenReturn(appList);
+               externalAccessRolesServiceImpl.getApp(uebKey);
+       }
+
+       @Test
+       public void getAppTest() throws Exception {
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = mockApp();
+               app.setId((long) 1);
+               appList.add(app);
+               final Map<String, String> appUebkeyParams = new HashMap<>();
+               appUebkeyParams.put("appKey", "test-ueb-key");
+               Mockito.when(dataAccessService1.executeNamedQuery("getMyAppDetailsByUebKey", appUebkeyParams, null))
+                               .thenReturn(appList);
+               List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
+               assertEquals(appList, expectedapp);
+       }
+
+       @Test
+       public void addRoleTest() throws Exception {
+               HttpHeaders headers = new HttpHeaders();
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               String uebKey = "test-ueb-key";
+               Role role = new Role();
+               role.setId((long) 25);
+               EPApp app = mockApp();
+               app.setEnabled(true);
+               app.setId((long) 10);
+               app.setNameSpace("test_namesapce");
+               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(app);
+               List<EPRole> roleList = new ArrayList<>();
+               EPRole ePRole = new EPRole();
+               role.setName("Test Role");
+               roleList.add(ePRole);
+               final Map<String, String> appUebkeyParams = new HashMap<>();
+               appUebkeyParams.put("appKey", "test-ueb-key");
+               Mockito.when(dataAccessService1.executeNamedQuery("getMyAppDetailsByUebKey", appUebkeyParams, null))
+                               .thenReturn(appList);
+               final Map<String, Long> getPartnerAppRoleParams = new HashMap<>();
+               getPartnerAppRoleParams.put("appRoleId", role.getId());
+               getPartnerAppRoleParams.put("appId", app.getId());                              
+               Mockito.when(dataAccessService1.executeNamedQuery("getPartnerAppRoleByRoleId", getPartnerAppRoleParams, null)).thenReturn(roleList);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL))
+                               .thenReturn("Testurl");
+               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.CREATED);
+               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.POST),
+                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
+
+               assertTrue(externalAccessRolesServiceImpl.addRole(role, uebKey));
+       }
+
+
+       @Test
+       public void addRoleMethodNotAllowedTest() throws Exception {
+               HttpHeaders headers = new HttpHeaders();
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(EPCommonSystemProperties.class);
+               Role role = new Role();
+               role.setId((long) 25);
+               EPApp app = mockApp();
+               app.setEnabled(true);
+               app.setId((long) 10);
+               app.setNameSpace("test_namesapce");
+               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
+               List<EPApp> appList = new ArrayList<>();
+               appList.add(app);
+               List<EPRole> roleList = new ArrayList<>();
+               EPRole ePRole = new EPRole();
+               role.setName("Test Role");
+               roleList.add(ePRole);
+               final Map<String, String> appUebkeyParams = new HashMap<>();
+               appUebkeyParams.put("appKey", "test-ueb-key");
+               Mockito.when(dataAccessService1.executeNamedQuery("getMyAppDetailsByUebKey", appUebkeyParams, null))
+                               .thenReturn(appList);
+               final Map<String, Long> getPartnerAppRoleParams = new HashMap<>();
+               getPartnerAppRoleParams.put("appRoleId", role.getId());
+               getPartnerAppRoleParams.put("appId", app.getId());                              
+               Mockito.when(dataAccessService1.executeNamedQuery("getPartnerAppRoleByRoleId", getPartnerAppRoleParams, null)).thenReturn(roleList);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL))
+                               .thenReturn("Testurl");
+               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.METHOD_NOT_ALLOWED);
+               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.POST),
+                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
+               assertFalse(externalAccessRolesServiceImpl.addRole(role, uebKey));
+       }
+
+       public EPApp getApp() {
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(true);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+               return app;
+       }
+
+       @Test
+       public void deleteCentralRoleFunctionTest() throws Exception {
+               final Map<String, String> params = new HashMap<>();
+               EPApp app = mockApp();
+               params.put("functionCode", "menu_fun_code");
+               params.put("appId", String.valueOf(10));
+               List<CentralV2RoleFunction> centralRoleFunctionList = new ArrayList<>();
+               CentralV2RoleFunction domainCentralRoleFunction = new CentralV2RoleFunction();
+               domainCentralRoleFunction.setCode("menu_fun_code");
+               centralRoleFunctionList.add(domainCentralRoleFunction);
+               Mockito.when(dataAccessService1.executeNamedQuery("getRoleFunction", params, null))
+                               .thenReturn(centralRoleFunctionList);
+               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.DELETE),
+                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
+               HttpHeaders headers = new HttpHeaders();
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
+
+               Mockito.doNothing().when(dataAccessService1).deleteDomainObjects(EPAppRoleFunction.class,
+                               "app_id = " + app.getId() + " and function_cd = '" + "menu_fun_code" + "'", null);
+               assertTrue(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
+       }
+       @Test
+       public void deleteCentralRoleFunctionFailTest() throws Exception {
+               final Map<String, String> params = new HashMap<>();
+               EPApp app = mockApp();
+               params.put("functionCode", "menu_fun_code");
+               params.put("appId", String.valueOf(10));
+               List<CentralV2RoleFunction> centralRoleFunctionList = new ArrayList<>();
+               CentralV2RoleFunction domainCentralRoleFunction = new CentralV2RoleFunction();
+               domainCentralRoleFunction.setCode("menu_fun_code");
+               centralRoleFunctionList.add(domainCentralRoleFunction);
+               HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.NOT_FOUND);
+               Mockito.when(dataAccessService1.executeNamedQuery("getRoleFunction", params, null))
+                               .thenReturn(centralRoleFunctionList);
+               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.NOT_FOUND);
+               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.DELETE),
+                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenThrow(httpClientErrorException);
+               HttpHeaders headers = new HttpHeaders();
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
+
+               Mockito.doNothing().when(dataAccessService1).deleteDomainObjects(EPAppRoleFunction.class,
+                               "app_id = " + app.getId() + " and function_cd = '" + "menu_fun_code" + "'", null);
+
+               boolean returnedValue = externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app);
+               assertTrue(returnedValue);
+       }
+
+       @Test
+       public void deleteCentralRoleFunctionExceptionTest() {
+               final Map<String, String> params = new HashMap<>();
+               EPApp app = mockApp();
+               params.put("functionCd", "menu_fun_code");
+               params.put("appId", String.valueOf(10));
+               List<CentralV2RoleFunction> centralRoleFunctionList = new ArrayList<>();
+               CentralV2RoleFunction domainCentralRoleFunction = new CentralV2RoleFunction();
+               domainCentralRoleFunction.setCode("menu_fun_code");
+               centralRoleFunctionList.add(domainCentralRoleFunction);
+               Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params, null))
+                               .thenThrow(nullPointerException);
+               assertTrue(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
+       }
+
+       @Test
+       public void getUserTest() {
+               List<EPUser> userList = new ArrayList<>();
+               EPUser user = mockUser.mockEPUser();
+               userList.add(user);
+               final Map<String, String> userParams = new HashMap<>();
+               userParams.put("org_user_id", "guestT");
+               Mockito.when(dataAccessService1.executeNamedQuery("getEPUserByOrgUserId", userParams, null))
+                               .thenReturn(userList);
+               List<EPUser> expectedUserList = externalAccessRolesServiceImpl.getUser("guestT");
+               assertEquals(expectedUserList, userList);
+       }
+    
+       
+       public void saveCentralRoleFunctionTest() throws Exception {
+               CentralV2RoleFunction centralV2RoleFunction = new CentralV2RoleFunction();
+               centralV2RoleFunction.setCode("menu_test");
+               EPApp app = mockApp();
+               app.setId((long) 1);
+               final Map<String, String> params = new HashMap<>();
+               params.put("functionCd", "menu_test");
+               params.put("appId", String.valueOf(1));
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               HttpHeaders headers = new HttpHeaders();
+               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
+               List<CentralV2RoleFunction> appRoleFunc  = new ArrayList<>();
+               appRoleFunc.add(centralV2RoleFunction);
+               Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params,
+                               null)).thenReturn(appRoleFunc);
+               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.OK);
+               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.GET),
+                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
+       }
+       
+//     @Test
+//     public void getAllAppUsersIfAppIsPortalTest() throws Exception
+//     {
+//             List<EPApp> expectedapps =  new ArrayList<>();
+//             EPApp app = new EPApp();
+//             app.setEnabled(true);
+//             app.setId((long) 1);
+//             expectedapps.add(app);
+//             List<EPRole> applicationRoles = new ArrayList<>();
+//             Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
+//             Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null)).thenReturn(expectedapps);
+//             externalAccessRolesServiceImpl.getAllAppUsers(uebKey);
+//     }
+       
+       
+       @Test(expected = IndexOutOfBoundsException.class)
+       public void getAllAppUsersTest() throws Exception
+       {
+               List<EPApp> expectedapps =  new ArrayList<>();
+               EPApp app = new EPApp();
+               app.setEnabled(true);
+               app.setId((long) 10);
+               expectedapps.add(app);
+               List<EPRole> applicationRoles = new ArrayList<>();
+               Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
+               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null)).thenReturn(expectedapps);
+               final Map<String, Long> appParams = new HashMap<>();
+               appParams.put("appId", app.getId());
+               List<EcompUserRoles> userList = new ArrayList<>();
+               EcompUserRoles ecompUserRoles = new EcompUserRoles();
+               ecompUserRoles.setOrgUserId("guestT");
+               ecompUserRoles.setRoleId((long) 1);
+               ecompUserRoles.setRoleName("test");
+               
+               EcompUserRoles ecompUserRoles2 = new EcompUserRoles();
+               ecompUserRoles2.setOrgUserId("guestT");
+               ecompUserRoles2.setRoleId((long) 2);
+               ecompUserRoles2.setRoleName("test new");
+               userList.add(ecompUserRoles);
+               userList.add(ecompUserRoles2);
+               
+               Mockito.when(dataAccessService1.executeNamedQuery("ApplicationUserRoles", appParams, null)).thenReturn(userList);
+               List<EcompUser> usersfinalList = externalAccessRolesServiceImpl.getAllAppUsers(uebKey);
+               assertEquals(usersfinalList.get(0).getRoles().size(), 2);
+       }
+       
+       @Test
+       public void getGlobalRolesOfPortalTest()
+       {
+               Mockito.when(dataAccessService1.executeNamedQuery("getGlobalRolesOfPortal", null, null)).thenReturn(null);
+               assertEquals(externalAccessRolesServiceImpl.getGlobalRolesOfPortal(), null);
+       }
+       
+       @Test
+       public void getGlobalRolesOfPortalExceptionTest()
+       {
+               List<EPRole> globalRoles = new ArrayList<>();
+               Mockito.when(dataAccessService1.executeNamedQuery("getGlobalRolesOfPortal", null, null)).thenThrow(nullPointerException);
+               assertEquals(externalAccessRolesServiceImpl.getGlobalRolesOfPortal(), globalRoles);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/FunctionalMenuMockServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/FunctionalMenuMockServiceImplTest.java
new file mode 100644 (file)
index 0000000..6655a5d
--- /dev/null
@@ -0,0 +1,222 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.domain.FunctionalMenuItemWithAppID;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.service.FunctionalMenuServiceImpl;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalsdk.core.service.DataAccessService;
+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;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({SystemProperties.class, EPCommonSystemProperties.class})
+public class FunctionalMenuMockServiceImplTest {
+
+       @Mock
+       FunctionalMenuService functionalMenuService;
+       
+       @Mock
+       DataAccessService dataAccessService;
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       
+    @InjectMocks
+       FunctionalMenuServiceImpl functionalMenuServiceImpl= new FunctionalMenuServiceImpl();
+       
+       @Test
+       public void assignHelpURLsTest(){
+               List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
+               FunctionalMenuItem functionalMenuItem1 = new FunctionalMenuItem();
+               functionalMenuItem1.text = "Contact Us";
+               FunctionalMenuItem functionalMenuItem2 = new FunctionalMenuItem();
+               functionalMenuItem2.text = "Get Access";
+               FunctionalMenuItem functionalMenuItem3 = new FunctionalMenuItem();
+               functionalMenuItem3.text = "User Guide";                
+               menuItems.add(functionalMenuItem1);
+               menuItems.add(functionalMenuItem2);
+               menuItems.add(functionalMenuItem3);
+               
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USER_GUIDE_URL)).thenReturn("http://todo_enter_user_guide_link");
+//             Mockito.doNothing().when(functionalMenuServiceImpl).assignHelpURLs(menuItems);
+               functionalMenuServiceImpl.assignHelpURLs(menuItems);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsTest(){
+               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, "
+                               + "fn_menu_functional_roles r WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  "
+                               + "UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  "
+                               + "WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
+                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
+                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
+                
+                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
+                
+                actualResult = functionalMenuServiceImpl.getFunctionalMenuItems(true);
+                assertEquals(actualResult, expectedResult);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsNegativeTest(){
+               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, "
+                               + "fn_menu_functional_roles r WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  "
+                               + "UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  "
+                               + "WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
+                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
+                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
+                
+                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
+                
+                actualResult = functionalMenuServiceImpl.getFunctionalMenuItems(false);
+                assertEquals(actualResult, expectedResult);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsForNotificationTreeTest(){
+               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, fn_menu_functional_roles r "
+                               + "WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id,"
+                               + " m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
+                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
+                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
+                
+                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
+                
+                actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForNotificationTree(true);
+                assertEquals(actualResult, expectedResult);
+               
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsForNotificationNegativeTreeTest(){
+               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, fn_menu_functional_roles r "
+                               + "WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id,"
+                               + " m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
+                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
+                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
+                
+                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
+                
+                actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForNotificationTree(false);
+                assertEquals(actualResult, expectedResult);            
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsForAppTest(){
+               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn  "
+                               + "FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr  "
+                               + "WHERE  mr.app_id='1'  AND mr.menu_id = m.menu_id  AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y' AND a.menu_id = m.menu_id  "
+                               + "AND a.ancestor_menu_id = m1.menu_id";
+               Integer appId = 1;
+               List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
+               List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
+                
+                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
+                
+                actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForApp(appId);
+                assertEquals(actualResult, expectedResult);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsForUserTest(){
+               String orgUserId = "test";
+               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn  "
+                               + "FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a,  fn_menu_functional_roles mr, fn_user u , fn_user_role ur  "
+                               + "WHERE  u.org_user_id='test'  AND u.user_id = ur.user_id  AND ur.app_id = mr.app_id  AND (ur.role_id = mr.role_id      OR ur.role_id = '999')  "
+                               + "AND m.menu_id = mr.menu_id  AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y'  AND a.menu_id = m.menu_id  "
+                               + "AND a.ancestor_menu_id = m1.menu_id  UNION  select m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m1.active_yn  "
+                               + "FROM fn_menu_functional m, fn_menu_functional_roles mr, fn_menu_functional m1,  fn_menu_functional_ancestors a  where a.menu_id = m.menu_id  AND a.ancestor_menu_id = m1.menu_id  AND m.menu_id != m1.menu_id  AND m.menu_id = mr.menu_id  AND mr.role_id = '900'  AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y'  UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn  FROM fn_menu_functional m  WHERE m.text in ('Favorites','Get Access','Contact Us','Support','User Guide','Help')";
+               List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
+               List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
+                
+               Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
+                
+               actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForUser(orgUserId);
+               assertEquals(actualResult, expectedResult);             
+       }
+       
+       @Test
+       public void getFunctionalMenuItemDetailsTest(){
+               Long menuid = 1L;
+               String sql = "SELECT * FROM fn_menu_functional_roles WHERE menu_id = '1'";
+               FunctionalMenuItem actualResult = null;
+               FunctionalMenuItem expectedResult = null;
+               List<FunctionalMenuRole> roleItems = new ArrayList<FunctionalMenuRole>();
+               Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(roleItems);
+                
+               actualResult = functionalMenuServiceImpl.getFunctionalMenuItemDetails(menuid);
+               assertEquals(actualResult, expectedResult);             
+       }
+               
+       @Test
+       public void getFavoriteItemsTest(){
+               Long userId = (long)1;
+               String sql = "SELECT DISTINCT f.user_id,f.menu_id,m.text,m.url  "
+                               + "FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr  "
+                               + "WHERE f.user_id='1' AND f.menu_id = m.menu_id  AND f.menu_id = mr.menu_id  AND mr.role_id != '900' ";
+               List<FavoritesFunctionalMenuItemJson> actualResult = new ArrayList<FavoritesFunctionalMenuItemJson>();
+               List<FavoritesFunctionalMenuItemJson> expectedResult = new ArrayList<FavoritesFunctionalMenuItemJson>();
+                
+               Mockito.when(dataAccessService.executeSQLQuery(sql, FavoritesFunctionalMenuItemJson.class, null)).thenReturn(expectedResult);
+                
+               actualResult = functionalMenuServiceImpl.getFavoriteItems(userId);
+               assertEquals(actualResult, expectedResult);             
+       }       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/FunctionalMenuServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/FunctionalMenuServiceImplTest.java
new file mode 100644 (file)
index 0000000..c954fcb
--- /dev/null
@@ -0,0 +1,92 @@
+package org.onap.portalapp.portal.service;
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+//package org.openecomp.portalapp.portal.test.service;
+//
+//import static org.junit.Assert.assertTrue;
+//
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//import org.junit.Test;
+//import org.openecomp.portalapp.portal.service.FunctionalMenuService;
+//import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
+//import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
+//import org.openecomp.portalapp.test.framework.ApplicationCommonContextTestSuite;
+//import org.springframework.beans.factory.annotation.Autowired;
+//
+//public class FunctionalMenuServiceImplTest extends ApplicationCommonContextTestSuite {
+//
+//     @Autowired
+//     FunctionalMenuService functionalMenuService;
+//
+//     @Test
+//     public void getAppListTestService() throws Exception {
+//
+//             String userId = "guestT";
+//             List<BusinessCardApplicationRole> userAppRolesActualResult = null;
+//
+//             List<BusinessCardApplicationRole> userAppRolesExpectedResult = new ArrayList<BusinessCardApplicationRole>();
+//             BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
+//             businessCardApplicationRole.setAppName("ECOMP Portal");
+//             businessCardApplicationRole.setRoleName("System Administrator");
+//             userAppRolesExpectedResult.add(businessCardApplicationRole);
+//             Map<String, String> params = new HashMap<String, String>();
+//             params.put("userId", userId);
+//             userAppRolesActualResult = functionalMenuService.getUserAppRolesList(userId);
+//             assertTrue(userAppRolesActualResult.contains(businessCardApplicationRole));
+//
+//     }
+//
+//     @Test
+//     public void getFunctionalMenuRoleTest() throws Exception {
+//
+//             FunctionalMenuRole expectedFunctionalMenuRole = new FunctionalMenuRole();
+//             expectedFunctionalMenuRole.setId(new Integer(-1));
+//
+//             expectedFunctionalMenuRole.setMenuId((long) 137);
+//             expectedFunctionalMenuRole.setAppId(new Integer(456));
+//             expectedFunctionalMenuRole.setRoleId(new Integer(6214));
+//             List<FunctionalMenuRole> actualFunctionalMenuRoleList = null;
+//             actualFunctionalMenuRoleList = functionalMenuService.getFunctionalMenuRole();
+//             assertTrue(actualFunctionalMenuRoleList.contains(expectedFunctionalMenuRole));
+//
+//     }
+//}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/GetAccessServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/GetAccessServiceImplTest.java
new file mode 100644 (file)
index 0000000..70d99cc
--- /dev/null
@@ -0,0 +1,87 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+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.GetAccessResult;
+import org.onap.portalapp.portal.service.GetAccessServiceImpl;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.DataAccessServiceImpl;
+
+public class GetAccessServiceImplTest {
+
+       
+    @Mock
+       DataAccessService dataAccessService = new DataAccessServiceImpl();
+    @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+    
+    @InjectMocks
+    GetAccessServiceImpl getAccessServiceImpl = new GetAccessServiceImpl();
+
+    MockEPUser mockUser = new MockEPUser();
+    
+    @Test
+       public void getAppAccessListTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Map<String, Long> params = new HashMap<>();
+               params.put("userId", user.getId());
+               List<GetAccessResult> appAccessList = new ArrayList<>();
+               Mockito.when(dataAccessService.executeNamedQuery("getAppAccessFunctionRole", params, null)).thenReturn(appAccessList);
+               
+               List<GetAccessResult> expectedAppAccessList =   getAccessServiceImpl.getAppAccessList(user);
+               assertEquals(expectedAppAccessList, appAccessList); 
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ManifestServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/ManifestServiceImplTest.java
new file mode 100644 (file)
index 0000000..0c06606
--- /dev/null
@@ -0,0 +1,92 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.jar.Attributes;
+
+import javax.servlet.ServletContext;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.service.ManifestServiceImpl;
+
+public class ManifestServiceImplTest {
+
+       @Mock
+       ServletContext context;
+
+       @Mock
+       ServletContext context1 = null;
+
+       @InjectMocks
+       ManifestServiceImpl manifestServiceImpl = new ManifestServiceImpl();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test
+       public void getWebappManifestTest() throws IOException {
+               final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
+               InputStream inputStream = new ByteArrayInputStream("test data".getBytes());
+               Mockito.when(context.getResourceAsStream(MANIFEST_RESOURCE_PATH)).thenReturn(inputStream);
+               Attributes attributes = manifestServiceImpl.getWebappManifest();
+               assertTrue(attributes.size() == 0);
+       }
+
+       @Test(expected = java.lang.NullPointerException.class)
+       public void getWebappManifestExceptionTest() throws IOException {
+               final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
+               InputStream inputStream = new ByteArrayInputStream("test data".getBytes());
+               Mockito.when(context1.getResourceAsStream(MANIFEST_RESOURCE_PATH)).thenThrow(nullPointerException);
+               Attributes attributes = manifestServiceImpl.getWebappManifest();
+               assertTrue(attributes.size() == 0);
+       }
+}
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
new file mode 100644 (file)
index 0000000..56104e8
--- /dev/null
@@ -0,0 +1,218 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+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.mockito.InjectMocks;
+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.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.domain.EPUserApp;
+import org.onap.portalapp.portal.domain.PersUserAppSelection;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.PersUserAppServiceImpl;
+import org.onap.portalapp.portal.service.UserRolesService;
+import org.onap.portalsdk.core.service.DataAccessService;
+
+public class PersUserAppServiceImplTest {
+
+       @Mock
+       DataAccessService dataAccessService;
+       @Mock
+       AdminRolesService adminRolesService;
+       @Mock
+       UserRolesService userRolesService;
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @InjectMocks
+       PersUserAppServiceImpl persUserAppServiceImpl = new PersUserAppServiceImpl();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+
+       public EPApp getApp() {
+               EPApp app = new EPApp();
+               app.setName("Test");
+               app.setImageUrl("test");
+               app.setDescription("test");
+               app.setNotes("test");
+               app.setUrl("test");
+               app.setId((long) 1);
+               app.setAppRestEndpoint("test");
+               app.setAlternateUrl("test");
+               app.setName("test");
+               app.setMlAppName("test");
+               app.setMlAppAdminId("test");
+               app.setUsername("test");
+               app.setAppPassword("test");
+               app.setOpen(true);
+               app.setEnabled(false);
+               app.setUebKey("test");
+               app.setUebSecret("test");
+               app.setUebTopicName("test");
+               app.setAppType(1);
+               return app;
+       }
+
+       @Test(expected = IllegalArgumentException.class)
+       public void setPersUserAppValueIfUserNull() {
+               persUserAppServiceImpl.setPersUserAppValue(null, null, false, false);
+       }
+
+       @Test
+       public void setPersUserAppValueTest() {
+               EPApp app = getApp();
+               EPUser user = mockUser.mockEPUser();
+               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setId((long) 1);
+               persUserAppSelectionList.add(persUserAppSelection);
+               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
+                               .thenReturn(persUserAppSelectionList);
+               Mockito.doNothing().when(dataAccessService).deleteDomainObject(persUserAppSelection, null);
+               persUserAppServiceImpl.setPersUserAppValue(user, app, false, true);
+       }
+
+       @Test
+       public void setPersUserAppValueIfSelectTest() {
+               EPApp app = getApp();
+               EPUser user = mockUser.mockEPUser();
+               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setId((long) 1);
+               persUserAppSelectionList.add(persUserAppSelection);
+               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
+                               .thenReturn(persUserAppSelectionList);
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
+               persUserAppServiceImpl.setPersUserAppValue(user, app, true, true);
+       }
+
+       @Test
+       public void setPersUserAppValueIfOpenTest() {
+               EPApp app = getApp();
+               app.setOpen(false);
+               EPUser user = mockUser.mockEPUser();
+               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setId((long) 1);
+               persUserAppSelectionList.add(persUserAppSelection);
+               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
+                               .thenReturn(persUserAppSelectionList);
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
+               persUserAppServiceImpl.setPersUserAppValue(user, app, true, true);
+       }
+
+       @Test
+       public void setPersUserAppValueIfAppNotOpenTest() {
+               EPApp app = getApp();
+               app.setOpen(false);
+               EPUser user = mockUser.mockEPUser();
+               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setId((long) 1);
+               persUserAppSelectionList.add(persUserAppSelection);
+               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
+                               .thenReturn(persUserAppSelectionList);
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               List<EPUserApp> roles = new ArrayList<>();
+               EPUserApp epUserApp = new EPUserApp();
+               roles.add(epUserApp);
+               Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
+               persUserAppServiceImpl.setPersUserAppValue(user, app, true, false);
+       }
+
+       @Test
+       public void setPersUserAppValueIfNotPortalAdminTest() {
+               EPApp app = getApp();
+               app.setOpen(false);
+               EPUser user = mockUser.mockEPUser();
+               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setId((long) 1);
+               persUserAppSelectionList.add(persUserAppSelection);
+               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
+                               .thenReturn(persUserAppSelectionList);
+               Mockito.doNothing().when(dataAccessService).deleteDomainObject(persUserAppSelection, null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               List<EPUserApp> roles = new ArrayList<>();
+               EPUserApp epUserApp = new EPUserApp();
+               roles.add(epUserApp);
+               Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
+               persUserAppServiceImpl.setPersUserAppValue(user, app, true, false);
+       }
+
+       @Test
+       public void setPersUserAppValueNewTest() {
+               EPApp app = getApp();
+               app.setOpen(false);
+               EPUser user = mockUser.mockEPUser();
+               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
+               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
+               persUserAppSelection.setId((long) 1);
+               persUserAppSelectionList.add(persUserAppSelection);
+               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
+                               .thenReturn(persUserAppSelectionList);
+               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               List<EPUserApp> roles = new ArrayList<>();
+               EPUserApp epUserApp = new EPUserApp();
+               roles.add(epUserApp);
+               Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
+               persUserAppServiceImpl.setPersUserAppValue(user, app, false, false);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AnalyticsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AnalyticsTest.java
new file mode 100644 (file)
index 0000000..e92f5cb
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.Analytics;
+
+public class AnalyticsTest {
+
+       public Analytics mockAnalytics(){
+               Analytics analytics = new Analytics();
+                               
+               analytics.setAction("test");
+               analytics.setPage("test");
+               analytics.setFunction("test");
+               analytics.setUserid("test");
+               analytics.setType("test");
+               
+               return analytics;
+       }
+       
+       @Test
+       public void analyticsTest(){
+               Analytics analytics = mockAnalytics();
+               
+               assertEquals(analytics.getAction(), "test");
+               assertEquals(analytics.getPage(), "test");
+               assertEquals(analytics.getFunction(), "test");
+               assertEquals(analytics.getUserid(), "test");
+               assertEquals(analytics.getType(), "test");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppCatalogPersonalizationTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppCatalogPersonalizationTest.java
new file mode 100644 (file)
index 0000000..2a512f7
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.AppCatalogPersonalization;
+
+public class AppCatalogPersonalizationTest {
+       
+       public AppCatalogPersonalization mockAppCatalogPersonalization(){
+               AppCatalogPersonalization appCatalogPersonalization = new AppCatalogPersonalization();
+               
+               return appCatalogPersonalization;
+       }
+       
+       @Test
+       public void appCatalogPersonalizationTest(){
+               AppCatalogPersonalization appCatalogPersonalization = mockAppCatalogPersonalization();
+               
+               AppCatalogPersonalization appCatalogPersonalization1 = new AppCatalogPersonalization();
+               
+               assertEquals(appCatalogPersonalization.hashCode(), appCatalogPersonalization1.hashCode());
+               assertTrue(appCatalogPersonalization.equals(appCatalogPersonalization1));
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppNameIdIsAdminTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppNameIdIsAdminTest.java
new file mode 100644 (file)
index 0000000..4287f3c
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.AppNameIdIsAdmin;
+
+public class AppNameIdIsAdminTest {
+
+       public AppNameIdIsAdmin mockAppNameIdIsAdmin(){
+               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
+               appNameIdIsAdmin.setId((long)1);
+               appNameIdIsAdmin.setAppName("test");
+               appNameIdIsAdmin.setRestrictedApp(false);
+               appNameIdIsAdmin.setIsAdmin(false);
+               return appNameIdIsAdmin;
+       }
+       
+       @Test
+       public void appNameIdIsAdminTest(){
+               AppNameIdIsAdmin appNameIdIsAdmin = mockAppNameIdIsAdmin(); 
+               
+               AppNameIdIsAdmin appNameIdIsAdmin1 = new AppNameIdIsAdmin();
+               appNameIdIsAdmin1.setId((long)1);
+               appNameIdIsAdmin1.setAppName("test");
+               appNameIdIsAdmin1.setRestrictedApp(false);
+               appNameIdIsAdmin1.setIsAdmin(false);
+               
+               assertEquals(appNameIdIsAdmin.getId(), new Long(1));
+               assertEquals(appNameIdIsAdmin.getAppName(), "test");
+               assertEquals(appNameIdIsAdmin.getRestrictedApp(), false);
+               assertEquals(appNameIdIsAdmin.getIsAdmin(), false);
+               
+               assertEquals(appNameIdIsAdmin.toString(), "AppNameIdIsAdmin [id=1, appName=test, isAdmin=false, restrictedApp=false]");
+               assertEquals(appNameIdIsAdmin.hashCode(), appNameIdIsAdmin1.hashCode());
+               assertTrue(appNameIdIsAdmin.equals(appNameIdIsAdmin1));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppWithRolesForUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppWithRolesForUserTest.java
new file mode 100644 (file)
index 0000000..da05ba3
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.AppWithRolesForUser;
+
+import static org.junit.Assert.assertEquals;
+
+public class AppWithRolesForUserTest {
+
+       public AppWithRolesForUser mockAppWithRolesForUser(){
+               AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser();
+               
+       //      List<RoleInAppForUser> appRoles = new ArrayList<RoleInAppForUser>();            
+               
+               appWithRolesForUser.setOrgUserId("test");
+               appWithRolesForUser.setAppId((long)1);
+               appWithRolesForUser.setAppName("test");
+               appWithRolesForUser.setAppRoles(null);
+               
+               return appWithRolesForUser;
+       }
+       
+       @Test
+       public void roleInAppForUserTest(){
+               AppWithRolesForUser appWithRolesForUser = mockAppWithRolesForUser();
+               
+               assertEquals(appWithRolesForUser.getOrgUserId(), "test");
+               assertEquals(appWithRolesForUser.getAppId(), new Long(1));
+               assertEquals(appWithRolesForUser.getAppName(), "test");
+               assertEquals(appWithRolesForUser.getAppRoles(), null);
+               assertEquals(appWithRolesForUser.toString(), "AppWithRolesForUser [orgUserId=test, appId=1, appName=test, appRoles=null]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppsListWithAdminRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/AppsListWithAdminRoleTest.java
new file mode 100644 (file)
index 0000000..fdacc60
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.AppNameIdIsAdmin;
+import org.onap.portalapp.portal.transport.AppsListWithAdminRole;
+
+public class AppsListWithAdminRoleTest {
+       
+       public AppsListWithAdminRole mockAppsListWithAdminRole(){
+               AppsListWithAdminRole appsListWithAdminRole = new AppsListWithAdminRole();
+               
+               ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
+               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
+               appsRoles.add(appNameIdIsAdmin);
+               
+               appsListWithAdminRole.setOrgUserId("test");
+               appsListWithAdminRole.setAppsRoles(appsRoles);
+               
+               return appsListWithAdminRole;
+       }
+
+       @Test
+       public void appsListWithAdminRoleTest(){
+               AppsListWithAdminRole appsListWithAdminRole = mockAppsListWithAdminRole();
+               
+               AppsListWithAdminRole appsListWithAdminRole1 = new AppsListWithAdminRole();
+               
+               ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
+               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
+               appsRoles.add(appNameIdIsAdmin);
+               
+               appsListWithAdminRole1.setOrgUserId("test");
+               appsListWithAdminRole1.setAppsRoles(appsRoles);
+                               
+               assertEquals(appsListWithAdminRole.getOrgUserId(), "test");
+               assertEquals(appsListWithAdminRole.getAppsRoles(), appsRoles);
+               
+               assertTrue(appsListWithAdminRole.equals(appsListWithAdminRole1));
+               assertEquals(appsListWithAdminRole.hashCode(), appsListWithAdminRole1.hashCode());
+               assertEquals(appsListWithAdminRole.toString(), "AppsListWithAdminRole [orgUserId=test, appsRoles=[AppNameIdIsAdmin [id=null, appName=null, isAdmin=null, restrictedApp=null]]]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BulkUploadRoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BulkUploadRoleFunctionTest.java
new file mode 100644 (file)
index 0000000..7d22f04
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.BulkUploadRoleFunction;
+
+public class BulkUploadRoleFunctionTest {
+
+       public BulkUploadRoleFunction mockBulkUploadRoleFunction(){
+               
+               BulkUploadRoleFunction bulkUploadRoleFunction = new BulkUploadRoleFunction();
+                                               
+               bulkUploadRoleFunction.setFunctionName("test");
+               bulkUploadRoleFunction.setFunctionCd("test");
+               
+               return bulkUploadRoleFunction;
+       }
+       
+       @Test
+       public void bulkUploadRoleFunctionTest(){
+               BulkUploadRoleFunction bulkUploadRoleFunction = mockBulkUploadRoleFunction();
+               
+               BulkUploadRoleFunction bulkUploadRoleFunction1 = new BulkUploadRoleFunction();
+               
+               bulkUploadRoleFunction1.setFunctionName("test");
+               bulkUploadRoleFunction1.setFunctionCd("test");
+               
+               assertEquals(bulkUploadRoleFunction.getFunctionCd(), "test");
+               assertEquals(bulkUploadRoleFunction.getFunctionName(), "test");
+               assertEquals(bulkUploadRoleFunction.hashCode(), bulkUploadRoleFunction1.hashCode());
+               assertTrue(bulkUploadRoleFunction.equals(bulkUploadRoleFunction1));
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BulkUploadUserRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BulkUploadUserRolesTest.java
new file mode 100644 (file)
index 0000000..14bd7ed
--- /dev/null
@@ -0,0 +1,74 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.BulkUploadUserRoles;
+
+public class BulkUploadUserRolesTest {
+
+       public BulkUploadUserRoles mockBulkUploadUserRoles(){
+               BulkUploadUserRoles bulkUploadUserRoles = new BulkUploadUserRoles();
+                               
+               bulkUploadUserRoles.setRoleName("test");
+               bulkUploadUserRoles.setOrgUserId("test");
+               bulkUploadUserRoles.setAppNameSpace("test");
+               
+               return bulkUploadUserRoles;
+       }
+       
+       @Test
+       public void bulkUploadUserRolesTest(){
+               BulkUploadUserRoles bulkUploadUserRoles = mockBulkUploadUserRoles();
+               
+               BulkUploadUserRoles bulkUploadUserRoles1 = new BulkUploadUserRoles();
+               
+               bulkUploadUserRoles1.setRoleName("test");
+               bulkUploadUserRoles1.setOrgUserId("test");
+               bulkUploadUserRoles1.setAppNameSpace("test");
+               
+               assertEquals(bulkUploadUserRoles.getRoleName(), "test");
+               assertEquals(bulkUploadUserRoles.getOrgUserId(), "test");
+               assertEquals(bulkUploadUserRoles.getAppNameSpace(), "test");
+               
+               assertEquals(bulkUploadUserRoles.hashCode(), bulkUploadUserRoles1.hashCode());
+               assertTrue(bulkUploadUserRoles.equals(bulkUploadUserRoles1));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRoleTest.java
new file mode 100644 (file)
index 0000000..225df01
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRole;
+
+public class BusinessCardApplicationRoleTest {
+
+       public BusinessCardApplicationRole mockBusinessCardApplicationRole(){
+               BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
+               
+               return businessCardApplicationRole;
+       }
+       
+       @Test
+       public void businessCardApplicationRoleTest(){
+               BusinessCardApplicationRole businessCardApplicationRole = mockBusinessCardApplicationRole();
+               
+               BusinessCardApplicationRole businessCardApplicationRole1 = new BusinessCardApplicationRole();
+               
+               assertEquals(businessCardApplicationRole.hashCode(), businessCardApplicationRole1.hashCode());
+               assertTrue(businessCardApplicationRole.equals(businessCardApplicationRole1));
+               assertEquals(businessCardApplicationRole.toString(), "BusinessCardUserApplicationRoles [appName=null, roleName=null]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRolesListTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/BusinessCardApplicationRolesListTest.java
new file mode 100644 (file)
index 0000000..c43361d
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.BusinessCardApplicationRolesList;
+
+public class BusinessCardApplicationRolesListTest {
+
+       public BusinessCardApplicationRolesList mockBusinessCardApplicationRolesList(){
+               BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
+               
+               return businessCardApplicationRolesList;
+       }
+       
+       @Test
+       public void businessCardApplicationRolesListTest(){
+               BusinessCardApplicationRolesList businessCardApplicationRolesList = mockBusinessCardApplicationRolesList();
+               
+               BusinessCardApplicationRolesList businessCardApplicationRolesList1 = new BusinessCardApplicationRolesList();
+               
+               assertEquals(businessCardApplicationRolesList.hashCode(), businessCardApplicationRolesList1.hashCode());
+               assertTrue(businessCardApplicationRolesList.equals(businessCardApplicationRolesList1));
+               assertEquals(businessCardApplicationRolesList.toString(), "BusinessCardUserAppRoles [appName=null, roleNames=null]");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralAppTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralAppTest.java
new file mode 100644 (file)
index 0000000..1dde292
--- /dev/null
@@ -0,0 +1,86 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.CentralApp;
+
+public class CentralAppTest {
+
+       public CentralApp mockCentralApp(){
+               CentralApp centralApp = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
+                               "test", "test", "test", "test", null, "test", "test", "test", "test");
+                               return centralApp;
+       }
+       
+       @Test
+       public void centralAppTest(){
+               CentralApp centralApp = mockCentralApp();
+               
+               CentralApp centralApp1 =  new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
+                               "test", "test", "test", "test", null, "test", "test", "test", "test");
+               
+               assertEquals(centralApp.getId(), new Long(1));
+               assertEquals(centralApp.getCreatedId(), new Long(1));
+               assertEquals(centralApp.getModifiedId(), new Long(1));
+               assertEquals(centralApp.getRowNum(), new Long(1));
+               assertEquals(centralApp.getName(), "test");
+               assertEquals(centralApp.getImageUrl(), "test");
+               assertEquals(centralApp.getDescription(), "test");
+               assertEquals(centralApp.getNotes(), "test");
+               assertEquals(centralApp.getUrl(), "test");
+               assertEquals(centralApp.getAlternateUrl(), "test");
+               assertEquals(centralApp.getRestEndpoint(), "test");
+               assertEquals(centralApp.getMlAppName(), "test");
+               assertEquals(centralApp.getMlAppAdminId(), "test");
+               assertEquals(centralApp.getMotsId(), "test");
+               assertEquals(centralApp.getAppPassword(), "test");
+               assertEquals(centralApp.getOpen(), "test");
+               assertEquals(centralApp.getEnabled(), "test");
+               assertEquals(centralApp.getUsername(), "test");
+               assertEquals(centralApp.getUebKey(), "test");
+               assertEquals(centralApp.getUebSecret(), "test");
+               assertEquals(centralApp.getUebTopicName(), "test");
+               
+               assertTrue(centralApp.equals(centralApp1));
+               assertEquals(centralApp.hashCode(), centralApp1.hashCode());
+       }
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralRoleTest.java
new file mode 100644 (file)
index 0000000..1c40be4
--- /dev/null
@@ -0,0 +1,96 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class CentralRoleTest {
+
+       public CentralV2Role mockCentralRole(){
+               CentralV2Role centralV2Role = new CentralV2Role((long)1, null, null, (long)1, (long)1, (long)1,
+                               "test", false, 1, null, null, null);
+           
+           centralV2Role.setId((long)1);
+           centralV2Role.setCreatedId((long)1);
+           centralV2Role.setModifiedId((long)1);
+           centralV2Role.setRowNum((long)1);
+           centralV2Role.setName("test");
+           centralV2Role.setActive(false);
+           centralV2Role.setPriority(1);
+           
+           centralV2Role.setCreated(null);
+           centralV2Role.setModified(null);
+           centralV2Role.setRoleFunctions(null);
+           centralV2Role.setChildRoles(null);
+           centralV2Role.setParentRoles(null);
+           
+               return centralV2Role;
+       }
+       
+       @Test
+       public void centralRoleTest(){
+               CentralV2Role centralV2Role = mockCentralRole();
+               
+               CentralV2Role centralRole1 = new CentralV2Role((long)1, null, null, (long)1, (long)1, (long)1,
+                               "test", false, 1, null, null, null);
+               
+               CentralV2Role centralRole2 = new CentralV2Role((long)1, "test");
+               
+               assertEquals(centralV2Role.getId(), new Long(1));
+               assertEquals(centralV2Role.getCreatedId(), new Long(1));
+               assertEquals(centralV2Role.getModifiedId(), new Long(1));
+               assertEquals(centralV2Role.getRowNum(), new Long(1));
+               assertEquals(centralV2Role.getName(), "test");
+               assertEquals(centralV2Role.isActive(), false);
+               assertEquals(centralV2Role.getCreated(), null);
+               assertEquals(centralV2Role.getModified(), null);
+               assertEquals(centralV2Role.getRoleFunctions(), null);
+               assertEquals(centralV2Role.getChildRoles(), null);
+               assertEquals(centralV2Role.getParentRoles(), null);             
+               assertEquals(centralV2Role.getPriority().toString(), "1");
+               assertEquals(centralV2Role.hashCode(), centralRole1.hashCode());
+               assertTrue(centralV2Role.equals(centralRole1));
+               assertEquals(centralV2Role, centralRole1);
+               assertEquals(centralRole2, new CentralV2Role((long)1, "test"));
+       }
+       
+       
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserAppTest.java
new file mode 100644 (file)
index 0000000..a04b47a
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.CentralApp;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.CentralV2UserApp;
+
+public class CentralUserAppTest {
+
+       public CentralV2UserApp mockCentralUserApp(){
+               CentralV2UserApp centralV2UserApp = new CentralV2UserApp();
+                               
+               CentralApp app = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
+                               "test", "test", "test", "test", null, "test", "test", "test", "test");
+               
+               CentralV2Role role = new CentralV2Role();
+                
+               centralV2UserApp.setUserId((long)1);
+               centralV2UserApp.setApp(app);
+               centralV2UserApp.setRole(role);
+               centralV2UserApp.setPriority((short) 123);
+               
+               return centralV2UserApp;
+       }
+       
+       @Test
+       public void centralUserAppTest(){
+               CentralV2UserApp centralV2UserApp = mockCentralUserApp();
+               
+               CentralApp app1 = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
+                               "test", "test", "test", "test", null, "test", "test", "test", "test");
+               
+               CentralV2Role role1 = new CentralV2Role();
+               
+               assertEquals(centralV2UserApp.getUserId(), new Long(1));
+               assertEquals(centralV2UserApp.getPriority(), new Short((short) 123));
+               assertEquals(centralV2UserApp.getApp(), app1);
+               assertEquals(centralV2UserApp.getRole(), role1);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/CentralUserTest.java
new file mode 100644 (file)
index 0000000..67c6ee0
--- /dev/null
@@ -0,0 +1,89 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.CentralV2Role;
+import org.onap.portalapp.portal.transport.CentralV2User;
+import org.onap.portalapp.portal.transport.CentralV2UserApp;
+
+public class CentralUserTest {
+
+       public CentralV2User mockCentralUser(){
+               Set<CentralV2UserApp> userApps = new HashSet<CentralV2UserApp>();
+               Set<CentralV2Role> pseudoRoles = new HashSet<CentralV2Role>();
+               CentralV2User centralV2User = new CentralV2User((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
+                               (long)1, "test", "test", "test", "test", "test",
+                               "test", "test", (long)1, "test", "test", "test",
+                               "test", "test", "test", "test", "test", "test", "test",
+                               "test", "test", "test", "test",
+                               "test", "test", "test", "test", "test",
+                               "test", "test", "test", "test", "test",
+                               "test", "test", "test", "test", null,
+                               false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
+               
+               return centralV2User;
+       }
+       
+       @Test
+       public void centralRoleTest(){
+               CentralV2User centralV2User = mockCentralUser();
+               
+               Set<CentralV2UserApp> userApps = new HashSet<CentralV2UserApp>();
+               Set<CentralV2Role> pseudoRoles = new HashSet<CentralV2Role>();
+               CentralV2User centralV2User1 = new CentralV2User((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
+                               (long)1, "test", "test", "test", "test", "test",
+                               "test", "test", (long)1, "test", "test", "test",
+                               "test", "test", "test", "test", "test", "test", "test",
+                               "test", "test", "test", "test",
+                               "test", "test", "test", "test", "test",
+                               "test", "test", "test", "test", "test",
+                               "test", "test", "test", "test", null,
+                               false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
+               
+               
+               assertEquals(centralV2User, centralV2User1);
+               assertEquals(centralV2User.hashCode(), centralV2User1.hashCode());
+               assertTrue(centralV2User.equals(centralV2User1));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPAppsManualPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPAppsManualPreferenceTest.java
new file mode 100644 (file)
index 0000000..e45ffac
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EPAppsManualPreference;
+
+public class EPAppsManualPreferenceTest {
+
+       public EPAppsManualPreference mockEPAppsManualPreference(){
+               EPAppsManualPreference epAppsManualPreference = new EPAppsManualPreference();
+                               
+               epAppsManualPreference.setAppid((long)1);
+               epAppsManualPreference.setCol(1);
+               epAppsManualPreference.setHeaderText("test");
+               epAppsManualPreference.setImageLink("test");
+               epAppsManualPreference.setOrder(1);
+               epAppsManualPreference.setRestrictedApp(false);
+               epAppsManualPreference.setRow(1);
+               epAppsManualPreference.setSizeX(1);
+               epAppsManualPreference.setSizeY(1);
+               epAppsManualPreference.setSubHeaderText("test");
+               epAppsManualPreference.setUrl("test");
+               epAppsManualPreference.setAddRemoveApps(false);
+               
+               return epAppsManualPreference;
+       }
+       
+       @Test
+       public void epAppsManualPreferenceTest(){
+               
+               EPAppsManualPreference epAppsManualPreference = mockEPAppsManualPreference();
+               
+               assertEquals(epAppsManualPreference.getAppid(), new Long(1));
+               assertEquals(epAppsManualPreference.getCol(), 1);
+               assertEquals(epAppsManualPreference.getHeaderText(), "test");
+               assertEquals(epAppsManualPreference.getImageLink(), "test");
+               assertEquals(epAppsManualPreference.getOrder(), 1);
+               assertEquals(epAppsManualPreference.isRestrictedApp(), false);
+               assertEquals(epAppsManualPreference.getRow(), 1);
+               assertEquals(epAppsManualPreference.getSizeX(), 1);
+               assertEquals(epAppsManualPreference.getSizeY(), 1);
+               assertEquals(epAppsManualPreference.getSubHeaderText(), "test");
+               assertEquals(epAppsManualPreference.getUrl(), "test");
+               assertEquals(epAppsManualPreference.isAddRemoveApps(), false);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPAppsSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPAppsSortPreferenceTest.java
new file mode 100644 (file)
index 0000000..84ae04a
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EPAppsSortPreference;
+
+public class EPAppsSortPreferenceTest {
+
+       public EPAppsSortPreference mockEPAppsSortPreference(){
+               EPAppsSortPreference epAppsSortPreference = new EPAppsSortPreference();
+               
+               epAppsSortPreference.setIndex(1);
+               epAppsSortPreference.setValue("test");
+               epAppsSortPreference.setTitle("test");
+               
+               return epAppsSortPreference;
+       }
+       
+       @Test
+       public void epAppsSortPreferenceTest(){
+               EPAppsSortPreference epAppsSortPreference = mockEPAppsSortPreference();
+               
+               assertEquals(epAppsSortPreference.getIndex(), 1);
+               assertEquals(epAppsSortPreference.getValue(), "test");
+               assertEquals(epAppsSortPreference.getTitle(), "test");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPDeleteAppsManualSortPrefTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPDeleteAppsManualSortPrefTest.java
new file mode 100644 (file)
index 0000000..5aad78c
--- /dev/null
@@ -0,0 +1,66 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EPDeleteAppsManualSortPref;
+
+public class EPDeleteAppsManualSortPrefTest {
+
+       public EPDeleteAppsManualSortPref mockEPDeleteAppsManualSortPref(){
+               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
+               
+               epDeleteAppsManualSortPref.setAppId((long)1);
+               epDeleteAppsManualSortPref.setSelect(false);
+               epDeleteAppsManualSortPref.setPending(false);
+
+               return epDeleteAppsManualSortPref;
+       }
+       
+       @Test
+       public void epDeleteAppsManualSortPrefTest(){
+               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = mockEPDeleteAppsManualSortPref();
+               
+               assertEquals(epDeleteAppsManualSortPref.getAppId(), new Long(1));
+               assertEquals(epDeleteAppsManualSortPref.isSelect(), false);
+               assertEquals(epDeleteAppsManualSortPref.isPending(), false);
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPUserAppCurrentRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPUserAppCurrentRolesTest.java
new file mode 100644 (file)
index 0000000..31296cc
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EPUserAppCurrentRoles;
+
+public class EPUserAppCurrentRolesTest {
+
+       public EPUserAppCurrentRoles mockEPUserAppCurrentRoles(){
+               EPUserAppCurrentRoles epUserAppCurrentRoles = new EPUserAppCurrentRoles();
+                       
+               epUserAppCurrentRoles.setRoleName("test");
+               epUserAppCurrentRoles.setUserId((long)1);
+               epUserAppCurrentRoles.setPriority("test");
+               epUserAppCurrentRoles.setRoleId((long)1);
+               
+               return epUserAppCurrentRoles;
+       }
+       
+       @Test
+       public void epUserAppCurrentRolesTest(){
+               EPUserAppCurrentRoles epUserAppCurrentRoles = mockEPUserAppCurrentRoles();
+               
+               EPUserAppCurrentRoles epUserAppCurrentRoles1 = new EPUserAppCurrentRoles();
+               
+               epUserAppCurrentRoles1.setRoleName("test");
+               epUserAppCurrentRoles1.setUserId((long)1);
+               epUserAppCurrentRoles1.setPriority("test");
+               epUserAppCurrentRoles1.setRoleId((long)1);
+               
+               assertEquals(epUserAppCurrentRoles.getRoleName(), "test");
+               assertEquals(epUserAppCurrentRoles.getUserId(), new Long(1));
+               assertEquals(epUserAppCurrentRoles.getRoleId(), new Long(1));
+               assertEquals(epUserAppCurrentRoles.getPriority(), "test");
+               assertEquals(epUserAppCurrentRoles.hashCode(), epUserAppCurrentRoles1.hashCode());
+               assertTrue(epUserAppCurrentRoles.equals(epUserAppCurrentRoles1));
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPWidgetsSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EPWidgetsSortPreferenceTest.java
new file mode 100644 (file)
index 0000000..ef50aef
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EPWidgetsSortPreference;
+
+public class EPWidgetsSortPreferenceTest {
+       
+       public EPWidgetsSortPreference mockEPWidgetsSortPreference(){
+               EPWidgetsSortPreference epWidgetsSortPreference = new EPWidgetsSortPreference();
+                               
+               epWidgetsSortPreference.setSizeX(1);
+               epWidgetsSortPreference.setSizeY(1);
+               epWidgetsSortPreference.setHeaderText("test");
+               epWidgetsSortPreference.setUrl("test");
+               epWidgetsSortPreference.setWidgetid((long)1);
+               epWidgetsSortPreference.setWidgetIdentifier("test");
+               epWidgetsSortPreference.setRow(1);
+               epWidgetsSortPreference.setCol(1);
+               
+               return epWidgetsSortPreference;
+       }
+       
+       @Test
+       public void epWidgetsSortPreferenceTest(){
+               EPWidgetsSortPreference epWidgetsSortPreference = mockEPWidgetsSortPreference();
+               
+               assertEquals(epWidgetsSortPreference.getSizeX(), 1);
+               assertEquals(epWidgetsSortPreference.getSizeY(), 1);
+               assertEquals(epWidgetsSortPreference.getHeaderText(), "test");
+               assertEquals(epWidgetsSortPreference.getUrl(), "test");
+               assertEquals(epWidgetsSortPreference.getWidgetid(), new Long(1));
+               assertEquals(epWidgetsSortPreference.getWidgetIdentifier(), "test");
+               assertEquals(epWidgetsSortPreference.getRow(), 1);
+               assertEquals(epWidgetsSortPreference.getRow(), 1);
+               
+       }
+       
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EcompUserAppRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EcompUserAppRolesTest.java
new file mode 100644 (file)
index 0000000..c8b1fdd
--- /dev/null
@@ -0,0 +1,70 @@
+
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EcompUserAppRoles;
+
+public class EcompUserAppRolesTest {
+
+       public EcompUserAppRoles mockEcompUserAppRoles(){
+               EcompUserAppRoles ecompUserAppRoles = new EcompUserAppRoles();
+                       
+               ecompUserAppRoles.setAppId("test");
+               ecompUserAppRoles.setUserId((long)1);
+               ecompUserAppRoles.setPriority("test");
+               ecompUserAppRoles.setRoleId((long)1);
+               ecompUserAppRoles.setRoleName("test");
+               
+               return ecompUserAppRoles;
+       }
+       
+       @Test
+       public void ecompUserAppRolesTest(){
+               
+               EcompUserAppRoles ecompUserAppRoles = mockEcompUserAppRoles();
+               
+               assertEquals(ecompUserAppRoles.getAppId(), "test");
+               assertEquals(ecompUserAppRoles.getPriority(), "test");
+               assertEquals(ecompUserAppRoles.getRoleName(), "test");
+               assertEquals(ecompUserAppRoles.getUserId(), new Long(1));
+               assertEquals(ecompUserAppRoles.getRoleId(), new Long(1));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemExtVOTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemExtVOTest.java
new file mode 100644 (file)
index 0000000..9f31686
--- /dev/null
@@ -0,0 +1,70 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EpNotificationItemExtVO;
+
+public class EpNotificationItemExtVOTest {
+
+       public EpNotificationItemExtVO mockEpNotificationItemExtVO(){
+               EpNotificationItemExtVO epNotificationItemExtVO = new EpNotificationItemExtVO();
+               
+               //epNotificationItemExtVO.setActiveYn("abc");
+               epNotificationItemExtVO.setMsgHeader("test");
+               epNotificationItemExtVO.setMsgDescription("test");
+               epNotificationItemExtVO.setPriority(1);
+               epNotificationItemExtVO.setCreatorId(1);
+               epNotificationItemExtVO.setLoginId("test");
+               
+               return epNotificationItemExtVO;
+       }
+       
+       @Test
+       public void epNotificationItemExtVOTest(){
+               EpNotificationItemExtVO epNotificationItemExtVO = mockEpNotificationItemExtVO();
+               
+               assertEquals(epNotificationItemExtVO.getMsgHeader(), "test");
+               assertEquals(epNotificationItemExtVO.getMsgDescription(), "test");
+               assertEquals(epNotificationItemExtVO.getPriority().toString(), "1");
+               assertEquals(epNotificationItemExtVO.getCreatorId().toString(), "1");
+               assertEquals(epNotificationItemExtVO.getLoginId(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemTest.java
new file mode 100644 (file)
index 0000000..7f80bc4
--- /dev/null
@@ -0,0 +1,100 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EpNotificationItem;
+
+public class EpNotificationItemTest {
+       
+       public EpNotificationItem mockEpNotificationItem(){
+               EpNotificationItem epNotificationItem = new EpNotificationItem();
+               
+               epNotificationItem.setNotificationId((long)1);
+               epNotificationItem.setIsForOnlineUsers("test");
+               epNotificationItem.setIsForAllRoles("test");
+               epNotificationItem.setActiveYn("test");
+               epNotificationItem.setMsgHeader("test");
+               epNotificationItem.setMsgDescription("test");
+               epNotificationItem.setMsgSource("test");
+               
+               epNotificationItem.setPriority((long)1);
+               epNotificationItem.setCreatedId((long)1);
+               epNotificationItem.setNotificationHyperlink("test");
+               
+               return epNotificationItem;
+       }
+       
+       @Test
+       public void epNotificationItemTest(){
+               EpNotificationItem epNotificationItem = mockEpNotificationItem();
+               
+               EpNotificationItem epNotificationItem1 = new EpNotificationItem();
+               epNotificationItem1.setNotificationId((long)1);
+               epNotificationItem1.setIsForOnlineUsers("test");
+               epNotificationItem1.setIsForAllRoles("test");
+               epNotificationItem1.setActiveYn("test");
+               epNotificationItem1.setMsgHeader("test");
+               epNotificationItem1.setMsgDescription("test");
+               epNotificationItem1.setMsgSource("test");
+               
+               epNotificationItem1.setPriority((long)1);
+               epNotificationItem1.setCreatedId((long)1);
+               epNotificationItem1.setNotificationHyperlink("test");
+               
+               assertEquals(epNotificationItem.getNotificationId(), new Long(1));
+               assertEquals(epNotificationItem.getIsForOnlineUsers(), "test");
+               assertEquals(epNotificationItem.getIsForAllRoles(), "test");
+               assertEquals(epNotificationItem.getActiveYn(), "test");
+               assertEquals(epNotificationItem.getMsgHeader(), "test");
+               assertEquals(epNotificationItem.getMsgDescription(), "test");
+               assertEquals(epNotificationItem.getMsgSource(), "test");
+               assertEquals(epNotificationItem.getPriority(), new Long(1));
+               assertEquals(epNotificationItem.getCreatedId(), new Long(1));
+               assertEquals(epNotificationItem.getNotificationHyperlink(), "test");
+               
+               assertEquals(epNotificationItem.toString(), "EpNotificationItem [notificationId=1, isForOnlineUsers=test, isForAllRoles=test, activeYn=test, msgHeader=test, msgDescription=test, msgSource=test, startTime=null, endTime=null, priority=1, creatorId=null, createdDate=null, roles=null, roleIds=null]");
+               assertEquals(epNotificationItem.hashCode(), epNotificationItem1.hashCode());
+               assertTrue(epNotificationItem.equals(epNotificationItem1));
+                               
+       }
+
+}
+
+
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemVOTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpNotificationItemVOTest.java
new file mode 100644 (file)
index 0000000..61bc86f
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EpNotificationItemVO;
+
+public class EpNotificationItemVOTest {
+
+       public EpNotificationItemVO mockEpNotificationItemVO(){
+               EpNotificationItemVO epNotificationItemVO = new EpNotificationItemVO();
+                               
+               epNotificationItemVO.setNotificationId(1);
+               epNotificationItemVO.setIsForOnlineUsers('a');
+               epNotificationItemVO.setIsForAllRoles('a');
+               epNotificationItemVO.setActiveYn('a');
+               epNotificationItemVO.setMsgHeader("test");
+               epNotificationItemVO.setMsgDescription("test");
+               epNotificationItemVO.setMsgSource("test");
+               epNotificationItemVO.setPriority(1);
+               epNotificationItemVO.setCreatorId(1);
+               epNotificationItemVO.setLoginId("test");
+               epNotificationItemVO.setNotificationHyperlink("test");
+               
+                return epNotificationItemVO;
+       }
+       
+       @Test
+       public void epNotificationItemVOTest(){
+               EpNotificationItemVO epNotificationItemVO = mockEpNotificationItemVO();
+               
+               assertEquals(epNotificationItemVO.getNotificationId().toString(), "1");
+               /*assertEquals(epNotificationItemVO.getIsForOnlineUsers(), 'a');
+               assertEquals(epNotificationItemVO.getIsForAllRoles(), 'a');
+               assertEquals(epNotificationItemVO.getActiveYn(), 'a');*/
+               assertEquals(epNotificationItemVO.getMsgHeader(), "test");
+               assertEquals(epNotificationItemVO.getMsgDescription(), "test");
+               assertEquals(epNotificationItemVO.getMsgSource(), "test");
+               assertEquals(epNotificationItemVO.getPriority().toString(), "1");
+               assertEquals(epNotificationItemVO.getCreatorId().toString(), "1");
+               assertEquals(epNotificationItemVO.getLoginId(), "test");
+               assertEquals(epNotificationItemVO.getNotificationHyperlink(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpRoleNotificationItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/EpRoleNotificationItemTest.java
new file mode 100644 (file)
index 0000000..8259293
--- /dev/null
@@ -0,0 +1,68 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.EpRoleNotificationItem;
+
+public class EpRoleNotificationItemTest {
+       
+       public EpRoleNotificationItem mockEpRoleNotificationItem(){
+               EpRoleNotificationItem epRoleNotificationItem = new EpRoleNotificationItem();
+               
+               epRoleNotificationItem.setId((long)1);
+               epRoleNotificationItem.setNotificationId((long)1);
+               epRoleNotificationItem.setRoleId(1);
+               epRoleNotificationItem.setRecvUserId(1);
+               
+               return epRoleNotificationItem;
+       }
+       
+       @Test
+       public void epRoleNotificationItemTest(){
+               EpRoleNotificationItem epRoleNotificationItem = mockEpRoleNotificationItem();
+               
+               assertEquals(epRoleNotificationItem.getId(), new Long(1));
+               assertEquals(epRoleNotificationItem.getNotificationId(), new Long(1));
+               assertEquals(epRoleNotificationItem.getRoleId().toString(), "1");
+               assertEquals(epRoleNotificationItem.getRecvUserId().toString(), "1");
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessPermsDetailTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessPermsDetailTest.java
new file mode 100644 (file)
index 0000000..f4f36d9
--- /dev/null
@@ -0,0 +1,76 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalAccessPermsDetail;
+
+public class ExternalAccessPermsDetailTest {
+
+       public ExternalAccessPermsDetail mockExternalAccessPermsDetail(){
+               ExternalAccessPermsDetail externalAccessPermsDetail = new ExternalAccessPermsDetail();
+                               
+               List<String> roles = new ArrayList<String>();
+               
+               externalAccessPermsDetail.setType("test");
+               externalAccessPermsDetail.setInstance("test");
+               externalAccessPermsDetail.setAction("test");
+               externalAccessPermsDetail.setDescription("test");
+               externalAccessPermsDetail.setRoles(roles);
+               
+               return externalAccessPermsDetail;
+       }
+       
+       @Test
+       public void externalAccessPermsDetailTest(){
+               ExternalAccessPermsDetail externalAccessPermsDetail = mockExternalAccessPermsDetail();
+               
+               List<String> roles = new ArrayList<String>();
+               
+               assertEquals(externalAccessPermsDetail.getType(), "test");
+               assertEquals(externalAccessPermsDetail.getInstance(), "test");
+               assertEquals(externalAccessPermsDetail.getAction(), "test");
+               assertEquals(externalAccessPermsDetail.getDescription(), "test");
+               assertEquals(externalAccessPermsDetail.getRoles(), roles);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessPermsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessPermsTest.java
new file mode 100644 (file)
index 0000000..3392f2e
--- /dev/null
@@ -0,0 +1,79 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalAccessPerms;
+
+public class ExternalAccessPermsTest {
+
+       public ExternalAccessPerms mockExternalAccessPerms(){
+               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
+                               
+               externalAccessPerms.setType("test");
+               externalAccessPerms.setInstance("test");
+               externalAccessPerms.setAction("test");
+               externalAccessPerms.setDescription("test");
+               
+               return externalAccessPerms;
+       }
+       
+       @Test
+       public void externalAccessPermsTest(){
+               ExternalAccessPerms externalAccessPerms = mockExternalAccessPerms();
+               
+               ExternalAccessPerms externalAccessPerms1 = new ExternalAccessPerms("test", "test", "test");
+               ExternalAccessPerms externalAccessPerms2 = new ExternalAccessPerms("test", "test", "test", "test");
+               ExternalAccessPerms externalAccessPerms3 = new ExternalAccessPerms();
+               externalAccessPerms3.setType("test");
+               externalAccessPerms3.setInstance("test");
+               externalAccessPerms3.setAction("test");
+               externalAccessPerms3.setDescription("test");
+               
+               assertEquals(externalAccessPerms.getType(), "test");
+               assertEquals(externalAccessPerms.getInstance(), "test");
+               assertEquals(externalAccessPerms.getAction(), "test");
+               assertEquals(externalAccessPerms.getDescription(), "test");
+               assertEquals(externalAccessPerms.hashCode(), externalAccessPerms3.hashCode());
+               
+               assertTrue(externalAccessPerms1.equals(new ExternalAccessPerms("test", "test", "test")));
+               assertTrue(externalAccessPerms2.equals(new ExternalAccessPerms("test", "test", "test", "test")));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessRolePermsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessRolePermsTest.java
new file mode 100644 (file)
index 0000000..5e78c9c
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalAccessPerms;
+import org.onap.portalapp.portal.transport.ExternalAccessRolePerms;
+
+public class ExternalAccessRolePermsTest {
+
+       public ExternalAccessRolePerms mockExternalAccessRolePerms(){
+               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
+               externalAccessPerms.setAction("test");
+               externalAccessPerms.setDescription("test");
+               externalAccessPerms.setInstance("test");
+               externalAccessPerms.setType("test");
+               ExternalAccessRolePerms ExternalAccessRolePerms = new ExternalAccessRolePerms(externalAccessPerms, "test");
+               
+               return ExternalAccessRolePerms;
+       }
+       
+       @Test
+       public void externalAccessRolePermsTest(){
+               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
+               externalAccessPerms.setAction("test");
+               externalAccessPerms.setDescription("test");
+               externalAccessPerms.setInstance("test");
+               externalAccessPerms.setType("test");
+               
+               ExternalAccessRolePerms ExternalAccessRolePerms = mockExternalAccessRolePerms();
+               
+               assertEquals(ExternalAccessRolePerms.getRole(), "test");
+               assertEquals(ExternalAccessRolePerms.getPerm(), externalAccessPerms);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessRoleTest.java
new file mode 100644 (file)
index 0000000..cf00f2b
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalAccessRole;
+
+public class ExternalAccessRoleTest {
+
+       public ExternalAccessRole mockExternalAccessRole(){
+               ExternalAccessRole externalAccessRole = new ExternalAccessRole();
+               
+               externalAccessRole.setName("test");
+               externalAccessRole.setDescription("test");
+               
+               return externalAccessRole;
+       }
+       
+       @Test
+       public void externalAccessRoleTest(){
+               ExternalAccessRole externalAccessRole = mockExternalAccessRole();
+               
+               assertEquals(externalAccessRole.getName(), "test");
+               assertEquals(externalAccessRole.getDescription(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessUserRoleDetailTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessUserRoleDetailTest.java
new file mode 100644 (file)
index 0000000..0229ece
--- /dev/null
@@ -0,0 +1,84 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalAccessUserRoleDetail;
+import org.onap.portalapp.portal.transport.ExternalRoleDescription;
+
+public class ExternalAccessUserRoleDetailTest {
+
+       public ExternalAccessUserRoleDetail mockExternalAccessUserRoleDetail(){
+               
+               ExternalRoleDescription externalRoleDescription = new ExternalRoleDescription();
+               externalRoleDescription.setId("test");
+               externalRoleDescription.setName("test");
+               externalRoleDescription.setActive("test");
+               externalRoleDescription.setPriority("test");
+               externalRoleDescription.setAppId("test");
+               externalRoleDescription.setAppRoleId("test");
+                           
+               ExternalAccessUserRoleDetail externalAccessUserRoleDetail = new ExternalAccessUserRoleDetail("test", externalRoleDescription);
+               
+               externalAccessUserRoleDetail.setName("test");
+               externalAccessUserRoleDetail.setDescription(externalRoleDescription);
+               return externalAccessUserRoleDetail;
+       }
+       
+       @Test
+       public void externalAccessUserRoleDetailTest(){
+               ExternalAccessUserRoleDetail externalAccessUserRoleDetail = mockExternalAccessUserRoleDetail();
+               
+               ExternalRoleDescription externalRoleDescription1 = new ExternalRoleDescription();
+               externalRoleDescription1.setId("test");
+               externalRoleDescription1.setName("test");
+               externalRoleDescription1.setActive("test");
+               externalRoleDescription1.setPriority("test");
+               externalRoleDescription1.setAppId("test");
+               externalRoleDescription1.setAppRoleId("test");
+                           
+               ExternalAccessUserRoleDetail externalAccessUserRoleDetail1 = new ExternalAccessUserRoleDetail("test", externalRoleDescription1);
+               
+               assertEquals(externalAccessUserRoleDetail.getName(), externalAccessUserRoleDetail1.getName());
+               assertEquals(externalAccessUserRoleDetail.getDescription(), externalAccessUserRoleDetail1.getDescription());
+               assertEquals(externalAccessUserRoleDetail.hashCode(), externalAccessUserRoleDetail1.hashCode());
+               assertTrue(externalAccessUserRoleDetail.equals(externalAccessUserRoleDetail1));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalAccessUserTest.java
new file mode 100644 (file)
index 0000000..8150405
--- /dev/null
@@ -0,0 +1,61 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalAccessUser;
+
+public class ExternalAccessUserTest {
+
+       public ExternalAccessUser mockExternalAccessUser(){
+               ExternalAccessUser externalAccessUser = new ExternalAccessUser("test", "test");
+               
+               return externalAccessUser;
+       }
+       
+       @Test
+       public void externalAccessUserTest(){
+               ExternalAccessUser externalAccessUser = mockExternalAccessUser();
+               
+               assertEquals(externalAccessUser.getRole(), "test");
+               assertEquals(externalAccessUser.getUser(), "test");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalRoleDescriptionTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/ExternalRoleDescriptionTest.java
new file mode 100644 (file)
index 0000000..616f86a
--- /dev/null
@@ -0,0 +1,72 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.ExternalRoleDescription;
+
+public class ExternalRoleDescriptionTest {
+
+       public ExternalRoleDescription mockExternalRoleDescription(){
+               
+               ExternalRoleDescription externalRoleDescription = new ExternalRoleDescription();
+                           
+           externalRoleDescription.setId("test");
+           externalRoleDescription.setName("test");
+           externalRoleDescription.setActive("test");
+           externalRoleDescription.setPriority("test");
+           externalRoleDescription.setAppId("test");
+           externalRoleDescription.setAppRoleId("test");
+           
+               return externalRoleDescription;
+       }
+       
+       @Test
+       public void externalRoleDescriptionTest(){
+               ExternalRoleDescription externalRoleDescription = mockExternalRoleDescription();
+               
+               assertEquals(externalRoleDescription.getId(), "test");
+               assertEquals(externalRoleDescription.getName(), "test");
+               assertEquals(externalRoleDescription.getActive(), "test");
+               assertEquals(externalRoleDescription.getPriority(), "test");
+               assertEquals(externalRoleDescription.getAppId(), "test");
+               assertEquals(externalRoleDescription.getAppRoleId(), "test");
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/FunctionalMenuItemTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/FunctionalMenuItemTest.java
new file mode 100644 (file)
index 0000000..518c78d
--- /dev/null
@@ -0,0 +1,79 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+
+public class FunctionalMenuItemTest {
+       
+       public FunctionalMenuItem mockFunctionalMenuItem(){
+               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+               
+               List<Integer> roles = new ArrayList<Integer>();
+               
+               functionalMenuItem.setRestrictedApp(false);
+               functionalMenuItem.setUrl("test");
+               functionalMenuItem.setRoles(roles);
+               
+               return functionalMenuItem;
+       }
+       
+       @Test
+       public void functionalMenuItemTest(){
+               FunctionalMenuItem functionalMenuItem = mockFunctionalMenuItem();
+               
+               FunctionalMenuItem functionalMenuItem1 = mockFunctionalMenuItem();
+               
+               List<Integer> roles = new ArrayList<Integer>();
+               
+               functionalMenuItem1.setRestrictedApp(false);
+               functionalMenuItem1.setUrl("test");
+               functionalMenuItem1.setRoles(roles);
+               
+               assertEquals(functionalMenuItem.getRoles(), functionalMenuItem1.getRoles());
+               assertEquals(functionalMenuItem.toString(), "FunctionalMenuItem [menuId=null, column=null, text=null, parentMenuId=null, url=test, active_yn=null, appid=null, roles=[], restrictedApp=false]");
+               // assertTrue(functionalMenuItem.normalize(), functionalMenuItem1.normalize());
+       }
+
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/FunctionalMenuRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/FunctionalMenuRoleTest.java
new file mode 100644 (file)
index 0000000..b48867c
--- /dev/null
@@ -0,0 +1,77 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.FunctionalMenuRole;
+
+public class FunctionalMenuRoleTest {
+
+       public FunctionalMenuRole mockFunctionalMenuRole(){
+               FunctionalMenuRole functionalMenuRole = new FunctionalMenuRole();
+               
+               functionalMenuRole.setId(1);
+               functionalMenuRole.setMenuId((long)1);
+               functionalMenuRole.setAppId(1);
+               functionalMenuRole.setRoleId(1);
+               
+               return functionalMenuRole;
+       }
+       
+       @Test
+       public void functionalMenuRoleTest(){
+               FunctionalMenuRole functionalMenuRole = mockFunctionalMenuRole();
+               
+               FunctionalMenuRole functionalMenuRole1 = new FunctionalMenuRole();
+               functionalMenuRole1.setId(1);
+               functionalMenuRole1.setMenuId((long)1);
+               functionalMenuRole1.setAppId(1);
+               functionalMenuRole1.setRoleId(1);
+                                
+               assertEquals(functionalMenuRole.getId().toString(), "1");
+               assertEquals(functionalMenuRole.getMenuId(), new Long(1));
+               assertEquals(functionalMenuRole.getAppId().toString(), "1");
+               assertEquals(functionalMenuRole.getRoleId().toString(), "1");
+               assertEquals(functionalMenuRole.toString(), "FunctionalMenuRole [id=1, menuId=1, appId=1, roleId=1]");
+               assertTrue(functionalMenuRole.equals(functionalMenuRole1));
+               assertEquals(functionalMenuRole.hashCode(), functionalMenuRole1.hashCode());
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/RemoteUserWithRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/RemoteUserWithRolesTest.java
new file mode 100644 (file)
index 0000000..aa2f48e
--- /dev/null
@@ -0,0 +1,102 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.RemoteRole;
+import org.onap.portalapp.portal.transport.RemoteUserWithRoles;
+
+public class RemoteUserWithRolesTest {
+
+       public RemoteUserWithRoles mockRemoteUserWithRoles(){
+               RemoteUserWithRoles remoteUserWithRoles = new RemoteUserWithRoles();
+               
+               List<RemoteRole> roles = new ArrayList<RemoteRole>();
+               RemoteRole remoteRole = new RemoteRole();
+               remoteRole.setId((long)1);
+               remoteRole.setName("test");
+               roles.add(remoteRole);
+               
+               remoteUserWithRoles.setOrgId((long)1);
+               remoteUserWithRoles.setManagerId((long)1);
+               remoteUserWithRoles.setFirstName("test");
+               remoteUserWithRoles.setMiddleInitial("test");
+               remoteUserWithRoles.setLastName("test");
+               remoteUserWithRoles.setPhone("test");
+               remoteUserWithRoles.setEmail("test");
+               remoteUserWithRoles.setHrid("test");
+               remoteUserWithRoles.setOrgUserId("test");
+               remoteUserWithRoles.setOrgCode("test");
+               remoteUserWithRoles.setOrgManagerUserId("test");
+               remoteUserWithRoles.setJobTitle("test");
+               remoteUserWithRoles.setLoginId("test");
+               remoteUserWithRoles.setActive(false);
+               remoteUserWithRoles.setRoles(roles);
+               
+               return remoteUserWithRoles;
+       }
+       
+       @Test
+       public void remoteUserWithRolesTest(){
+               RemoteUserWithRoles remoteUserWithRoles = mockRemoteUserWithRoles();
+               
+               assertEquals(remoteUserWithRoles.getOrgId(), new Long(1));
+               assertEquals(remoteUserWithRoles.getManagerId(), new Long(1));
+               assertEquals(remoteUserWithRoles.getFirstName(), "test");
+               assertEquals(remoteUserWithRoles.getMiddleInitial(), "test");
+               assertEquals(remoteUserWithRoles.getLastName(), "test");
+               assertEquals(remoteUserWithRoles.getPhone(), "test");
+               assertEquals(remoteUserWithRoles.getEmail(), "test");
+               assertEquals(remoteUserWithRoles.getHrid(), "test");
+               assertEquals(remoteUserWithRoles.getOrgUserId(), "test");
+               assertEquals(remoteUserWithRoles.getOrgCode(), "test");
+               assertEquals(remoteUserWithRoles.getOrgManagerUserId(), "test");
+               assertEquals(remoteUserWithRoles.getJobTitle(), "test");
+               assertEquals(remoteUserWithRoles.getLoginId(), "test");
+               assertEquals(remoteUserWithRoles.getActive(), false);
+               assertEquals(remoteUserWithRoles.getRoles().size(), 1);
+               assertEquals(remoteUserWithRoles.toString(), "RemoteUserWithRoles [orgId=1, managerId=1, firstName=test, middleInitial=test, lastName=test, phone=test, "
+                               + "email=test, hrid=test, orgUserId=test, orgCode=test, orgManagerUserId=test, jobTitle=test, loginId=test, active=false, roles=[RemoteRole [id=1, name=test]]]");
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/RoleInAppForUserTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/RoleInAppForUserTest.java
new file mode 100644 (file)
index 0000000..51d1847
--- /dev/null
@@ -0,0 +1,74 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.RoleInAppForUser;
+
+public class RoleInAppForUserTest {
+
+       public RoleInAppForUser mockRoleInAppForUser(){
+               RoleInAppForUser roleInAppForUser = new RoleInAppForUser((long)1 , "test");
+               roleInAppForUser.setRoleId((long)1);
+               roleInAppForUser.setRoleName("test");
+               roleInAppForUser.setIsApplied(false);
+               
+               return roleInAppForUser;
+       }
+       
+       @Test
+       public void roleInAppForUserTest(){
+               RoleInAppForUser roleInAppForUser = mockRoleInAppForUser();
+               
+               RoleInAppForUser roleInAppForUser1 = new RoleInAppForUser((long)1 , "test");
+               roleInAppForUser1.setRoleId((long)1);
+               roleInAppForUser1.setRoleName("test");
+               roleInAppForUser1.setIsApplied(false);
+               
+               assertEquals(roleInAppForUser.getRoleId(), new Long(1));
+               assertEquals(roleInAppForUser.getRoleName(), "test");
+               assertEquals(roleInAppForUser.getIsApplied(), false);
+               
+               assertEquals(roleInAppForUser.toString(), "RoleInAppForUser [roleId=1, roleName=test, isApplied=false]");
+               assertTrue(roleInAppForUser.equals(roleInAppForUser1));
+               assertEquals(roleInAppForUser.hashCode(), roleInAppForUser1.hashCode());
+               //constructor
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/UserApplicationRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/UserApplicationRolesTest.java
new file mode 100644 (file)
index 0000000..3359626
--- /dev/null
@@ -0,0 +1,95 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.RemoteRole;
+import org.onap.portalapp.portal.transport.UserApplicationRoles;
+
+public class UserApplicationRolesTest {
+
+       public UserApplicationRoles mockUserApplicationRoles(){
+               UserApplicationRoles userApplicationRoles = new UserApplicationRoles();
+               
+               List<RemoteRole> roles = new ArrayList<RemoteRole>();
+               RemoteRole remoteRole = new RemoteRole();
+               remoteRole.setId((long)1);
+               remoteRole.setName("test");
+               roles.add(remoteRole);
+               
+               userApplicationRoles.setAppId((long)1);
+               userApplicationRoles.setOrgUserId("test");
+               userApplicationRoles.setFirstName("test");
+               userApplicationRoles.setLastName("test");
+               userApplicationRoles.setRoles(roles);
+               
+               return userApplicationRoles;
+       }
+       
+       @Test
+       public void userApplicationRolesTest(){
+               UserApplicationRoles userApplicationRoles = mockUserApplicationRoles();
+               
+               UserApplicationRoles userApplicationRoles1 = new UserApplicationRoles();
+               
+               List<RemoteRole> roles = new ArrayList<RemoteRole>();
+               RemoteRole remoteRole = new RemoteRole();
+               remoteRole.setId((long)1);
+               remoteRole.setName("test");
+               roles.add(remoteRole);
+               
+               userApplicationRoles1.setAppId((long)1);
+               userApplicationRoles1.setOrgUserId("test");
+               userApplicationRoles1.setFirstName("test");
+               userApplicationRoles1.setLastName("test");
+               userApplicationRoles1.setRoles(roles);
+               
+               assertEquals(userApplicationRoles.getAppId(), userApplicationRoles1.getAppId());
+               assertEquals(userApplicationRoles.getOrgUserId(), userApplicationRoles1.getOrgUserId());
+               assertEquals(userApplicationRoles.getFirstName(), userApplicationRoles1.getFirstName());
+               assertEquals(userApplicationRoles.getLastName(), userApplicationRoles1.getLastName());
+               assertEquals(userApplicationRoles.getRoles(), userApplicationRoles1.getRoles());
+               
+               
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/UserWithNameSurnameTitleTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/UserWithNameSurnameTitleTest.java
new file mode 100644 (file)
index 0000000..3c8e6ce
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle;
+
+public class UserWithNameSurnameTitleTest {
+
+       @Test
+       public void userWithNameSurnameTitleTest(){
+               
+               UserWithNameSurnameTitle userWithNameSurnameTitle = new UserWithNameSurnameTitle("test", "test", "test", "test");
+               
+               assertEquals(userWithNameSurnameTitle, new UserWithNameSurnameTitle("test", "test", "test", "test"));
+               assertEquals(userWithNameSurnameTitle.hashCode(), new UserWithNameSurnameTitle("test", "test", "test", "test").hashCode());
+               assertTrue(userWithNameSurnameTitle.equals(new UserWithNameSurnameTitle("test", "test", "test", "test")));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/WidgetCatalogPersonalizationTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/transport/WidgetCatalogPersonalizationTest.java
new file mode 100644 (file)
index 0000000..77e9cdb
--- /dev/null
@@ -0,0 +1,62 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.transport.WidgetCatalogPersonalization;
+
+public class WidgetCatalogPersonalizationTest {
+
+       public WidgetCatalogPersonalization mockWidgetCatalogPersonalization(){
+               WidgetCatalogPersonalization widgetCatalogPersonalization = new WidgetCatalogPersonalization();
+               
+               widgetCatalogPersonalization.setWidgetId((long)1);
+               widgetCatalogPersonalization.setSelect(false);
+               return widgetCatalogPersonalization;
+       }
+       
+       @Test
+       public void widgetCatalogPersonalizationTest(){
+               WidgetCatalogPersonalization widgetCatalogPersonalization = mockWidgetCatalogPersonalization();
+               
+               assertEquals(widgetCatalogPersonalization.getWidgetId(), new Long(1));
+               assertEquals(widgetCatalogPersonalization.getSelect(), false);
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java
new file mode 100644 (file)
index 0000000..efc1dab
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+
+public class EcompPortalUtilsTest {
+
+       @Test
+       public void legitimateAttuidSuccessTest() {
+               assertEquals(true, EcompPortalUtils.legitimateUserId("mm016f"));
+       }
+
+       @Test
+       public void legitimateAttuidFailureTest() {
+               assertEquals(false, EcompPortalUtils.legitimateUserId("1#@23456"));
+       }
+}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/command/EPLoginBeanTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/command/EPLoginBeanTest.java
deleted file mode 100644 (file)
index e540bd8..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.command;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Test;
-import org.openecomp.portalapp.command.EPLoginBean;
-
-public class EPLoginBeanTest {
-
-       
-public EPLoginBean ePLoginBean(){
-               
-       EPLoginBean ePLoginBean = new EPLoginBean();
-       ePLoginBean.setLoginId("guestT");
-       ePLoginBean.setLoginPwd("password");
-       ePLoginBean.setHrid("hrId");
-       ePLoginBean.setOrgUserId("guestT");
-       ePLoginBean.setBusinessDirectMenu(null);
-       ePLoginBean.setSiteAccess("site_test");
-       ePLoginBean.setLoginErrorMessage("error");
-       ePLoginBean.setUser(null);
-       ePLoginBean.setMenu(null);
-       return ePLoginBean;
-       }
-       
-       @Test
-       public void ePLoginBeanTest(){
-               EPLoginBean ePLoginBean = ePLoginBean();
-               
-               assertEquals(ePLoginBean.getLoginId(), "guestT");
-               assertEquals(ePLoginBean.getLoginPwd(), "password");
-               assertEquals(ePLoginBean.getHrid(), "hrId");
-               assertEquals(ePLoginBean.getOrgUserId(), "guestT");
-               assertNull(ePLoginBean.getBusinessDirectMenu());
-               assertEquals(ePLoginBean.getSiteAccess(), "site_test");
-               assertEquals(ePLoginBean.getLoginErrorMessage(), "error");
-               assertNull(ePLoginBean.getUser());
-               assertNull(ePLoginBean.getMenu());
-
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/command/PostSearchBeanTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/command/PostSearchBeanTest.java
deleted file mode 100644 (file)
index 324d91d..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.command;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public class PostSearchBeanTest {
-
-       @InjectMocks
-       PostSearchBean mockPostSearchBean = new PostSearchBean();
-       
-     MockEPUser mockUser = new MockEPUser();
-    public PostSearchBean mockPostSearchBean(){
-       
-       PostSearchBean postSearchBean = new PostSearchBean();
-       EPUser user = mockUser.mockEPUser();
-       postSearchBean.setUser(user);
-       postSearchBean.setUserOrig(null);
-       postSearchBean.setSelected(null);
-       postSearchBean.setHrid(null);
-       postSearchBean.setPostUserId(null);
-       postSearchBean.setPostFirstName(null);
-       postSearchBean.setPostLastName(null);
-       postSearchBean.setPostOrgCode(null);
-       postSearchBean.setPostPhone(null);
-       postSearchBean.setPostEmail(null);
-       postSearchBean.setPostAddress1(null);
-       postSearchBean.setPostAddress2(null);
-       postSearchBean.setPostCity(null);
-       postSearchBean.setPostState(null);
-       postSearchBean.setPostZipCode(null);
-       postSearchBean.setPostLocationClli(null);
-       postSearchBean.setPostBusinessCountryCode(null);
-       postSearchBean.setPostBusinessCountryName(null);
-       postSearchBean.setPostDepartment(null);
-       postSearchBean.setPostDepartmentName(null);
-       postSearchBean.setPostBusinessUnit(null);
-       postSearchBean.setPostBusinessUnitName(null);
-       postSearchBean.setPostJobTitle(null);
-       postSearchBean.setOrgManagerUserId(null);
-       postSearchBean.setPostCommandChain(null);
-       postSearchBean.setPostCompanyCode(null);
-       postSearchBean.setPostCostCenter(null);
-       postSearchBean.setPostSiloStatus(null);
-       postSearchBean.setPostFinancialLocCode(null);
-       postSearchBean.setPostManagerUserId(null);
-       return postSearchBean;
-       }
-    
-        @Test
-        public void postSearchBeanTest()
-        {
-        PostSearchBean postSearchBean = mockPostSearchBean();
-        EPUser user = mockUser.mockEPUser();
-        assertEquals(postSearchBean.getUser().getActive(), user.getActive());
-        assertNull(postSearchBean.getUserOrig());
-        assertNull(postSearchBean.getSelected());
-        assertNull(postSearchBean.getHrid());
-        assertNull(postSearchBean.getPostOrgUserId());
-        assertNull(postSearchBean.getPostFirstName());
-        assertNull(postSearchBean.getPostLastName());
-        assertNull(postSearchBean.getPostOrgCode());
-        assertNull(postSearchBean.getPostPhone());
-        assertNull(postSearchBean.getPostEmail());
-        assertNull(postSearchBean.getPostAddress1());
-        assertNull(postSearchBean.getPostAddress2());
-        assertNull(postSearchBean.getPostCity());
-        assertNull(postSearchBean.getPostState());
-        assertNull(postSearchBean.getPostZipCode());
-        assertNull(postSearchBean.getPostLocationClli());
-        assertNull(postSearchBean.getPostBusinessCountryCode());
-        assertNull(postSearchBean.getPostBusinessCountryName());
-        assertNull(postSearchBean.getPostDepartment());
-        assertNull(postSearchBean.getPostDepartmentName());
-        assertNull(postSearchBean.getPostBusinessUnit());
-        assertNull(postSearchBean.getPostBusinessUnitName());
-        assertNull(postSearchBean.getPostJobTitle());
-        assertNull(postSearchBean.getOrgManagerUserId());
-        assertNull(postSearchBean.getPostCommandChain());
-        assertNull(postSearchBean.getPostCompanyCode());
-        assertNull(postSearchBean.getPostCostCenter());
-        assertNull(postSearchBean.getPostSiloStatus());
-        assertNull(postSearchBean.getPostFinancialLocCode());
-        assertNull(postSearchBean.getPostManagerUserId());
- }
-        
-        @Test
-        public void isCriteriaUpdatedIfUserNotNullTest()
-        {
-                assertFalse(mockPostSearchBean.isCriteriaUpdated());
-        }
-        
-        @Test
-        public void isCriteriaUpdatedIfUserNullTest()
-        {
-                mockPostSearchBean.setUser(null);
-                assertTrue(mockPostSearchBean.isCriteriaUpdated());
-        }
-        
-        
-        @Test
-        public void isCriteriaUpdatedIfUserTest()
-        {
-                mockPostSearchBean.setUser(null);
-                mockPostSearchBean.setUserOrig(null);
-                assertFalse(mockPostSearchBean.isCriteriaUpdated());
-        }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/config/NotificationCleanupTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/config/NotificationCleanupTest.java
deleted file mode 100644 (file)
index 0cd82ae..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.service.UserNotificationServiceImpl;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.context.ApplicationContext;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(NotificationCleanupConfig.class)
-public class NotificationCleanupTest {
-
-       @InjectMocks
-       NotificationCleanup notificationCleanup = new NotificationCleanup();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @Mock
-       UserNotificationService userNotificationService = new UserNotificationServiceImpl();
-       @Mock
-       ApplicationContext applicationContext;
-
-       @Test
-       public void runTest() {
-               PowerMockito.mockStatic(NotificationCleanupConfig.class);
-               Mockito.when(NotificationCleanupConfig.getApplicationContext()).thenReturn(applicationContext);
-               Mockito.when((applicationContext).getBean(UserNotificationService.class)).thenReturn(userNotificationService);
-               Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpUserNotificationTable();
-               Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpRoleNotificationTable();
-
-               Mockito.doNothing().when(userNotificationService).deleteNotificationsFromEpNotificationTable();
-               notificationCleanup.run();
-
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/config/PortalCentralAccessConfigurationTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/config/PortalCentralAccessConfigurationTest.java
deleted file mode 100644 (file)
index d58beac..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.config;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceImpl;
-
-public class PortalCentralAccessConfigurationTest {
-       
-       @InjectMocks
-       PortalCentralAccessConfiguration portalCentralAccessConfiguration = new PortalCentralAccessConfiguration();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-       @Mock
-       EPRoleFunctionService  ePRoleFunctionServiceImpl  = new EPRoleFunctionServiceImpl();
-       
-       @Mock
-       EPRoleFunctionService  ePRoleFunctionServiceCentralizedImpl = new EPRoleFunctionServiceCentralizedImpl();
-
-           @Test
-               public void ePRoleFunctionServiceImplTest()
-               {
-           EPRoleFunctionService  expectedPRoleFunctionServiceImpl  =   portalCentralAccessConfiguration.ePRoleFunctionServiceImpl();
-           assertEquals(expectedPRoleFunctionServiceImpl.getClass(), EPRoleFunctionServiceImpl.class);
-               }
-           
-           @Test
-               public void ePRoleFunctionServiceCentralImplTest()
-               {
-           EPRoleFunctionService  expectedPRoleFunctionServiceImpl  =   portalCentralAccessConfiguration.ePRoleFunctionServiceCentralizedImpl();
-           assertEquals(expectedPRoleFunctionServiceImpl.getClass(), EPRoleFunctionServiceCentralizedImpl.class);
-               }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppCatalogControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppCatalogControllerTest.java
deleted file mode 100644 (file)
index a04c1b0..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.AppCatalogController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppCommonServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppServiceImpl;
-import org.openecomp.portalapp.portal.transport.AppCatalogPersonalization;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator.FieldName;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-public class AppCatalogControllerTest extends MockitoTestSuite {
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
-       @Mock
-       EPAppService appService = new EPAppCommonServiceImpl();
-
-       @InjectMocks
-       AppCatalogController appCatalogController = new AppCatalogController();
-
-       PersUserAppService persUserAppService = Mockito.spy(new PersUserAppServiceImpl());
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       @Mock
-       EPUser epuser;
-
-       NullPointerException nullPointerException = new NullPointerException();
-
-       MockEPUser mockUser = new MockEPUser();
-
-       public AppCatalogItem mockAppCatalogItem() {
-               AppCatalogItem appCatalogItem = new AppCatalogItem();
-               appCatalogItem.setId((long) 1);
-               appCatalogItem.setName("Ecomp Portal");
-               appCatalogItem.setImageUrl("Test_URL");
-               appCatalogItem.setDescription("Testing");
-               appCatalogItem.setNotes("Test");
-               appCatalogItem.setUrl("test");
-               appCatalogItem.setAlternateUrl("test");
-               appCatalogItem.setRestricted(false);
-               appCatalogItem.setOpen(false);
-               appCatalogItem.setAccess(true);
-               appCatalogItem.setSelect(true);
-               appCatalogItem.setPending(false);
-
-               return appCatalogItem;
-       }
-
-       @Test
-       public void getAppCatalogTestIfUserNotAdmin() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppCatalogItem> actualAppCatalogList = null;
-
-               List<AppCatalogItem> expectedAppCatalog = new ArrayList<>();
-
-               AppCatalogItem appCatalogItem = mockAppCatalogItem();
-               expectedAppCatalog.add(appCatalogItem);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(appService.getUserAppCatalog(user)).thenReturn(expectedAppCatalog);
-               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
-
-               assertTrue(actualAppCatalogList.contains(appCatalogItem));
-
-       }
-
-       @Test
-       public void getAppCatalogTestIfUserIsAdmin() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppCatalogItem> actualAppCatalogList = null;
-
-               List<AppCatalogItem> expectedAppCatalog = new ArrayList<>();
-
-               AppCatalogItem appCatalogItem = mockAppCatalogItem();
-
-               expectedAppCatalog.add(appCatalogItem);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAdminAppCatalog(user)).thenReturn(expectedAppCatalog);
-               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
-
-               assertTrue(actualAppCatalogList.contains(appCatalogItem));
-
-       }
-
-       @Test
-       public void getAppCatalogTestIfUserisNull() throws IOException {
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
-               List<AppCatalogItem> actualAppCatalogList = new ArrayList<>();
-               ;
-               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
-               assertNull(actualAppCatalogList);
-
-       }
-
-       @Test
-       public void getAppCatalogTestIfUserThrowsExceptionTest() throws IOException {
-               EPUser user = new EPUser();
-               user.setFirstName("test");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppCatalogItem> actualAppCatalogList = new ArrayList<>();
-               ;
-
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-
-               Mockito.when(appCatalogController.getAppCatalog(mockedRequest, mockedResponse)).thenThrow(nullPointerException);
-
-               actualAppCatalogList = appCatalogController.getAppCatalog(mockedRequest, mockedResponse);
-               assertNull(actualAppCatalogList);
-
-       }
-
-       @Test
-       public void putAppCatalogSelectionTestWhenAppIsNull() throws IOException {
-
-               AppCatalogPersonalization persRequest = new AppCatalogPersonalization();
-               persRequest.setAppId((long) 1);
-               persRequest.setPending(false);
-               persRequest.setSelect(false);
-
-               EPUser user = mockUser.mockEPUser();
-
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               ;
-
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(fields);
-               expectedFieldValidator.setErrorCode(null);
-
-               EPApp app = null;
-
-               Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app);
-
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               actualFieldValidator = appCatalogController.putAppCatalogSelection(mockedRequest, persRequest, mockedResponse);
-               assertEquals(expectedFieldValidator, actualFieldValidator);
-
-       }
-
-       @Test
-       public void putAppCatalogSelectionTest() throws IOException {
-
-               AppCatalogPersonalization persRequest = new AppCatalogPersonalization();
-               persRequest.setAppId((long) 1);
-               persRequest.setPending(false);
-               persRequest.setSelect(false);
-
-               EPUser user = mockUser.mockEPUser();
-
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               ;
-
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(fields);
-               expectedFieldValidator.setErrorCode(null);
-
-               EPApp app = new EPApp();
-
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(false);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-
-               Mockito.when(appService.getApp(persRequest.getAppId())).thenReturn(app);
-
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.doNothing().when(persUserAppService).setPersUserAppValue(user, app, persRequest.getSelect(),
-                               persRequest.getPending());
-
-               actualFieldValidator = appCatalogController.putAppCatalogSelection(mockedRequest, persRequest, mockedResponse);
-
-               assertEquals(expectedFieldValidator, actualFieldValidator);
-
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppContactUsControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppContactUsControllerTest.java
deleted file mode 100644 (file)
index 487b116..0000000
+++ /dev/null
@@ -1,338 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.AppContactUsController;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AppContactUsService;
-import org.openecomp.portalapp.portal.service.AppContactUsServiceImpl;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class, EPCommonSystemProperties.class})
-public class AppContactUsControllerTest extends MockitoTestSuite{
-
-       @Mock
-       AppContactUsService contactUsService = new AppContactUsServiceImpl();
-
-       @InjectMocks
-       AppContactUsController appContactUsController = new AppContactUsController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       public List<AppContactUsItem> mockResponse() {
-               List<AppContactUsItem> appContactUsItemList = new ArrayList<AppContactUsItem>();
-               AppContactUsItem appContactUsItem = new AppContactUsItem();
-               appContactUsItem.setAppId((long) 1);
-               appContactUsItem.setAppName("ECOMP Portal");
-               appContactUsItem.setDescription("Test");
-               appContactUsItem.setContactName("Test");
-               appContactUsItem.setContactEmail("person@onap.org");
-               appContactUsItem.setUrl("Test_URL");
-               appContactUsItem.setActiveYN("Y");
-               appContactUsItemList.add(appContactUsItem);
-
-               return appContactUsItemList;
-
-       }
-
-       public PortalRestResponse<List<AppContactUsItem>> successPortalRestResponse() {
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
-               List<AppContactUsItem> appContactUsItemList = mockResponse();
-               expectedportalRestResponse.setMessage("success");
-               expectedportalRestResponse.setResponse(appContactUsItemList);
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               return expectedportalRestResponse;
-
-       }
-
-       public PortalRestResponse<List<AppContactUsItem>> exceptionPortalRestResponse() {
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse(null);
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               return expectedportalRestResponse;
-
-       }
-
-       @Test
-       public void getAppContactUsList() throws Exception {
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = successPortalRestResponse();
-               List<AppContactUsItem> appContactUsItemList = mockResponse();
-               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
-               Mockito.when(contactUsService.getAppContactUs()).thenReturn(appContactUsItemList);
-               actualPortalRestResponse = appContactUsController.getAppContactUsList(mockedRequest);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void getAppContactUsListCatchesExeptionTest() throws Exception {
-
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
-               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
-               Mockito.when(contactUsService.getAppContactUs()).thenThrow(nullPointerException);
-               actualPortalRestResponse = appContactUsController.getAppContactUsList(mockedRequest);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void getAppsAndContactsTest() throws Exception {
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = successPortalRestResponse();
-               List<AppContactUsItem> appContactUsItemList = mockResponse();
-               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
-               Mockito.when(contactUsService.getAppsAndContacts()).thenReturn(appContactUsItemList);
-               actualPortalRestResponse = appContactUsController.getAppsAndContacts(mockedRequest);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
-       }
-
-       @Test
-       public void getAppsAndContactsCatchesExceptionTest() throws Exception {
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
-               PortalRestResponse<List<AppContactUsItem>> actualPortalRestResponse = new PortalRestResponse<List<AppContactUsItem>>();
-               Mockito.when(contactUsService.getAppsAndContacts()).thenThrow(nullPointerException);
-               actualPortalRestResponse = appContactUsController.getAppsAndContacts(mockedRequest);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
-       }
-
-       @Test
-       public void getAppCategoryFunctionsTest() throws Exception {
-               PortalRestResponse<List<AppCategoryFunctionsItem>> actualportalRestResponse = null;
-
-               List<AppCategoryFunctionsItem> contents = new ArrayList<AppCategoryFunctionsItem>();
-
-               AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem();
-               AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem();
-
-               appCategoryFunctionsItem.setRowId("1");
-               appCategoryFunctionsItem.setAppId("1");
-               appCategoryFunctionsItem.setApplication("Ecomp-portal");
-               appCategoryFunctionsItem.setCategory("test");
-               appCategoryFunctionsItem.setFunctions("test");
-
-               appCategoryFunctionsItem1.setRowId("2");
-               appCategoryFunctionsItem1.setAppId("2");
-               appCategoryFunctionsItem1.setApplication("Ecomp-portal-test");
-               appCategoryFunctionsItem1.setCategory("test");
-               appCategoryFunctionsItem1.setFunctions("test");
-               contents.add(appCategoryFunctionsItem);
-               contents.add(appCategoryFunctionsItem1);
-
-               PortalRestResponse<List<AppCategoryFunctionsItem>> expectedportalRestResponse = new PortalRestResponse<List<AppCategoryFunctionsItem>>();
-               expectedportalRestResponse.setMessage("success");
-               expectedportalRestResponse.setResponse(contents);
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
-
-               Mockito.when(contactUsService.getAppCategoryFunctions()).thenReturn(contents);
-               actualportalRestResponse = appContactUsController.getAppCategoryFunctions(mockedRequest);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-
-       }
-
-       @Test
-       public void getAppCategoryFunctionsCatchesExceptionTest() throws Exception {
-               PortalRestResponse<List<AppCategoryFunctionsItem>> actualportalRestResponse = null;
-               PortalRestResponse<List<AppContactUsItem>> expectedportalRestResponse = exceptionPortalRestResponse();
-               Mockito.when(contactUsService.getAppCategoryFunctions()).thenThrow(nullPointerException);
-               actualportalRestResponse = appContactUsController.getAppCategoryFunctions(mockedRequest);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-
-       }
-
-       @Test
-       public void saveTest() throws Exception {
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-
-               AppContactUsItem contactUs = new AppContactUsItem();
-               contactUs.setAppId((long) 1);
-               contactUs.setAppName("Ecomp Portal");
-               contactUs.setDescription("Test");
-               contactUs.setContactName("Test");
-               contactUs.setContactEmail("person@onap.org");
-               contactUs.setUrl("Test_URL");
-               contactUs.setActiveYN("Y");
-
-               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenReturn("SUCCESS");
-               actualSaveAppContactUS = appContactUsController.save(contactUs);
-               assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
-       }
-
-       @Test
-       public void saveExceptionTest() throws Exception {
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-
-               AppContactUsItem contactUs = new AppContactUsItem();
-               contactUs.setAppId((long) 1);
-               contactUs.setAppName("Ecomp Portal");
-               contactUs.setDescription("Test");
-               contactUs.setContactName("Test");
-               contactUs.setContactEmail("person@onap.org");
-               contactUs.setUrl("Test_URL");
-               contactUs.setActiveYN("Y");
-
-               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenThrow(new Exception());
-               actualSaveAppContactUS = appContactUsController.save(contactUs);
-               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
-       }
-
-       @Test
-       public void saveWhenAppContactUsItemNullTest() throws Exception {
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-               AppContactUsItem contactUs = null;
-               actualSaveAppContactUS = appContactUsController.save(contactUs);
-               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
-
-       }
-
-       @Test
-       public void saveAllTest() throws Exception {
-
-               List<AppContactUsItem> contactUs = mockResponse();
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenReturn("SUCCESS");
-               actualSaveAppContactUS = appContactUsController.save(contactUs);
-               assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
-       }
-
-       @Test
-       public void saveAllExceptionTest() throws Exception {
-
-               List<AppContactUsItem> contactUs = mockResponse();
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-               Mockito.when(contactUsService.saveAppContactUs(contactUs)).thenThrow(new Exception());
-               actualSaveAppContactUS = appContactUsController.save(contactUs);
-               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
-       }
-
-       @Test
-       public void deleteTest() throws Exception {
-
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-               Long id = (long) 1;
-               String saveAppContactUs = "SUCCESS";
-               Mockito.when(contactUsService.deleteContactUs(id)).thenReturn(saveAppContactUs);
-               actualSaveAppContactUS = appContactUsController.delete(id);
-               assertEquals(actualSaveAppContactUS.getMessage(), "SUCCESS");
-       }
-
-       @Test
-       public void deleteExceptionTest() throws Exception {
-
-               PortalRestResponse<String> actualSaveAppContactUS = null;
-               Long id = (long) 1;
-               Mockito.when(contactUsService.deleteContactUs(id)).thenThrow(new Exception());
-               actualSaveAppContactUS = appContactUsController.delete(id);
-               assertEquals(actualSaveAppContactUS.getMessage(), "failure");
-       }
-
-       @Test
-       public void getPortalDetailsTest(){
-               PortalRestResponse<String> actualResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setStatus(PortalRestStatusEnum.OK);
-               expectedResponse.setMessage("success");
-               expectedResponse.setResponse("\"ush_ticket_url\":\"http://todo_enter_ush_ticket_url\",\"portal_info_url\":\"https://todo_enter_portal_info_url\",\"feedback_email_address\":\"portal@lists.openecomp.org\"");
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL)).thenReturn("http://todo_enter_ush_ticket_url"); 
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL)).thenReturn("https://todo_enter_portal_info_url"); 
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS)).thenReturn("portal@lists.openecomp.org"); 
-               
-               actualResponse = appContactUsController.getPortalDetails(mockedRequest);
-               assertTrue(actualResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
-       }
-       
-       @Test
-       public void getPortalDetailsExceptionTest(){
-               PortalRestResponse<String> actualResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setStatus(PortalRestStatusEnum.ERROR);
-               expectedResponse.setMessage("failure");
-               expectedResponse.setResponse(null);
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USH_TICKET_URL)).thenThrow(nullPointerException); 
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.PORTAL_INFO_URL)).thenReturn("https://todo_enter_portal_info_url"); 
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.FEEDBACK_EMAIL_ADDRESS)).thenReturn("portal@lists.openecomp.org"); 
-               
-               actualResponse = appContactUsController.getPortalDetails(mockedRequest);
-               assertEquals(actualResponse, expectedResponse);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppsControllerExternalRequestTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppsControllerExternalRequestTest.java
deleted file mode 100644 (file)
index a979a5b..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.AppsControllerExternalRequest;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.service.UserServiceImpl;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class AppsControllerExternalRequestTest extends MockitoTestSuite {
-
-       @Mock
-       AdminRolesService adminRolesService;
-
-       @Mock
-       EPAppService appService;
-
-       @Mock
-       PortalAdminService portalAdminService;
-
-       @Mock
-       UserService userService = new UserServiceImpl();
-
-       @InjectMocks
-       AppsControllerExternalRequest appsControllerExternalRequest = new AppsControllerExternalRequest();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       MockEPUser mockUser = new MockEPUser();
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       @Test
-       public void postPortalAdminIfUSerNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Missing required field: email, loginId, or loginPwd");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("guestT@test.portal.onap.org");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postPortalAdmin(mockedRequest, mockedResponse, user);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void postPortalAdminTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("java.lang.NullPointerException");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("guestT@test.portal.onap.org");
-               user.setLoginPwd("pwd");
-               user.setLoginId("Test");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenThrow(nullPointerException);
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postPortalAdmin(mockedRequest, mockedResponse, user);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void postPortalAdminCreateUserIfNotFoundTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("guestT@test.portal.onap.org");
-               user.setLoginPwd("pwd");
-               user.setLoginId("Test");
-               List<EPUser> expectedList = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
-               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postPortalAdmin(mockedRequest, mockedResponse, user);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void postPortalAdminCreateUserIfFoundTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("guestT@test.portal.onap.org");
-               user.setLoginPwd("pwd");
-               user.setLoginId("Test");
-               List<EPUser> expectedList = new ArrayList<EPUser>();
-               expectedList.add(user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
-               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postPortalAdmin(mockedRequest, mockedResponse, user);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void postPortalAdminCreateUserIfNotSuperAdminTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("guestT@test.portal.onap.org");
-               user.setLoginPwd("pwd");
-               user.setLoginId("Test");
-               List<EPUser> expectedList = new ArrayList<EPUser>();
-               expectedList.add(user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
-               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               Mockito.when(portalAdminService.createPortalAdmin(user.getOrgUserId())).thenReturn(expectedFieldValidator);
-
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postPortalAdmin(mockedRequest, mockedResponse, user);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void postPortalAdminCreateUserIfFieldValidatorErrorTest() throws Exception {
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 500);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("FieldsValidator [httpStatusCode=500, errorCode=null, fields=null]");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("guestT@test.portal.onap.org");
-               user.setLoginPwd("pwd");
-               user.setLoginId("Test");
-               List<EPUser> expectedList = new ArrayList<EPUser>();
-               expectedList.add(user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(userService.getUserByUserId(user.getOrgUserId())).thenReturn(expectedList);
-               Mockito.when(userService.saveNewUser(user, "Yes")).thenReturn(null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(portalAdminService.createPortalAdmin(user.getOrgUserId())).thenReturn(expectedFieldValidator);
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postPortalAdmin(mockedRequest, mockedResponse, user);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void getOnboardAppExternalTest() {
-               EPApp epApp = new EPApp();
-               Long appId = (long) 1;
-               Mockito.when(appService.getApp(appId)).thenReturn(epApp);
-               OnboardingApp expectedApp = new OnboardingApp();
-               Mockito.doNothing().when(appService).createOnboardingFromApp(epApp, expectedApp);
-               OnboardingApp actualApp = appsControllerExternalRequest.getOnboardAppExternal(mockedRequest, mockedResponse,
-                               appId);
-               assertEquals(expectedApp.getClass(), actualApp.getClass());
-       }
-
-       @Test
-       public void postOnboardAppExternalExceptionTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Unexpected field: id");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-
-               OnboardingApp expectedOnboardingApp = new OnboardingApp();
-               expectedOnboardingApp.id = (long) 1;
-
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void postOnboardAppExternalTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(
-                               "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-
-               OnboardingApp expectedOnboardingApp = new OnboardingApp();
-               expectedOnboardingApp.id = null;
-
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .postOnboardAppExternal(mockedRequest, mockedResponse, expectedOnboardingApp);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-
-       }
-
-       @Test
-       public void putOnboardAppExternalifAppNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Unexpected value for field: id");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               Long appId = null;
-               OnboardingApp expectedOnboardingApp = new OnboardingApp();
-               expectedOnboardingApp.id = null;
-
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void putOnboardAppExternalIfOnboardingAppDetailsNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(
-                               "Missing required field: name, url, restUrl, restrictedApp, isOpen, isEnabled, myLoginsAppOwner");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               Long appId = (long) 1;
-               OnboardingApp expectedOnboardingApp = new OnboardingApp();
-               expectedOnboardingApp.id = (long) 1;
-               PortalRestResponse<String> actualPortalRestResponse = appsControllerExternalRequest
-                               .putOnboardAppExternal(mockedRequest, mockedResponse, appId, expectedOnboardingApp);
-               assertEquals(actualPortalRestResponse, expectedportalRestResponse);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppsControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AppsControllerTest.java
deleted file mode 100644 (file)
index e5c30ed..0000000
+++ /dev/null
@@ -1,951 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.AppsController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
-import org.openecomp.portalapp.portal.domain.AppsResponse;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.domain.UserRole;
-import org.openecomp.portalapp.portal.domain.UserRoles;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppCommonServiceImpl;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.EPLeftMenuService;
-import org.openecomp.portalapp.portal.service.EPLeftMenuServiceImpl;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.LocalRole;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
-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.MediaType;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class,AppUtils.class, EPUserUtils.class, MediaType.class})
-public class AppsControllerTest extends MockitoTestSuite{
-
-       @InjectMocks
-       AppsController appsController = new AppsController();
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
-       @Mock
-       EPAppService appService = new EPAppCommonServiceImpl();
-
-       @Mock
-       EPLeftMenuService leftMenuService = new EPLeftMenuServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       @Mock
-       AppUtils appUtils = new AppUtils();
-
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void getUserAppsTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
-               EcompApp ecompApp = new EcompApp();
-               ecompApp.setId((long) 1);
-               ecompApp.setName("Test_app");
-               ecompApp.setUrl("Test_URL");
-               ecompApp.setUebKey("Test_key");
-               ecompApp.setAlternateUrl("Test_alt_URL");
-               expectedEcompApps.add(ecompApp);
-               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
-               Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenReturn(expectedEcompApps);
-               actualEcompApps = appsController.getUserApps(mockedRequest, mockedResponse);
-               assertEquals(expectedEcompApps, actualEcompApps);
-       }
-
-       @Test
-       public void getUserAppsNoUserTest() {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenReturn(null);
-               assertNull(appsController.getUserApps(mockedRequest, mockedResponse));
-
-       }
-
-       @Test
-       public void getUserAppsExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(appService.transformAppsToEcompApps(appService.getUserApps(user))).thenThrow(nullPointerException);
-               assertNull(appsController.getUserApps(mockedRequest, mockedResponse));
-
-       }
-
-       @Test
-       public void getPersUserAppsIfUserIsAdminTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
-               EcompApp ecompApp = new EcompApp();
-               ecompApp.setId((long) 1);
-               ecompApp.setName("Test_app");
-               ecompApp.setUrl("Test_URL");
-               ecompApp.setUebKey("Test_key");
-               ecompApp.setAlternateUrl("Test_alt_URL");
-               expectedEcompApps.add(ecompApp);
-               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
-
-               List<EPApp> expectedApps = new ArrayList<EPApp>();
-
-               EPApp app = new EPApp();
-
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(false);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-
-               expectedApps.add(app);
-
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getPersAdminApps(user)).thenReturn(expectedApps);
-
-               Mockito.when(appService.transformAppsToEcompApps(expectedApps)).thenReturn(expectedEcompApps);
-               actualEcompApps = appsController.getPersUserApps(mockedRequest, mockedResponse);
-               assertEquals(expectedEcompApps, actualEcompApps);
-       }
-
-       @Test
-       public void getPersUserAppsIfUserNotAdminTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
-               EcompApp ecompApp = new EcompApp();
-               ecompApp.setId((long) 1);
-               ecompApp.setName("Test_app");
-               ecompApp.setUrl("Test_URL");
-               ecompApp.setUebKey("Test_key");
-               ecompApp.setAlternateUrl("Test_alt_URL");
-               expectedEcompApps.add(ecompApp);
-               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
-
-               List<EPApp> expectedApps = new ArrayList<EPApp>();
-
-               EPApp app = new EPApp();
-
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(false);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-
-               expectedApps.add(app);
-
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(appService.getPersUserApps(user)).thenReturn(expectedApps);
-               Mockito.when(appService.transformAppsToEcompApps(expectedApps)).thenReturn(expectedEcompApps);
-               actualEcompApps = appsController.getPersUserApps(mockedRequest, mockedResponse);
-               assertEquals(expectedEcompApps, actualEcompApps);
-       }
-
-       @Test
-       public void getPersUserAppsIfUserNullTest() throws IOException {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               assertNull(appsController.getPersUserApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getPersUserAppsExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getPersAdminApps(user)).thenThrow(nullPointerException);
-               assertNull(appsController.getPersUserApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAdminAppsIfNotAdminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               assertNull(appsController.getAdminApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAdminAppsTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppIdAndNameTransportModel> expectedAdminApps = new ArrayList<AppIdAndNameTransportModel>();
-               AppIdAndNameTransportModel appIdAndNameTransportModel = new AppIdAndNameTransportModel();
-               appIdAndNameTransportModel.setId((long) 1);
-               appIdAndNameTransportModel.setName("Test_app");
-               expectedAdminApps.add(appIdAndNameTransportModel);
-               List<AppIdAndNameTransportModel> actualAdminApps = new ArrayList<AppIdAndNameTransportModel>();
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAdminApps(user)).thenReturn(expectedAdminApps);
-               actualAdminApps = appsController.getAdminApps(mockedRequest, mockedResponse);
-               assertEquals(actualAdminApps, expectedAdminApps);
-
-       }
-
-       @Test
-       public void getAdminAppsExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAdminApps(user)).thenThrow(nullPointerException);
-               assertNull(appsController.getAdminApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsForSuperAdminAndAccountAdminifOnlyAccountAdminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               assertNull(appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsForSuperAdminAndAccountAdminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppIdAndNameTransportModel> expectedAdminApps = new ArrayList<AppIdAndNameTransportModel>();
-               AppIdAndNameTransportModel appIdAndNameTransportModel = new AppIdAndNameTransportModel();
-               appIdAndNameTransportModel.setId((long) 1);
-               appIdAndNameTransportModel.setName("Test_app");
-               expectedAdminApps.add(appIdAndNameTransportModel);
-               List<AppIdAndNameTransportModel> actualAdminApps = new ArrayList<AppIdAndNameTransportModel>();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAppsForSuperAdminAndAccountAdmin(user)).thenReturn(expectedAdminApps);
-               actualAdminApps = appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse);
-               assertEquals(actualAdminApps, expectedAdminApps);
-
-       }
-
-       @Test
-       public void getAppsForSuperAdminExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               Mockito.when(appService.getAppsForSuperAdminAndAccountAdmin(user)).thenThrow(nullPointerException);
-               assertNull(appsController.getAppsForSuperAdminAndAccountAdmin(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void putUserAppsSortingManualTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenReturn(expectedFieldValidator);
-               actualFieldValidator = appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference,
-                               mockedResponse);
-               assertEquals(actualFieldValidator, expectedFieldValidator);
-       }
-
-       @Test
-       public void putUserAppsSortingManualExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
-               Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenThrow(nullPointerException);
-               assertNull(appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference, mockedResponse));
-       }
-
-       @Test
-       public void putUserWidgetsSortManualTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Mockito.when(appService.saveWidgetsSortManual(ePWidgetsSortPreference, user))
-                               .thenReturn(expectedFieldValidator);
-               actualFieldValidator = appsController.putUserWidgetsSortManual(mockedRequest, ePWidgetsSortPreference,
-                               mockedResponse);
-               assertEquals(actualFieldValidator, expectedFieldValidator);
-       }
-
-       @Test
-       public void putUserWidgetsSortManualExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPAppsManualPreference> ePAppsManualPreference = new ArrayList<EPAppsManualPreference>();
-               Mockito.when(appService.saveAppsSortManual(ePAppsManualPreference, user)).thenThrow(nullPointerException);
-               assertNull(appsController.putUserAppsSortingManual(mockedRequest, ePAppsManualPreference, mockedResponse));
-       }
-
-       @Test
-       public void putUserWidgetsSortPrefTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Mockito.when(appService.deleteUserWidgetSortPref(ePWidgetsSortPreference, user))
-                               .thenReturn(expectedFieldValidator);
-               actualFieldValidator = appsController.putUserWidgetsSortPref(mockedRequest, ePWidgetsSortPreference,
-                               mockedResponse);
-               assertEquals(actualFieldValidator, expectedFieldValidator);
-       }
-
-       @Test
-       public void putUserWidgetsSortPrefExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPWidgetsSortPreference> ePWidgetsSortPreference = new ArrayList<EPWidgetsSortPreference>();
-               Mockito.when(appService.deleteUserWidgetSortPref(ePWidgetsSortPreference, user))
-                               .thenThrow(nullPointerException);
-               assertNull(appsController.putUserWidgetsSortPref(mockedRequest, ePWidgetsSortPreference, mockedResponse));
-       }
-
-       @Test
-       public void deleteUserAppSortManualTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
-
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Mockito.when(appService.deleteUserAppSortManual(epDeleteAppsManualSortPref, user))
-                               .thenReturn(expectedFieldValidator);
-               actualFieldValidator = appsController.deleteUserAppSortManual(mockedRequest, epDeleteAppsManualSortPref,
-                               mockedResponse);
-               assertEquals(actualFieldValidator, expectedFieldValidator);
-       }
-
-       @Test
-       public void deleteUserAppSortManualExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
-               Mockito.when(appService.deleteUserAppSortManual(epDeleteAppsManualSortPref, user))
-                               .thenThrow(nullPointerException);
-               assertNull(appsController.deleteUserAppSortManual(mockedRequest, epDeleteAppsManualSortPref, mockedResponse));
-       }
-
-       @Test
-       public void putUserAppsSortingPreferenceTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               EPAppsSortPreference userAppsValue = new EPAppsSortPreference();
-
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Mockito.when(appService.saveAppsSortPreference(userAppsValue, user)).thenReturn(expectedFieldValidator);
-               actualFieldValidator = appsController.putUserAppsSortingPreference(mockedRequest, userAppsValue,
-                               mockedResponse);
-               assertEquals(actualFieldValidator, expectedFieldValidator);
-       }
-
-       @Test
-       public void putUserAppsSortingPreferenceExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               EPAppsSortPreference userAppsValue = new EPAppsSortPreference();
-               Mockito.when(appService.saveAppsSortPreference(userAppsValue, user)).thenThrow(nullPointerException);
-               assertNull(appsController.putUserAppsSortingPreference(mockedRequest, userAppsValue, mockedResponse));
-       }
-
-       @Test
-       public void getUserAppsSortTypePreferenceTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String expectedUserSortPreference = "TEST_DECE";
-               String actualUserSortPreference = new String();
-               Mockito.when(appService.getUserAppsSortTypePreference(user)).thenReturn(expectedUserSortPreference);
-               actualUserSortPreference = appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse);
-               assertEquals(actualUserSortPreference, expectedUserSortPreference);
-       }
-
-       @Test
-       public void getUserAppsSortTypePreferenceExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(appService.getUserAppsSortTypePreference(user)).thenThrow(nullPointerException);
-               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getUserAppsSortTypePreferenceIfUserNullTest() throws IOException {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(appService.getUserAppsSortTypePreference(user)).thenThrow(nullPointerException);
-               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsAdministratorsTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AdminUserApplications> expecteAdminUserApplications = new ArrayList<AdminUserApplications>();
-               List<AdminUserApplications> actualAdminUserApplications = new ArrayList<AdminUserApplications>();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAppsAdmins()).thenReturn(expecteAdminUserApplications);
-               actualAdminUserApplications = appsController.getAppsAdministrators(mockedRequest, mockedResponse);
-               assertEquals(expecteAdminUserApplications, actualAdminUserApplications);
-       }
-
-       @Test
-       public void getAppsAdministratorsIfUserNotSuperAdminTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsAdministratorsExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAppsAdmins()).thenThrow(nullPointerException);
-               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppsResponse> expectedApps = new ArrayList<AppsResponse>();
-               AppsResponse apps = new AppsResponse((long) 1, "test", true, true);
-               expectedApps.add(apps);
-
-               List<AppsResponse> atualApps = new ArrayList<AppsResponse>();
-
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAllApps(false)).thenReturn(expectedApps);
-               atualApps = appsController.getApps(mockedRequest, mockedResponse);
-               assertEquals(expectedApps, atualApps);
-       }
-
-       @Test
-       public void getAppsExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               assertNull(appsController.getApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsIfUserNotSuperAdminTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAllApps(false)).thenThrow(nullPointerException);
-               assertNull(appsController.getApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAllAppsTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<AppsResponse> expectedApps = new ArrayList<AppsResponse>();
-               AppsResponse apps = new AppsResponse((long) 1, "test", true, true);
-               expectedApps.add(apps);
-               List<AppsResponse> atualApps = new ArrayList<AppsResponse>();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAllApps(true)).thenReturn(expectedApps);
-               atualApps = appsController.getAllApps(mockedRequest, mockedResponse);
-               assertEquals(expectedApps, atualApps);
-       }
-
-       @Test
-       public void getAllAppsExceptionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               assertNull(appsController.getAllApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAllAppsIfUserNotSuperAdminTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getAllApps(true)).thenThrow(nullPointerException);
-               assertNull(appsController.getAllApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppsFullListTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EcompApp> expectedEcompApps = new ArrayList<EcompApp>();
-
-               EcompApp ecompApp = new EcompApp();
-               ecompApp.setId((long) 1);
-               ecompApp.setName("Test_app");
-               ecompApp.setUrl("Test_URL");
-               ecompApp.setUebKey("Test_key");
-               ecompApp.setAlternateUrl("Test_alt_URL");
-               expectedEcompApps.add(ecompApp);
-               List<EcompApp> actualEcompApps = new ArrayList<EcompApp>();
-               Mockito.when(appService.getEcompAppAppsFullList()).thenReturn(expectedEcompApps);
-               actualEcompApps = appsController.getAppsFullList(mockedRequest, mockedResponse);
-               assertEquals(expectedEcompApps, actualEcompApps);
-       }
-
-//     @Test
-//     public void getAppsFullListNoUserTest() {
-//             EPUser user = null;
-//             Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-//             Mockito.when(appService.getEcompAppAppsFullList()).thenReturn(null);
-//             assertNull(appsController.getAppsFullList(mockedRequest, mockedResponse));
-//
-//     }
-
-       @Test
-       public void getUserProfileTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-               UserRole userRole = new UserRole();
-               userRole.setUser_Id((long) 1);
-               userRole.setOrgUserId("guest");
-               userRole.setFirstName("Test_User_FirstName");
-               userRole.setLastName("Test_User_LastName");
-               userRole.setRoleId((long) 1);
-               userRole.setRoleName("test");
-
-               UserRoles unexpectedserAndRoles = new UserRoles(userRole);
-               unexpectedserAndRoles.setFirstName("Test_User_FirstName");
-               unexpectedserAndRoles.setLastName("Test_User_LastName");
-               unexpectedserAndRoles.setGuestSession(false);
-               unexpectedserAndRoles.setOrgUserId("guest");
-               List<String> roles = new ArrayList<String>();
-               roles.add("Test");
-               unexpectedserAndRoles.setRoles(roles);
-               Mockito.when(appService.getUserProfileNormalized(user)).thenReturn(unexpectedserAndRoles);
-               UserRoles actualUserAndRoles = appsController.getUserProfile(mockedRequest, mockedResponse);
-               assertEquals(unexpectedserAndRoles, actualUserAndRoles);
-       }
-
-       @Test
-       public void getUserProfileIfUserNullTest() throws IOException {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(appService.getUserProfileNormalized(user)).thenReturn(null);
-               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getUserProfileExcpetionTest() throws IOException {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(appService.getUserProfileNormalized(user)).thenThrow(nullPointerException);
-               assertNull(appsController.getUserAppsSortTypePreference(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getAppRolesTest() {
-               List<LocalRole> expectedRoleList = new ArrayList<LocalRole>();
-               LocalRole localRole = new LocalRole();
-               localRole.setRoleId(1);
-               localRole.setRolename("test");
-               expectedRoleList.add(localRole);
-               long appId = 1;
-               Mockito.when(appService.getAppRoles(appId)).thenReturn(expectedRoleList);
-               List<LocalRole> actualRoleList = appsController.getAppRoles(mockedRequest, appId);
-               assertEquals(actualRoleList, expectedRoleList);
-       }
-
-       @Test
-       public void getAppRolesExceptionTest() {
-               long appId = 1;
-               Mockito.when(appService.getAppRoles(appId)).thenThrow(nullPointerException);
-               assertNull(appsController.getAppRoles(mockedRequest, appId));
-       }
-
-       @Test
-       public void getOnboardingAppsTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<OnboardingApp> expectedOnboardingApps = new ArrayList<OnboardingApp>();
-               OnboardingApp onboardingApp = new OnboardingApp();
-               onboardingApp.setUebKey("test");
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getOnboardingApps()).thenReturn(expectedOnboardingApps);
-               List<OnboardingApp> actualOnboardingApps = appsController.getOnboardingApps(mockedRequest, mockedResponse);
-               assertEquals(expectedOnboardingApps, actualOnboardingApps);
-       }
-
-       @Test
-       public void getOnboardingAppsifSuperAdiminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               assertNull(appsController.getOnboardingApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getOnboardingAppsExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(!adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.getOnboardingApps()).thenThrow(nullPointerException);
-               assertNull(appsController.getOnboardingApps(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void putOnboardingAppTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               OnboardingApp OnboardingApp = new OnboardingApp();
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
-               FieldsValidator actualFieldValidator = appsController.putOnboardingApp(mockedRequest, OnboardingApp,
-                               mockedResponse);
-               assertEquals(expectedFieldValidator, actualFieldValidator);
-       }
-
-       @Test
-       public void putOnboardingAppIfSuperAdminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               FieldsValidator expectedFieldValidator = null;
-               OnboardingApp OnboardingApp = new OnboardingApp();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
-               assertNull(appsController.putOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
-       }
-
-       @Test
-       public void putOnboardingAppExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               OnboardingApp OnboardingApp = new OnboardingApp();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.modifyOnboardingApp(OnboardingApp, user)).thenThrow(nullPointerException);
-               assertNull(appsController.putOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
-       }
-       
-       @Test
-       public void postOnboardingAppTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               OnboardingApp OnboardingApp = new OnboardingApp();
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
-               FieldsValidator actualFieldValidator = appsController.postOnboardingApp(mockedRequest, OnboardingApp,
-                               mockedResponse);
-               assertEquals(expectedFieldValidator, actualFieldValidator);
-       }
-
-       @Test
-       public void postOnboardingAppIfSuperAdminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               FieldsValidator expectedFieldValidator = null;
-               OnboardingApp OnboardingApp = new OnboardingApp();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenReturn(expectedFieldValidator);
-               assertNull(appsController.postOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
-       }
-
-       @Test
-       public void postOnboardingAppExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               OnboardingApp OnboardingApp = new OnboardingApp();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(appService.addOnboardingApp(OnboardingApp, user)).thenThrow(nullPointerException);
-               assertNull(appsController.postOnboardingApp(mockedRequest, OnboardingApp, mockedResponse));
-       }
-       
-       @Test
-       public void deleteOnboardingAppTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               long appId = 1;
-               Mockito.when(appService.deleteOnboardingApp(user,appId )).thenReturn(expectedFieldValidator);
-               FieldsValidator actualFieldValidator = appsController.deleteOnboardingApp(mockedRequest,appId,
-                               mockedResponse);
-               assertEquals(expectedFieldValidator, actualFieldValidator);
-       }
-
-       @Test
-       public void deleteOnboardingAppIfSuperAdminTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               FieldsValidator expectedFieldValidator = null;
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               long appId = 1;
-        Mockito.when(appService.deleteOnboardingApp(user,appId)).thenReturn(expectedFieldValidator);
-               assertNull(appsController.deleteOnboardingApp(mockedRequest,appId,mockedResponse));
-       }
-
-       @Test
-       public void deleteOnboardingAppExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               long appId = 1;
-      Mockito.when(appService.deleteOnboardingApp(user,appId)).thenThrow(nullPointerException);
-               assertNull(appsController.deleteOnboardingApp(mockedRequest,appId,mockedResponse));
-       }
-       
-       @Test
-       public void getLeftMenuItemsTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               String menuList = "Test";
-               PowerMockito.mockStatic(EPUserUtils.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Set menuSet = new HashSet<>();
-               menuSet.add(1);
-               Mockito.when(AppUtils.getSession(mockedRequest)
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuSet);
-               Mockito.when(AppUtils.getSession(mockedRequest)
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME))).thenReturn(menuSet);
-               Mockito.when(leftMenuService.getLeftMenuItems(user, menuSet, menuSet)).thenReturn(menuList);
-               String response = appsController.getLeftMenuItems(mockedRequest, mockedResponse);
-               assertTrue(response.equals("Test"));
-       }
-       
-       @Test
-       public void getLeftMenuItemsExceptionTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               String menuList = "Test";
-               PowerMockito.mockStatic(EPUserUtils.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Set menuSet = new HashSet<>();
-               menuSet.add(1);
-               Mockito.when(AppUtils.getSession(mockedRequest)
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuSet);
-               Mockito.when(AppUtils.getSession(mockedRequest)
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME))).thenReturn(menuSet);
-               Mockito.when(leftMenuService.getLeftMenuItems(user, menuSet, menuSet)).thenThrow(nullPointerException);
-               assertNull(appsController.getLeftMenuItems(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void getAppThumbnailExceptionTest()
-       {
-               EPApp app = null;
-               assertNull(appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse));
-       }
-       
-       @Test
-       public void getAppThumbnailTest()
-       {
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppType(1);
-               app.setImageUrl("www.ecomp.com");
-               app.setThumbnail(new byte[] {1, 6, 3});
-               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
-               HttpEntity<byte[]> response = appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse);
-               assertEquals(response.getHeaders().getContentLength(), 3);
-       }
-       
-       @Test
-       public void getAppThumbnailForMediaTypePngTest()
-       {
-               
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppType(1);
-               app.setImageUrl("www.ecomp.png");
-               app.setThumbnail(new byte[] {1, 6, 3});
-               Mockito.when(appService.getApp((long) 1)).thenReturn(app);
-               PowerMockito.mockStatic(MediaType.class);
-               HttpEntity<byte[]> response = appsController.getAppThumbnail(mockedRequest, (long) 1, mockedResponse);
-               assertEquals(response.getHeaders().getContentLength(), 3);
-       }
-       
-       @Test
-       public void getUserAppsOrderBySortPrefIfUSerNullTest(){
-               List<EcompApp> listOfApps = new ArrayList<EcompApp>();
-               
-               EcompApp app = new EcompApp();
-               listOfApps.add(app);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
-               assertNull(appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void getUserAppsOrderBySortPrefTest(){
-               List<EcompApp> listOfApps = new ArrayList<EcompApp>();
-               
-               EcompApp app = new EcompApp();
-               listOfApps.add(app);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(mockedRequest.getParameter("mparams")).thenReturn("");
-               Mockito.when(appService.transformAppsToEcompApps(appService.getAppsOrderByName(user))).thenReturn(listOfApps);
-               List<EcompApp> listOfActualApps =       appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse);
-               assertEquals(listOfActualApps.size(), 1);
-       }
-       
-       @Test
-       public void getUserAppsOrderBySortPrefIfusrSortPrefIsMTest(){
-               List<EcompApp> listOfApps = new ArrayList<EcompApp>();
-               
-               EcompApp app = new EcompApp();
-               listOfApps.add(app);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(mockedRequest.getParameter("mparams")).thenReturn("M");
-               Mockito.when(appService.transformAppsToEcompApps(appService.getAppsOrderByName(user))).thenReturn(listOfApps);
-               List<EcompApp> listOfActualApps =       appsController.getUserAppsOrderBySortPref(mockedRequest, mockedResponse);
-               assertEquals(listOfActualApps.size(), 1);
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AuditLogControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/AuditLogControllerTest.java
deleted file mode 100644 (file)
index 68371d0..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.AuditLogController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(EPUserUtils.class)
-public class AuditLogControllerTest {
-
-       
-       @Mock
-       AuditService auditService;
-       
-       @InjectMocks
-     AuditLogController auditLogController = new AuditLogController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-       
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-       @Test
-       public void auditLogTest()
-       {
-               PowerMockito.mockStatic(EPUserUtils.class);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
-               auditLogController.auditLog(mockedRequest, "1", "app", "test");
-       }
-       
-       @Test
-       public void auditLogTabTest()
-       {
-               PowerMockito.mockStatic(EPUserUtils.class);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
-               auditLogController.auditLog(mockedRequest, "1", "tab", "test");
-       }
-       
-       @Test
-       public void auditLogfunctionalTest()
-       {
-               PowerMockito.mockStatic(EPUserUtils.class);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
-               auditLogController.auditLog(mockedRequest, "1", "functional", "test");
-       }
-       
-       @Test
-       public void auditLogleftMenuTest()
-       {
-               PowerMockito.mockStatic(EPUserUtils.class);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
-               auditLogController.auditLog(mockedRequest, "1", "leftMenu", "test");
-       }
-       
-       @Test(expected = NumberFormatException.class)
-       public void auditLogExceptionTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(EPUserUtils.getUserId(mockedRequest)).thenReturn((int)1);
-               auditLogController.auditLog(mockedRequest, "1", "app", "test");
-       }
-       
-       @Test
-       public void auditLogerrorTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenThrow(nullPointerException);
-               auditLogController.auditLog(mockedRequest, "1", "app", "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/BEPropertyReaderControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/BEPropertyReaderControllerTest.java
deleted file mode 100644 (file)
index 41233c8..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.BEPropertyReaderController;
-import org.openecomp.portalapp.portal.domain.BEProperty;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class BEPropertyReaderControllerTest extends MockitoTestSuite {
-
-       @InjectMocks
-       BEPropertyReaderController bEPropertyReaderController = new BEPropertyReaderController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test
-       public void readPropertyTest() {
-               String key = "DOMAIN_CLASS_LOCATION";
-               BEProperty beProperty = new BEProperty("DOMAIN_CLASS_LOCATION", "domain_class_location");
-               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(beProperty);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               PortalRestResponse<BEProperty> actualPortalRestResponse = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty("DOMAIN_CLASS_LOCATION")).thenReturn("domain_class_location");
-               actualPortalRestResponse = bEPropertyReaderController.readProperty(mockedRequest, key);
-               assertTrue(actualPortalRestResponse.equals(ecpectedPortalRestResponse));
-
-       }
-       
-       @Test
-       public void readPropertyExceptionTest() {
-               String key =null;
-               //BEProperty beProperty = new BEProperty("DOMAIN_CLASS_LOCATION", "domain_class_location");
-               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
-               ecpectedPortalRestResponse.setMessage("java.lang.NullPointerException");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<BEProperty> actualPortalRestResponse = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(new BEProperty(key, SystemProperties.getProperty(key))).thenThrow(nullPointerException);
-               actualPortalRestResponse = bEPropertyReaderController.readProperty(mockedRequest, key);
-               assertTrue(actualPortalRestResponse.equals(ecpectedPortalRestResponse));
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/BasicAuthAccountControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/BasicAuthAccountControllerTest.java
deleted file mode 100644 (file)
index 5a27755..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.BasicAuthAccountController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.BasicAuthCredentials;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.BasicAuthAccountService;
-import org.openecomp.portalapp.portal.service.BasicAuthAccountServiceImpl;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class BasicAuthAccountControllerTest extends MockitoTestSuite {
-
-       @Mock
-       BasicAuthAccountService basicAuthAccountService = new BasicAuthAccountServiceImpl();
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
-       @InjectMocks
-       BasicAuthAccountController basicAuthAccountController = new BasicAuthAccountController();
-       
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       MockEPUser mockUser = new MockEPUser();
-
-       public BasicAuthCredentials basicAuthCredentials() {
-               BasicAuthCredentials basicAuthCredentials = new BasicAuthCredentials();
-
-               basicAuthCredentials.setId((long) 1);
-               basicAuthCredentials.setApplicationName("test");
-               basicAuthCredentials.setUsername("Test");
-               basicAuthCredentials.setPassword("Password");
-               basicAuthCredentials.setIsActive("YES");
-
-               List<EPEndpoint> endpoints = new ArrayList<EPEndpoint>();
-
-               EPEndpoint ePEndpoint = new EPEndpoint();
-               ePEndpoint.setId((long) 1);
-               ePEndpoint.setName("Test");
-               endpoints.add(ePEndpoint);
-               basicAuthCredentials.setEndpoints(endpoints);
-
-               return basicAuthCredentials;
-
-       }
-
-       @Test
-       public void createBasicAuthAccountTest() throws Exception {
-               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("SUCCESS");
-               expectedResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.OK);
-               long accountd = 1;
-
-               Mockito.when(basicAuthAccountService.saveBasicAuthAccount(basicAuthCredentials)).thenReturn(accountd);
-
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
-                               mockedResponse, basicAuthCredentials);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void createBasicAuthAccountAdminTest() throws Exception {
-               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("Authorization Required");
-               expectedResponse.setResponse("Admin Only Operation! ");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
-
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
-                               mockedResponse, basicAuthCredentials);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void createBasicAuthAccountIfInputNullTest() throws Exception {
-               BasicAuthCredentials basicAuthCredentials = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("FAILURE");
-               expectedResponse.setResponse("newBasicAuthAccount cannot be null or empty");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.createBasicAuthAccount(mockedRequest,
-                               mockedResponse, basicAuthCredentials);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void getBasicAuthAccountTest() throws Exception {
-               PortalRestResponse<List<BasicAuthCredentials>> expectedPortalResponse = new PortalRestResponse<List<BasicAuthCredentials>>();
-               List<BasicAuthCredentials> basicAuthCredentialsList = new ArrayList<BasicAuthCredentials>();
-               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-               basicAuthCredentialsList.add(basicAuthCredentials);
-
-               expectedPortalResponse.setMessage("Success");
-               expectedPortalResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedPortalResponse.setStatus(portalRestStatusEnum.OK);
-
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(basicAuthAccountService.getAccountData()).thenReturn(null);
-               PortalRestResponse<List<BasicAuthCredentials>> actualResponse = basicAuthAccountController
-                               .getBasicAuthAccount(mockedRequest, mockedResponse);
-               assertEquals(expectedPortalResponse, actualResponse);
-       }
-
-       @Test
-       public void getBasicAuthAccountIfSuperAdminTest() throws Exception {
-               PortalRestResponse<List<BasicAuthCredentials>> expectedPortalResponse = new PortalRestResponse<List<BasicAuthCredentials>>();
-               List<BasicAuthCredentials> basicAuthCredentialsList = new ArrayList<BasicAuthCredentials>();
-               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-               basicAuthCredentialsList.add(basicAuthCredentials);
-
-               expectedPortalResponse.setMessage("UnAuthorized! Admin Only Operation");
-               expectedPortalResponse.setResponse(new ArrayList<>());
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedPortalResponse.setStatus(portalRestStatusEnum.ERROR);
-
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(basicAuthAccountService.getAccountData()).thenReturn(null);
-               PortalRestResponse<List<BasicAuthCredentials>> actualResponse = basicAuthAccountController
-                               .getBasicAuthAccount(mockedRequest, mockedResponse);
-               assertEquals(expectedPortalResponse, actualResponse);
-       }
-
-       @Test
-       public void updateAccountTest() throws Exception {
-               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("SUCCESS");
-               expectedResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.OK);
-               long accountd = 1;
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
-                               mockedResponse, accountd, basicAuthCredentials);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void updateAccountIfSuperAdminTest() throws Exception {
-               BasicAuthCredentials basicAuthCredentials = basicAuthCredentials();
-
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("Authorization Required");
-               expectedResponse.setResponse("Admin Only Operation! ");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
-               long accountd = 1;
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
-                               mockedResponse, accountd, basicAuthCredentials);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void updateAccountIfInputNullTest() throws Exception {
-               BasicAuthCredentials basicAuthCredentials = null;
-
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("FAILURE");
-               expectedResponse.setResponse("BasicAuthCredentials cannot be null or empty");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
-               long accountd = 1;
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.updateAccount(mockedRequest,
-                               mockedResponse, accountd, basicAuthCredentials);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void deleteAccountTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("SUCCESS");
-               expectedResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.OK);
-               long accountd = 1;
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.deleteAccount(mockedRequest,
-                               mockedResponse, accountd);
-               assertEquals(actualResponse, expectedResponse);
-       }
-
-       @Test
-       public void deleteAccountIfNotSuperAdminTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("Authorization Required");
-               expectedResponse.setResponse("Admin Only Operation! ");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedResponse.setStatus(portalRestStatusEnum.ERROR);
-               long accountd = 1;
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               PortalRestResponse<String> actualResponse = basicAuthAccountController.deleteAccount(mockedRequest,
-                               mockedResponse, accountd);
-               System.out.println(actualResponse);
-               assertEquals(actualResponse, expectedResponse);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/CommonWidgetControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/CommonWidgetControllerTest.java
deleted file mode 100644 (file)
index 51d871d..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.CommonWidgetController;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-
-public class CommonWidgetControllerTest {
-
-       @Mock
-       DashboardSearchService dashboardSearchService = new DashboardSearchServiceImpl();
-
-       @InjectMocks
-       CommonWidgetController commonWidgetController = new CommonWidgetController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void getWidgetDataTest() {
-               String resourceType = "Test";
-               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
-               @SuppressWarnings("rawtypes")
-               PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
-               ecpectedPortalRestResponse.setMessage("Unexpected resource type Test");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
-               assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
-
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void getWidgetDataTestNew() {
-               String resourceType = "EVENTS";
-               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
-               @SuppressWarnings("rawtypes")
-               PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
-               assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
-
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void getWidgetDataExceptionTest() {
-               String resourceType = "null";
-               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = null;
-               @SuppressWarnings("rawtypes")
-               PortalRestResponse ecpectedPortalRestResponse = new PortalRestResponse();
-               ecpectedPortalRestResponse.setMessage("Unexpected resource type null");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               acutualPoratlRestResponse = commonWidgetController.getWidgetData(mockedRequest, resourceType);
-               assertTrue(acutualPoratlRestResponse.equals(ecpectedPortalRestResponse));
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ConsulClientControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ConsulClientControllerTest.java
deleted file mode 100644 (file)
index d9e5046..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.ConsulClientController;
-import org.openecomp.portalapp.portal.domain.BEProperty;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-
-import com.orbitz.consul.ConsulException;
-import com.orbitz.consul.model.health.ServiceHealth;
-
-import io.searchbox.client.config.exception.NoServerConfiguredException;
-
-public class ConsulClientControllerTest {
-
-       @Mock
-       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-
-       @InjectMocks
-       ConsulClientController consulClientController = new ConsulClientController();
-
-       NoServerConfiguredException noServerConfiguredException = new NoServerConfiguredException(null);
-
-       String service = "Test";
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       ConsulException consulException = new ConsulException(nullPointerException);
-
-       @Test
-       public void getServiceLocationTest() {
-               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
-               ecpectedPortalRestResponse.setMessage("Success!");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
-               actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
-       }
-
-       @Test
-       public void getServiceLocationExceptionTest() {
-               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
-               ecpectedPortalRestResponse.setMessage("Warning!");
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.WARN);
-               PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
-               Mockito.when(consulHealthService.getServiceLocation(service, null)).thenThrow(noServerConfiguredException);
-               actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.getMessage().equals(ecpectedPortalRestResponse.getMessage()));
-               assertTrue(actualPortalRestRespone.getStatus().equals(ecpectedPortalRestResponse.getStatus()));
-
-       }
-
-       @Test
-       public void getServiceLocationExceptionConsulExceptionTest() {
-               PortalRestResponse<BEProperty> ecpectedPortalRestResponse = new PortalRestResponse<BEProperty>();
-               ecpectedPortalRestResponse.setMessage("Error!");
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<String> actualPortalRestRespone = new PortalRestResponse<String>();
-               Mockito.when(consulHealthService.getServiceLocation(service, null)).thenThrow(consulException);
-               actualPortalRestRespone = consulClientController.getServiceLocation(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.getMessage().equals(ecpectedPortalRestResponse.getMessage()));
-               assertTrue(actualPortalRestRespone.getStatus().equals(ecpectedPortalRestResponse.getStatus()));
-       }
-
-       public PortalRestResponse<List<ServiceHealth>> successResponse() {
-               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = new PortalRestResponse<List<ServiceHealth>>();
-               List<ServiceHealth> healths = new ArrayList<ServiceHealth>();
-               ecpectedPortalRestResponse.setMessage("Success!");
-               ecpectedPortalRestResponse.setResponse(healths);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               return ecpectedPortalRestResponse;
-       }
-
-       public PortalRestResponse<List<ServiceHealth>> errorResponse() {
-               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = new PortalRestResponse<List<ServiceHealth>>();
-               List<ServiceHealth> healths = new ArrayList<ServiceHealth>();
-               ecpectedPortalRestResponse.setMessage("Error!");
-               ecpectedPortalRestResponse.setResponse(healths);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               return ecpectedPortalRestResponse;
-       }
-
-       @Test
-       public void getAllHealthyNodesTest() {
-               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = successResponse();
-               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
-               actualPortalRestRespone = consulClientController.getAllHealthyNodes(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
-
-       }
-
-       @Test
-       public void getAllHealthyNodesExceptionTest() {
-               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = errorResponse();
-               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
-               Mockito.when(consulHealthService.getAllHealthyNodes(service)).thenThrow(consulException);
-               actualPortalRestRespone = consulClientController.getAllHealthyNodes(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
-       }
-
-       @Test
-       public void getAllNodesTest() {
-               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = successResponse();
-               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
-               actualPortalRestRespone = consulClientController.getAllNodes(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
-       }
-
-       @Test
-       public void getAllNodesExceptionTest() {
-               PortalRestResponse<List<ServiceHealth>> ecpectedPortalRestResponse = errorResponse();
-               PortalRestResponse<List<ServiceHealth>> actualPortalRestRespone = new PortalRestResponse<List<ServiceHealth>>();
-               Mockito.when(consulHealthService.getAllNodes(service)).thenThrow(consulException);
-               actualPortalRestRespone = consulClientController.getAllNodes(mockedRequest, mockedResponse, service);
-               assertTrue(actualPortalRestRespone.equals(ecpectedPortalRestResponse));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/DashboardControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/DashboardControllerTest.java
deleted file mode 100644 (file)
index 0e8b74d..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.DashboardController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EPUserUtils.class, CollaborateList.class, SystemProperties.class, EPCommonSystemProperties.class})
-public class DashboardControllerTest {
-       
-       @Mock
-       DashboardSearchService searchService = new DashboardSearchServiceImpl();
-       
-       @InjectMocks
-       DashboardController dashboardController = new DashboardController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       MockEPUser mockUser = new MockEPUser();
-       
-       public CommonWidgetMeta mockCommonWidgetMeta() {
-               CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta();
-               List<CommonWidget> widgetList = new ArrayList<>();
-               CommonWidget commonWidget = new CommonWidget();         
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("test");
-               commonWidget.setHref("testhref");
-               commonWidget.setTitle("testTitle");
-           commonWidget.setContent("testcontent");
-           commonWidget.setEventDate("testDate");
-           commonWidget.setSortOrder(1);                   
-               widgetList.add(commonWidget);           
-               commonWidgetMeta.setItems(widgetList);
-               
-               return commonWidgetMeta;
-       }
-       
-       public CommonWidget mockCommonWidget() {
-               
-               CommonWidget commonWidget = new CommonWidget();         
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("test");
-               commonWidget.setHref("testhref");
-               commonWidget.setTitle("testTitle");
-           commonWidget.setContent("testcontent");
-           commonWidget.setEventDate("testDate");
-           commonWidget.setSortOrder(1);
-           
-           return commonWidget;
-       }
-       
-       
-       @Test
-       public void getWidgetDataTest() throws IOException {
-               
-               String resourceType = null;
-               PortalRestResponse<CommonWidgetMeta> expectedData = new PortalRestResponse<CommonWidgetMeta>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("Unexpected resource type null");
-               expectedData.setResponse(null);
-               
-               PortalRestResponse<CommonWidgetMeta> actualResponse =   dashboardController.getWidgetData(mockedRequest, resourceType);
-               assertEquals(expectedData,actualResponse);              
-       }       
-       
-       @Test
-       public void getWidgetDataWithValidResourceTest() throws IOException {
-               String resourceType = "EVENTS";
-               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
-               commonWidgetMeta.setCategory(null);
-                               
-               Mockito.when(searchService.getWidgetData(resourceType)).thenReturn(commonWidgetMeta);
-               PortalRestResponse<CommonWidgetMeta> expectedData = new PortalRestResponse<CommonWidgetMeta>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse(commonWidgetMeta);
-               
-               PortalRestResponse<CommonWidgetMeta> actualResponse = dashboardController.getWidgetData(mockedRequest, resourceType);
-               System.out.println(actualResponse);
-               assertEquals(expectedData,actualResponse);
-       }
-               
-       @Test
-       public void saveWidgetDataBulkNullTest() throws IOException {
-               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
-               commonWidgetMeta.setCategory(null);
-               
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("ERROR");
-               expectedData.setResponse("Category cannot be null or empty");
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(expectedData,actualResponse);              
-       }
-       
-       @Test
-       public void saveWidgetUnexpectedDataBulkTest() throws IOException {
-               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
-               commonWidgetMeta.setCategory("Unexpected Data");
-               
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("Unexpected resource type Unexpected Data");
-               expectedData.setResponse(null);
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(expectedData,actualResponse);
-               
-       }
-               
-       @Test
-       public void saveWidgetInvalidDataBulkTest() throws IOException {
-               CommonWidgetMeta commonWidgetMeta= mockCommonWidgetMeta();
-               commonWidgetMeta.setCategory("EVENTS");
-               
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("Invalid category: test");
-               expectedData.setResponse(null);
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(expectedData,actualResponse);              
-       }
-       
-       @Test
-       public void saveWidgetDataBulkTest() throws IOException {
-               
-               List<CommonWidget> widgetList = new ArrayList<>();              
-               CommonWidget commonWidget = new CommonWidget("EVENTS", "http://test.com", "testTitle", "testcontent", "2017-07-01", 1);
-               widgetList.add(commonWidget);
-               CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta("EVENTS", widgetList);
-               
-                                   
-                               
-       /*      commonWidgetMeta.setItems(widgetList);
-               
-               commonWidgetMeta.setCategory("EVENTS");*/
-               
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse("success");
-               
-               Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn("success");
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(expectedData,actualResponse);              
-       }
-       
-       @Test
-       public void saveWidgetDataNullTest() throws IOException {
-                               
-               CommonWidget commonWidget = mockCommonWidget(); 
-               commonWidget.setId((long)1);
-               commonWidget.setContent("test");
-               commonWidget.setCategory(null);
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("ERROR");
-               expectedData.setResponse("Category cannot be null or empty");
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget);
-               assertEquals(expectedData,actualResponse);
-               
-       }
-       
-       @Test
-       public void saveWidgetDataErrorTest() throws IOException {
-                               
-               CommonWidget commonWidget = mockCommonWidget();         
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("Invalid category: test");
-               expectedData.setResponse(null); 
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget);
-               assertEquals(expectedData,actualResponse);              
-       }
-       
-       @Test
-       public void saveWidgetDataTest() throws IOException {
-                               
-               CommonWidgetMeta commonWidgetMeta= new CommonWidgetMeta();
-               List<CommonWidget> widgetList = new ArrayList<>();
-               CommonWidget commonWidget = new CommonWidget();         
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("EVENTS");
-               commonWidget.setHref("http://test.com");
-               commonWidget.setTitle("testTitle");
-           commonWidget.setContent("testcontent");
-           commonWidget.setEventDate("2017-07-01");
-           commonWidget.setSortOrder(1);                   
-               widgetList.add(commonWidget);           
-               commonWidgetMeta.setItems(widgetList);
-               
-               commonWidgetMeta.setCategory("EVENTS");
-               
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse("success"); 
-               
-               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn("success");
-               
-               PortalRestResponse<String> actualResponse = dashboardController.saveWidgetData(commonWidget);
-               assertEquals(expectedData,actualResponse);
-               
-       }
-       
-       @Test
-       public void deleteWidgetDataTest() throws IOException {
-                               
-               CommonWidget commonWidget = mockCommonWidget();
-               
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse(null); 
-               
-               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn("success");
-               
-               PortalRestResponse<String> actualResponse = dashboardController.deleteWidgetData(commonWidget);
-               assertEquals(expectedData,actualResponse);
-               
-       }
-               
-       @Test
-       public void getActiveUsersTest(){
-               List<String> activeUsers = new ArrayList<>();
-               List<String> expectedUsersList = new ArrayList<>();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String userId = user.getOrgUserId();
-               Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(activeUsers);
-               expectedUsersList=      dashboardController.getActiveUsers(mockedRequest);
-               assertEquals(expectedUsersList, activeUsers);
-       }
-       
-       
-       @Test
-       public void getActiveUsersExceptionTest(){
-               List<String> activeUsers = new ArrayList<>();
-               List<String> expectedUsersList = new ArrayList<>();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String userId = user.getOrgUserId();
-               Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
-               expectedUsersList = dashboardController.getActiveUsers(mockedRequest);
-               assertEquals(expectedUsersList, activeUsers);
-       }
-               
-       @Test
-       public void getOnlineUserUpdateRateTest(){
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse("{onlineUserUpdateRate=1400000, onlineUserUpdateDuration=1400000}"); 
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE)).thenReturn("1400"); 
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION)).thenReturn("1400");
-               
-               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getOnlineUserUpdateRate(mockedRequest);
-               assertEquals(expectedData.getStatus(),actualResponse.getStatus());
-       }
-       
-       @Test
-       public void getOnlineUserUpdateRateExceptionTest(){
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("java.lang.NullPointerException");
-               expectedData.setResponse(null); 
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_RATE)).thenThrow(nullPointerException); 
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.ONLINE_USER_UPDATE_DURATION)).thenThrow(nullPointerException);
-               
-               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getOnlineUserUpdateRate(mockedRequest);
-               assertEquals(expectedData,actualResponse);
-       }
-       
-       @Test
-       public void getWindowWidthThresholdForRightMenuTest(){
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse("{windowWidth=1400}"); 
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU)).thenReturn("1400");
-               
-               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForRightMenu(mockedRequest);
-               assertEquals(expectedData.getStatus(),actualResponse.getStatus());
-       }
-       
-       @Test
-       public void getWindowWidthThresholdForRightMenuExceptionTest(){
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("java.lang.NullPointerException");
-               expectedData.setResponse(null); 
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_RIGHT_MENU)).thenThrow(nullPointerException);
-               
-               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForRightMenu(mockedRequest);
-               assertEquals(expectedData,actualResponse);
-       }
-       
-       @Test
-       public void getWindowWidthThresholdForLeftMenuTest(){
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");             
-               expectedData.setResponse("{windowWidth=1400}"); 
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU)).thenReturn("1400");
-               
-               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForLeftMenu(mockedRequest);
-               assertEquals(expectedData.getStatus(),actualResponse.getStatus());
-       }
-       
-       @Test
-       public void getWindowWidthThresholdForLeftMenuExceptionTest(){
-               PortalRestResponse<String> expectedData = new PortalRestResponse<String>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("java.lang.NullPointerException");
-               expectedData.setResponse(null); 
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.WINDOW_WIDTH_THRESHOLD_LEFT_MENU)).thenThrow(nullPointerException);
-               
-               PortalRestResponse<Map<String, String>> actualResponse = dashboardController.getWindowWidthThresholdForLeftMenu(mockedRequest);
-               assertEquals(expectedData,actualResponse);
-       }
-               
-       @Test
-       public void getActiveUsersNullTest(){
-               PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("User object is null? - check logs");
-               expectedData.setResponse(new ArrayList<>()); 
-
-               PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
-               assertEquals(expectedData,actualResponse);
-       }
-       
-       @Test
-       public void activeUsersTest(){
-               EPUser user = mockUser.mockEPUser();
-               PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
-               expectedData.setStatus(PortalRestStatusEnum.OK);
-               expectedData.setMessage("success");
-               expectedData.setResponse(new ArrayList<>()); 
-               PowerMockito.mockStatic(EPUserUtils.class);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
-               assertEquals(expectedData,actualResponse);
-       }
-       
-       @Test
-       public void activeUsersExceptionTest(){
-               EPUser user = mockUser.mockEPUser();
-               user.setLoginId("test");
-               PortalRestResponse<List<String>> expectedData = new PortalRestResponse<List<String>>();
-               expectedData.setStatus(PortalRestStatusEnum.ERROR);
-               expectedData.setMessage("null - check logs.");
-               expectedData.setResponse(null);  
-               
-               PowerMockito.mockStatic(EPUserUtils.class);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
-               PortalRestResponse<List<String>> actualResponse = dashboardController.activeUsers(mockedRequest);
-               assertTrue(actualResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java
deleted file mode 100644 (file)
index 9ac81b6..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.DashboardSearchResultController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class DashboardSearchResultControllerTest {
-
-       @Mock
-       DashboardSearchService searchService = new DashboardSearchServiceImpl();
-
-       @InjectMocks
-       DashboardSearchResultController dashboardSearchResultController = new DashboardSearchResultController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void getWidgetDataTest() {
-               String resourceType = "test";
-               PortalRestResponse<CommonWidgetMeta> ecpectedPortalRestResponse = new PortalRestResponse<CommonWidgetMeta>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               Mockito.when(searchService.getWidgetData(resourceType)).thenReturn(null);
-               PortalRestResponse<CommonWidgetMeta> acutualPoratlRestResponse = dashboardSearchResultController
-                               .getWidgetData(mockedRequest, resourceType);
-               assertEquals(acutualPoratlRestResponse, ecpectedPortalRestResponse);
-
-       }
-
-       @Test
-       public void saveWidgetDataBulkTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-
-               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
-               commonWidgetMeta.setCategory("test");
-
-               List<CommonWidget> commonWidgetList = new ArrayList<CommonWidget>();
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("test");
-               commonWidget.setHref("test_href");
-               commonWidget.setTitle("test_title");
-               commonWidget.setContent("test_content");
-               commonWidget.setEventDate(null);
-               commonWidget.setSortOrder(1);
-
-               commonWidgetList.add(commonWidget);
-
-               commonWidgetMeta.setItems(commonWidgetList);
-
-               Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn(null);
-
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataBulkIfCategoryNullTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"1\"");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-
-               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
-               commonWidgetMeta.setCategory("test");
-
-               List<CommonWidget> commonWidgetList = new ArrayList<CommonWidget>();
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId(null);
-               commonWidget.setCategory(null);
-               commonWidget.setHref(null);
-               commonWidget.setTitle(null);
-               commonWidget.setContent("test_content");
-               commonWidget.setEventDate("1");
-               commonWidget.setSortOrder(1);
-               commonWidgetList.add(commonWidget);
-               commonWidgetMeta.setItems(commonWidgetList);
-
-               Mockito.when(searchService.saveWidgetDataBulk(commonWidgetMeta)).thenReturn(null);
-
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("test");
-               commonWidget.setHref("test_href");
-               commonWidget.setTitle("test_title");
-               commonWidget.setContent("test_content");
-               commonWidget.setEventDate(null);
-               commonWidget.setSortOrder(1);
-
-               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
-
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetData(commonWidget);
-               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-
-       }
-
-       @Test
-       public void saveWidgetDataExceptionTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("ERROR");
-               ecpectedPortalRestResponse.setResponse("Cateogry cannot be null or empty");
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("");
-               commonWidget.setHref("test_href");
-               commonWidget.setTitle("test_title");
-               commonWidget.setContent("test_content");
-               commonWidget.setEventDate(null);
-               commonWidget.setSortOrder(1);
-
-               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
-
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetData(commonWidget);
-               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-
-       }
-
-       @Test
-       public void saveWidgetDataDateErrorTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"1\"");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("test");
-               commonWidget.setHref("test_href");
-               commonWidget.setTitle("test_title");
-               commonWidget.setContent("test_content");
-               commonWidget.setEventDate("1");
-               commonWidget.setSortOrder(1);
-
-               Mockito.when(searchService.saveWidgetData(commonWidget)).thenReturn(null);
-
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetData(commonWidget);
-               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-
-       }
-
-       public void deleteWidgetDataTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setCategory("test");
-               commonWidget.setHref("test_href");
-               commonWidget.setTitle("test_title");
-               commonWidget.setContent("test_content");
-               commonWidget.setEventDate(null);
-               commonWidget.setSortOrder(1);
-               Mockito.when(searchService.deleteWidgetData(commonWidget)).thenReturn(null);
-
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .deleteWidgetData(commonWidget);
-               System.out.println(actualPortalRestResponse);
-               assertEquals(actualPortalRestResponse, ecpectedPortalRestResponse);
-       }
-
-       @Test
-       public void searchPortalIfUserIsNull() {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = "test";
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("searchPortal: User object is null? - check logs");
-               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-       }
-
-       @Test
-       public void searchPortalIfSearchStringNullTest() {
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = null;
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("searchPortal: String string is null");
-               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-       }
-
-       @Test
-       public void searchPortalIfSearchTest() {
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = "test";
-               List<SearchResultItem> searchResultItemList = new ArrayList<SearchResultItem>();
-               SearchResultItem searchResultItem = new SearchResultItem();
-
-               searchResultItem.setId((long) 1);
-               searchResultItem.setCategory("test");
-               searchResultItem.setName("test_name");
-               searchResultItem.setTarget("test_target");
-               searchResultItem.setUuid("test_UUId");
-               searchResultItemList.add(searchResultItem);
-               Map<String, List<SearchResultItem>> expectedResultMap = new HashMap<String, List<SearchResultItem>>();
-               expectedResultMap.put(searchString, searchResultItemList);
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("success");
-               expectedResult.setResponse(expectedResultMap);
-               expectedResult.setStatus(PortalRestStatusEnum.OK);
-
-               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenReturn(expectedResultMap);
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-
-       }
-
-       @Test
-       public void searchPortalIfSearchExcptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = "test";
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("null - check logs.");
-               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-
-               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenThrow(nullPointerException);
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-       }
-
-       @Test
-       public void getActiveUsersTest() {
-               List<String> expectedActiveUsers = new ArrayList<String>();
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String userId = user.getOrgUserId();
-               Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(expectedActiveUsers);
-               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
-               assertEquals(expectedActiveUsers, actualOnlineUsers);
-
-       }
-
-       @Test
-       public void getActiveUsersExceptionTest() {
-               List<String> expectedActiveUsers = new ArrayList<String>();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String userId = user.getOrgUserId();
-               Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
-               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
-               assertEquals(expectedActiveUsers, actualOnlineUsers);
-
-       }
-
-       @Test
-       public void activeUsersTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
-               expectedResult.setMessage("success");
-               expectedResult.setResponse(new ArrayList<>());
-               expectedResult.setStatus(PortalRestStatusEnum.OK);
-               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
-
-               assertEquals(actualResult, expectedResult);
-
-       }
-
-       @Test
-       public void activeUsersIfUserNullTest() {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
-               expectedResult.setMessage("User object is null? - check logs");
-               expectedResult.setResponse(new ArrayList<>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
-               assertEquals(actualResult, expectedResult);
-
-       }
-
-       @Test
-       public void activeUsersExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
-               expectedResult.setMessage("null - check logs.");
-               expectedResult.setResponse(new ArrayList<>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-               Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
-               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
-               assertEquals(actualResult, expectedResult);
-
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/EPFusionBaseControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/EPFusionBaseControllerTest.java
deleted file mode 100644 (file)
index ef857d0..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.*;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.EPFusionBaseController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.MenuData;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EPUserUtils.class, SystemProperties.class, EPCommonSystemProperties.class, EcompPortalUtils.class})
-public class EPFusionBaseControllerTest {
-
-       @Mock
-       DashboardSearchService searchService = new DashboardSearchServiceImpl();
-       
-       @InjectMocks
-       EPFusionBaseController epFusionBaseController = new EPFusionBaseController() {
-       };
-
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       MockEPUser mockUser = new MockEPUser();
-       
-       @Test
-       public void messagesExceptionTest(){
-               Map<String, Object> expectedData = new HashMap<String, Object>();
-               Map<String, Object> actualData = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).thenReturn("test"); 
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Set<MenuData> menuResult = null;
-               HttpSession  session = mockedRequest.getSession();
-               Mockito.when(session
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuResult);
-               actualData = epFusionBaseController.messages(mockedRequest);
-               assertEquals(expectedData,actualData );
-               System.out.println();
-               
-       }
-       
-       @Test
-       public void messagesTest(){
-               Map<String, Object> expectedData = new HashMap<String, Object>();
-               Map<String, Object> actualData = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME)).thenReturn("test"); 
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Set<MenuData> menuResult = new HashSet<>();
-               MenuData menuData= new MenuData();
-               menuResult.add(menuData);
-               menuData.setChildMenus(menuResult);
-               HttpSession  session = mockedRequest.getSession();
-               Mockito.when(session
-                               .getAttribute(SystemProperties.getProperty(SystemProperties.APPLICATION_MENU_ATTRIBUTE_NAME))).thenReturn(menuResult);
-               actualData = epFusionBaseController.messages(mockedRequest);
-               assertEquals(actualData.size(), 2);
-       }
-       
-       @Test
-       public void isAccessibleTest()
-       {
-               assertTrue(epFusionBaseController.isAccessible());
-       }
-       @Test
-       public void isRESTfulCallTest()
-       {
-               assertTrue(epFusionBaseController.isRESTfulCall());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/EPRestrictedBaseControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/EPRestrictedBaseControllerTest.java
deleted file mode 100644 (file)
index 6bcf273..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.*;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-
-public class EPRestrictedBaseControllerTest {
-
-       @InjectMocks
-       EPRestrictedBaseController ePRestrictedBaseController = new EPRestrictedBaseController() ;
-
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-   @Test
-       public void isAccessibleTest()
-       {
-               assertFalse(ePRestrictedBaseController.isAccessible());
-       }
-       
-   @Test
-       public void isRESTfulCallTest()
-       {
-               assertFalse(ePRestrictedBaseController.isRESTfulCall());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAccessRolesControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAccessRolesControllerTest.java
deleted file mode 100644 (file)
index e578844..0000000
+++ /dev/null
@@ -1,569 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesService;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesServiceImpl;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalsdk.core.domain.AuditLog;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.client.HttpClientErrorException;
-public class ExternalAccessRolesControllerTest {
-
-       @Mock
-       ExternalAccessRolesService externalAccessRolesService = new ExternalAccessRolesServiceImpl();
-
-       @InjectMocks
-       ExternalAccessRolesController externalAccessRolesController = new ExternalAccessRolesController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       @Mock
-       AuditLog auditLog = new AuditLog();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Failed");
-
-       MockEPUser mockUser = new MockEPUser();
-       String loginId = "guestT";
-       String uebKey = "testUebKey";
-
-       @Test
-       public void getUserTest() throws Exception {
-                List<EPUser> userList = new ArrayList<>();
-               Mockito.when(externalAccessRolesService.getUser(loginId)).thenReturn(userList);
-               assertNull(externalAccessRolesController.getUser(mockedRequest, mockedResponse, loginId));
-       }
-
-       @Test
-       public void getUserExceptionTest() throws Exception {
-               Mockito.when(externalAccessRolesService.getUser(loginId))
-                               .thenThrow(nullPointerException);
-               assertNull(externalAccessRolesController.getUser(mockedRequest, mockedResponse, loginId));
-       }
-       
-       public EPApp mockApp()
-       {
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(false);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-               return app;
-       }
-       
-       @Test
-       public void getRolesForAppTest() throws Exception {
-               List<EPApp> applicationList = new ArrayList<EPApp>();
-               List<CentralRole> answer = new ArrayList<>();
-               EPApp app = mockApp();
-               applicationList.add(app);
-               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
-               Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
-               Mockito.when(externalAccessRolesService.getRolesForApp(mockedRequest.getHeader(uebKey))).thenReturn(answer);
-               assertEquals(externalAccessRolesController.getRolesForApp(mockedRequest, mockedResponse), answer);
-       }
-
-       @Test
-       public void getRolesForAppExceptionTest() throws Exception {
-               List<EPApp> applicationList = new ArrayList<EPApp>();
-               List<CentralRole> answer = new ArrayList<>();
-               EPApp app = mockApp();
-               applicationList.add(app);
-               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
-               Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
-               Mockito.when(externalAccessRolesService.getRolesForApp(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               assertNull(externalAccessRolesController.getRolesForApp(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getRoleFunctionsListTest() throws Exception {
-               List<CentralRoleFunction> answer = new ArrayList<>();
-               Mockito.when(externalAccessRolesService.getRoleFuncList(mockedRequest.getHeader(uebKey))).thenReturn(answer);
-               assertEquals(externalAccessRolesController.getRoleFunctionsList(mockedRequest, mockedResponse), answer);
-       }
-
-       @Test
-       public void getRoleFunctionsListExceptionTest() throws Exception {
-               Mockito.when(externalAccessRolesService.getRoleFuncList(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               assertNull(externalAccessRolesController.getRoleFunctionsList(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void getRoleInfoTest() throws Exception {
-               CentralRole answer = new CentralRole();
-               long roleId = 1;
-               Mockito.when(externalAccessRolesService.getRoleInfo(roleId, mockedRequest.getHeader(uebKey)))
-                               .thenReturn(answer);
-               assertEquals(externalAccessRolesController.getRoleInfo(mockedRequest, mockedResponse, roleId), answer);
-       }
-
-       @Test
-       public void getRoleInfoExceptionTest() throws Exception {
-               long roleId = 1;
-               Mockito.when(externalAccessRolesService.getRoleInfo(roleId, mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               assertNull(externalAccessRolesController.getRoleInfo(mockedRequest, mockedResponse, roleId));
-       }
-
-       @Test
-       public void getRoleFunctionTest() throws Exception {
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-               String code = "test_menu";
-               Mockito.when(externalAccessRolesService.getRoleFunction(code, mockedRequest.getHeader(uebKey)))
-                               .thenReturn(centralRoleFunction);
-               assertEquals(externalAccessRolesController.getRoleFunction(mockedRequest, mockedResponse, code),
-                               centralRoleFunction);
-       }
-
-       @Test
-       public void getRoleFunctionExceptionTest() throws Exception {
-               String code = "test_menu";
-               Mockito.when(externalAccessRolesService.getRoleFunction(code, mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               assertNull(externalAccessRolesController.getRoleFunction(mockedRequest, mockedResponse, code));
-       }
-
-       @Test
-       public void saveRoleFunctionIfIsIsNotDeletedTest() throws Exception {
-               List<EPApp> applicationList = new ArrayList<EPApp>();
-               EPApp app = mockApp();
-               applicationList.add(app);
-               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               String data = null;
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-               Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralRoleFunction, app)).thenReturn(false);
-               portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-       
-       @Test
-       public void saveRoleFunctionExceptionTest() throws Exception {
-               List<EPApp> applicationList = new ArrayList<EPApp>();
-               EPApp app = mockApp();
-               applicationList.add(app);
-               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               String data = null;
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-               Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralRoleFunction, app)).thenThrow(nullPointerException);
-               portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
-               System.out.println(portalRestResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-       
-       @Test
-       public void saveRoleFunctionTest() throws Exception {
-               List<EPApp> applicationList = new ArrayList<EPApp>();
-               List<CentralRole> answer = new ArrayList<>();
-               EPApp app = mockApp();
-               applicationList.add(app);
-               Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader(uebKey))).thenReturn(applicationList);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               String data = null;
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-               Mockito.when(externalAccessRolesService.saveCentralRoleFunction(centralRoleFunction, app)).thenReturn(true);
-               portalRestResponse = externalAccessRolesController.saveRoleFunction(mockedRequest, mockedResponse, data);
-               System.out.println(portalRestResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-//     @Test
-//     public void deleteRoleFunctionTest() throws Exception {
-//             PortalRestResponse<String> portalRestResponse = null;
-//             PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-//             expectedportalRestResponse.setMessage("Successfully Deleted");
-//             expectedportalRestResponse.setResponse("Success");
-//             PortalRestStatusEnum portalRestStatusEnum = null;
-//             EPUser user = mockUser.mockEPUser();
-//             EPApp app = mockApp();
-//             expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-//             String code ="testNew";
-//             Mockito.when(externalAccessRolesService.getUser(mockedRequest.getHeader("LOGIN_ID"))).thenReturn((List<EPUser>) user);
-//             Mockito.when(externalAccessRolesService.getApp(mockedRequest.getHeader("UEBKEY")).get(0)).thenReturn(app);
-//             Mockito.when(externalAccessRolesService.deleteCentralRoleFunction(code, app)).thenReturn(true);
-//             portalRestResponse = externalAccessRolesController.deleteRoleFunction(mockedRequest, mockedResponse, code);
-//             assertEquals(portalRestResponse, expectedportalRestResponse);
-//     }
-
-       @Test
-       public void getActiveRolesTest() throws Exception {
-               List<CentralRole> cenRole = new ArrayList<>();
-               Mockito.when(externalAccessRolesService.getActiveRoles(mockedRequest.getHeader(uebKey))).thenReturn(cenRole);
-               List<CentralRole> expectedCenRole = externalAccessRolesController.getActiveRoles(mockedRequest, mockedResponse);
-               assertEquals(expectedCenRole, cenRole);
-       }
-
-       @Test
-       public void getActiveRolesExceptionTest() throws Exception {
-               Mockito.when(externalAccessRolesService.getActiveRoles(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               assertNull(externalAccessRolesController.getActiveRoles(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void deleteDependcyRoleRecordExceptionTest() throws Exception {
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to deleteDependencyRoleRecord");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               long roleId = 123;
-               portalRestResponse = externalAccessRolesController.deleteDependencyRoleRecord(mockedRequest, mockedResponse, roleId);
-               assertEquals(expectedportalRestResponse, portalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadFunctionsTest() throws Exception {
-               Integer result = 0;
-               Mockito.when(externalAccessRolesService.bulkUploadFunctions(mockedRequest.getHeader(uebKey)))
-                               .thenReturn(result);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added: 0");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               portalRestResponse = externalAccessRolesController.bulkUploadFunctions(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadFunctionsExceptionTest() throws Exception {
-               Mockito.when(externalAccessRolesService.bulkUploadFunctions(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to bulkUploadFunctions");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               portalRestResponse = externalAccessRolesController.bulkUploadFunctions(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadRolesTest() throws Exception {
-               Integer result = 0;
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added: 0");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               Mockito.when(externalAccessRolesService.bulkUploadRoles(mockedRequest.getHeader(uebKey))).thenReturn(result);
-               portalRestResponse = externalAccessRolesController.bulkUploadRoles(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadRolesTestException() throws Exception {
-               Mockito.when(externalAccessRolesService.bulkUploadRoles(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to bulkUploadRoles");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               portalRestResponse = externalAccessRolesController.bulkUploadRoles(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadRoleFunctionsTest() throws Exception {
-               Integer result = 0;
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added: 0");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               Mockito.when(externalAccessRolesService.bulkUploadRolesFunctions(mockedRequest.getHeader(uebKey)))
-                               .thenReturn(result);
-               portalRestResponse = externalAccessRolesController.bulkUploadRoleFunctions(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadRoleFunctionsException() throws Exception {
-               Mockito.when(externalAccessRolesService.bulkUploadRolesFunctions(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to bulkUploadRoleFunctions");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               portalRestResponse = externalAccessRolesController.bulkUploadRoleFunctions(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadUserRolesTest() throws Exception {
-               Integer result = 0;
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added: 0");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               Mockito.when(externalAccessRolesService.bulkUploadUserRoles(mockedRequest.getHeader(uebKey)))
-                               .thenReturn(result);
-               portalRestResponse = externalAccessRolesController.bulkUploadUserRoles(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadUserRolesExceptionTest() throws Exception {
-               Mockito.when(externalAccessRolesService.bulkUploadUserRoles(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to bulkUploadUserRoles");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               portalRestResponse = externalAccessRolesController.bulkUploadUserRoles(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void bulkUploadPartnerFunctionsTest() throws Exception {
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               portalRestResponse = externalAccessRolesController.bulkUploadPartnerFunctions(mockedRequest, mockedResponse, null);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-
-       @Test
-       public void bulkUploadPartnerRolesTest() throws Exception {
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               List<Role> upload = new ArrayList<>();
-               portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoles(mockedRequest, mockedResponse,
-                               upload);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-
-        @Test
-        public void bulkUploadPartnerRolesExceptionTest() throws Exception
-        {
-                ExternalAccessRolesService externalAccessRolesService = null;
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               List<Role> upload = new ArrayList<>();
-               portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoles(mockedRequest, mockedResponse,
-                               upload);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-        }
-
-       @Test
-       public void getMenuFunctionsTest() throws Exception {
-               List<String> functionsList = new ArrayList<>();
-               Mockito.when(externalAccessRolesService.getMenuFunctionsList(mockedRequest.getHeader(uebKey)))
-                               .thenReturn(functionsList);
-               List<String> expectedFunctionsList = externalAccessRolesController.getMenuFunctions(mockedRequest,
-                               mockedResponse);
-               assertEquals(functionsList, expectedFunctionsList);
-       }
-
-       @Test
-       public void getMenuFunctionsExceptionTest() throws Exception {
-               Mockito.when(externalAccessRolesService.getMenuFunctionsList(mockedRequest.getHeader(uebKey)))
-                               .thenThrow(httpClientErrorException);
-               assertNull(externalAccessRolesController.getMenuFunctions(mockedRequest, mockedResponse));
-       }
-
-//     @Test
-//     public void getUsersOfApplicationTest() throws Exception {
-//             List<String> users = new ArrayList<>();
-//             Mockito.when(externalAccessRolesService.getAllUsers(mockedRequest.getHeader(uebKey))).thenReturn(users);
-//             List<String> expectedusers = externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse);
-//             assertEquals(users, expectedusers);
-//     }
-
-//     @Test
-//     public void getUsersOfApplicationExceptionTest() throws Exception {
-//             Mockito.when(externalAccessRolesService.getAllUsers(mockedRequest.getHeader(uebKey)))
-//                             .thenThrow(httpClientErrorException);
-//             assertNull(externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse));
-//     }
-       
-       @Test
-       public void saveRoleExceptionTest() throws Exception {
-               Role role = new Role();
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to saveRole");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               List<Role> upload = new ArrayList<>();
-               portalRestResponse = externalAccessRolesController.saveRole(mockedRequest, mockedResponse,role);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-       
-       @Test
-       public void deleteRoleExceptionTest() throws Exception {
-               String role = "TestNew";
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Failed to deleteRole for 'TestNew'");
-               expectedportalRestResponse.setResponse("Failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               portalRestResponse = externalAccessRolesController.deleteRole(mockedRequest, mockedResponse,role);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-       
-       
-       @Test
-       public void bulkUploadPartnerRoleFunctionsTest() throws Exception {
-               PortalRestResponse<String> portalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Successfully added");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               List<Role> upload = new ArrayList<>();
-               portalRestResponse = externalAccessRolesController.bulkUploadPartnerRoleFunctions(mockedRequest, mockedResponse,upload);
-               assertEquals(portalRestResponse, expectedportalRestResponse);
-       }
-       
-       @Test
-       public void getUsersOfApplicationTest() throws Exception
-       {
-               List<EcompUser> users = new ArrayList<>();
-               EcompUser user = new EcompUser();
-               user.setOrgUserId("guestT");
-               users.add(user);
-               Mockito.when(externalAccessRolesService.getAllAppUsers(mockedRequest.getHeader(uebKey))).thenReturn(users);
-               List<EcompUser> expectedUsers =         externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse);
-               assertEquals(expectedUsers, users);
-       }
-       
-       @Test(expected = Exception.class)
-       public void getUsersOfApplicationExceptionTest() throws Exception
-       {
-               List<EcompUser> users = new ArrayList<>();
-               EcompUser user = new EcompUser();
-               user.setOrgUserId("guestT");
-               users.add(user);
-               Mockito.when(externalAccessRolesService.getAllAppUsers(mockedRequest.getHeader(uebKey))).thenThrow(nullPointerException);
-               assertNull(externalAccessRolesController.getUsersOfApplication(mockedRequest, mockedResponse));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerTest.java
deleted file mode 100644 (file)
index 4bd3288..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.ExternalAppsRestfulController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPLoginServiceImpl;
-import org.openecomp.portalapp.portal.service.EPRoleService;
-import org.openecomp.portalapp.portal.service.EPRoleServiceImpl;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.service.UserNotificationServiceImpl;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.slf4j.MDC;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ MDC.class, EPCommonSystemProperties.class })
-public class ExternalAppsRestfulControllerTest {
-
-       @InjectMocks
-       ExternalAppsRestfulController externalAppsRestfulController = new ExternalAppsRestfulController();
-       @Mock
-       FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
-
-       @Mock
-       EPLoginService epLoginService = new EPLoginServiceImpl();
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-
-       @Mock
-       UserNotificationService userNotificationService = new UserNotificationServiceImpl();
-
-       @Mock
-       EPRoleService epRoleService = new EPRoleServiceImpl();
-
-       @Mock
-       EcompPortalUtils EcompPortalUtils = new EcompPortalUtils();
-       
-       @Mock
-       DataAccessService DataAccessService = new DataAccessServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       MockEPUser mockUser = new MockEPUser();
-
-        @Test(expected = Exception.class)
-        public void getFunctionalMenuItemsForUserIfUSerNullTest() throws
-        Exception
-        {
-        PowerMockito.mockStatic(EPCommonSystemProperties.class);
-        PowerMockito.mockStatic(MDC.class);
-        EPUser epUser = null;
-        String loginId = "guestT";
-        Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
-        Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
-        externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
-        mockedResponse);
-        }
-       
-       @Test
-       public void getFunctionalMenuItemsForUserIfSuperAdminTest() throws Exception {
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(MDC.class);
-               EPUser epUser = mockUser.mockEPUser();
-               epUser.setId((long) 1);
-               epUser.setLoginId("guestT");
-               String loginId = "guestT";
-               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
-               List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
-               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
-               expectedList.add(functionalMenuItem);
-               Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
-               Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(true);
-               Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(expectedList);
-               List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
-                               mockedResponse);
-               assertNull(actualList.get(0).menuId);
-       }
-
-       @Test
-       public void getFunctionalMenuItemsForUserTest() throws Exception {
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(MDC.class);
-               EPUser epUser = mockUser.mockEPUser();
-               epUser.setId((long) 1);
-               epUser.setLoginId("guestT");
-               String loginId = "guestT";
-               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
-               List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
-               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
-               expectedList.add(functionalMenuItem);
-               Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
-               Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(false);
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId()))
-                               .thenReturn(expectedList);
-               List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
-                               mockedResponse);
-               assertNull(actualList.get(0).menuId);
-       }
-
-       @Test(expected = Exception.class)
-       public void getFavoritesForUserIfUserNullTest() throws Exception {
-               List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
-               FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
-               favorites.add(favoritesFunctionalMenuItemJson);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(MDC.class);
-               Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
-               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               EPUser epUser = null;
-               externalAppsRestfulController.getFavoritesForUser(mockedRequest, mockedResponse);
-       }
-
-       @Test
-       public void getFavoritesForUserTest() throws Exception {
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(MDC.class);
-               EPUser epUser = mockUser.mockEPUser();
-               epUser.setId((long) 1);
-               epUser.setLoginId("guestT");
-               String loginId = "guestT";
-               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
-               FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
-               favorites.add(favoritesFunctionalMenuItemJson);
-               Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
-               Mockito.when(MDC.get(EPCommonSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               Mockito.when(epLoginService.findUserWithoutPwd("Login_URL")).thenReturn(epUser);
-               Mockito.when(functionalMenuService.getFavoriteItems(epUser.getId())).thenReturn(favorites);
-               List<FavoritesFunctionalMenuItemJson> actaulFavorites = externalAppsRestfulController
-                               .getFavoritesForUser(mockedRequest, mockedResponse);
-               assertEquals(actaulFavorites.size(), 1);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/FunctionalMenuControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/FunctionalMenuControllerTest.java
deleted file mode 100644 (file)
index b72ef9a..0000000
+++ /dev/null
@@ -1,607 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.portal.controller.FunctionalMenuController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRole;
-import org.openecomp.portalapp.portal.transport.BusinessCardApplicationRolesList;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator.FieldName;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItemWithRoles;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class FunctionalMenuControllerTest extends MockitoTestSuite {
-
-       String userid = "ab1234";
-
-       @Mock
-       FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
-
-       @InjectMocks
-       FunctionalMenuController functionalMenuController = new FunctionalMenuController();
-
-       @Mock
-       private DataAccessService dataAccessService;
-       
-       @Mock
-       SearchService searchService;
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-       
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       @InjectMocks
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       @Mock
-       EPUser epuser;
-
-       MockEPUser mockUser = new MockEPUser();
-
-       List<BusinessCardApplicationRolesList> appRoles = new ArrayList<BusinessCardApplicationRolesList>();
-       List<BusinessCardApplicationRolesList> appRolesActual = new ArrayList<BusinessCardApplicationRolesList>();
-
-       List<BusinessCardApplicationRole> userAppRoleList = new ArrayList<BusinessCardApplicationRole>();
-
-       public List<BusinessCardApplicationRole> mockBusinessCardApplicationRole() {
-               List<BusinessCardApplicationRole> userAppRoleList = new ArrayList<BusinessCardApplicationRole>();
-
-               BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
-               businessCardApplicationRole.setRoleName("ADMIN");
-               businessCardApplicationRole.setAppName("ASDC");
-
-               BusinessCardApplicationRole businessCardApplicationRole1 = new BusinessCardApplicationRole();
-               businessCardApplicationRole1.setAppName("ASDC");
-               businessCardApplicationRole1.setRoleName("Tester");
-
-               userAppRoleList.add(businessCardApplicationRole);
-               userAppRoleList.add(businessCardApplicationRole1);
-               return userAppRoleList;
-       }
-
-       public List<BusinessCardApplicationRolesList> mockBusinessCardApplicationRolesList() {
-               List<BusinessCardApplicationRolesList> appRolesActual = new ArrayList<BusinessCardApplicationRolesList>();
-
-               BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
-               businessCardApplicationRolesList.setAppName("ASDC");
-
-               List<String> roleNames = new ArrayList<String>();
-               roleNames.add("ADMIN");
-               roleNames.add("Tester");
-               businessCardApplicationRolesList.setRoleNames(roleNames);
-
-               appRolesActual.add(businessCardApplicationRolesList);
-               return appRolesActual;
-       }
-
-       @Test
-       public void getAppListTestIfAppAlredyExistsBusinessCardApplicationRolesList() throws IOException {
-
-               userAppRoleList = mockBusinessCardApplicationRole();
-               appRolesActual = mockBusinessCardApplicationRolesList();
-
-               Mockito.when(functionalMenuService.getUserAppRolesList(userid)).thenReturn(userAppRoleList);
-
-               appRoles = functionalMenuController.getAppList(mockedRequest, userid);
-
-               assertEquals(appRolesActual.size(), appRoles.size());
-               assertEquals(appRolesActual.get(0).getAppName(), appRoles.get(0).getAppName());
-               assertEquals(appRolesActual.get(0).getRoleNames(), appRoles.get(0).getRoleNames());
-
-       }
-
-       @Test
-       public void getAppListTestIfAppDoesnotExistsInBusinessCardApplicationRolesList() throws IOException {
-
-               userAppRoleList = mockBusinessCardApplicationRole();
-               BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
-               businessCardApplicationRole.setAppName("CCD");
-               businessCardApplicationRole.setRoleName("ADMIN");
-               userAppRoleList.add(businessCardApplicationRole);
-               appRolesActual = mockBusinessCardApplicationRolesList();
-               BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
-               businessCardApplicationRolesList.setAppName("CCD");
-               List<String> roleNames1 = new ArrayList<String>();
-               roleNames1.add("ADMIN");
-               businessCardApplicationRolesList.setRoleNames(roleNames1);
-               appRolesActual.add(businessCardApplicationRolesList);
-               Mockito.when(functionalMenuService.getUserAppRolesList(userid)).thenReturn(userAppRoleList);
-               appRoles = functionalMenuController.getAppList(mockedRequest, userid);
-               assertEquals(appRolesActual.size(), appRoles.size());
-               assertEquals(appRolesActual.get(0).getAppName(), appRoles.get(0).getAppName());
-               assertEquals(appRolesActual.get(0).getRoleNames(), appRoles.get(0).getRoleNames());
-               assertEquals(appRolesActual.get(1).getAppName(), appRoles.get(1).getAppName());
-               assertEquals(appRolesActual.get(1).getRoleNames(), appRoles.get(1).getRoleNames());
-
-       }
-
-       @Test
-       public void regenerateAncestorTableTest() {
-               EPUser user = mockUser.mockEPUser();
-
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               FieldsValidator acutualFieldValidator = null;
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(fields);
-               expectedFieldValidator.setErrorCode(null);
-               Mockito.when(!adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(functionalMenuService.regenerateAncestorTable()).thenReturn(expectedFieldValidator);
-               acutualFieldValidator = functionalMenuController.regenerateAncestorTable(mockedRequest, mockedResponse);
-               assertTrue(acutualFieldValidator.equals(expectedFieldValidator));
-       }
-       
-       @Test
-       public void getMenuItemsExceptionTest(){
-               List<FunctionalMenuItem> actualmenuItems = null;
-               List<FunctionalMenuItem> expectedmenuItems = null;
-               
-               Mockito.when(functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse)).thenThrow(nullPointerException);
-               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
-               assertEquals(actualmenuItems, expectedmenuItems);
-       }
-       
-       @Test
-       public void getFunctionalMenuStaticInfoExceptionTest(){
-               String fnMenuStaticactualResponse = null;
-               String fnMenuStaticexpectedResponse = null;
-               String orgUserIdStr = null;
-               
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(searchService.searchUserByUserId(orgUserIdStr)).thenReturn(user);  
-               fnMenuStaticactualResponse = functionalMenuController.getFunctionalMenuStaticInfo(mockedRequest, mockedResponse);
-               
-               assertEquals(fnMenuStaticactualResponse, fnMenuStaticexpectedResponse);
-               
-       }
-       
-       @Test
-       public void getFunctionalMenuStaticInfoTest(){
-               String fnMenuStaticactualResponse = null;
-               String fnMenuStaticexpectedResponse = "{\"firstName\":\"test\",\"lastName\":\"test\",\"last_login\":\"09/08/2017 03:48:13-0400\",\"userId\":\"guestT\",\"email\":\"test\"}";
-               String orgUserIdStr = null;
-               
-               EPUser user = mockUser.mockEPUser();
-               user.setEmail("test");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(searchService.searchUserByUserId(orgUserIdStr)).thenReturn(user);  
-               fnMenuStaticactualResponse = functionalMenuController.getFunctionalMenuStaticInfo(mockedRequest, mockedResponse);
-               assertEquals(fnMenuStaticactualResponse.length(), fnMenuStaticexpectedResponse.length());               
-       }
-       
-       @Test
-       public void getMenuItemsForAuthUserNullTest(){
-               List<FunctionalMenuItem> actualmenuItems = null;
-               List<FunctionalMenuItem> expectedmenuItems = null;
-               
-               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
-               assertEquals(actualmenuItems, expectedmenuItems);
-       }
-       
-       @Test
-       public void getMenuItemsForAuthUserIsSuperAdminTest(){
-               List<FunctionalMenuItem> actualmenuItems = null;
-               List<FunctionalMenuItem> expectedmenuItems = new ArrayList<FunctionalMenuItem>();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               
-               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
-               assertEquals(actualmenuItems, expectedmenuItems);
-       }
-
-       @Test
-       public void getMenuItemsForAuthUserTest(){
-               List<FunctionalMenuItem> actualmenuItems = null;
-               List<FunctionalMenuItem> expectedmenuItems = new ArrayList<FunctionalMenuItem>();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);   
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               
-               actualmenuItems = functionalMenuController.getMenuItemsForAuthUser(mockedRequest, mockedResponse);
-               assertEquals(actualmenuItems, expectedmenuItems);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemDetailsBadPermissionTest(){
-               Integer menuId = 1234;
-               FunctionalMenuItem actualmenuItem = null;
-               FunctionalMenuItem expectedmenuItem = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);   
-               
-               actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
-               assertEquals(actualmenuItem, expectedmenuItem);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemDetailsExceptionTest(){
-               Integer menuId = 1234;
-               FunctionalMenuItem actualmenuItem = null;
-               FunctionalMenuItem expectedmenuItem = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.getFunctionalMenuItemDetails(menuId)).thenThrow(nullPointerException);       
-               
-               actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
-               assertEquals(actualmenuItem, expectedmenuItem);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemDetailsTest(){
-               Integer menuId = 1234;
-               FunctionalMenuItem actualmenuItem = null;
-               FunctionalMenuItem expectedmenuItem = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.getFunctionalMenuItemDetails(menuId)).thenReturn(actualmenuItem);    
-               
-               actualmenuItem = functionalMenuController.getFunctionalMenuItemDetails(mockedRequest, menuId, mockedResponse);
-               assertEquals(actualmenuItem, expectedmenuItem);
-       }
-       
-       @Test
-       public void getMenuItemsForEditingTest(){
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenReturn(actualMenuItems);   
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
-               assertEquals(actualMenuItems, expectedMenuItems);
-       }
-       
-       @Test
-       public void getMenuItemsForEditingBadPermissionsTest(){
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);   
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenReturn(actualMenuItems);   
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
-               assertEquals(actualMenuItems, expectedMenuItems);
-       }
-       
-       @Test
-       public void getMenuItemsForEditingExceptionTest(){
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.getFunctionalMenuItems(true)).thenThrow(nullPointerException);
-               actualMenuItems = functionalMenuController.getMenuItemsForEditing(mockedRequest, mockedResponse);
-               assertEquals(actualMenuItems, expectedMenuItems);
-       }
-       
-       @Test
-       public void getMenuItemsForNotificationsExceptionTest(){
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForNotificationTree(true)).thenThrow(nullPointerException);    
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForNotifications(mockedRequest, mockedResponse);
-               assertEquals(actualMenuItems, expectedMenuItems);
-       }
-       @Test
-       public void getMenuItemsForNotificationsTest(){
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = new ArrayList<FunctionalMenuItem>();
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForNotificationTree(false)).thenReturn(actualMenuItems);       
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForNotifications(mockedRequest, mockedResponse);
-               assertEquals(actualMenuItems, expectedMenuItems);
-       }
-       
-       @Test
-       public void getMenuItemsForAppTest(){
-               Integer appId = 1234;
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForApp(appId)).thenReturn(actualMenuItems);
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForApp(mockedRequest, appId);
-               assertEquals(actualMenuItems, expectedMenuItems);               
-       }
-       
-       @Test
-       public void getMenuItemsForAppExceptionTest(){
-               Integer appId = 1234;
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForApp(appId)).thenThrow(nullPointerException);
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForApp(mockedRequest, appId);
-               assertEquals(actualMenuItems, expectedMenuItems);               
-       }
-       
-       @Test
-       public void getMenuItemsForUserTest(){
-               String orgUserId ="test";
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(orgUserId)).thenReturn(actualMenuItems);                
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForUser(mockedRequest, orgUserId);
-               assertEquals(actualMenuItems, expectedMenuItems);               
-       }
-       
-       @Test
-       public void getMenuItemsForUserExceptionTest(){
-               String orgUserId ="test";
-               List<FunctionalMenuItem> actualMenuItems = null;
-               List<FunctionalMenuItem> expectedMenuItems = null;
-               Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(orgUserId)).thenThrow(nullPointerException);                
-               
-               actualMenuItems = functionalMenuController.getMenuItemsForUser(mockedRequest, orgUserId);
-               assertEquals(actualMenuItems, expectedMenuItems);               
-       }
-       
-       @Test
-       public void createFunctionalMenuItemTest(){
-               FieldsValidator actualFieldsValidator = new FieldsValidator();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               expectedFieldsValidator.setHttpStatusCode((long) 200);
-               expectedFieldsValidator.setFields(fields);
-               expectedFieldsValidator.setErrorCode(null);
-               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(functionalMenuService.createFunctionalMenuItem(menuItemJson)).thenReturn(expectedFieldsValidator);
-               actualFieldsValidator = functionalMenuController.createFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void createFunctionalMenuItemBadPermisssionsTest(){
-               FieldsValidator actualFieldsValidator = null;
-               FieldsValidator expectedFieldsValidator = null;
-               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(functionalMenuService.createFunctionalMenuItem(menuItemJson)).thenReturn(expectedFieldsValidator);
-               actualFieldsValidator = functionalMenuController.createFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void getFavoritesForUserTest(){
-               List<FavoritesFunctionalMenuItemJson> actualFavoritesFunctionalMenuItemsJson = null;
-               List<FavoritesFunctionalMenuItemJson> expectedFunctionalMenuItemsJson = new ArrayList<FavoritesFunctionalMenuItemJson>();
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(functionalMenuService.getFavoriteItems(user.getId())).thenReturn(expectedFunctionalMenuItemsJson);
-               actualFavoritesFunctionalMenuItemsJson = functionalMenuController.getFavoritesForUser(mockedRequest, mockedResponse);
-               assertEquals(actualFavoritesFunctionalMenuItemsJson, expectedFunctionalMenuItemsJson);
-       }
-       
-       @Test
-       public void deleteFavoriteItemTest(){
-               Long userId = (long)1;
-               Long menuId = (long)1;
-               FieldsValidator actualFieldsValidator = new FieldsValidator();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               expectedFieldsValidator.setHttpStatusCode((long) 200);
-               expectedFieldsValidator.setFields(fields);
-               expectedFieldsValidator.setErrorCode(null);
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.removeFavoriteItem(user.getId(), menuId)).thenReturn(actualFieldsValidator);
-               actualFieldsValidator = functionalMenuController.deleteFavoriteItem(mockedRequest, menuId, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void addFavoriteItemTest(){
-               FavoritesFunctionalMenuItem menuItemJson = new FavoritesFunctionalMenuItem();
-               FieldsValidator actualFieldsValidator = new FieldsValidator();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               expectedFieldsValidator.setHttpStatusCode((long) 200);
-               expectedFieldsValidator.setFields(fields);
-               expectedFieldsValidator.setErrorCode(null);
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(functionalMenuService.setFavoriteItem(menuItemJson)).thenReturn(actualFieldsValidator);
-               actualFieldsValidator = functionalMenuController.addFavoriteItem(mockedRequest, menuItemJson, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void getMenuItemsTest(){
-               List<FunctionalMenuItem> actualFunctionalMenuItems = new ArrayList<FunctionalMenuItem>();
-               List<FunctionalMenuItem> expectedFunctionalMenuItems = new ArrayList<FunctionalMenuItem>();
-               List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
-               Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(menuItems);
-               actualFunctionalMenuItems = functionalMenuController.getMenuItems(mockedRequest, mockedResponse);
-               assertEquals(actualFunctionalMenuItems, expectedFunctionalMenuItems);
-       }
-       
-       @Test
-       public void deleteFunctionalMenuItemTest(){
-               Long menuId = (long)1;
-               FieldsValidator actualFieldsValidator = new FieldsValidator();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               expectedFieldsValidator.setHttpStatusCode((long) 200);
-               expectedFieldsValidator.setFields(fields);
-               expectedFieldsValidator.setErrorCode(null);
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(functionalMenuService.deleteFunctionalMenuItem(menuId)).thenReturn(actualFieldsValidator);
-               actualFieldsValidator = functionalMenuController.deleteFunctionalMenuItem(mockedRequest, menuId, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void deleteFunctionalMenuItemBadPermissionsTest(){
-               Long menuId = (long)1;
-               FieldsValidator actualFieldsValidator = null;
-               FieldsValidator expectedFieldsValidator = null;
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(functionalMenuService.deleteFunctionalMenuItem(menuId)).thenReturn(actualFieldsValidator);
-               actualFieldsValidator = functionalMenuController.deleteFunctionalMenuItem(mockedRequest, menuId, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void editFunctionalMenuItemTest(){
-               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
-               FieldsValidator actualFieldsValidator = new FieldsValidator();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-               expectedFieldsValidator.setHttpStatusCode((long) 200);
-               expectedFieldsValidator.setFields(fields);
-               expectedFieldsValidator.setErrorCode(null);
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true); 
-               Mockito.when(functionalMenuService.editFunctionalMenuItem(menuItemJson)).thenReturn(actualFieldsValidator);
-               actualFieldsValidator = functionalMenuController.editFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void editFunctionalMenuItemBadPermissionsTest(){
-               FunctionalMenuItemWithRoles menuItemJson = new FunctionalMenuItemWithRoles();
-               FieldsValidator actualFieldsValidator = null;
-               FieldsValidator expectedFieldsValidator = null;
-               EPUser user = mockUser.mockEPUser();    
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false); 
-               Mockito.when(functionalMenuService.editFunctionalMenuItem(menuItemJson)).thenReturn(actualFieldsValidator);
-               actualFieldsValidator = functionalMenuController.editFunctionalMenuItem(mockedRequest, menuItemJson, mockedResponse);
-               assertEquals(actualFieldsValidator, expectedFieldsValidator);
-       }
-       
-       @Test
-       public void getECOMPTitleTest(){
-               PortalRestResponse<String> actualportalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               expectedportalRestResponse.setMessage("success");
-               expectedportalRestResponse.setResponse("Portal");
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)).thenReturn("Portal");
-               actualportalRestResponse = functionalMenuController.getECOMPTitle(mockedRequest, mockedResponse);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-       
-       @Test
-       public void getECOMPTitleExceptionTest(){
-               PortalRestResponse<String> actualportalRestResponse = null;
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse(null);
-               PowerMockito.mockStatic(SystemProperties.class);
-               
-               Mockito.when(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)).thenThrow(nullPointerException);
-               actualportalRestResponse = functionalMenuController.getECOMPTitle(mockedRequest, mockedResponse);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/GetAccessControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/GetAccessControllerTest.java
deleted file mode 100644 (file)
index e18704f..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.GetAccessController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-import org.openecomp.portalapp.portal.service.GetAccessService;
-import org.openecomp.portalapp.portal.service.GetAccessServiceImpl;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class GetAccessControllerTest {
-
-       @Mock
-       GetAccessService getAccessService = new GetAccessServiceImpl();
-
-       @InjectMocks
-       GetAccessController getAccessController = new GetAccessController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       MockEPUser mockUser = new MockEPUser();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       
-       @Test
-       public void getAppList() throws IOException
-       {
-               List<GetAccessResult> expectedAppsList = new ArrayList<GetAccessResult>();
-               EPUser user = mockUser.mockEPUser();
-               GetAccessResult getAccessResult = new GetAccessResult();
-               getAccessResult.setRowId("1");
-               getAccessResult.setRoleId((long) 1);
-               getAccessResult.setEcompFunction("test");
-               getAccessResult.setAppName("Test_App");
-               getAccessResult.setAppMotsId(1);
-               getAccessResult.setRoleName("Test_role");
-               getAccessResult.setRoleActive("N");
-               getAccessResult.setReqType("test");
-               
-               expectedAppsList.add(getAccessResult);
-               
-               List<GetAccessResult> actualAppsList = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(getAccessService.getAppAccessList(user)).thenReturn(expectedAppsList);
-               actualAppsList = getAccessController.getAppList(mockedRequest);
-               assertTrue(actualAppsList.contains(getAccessResult));
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ManifestControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/ManifestControllerTest.java
deleted file mode 100644 (file)
index 61d5bb3..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.jar.Attributes;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.ManifestController;
-import org.openecomp.portalapp.portal.service.ManifestService;
-import org.openecomp.portalapp.portal.service.ManifestServiceImpl;
-
-public class ManifestControllerTest extends MockitoTestSuite{
-
-       
-       @Mock
-       ManifestService manifestService = new ManifestServiceImpl();
-       
-       @InjectMocks
-       ManifestController  manifestController = new  ManifestController();
-       
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       @Test
-       public void getManifestTest() throws IOException
-       {
-               Map<String, Object> expectedResponse = new HashMap<String, Object>();
-               Attributes attributes  = new Attributes();
-               expectedResponse.put("test", attributes);
-               Mockito.when(manifestService.getWebappManifest()).thenReturn(attributes);
-               Map<String, Object> actualResponse = manifestController.getManifest(mockedRequest);
-               assertTrue((actualResponse.keySet().toArray().length) == 1);
-               
-       }
-       
-       @Test
-       public void getManifestExceptionTest() throws IOException
-       {
-               Mockito.when(manifestService.getWebappManifest()).thenThrow(nullPointerException);
-               Map<String, Object> actualResponse = manifestController.getManifest(mockedRequest);
-               assertTrue((actualResponse.keySet().toArray().length) == 1);
-               assertTrue(actualResponse.get("error").equals("failed to get manifest: java.lang.NullPointerException"));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/MicroserviceControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/MicroserviceControllerTest.java
deleted file mode 100644 (file)
index 3b569ac..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-import org.openecomp.portalapp.portal.service.MicroserviceService;
-import org.openecomp.portalapp.portal.service.MicroserviceServiceImpl;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.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.core.ParameterizedTypeReference;
-import org.springframework.http.HttpEntity;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.RestTemplate;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({WidgetServiceHeaders.class, EcompPortalUtils.class})
-public class MicroserviceControllerTest extends MockitoTestSuite{
-
-       @InjectMocks
-       MicroserviceController microserviceController = new MicroserviceController();
-
-       @Mock
-       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-
-       @Mock
-       MicroserviceService microserviceService = new MicroserviceServiceImpl();
-
-       @Mock
-       RestTemplate template = new RestTemplate();
-
-       @Mock
-       MicroserviceData microserviceData = new MicroserviceData();
-
-       @SuppressWarnings("rawtypes")
-       @Mock
-       ResponseEntity<List<WidgetCatalog>> ans = new ResponseEntity<List<WidgetCatalog>>(HttpStatus.OK);
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @Mock
-       EcompPortalUtils EcompPortalUtils = new EcompPortalUtils();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test
-       public void createMicroserviceIfServiceDataNullTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("FAILURE");
-               expectedportalRestResponse.setResponse("MicroserviceData cannot be null or empty");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               MicroserviceData microserviceData = null;
-               PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
-                               mockedResponse, microserviceData);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void createMicroserviceTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("SUCCESS");
-               expectedportalRestResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
-                               mockedResponse, microserviceData);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void createMicroserviceExceptionTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("FAILURE");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               Mockito.when(microserviceService.saveMicroservice(microserviceData)).thenReturn((long) 1);
-               Mockito.when(microserviceData.getParameterList()).thenThrow(nullPointerException);
-               PortalRestResponse<String> actualportalRestResponse = microserviceController.createMicroservice(mockedRequest,
-                               mockedResponse, microserviceData);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void getMicroserviceTest() throws Exception {
-               Mockito.when(microserviceService.getMicroserviceData()).thenReturn(null);
-               List<MicroserviceData> list = microserviceController.getMicroservice(mockedRequest, mockedResponse);
-               assertEquals(list, null);
-       }
-
-       @Test
-       public void updateMicroserviceIfServiceISNullTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("FAILURE");
-               expectedportalRestResponse.setResponse("MicroserviceData cannot be null or empty");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               MicroserviceData microserviceData = null;
-               PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
-                               mockedResponse, 1, microserviceData);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void updateMicroserviceTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("SUCCESS");
-               expectedportalRestResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
-                               mockedResponse, 1, microserviceData);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void updateMicroserviceExceptionTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("FAILURE");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               Mockito.when(microserviceController.updateMicroservice(mockedRequest, mockedResponse, 1, microserviceData))
-                               .thenThrow(nullPointerException);
-               PortalRestResponse<String> actualportalRestResponse = microserviceController.updateMicroservice(mockedRequest,
-                               mockedResponse, 1, microserviceData);
-               assertEquals(actualportalRestResponse, expectedportalRestResponse);
-       }
-
-       @Test
-       public void deleteMicroserviceExceptionTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("FAILURE");
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               expectedportalRestResponse.setResponse(
-                               "I/O error on GET request for \""  + EcompPortalUtils.widgetMsProtocol() + "://null/widget/microservices/widgetCatalog/service/1\":null; nested exception is java.net.UnknownHostException: null");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               PowerMockito.mockStatic(WidgetServiceHeaders.class);
-               PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
-                               mockedResponse, 1);
-               assertEquals(actuaPportalRestResponse.getStatus(), expectedportalRestResponse.getStatus());
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void deleteMicroserviceTest() throws Exception {
-               String HTTPS = "https://";
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("SOME WIDGETS ASSOICATE WITH THIS SERVICE");
-               expectedportalRestResponse.setResponse("'null' ,'null' ");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.WARN);
-               List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
-               WidgetCatalog widgetCatalog = new WidgetCatalog();
-               widgetCatalog.setId(1);
-               WidgetCatalog widgetCatalog1 = new WidgetCatalog();
-               widgetCatalog.setId(2);
-               List.add(widgetCatalog);
-               List.add(widgetCatalog1);
-               PowerMockito.mockStatic(WidgetServiceHeaders.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               String whatService = "widgets-service";
-               Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
-               Mockito.when(ans.getBody()).thenReturn(List);
-               ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
-               };
-               Mockito.when(template.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
-                                               + "/widget/microservices/widgetCatalog/service/" + 1,
-                               HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
-
-               PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
-                               mockedResponse, 1);
-               assertEquals(actuaPportalRestResponse, expectedportalRestResponse);
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void deleteMicroserviceWhenNoWidgetsAssociatedTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("SUCCESS");
-               expectedportalRestResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               List<WidgetCatalog> List = new ArrayList<WidgetCatalog>();
-               PowerMockito.mockStatic(WidgetServiceHeaders.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               String whatService = "widgets-service";
-               Mockito.when(consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))).thenReturn("Test");
-               Mockito.when(ans.getBody()).thenReturn(List);
-               ParameterizedTypeReference<List<WidgetCatalog>> typeRef = new ParameterizedTypeReference<List<WidgetCatalog>>() {
-               };
-               Mockito.when(template.exchange(
-                               EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, SystemProperties.getProperty("microservices.widget.local.port"))
-                                               + "/widget/microservices/widgetCatalog/service/" + 1,
-                               HttpMethod.GET, new HttpEntity(WidgetServiceHeaders.getInstance()), typeRef)).thenReturn(ans);
-               PortalRestResponse<String> actuaPportalRestResponse = microserviceController.deleteMicroservice(mockedRequest,
-                               mockedResponse, 1);
-               assertEquals(actuaPportalRestResponse, expectedportalRestResponse);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/MicroserviceProxyControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/MicroserviceProxyControllerTest.java
deleted file mode 100644 (file)
index e712e4d..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.MicroserviceProxyController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.MicroserviceProxyService;
-import org.openecomp.portalapp.portal.service.MicroserviceProxyServiceImpl;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.client.HttpClientErrorException;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-
-
-public class MicroserviceProxyControllerTest extends MockitoTestSuite {
-
-       @Mock
-       MicroserviceProxyService microserviceProxyService = new MicroserviceProxyServiceImpl();
-
-       @InjectMocks
-       MicroserviceProxyController microserviceProxyController = new MicroserviceProxyController();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-       @Mock
-       ObjectMapper objectMapper = new ObjectMapper();
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void getMicroserviceProxyTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest)).thenReturn("Success");
-               String acutualString = microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
-               assertTrue(acutualString.equals("{\"error\":\"Success\"}"));
-       }
-
-       @Test(expected = NullPointerException.class)
-       public void getMicroserviceProxyNullPoniterExceptionTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest))
-                               .thenThrow(nullPointerException);
-               microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
-       }
-
-       @Test
-       public void getMicroserviceProxyExceptionTest() throws Exception {
-               HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.OK, "Success");
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(microserviceProxyService.proxyToDestination(1, user, mockedRequest))
-                               .thenThrow(httpClientErrorException);
-               String acutualString = microserviceProxyController.getMicroserviceProxy(mockedRequest, getMockedResponse(), 1);
-               assertTrue(acutualString.equals("{\"error\":\"\"}"));
-       }
-
-       @Test
-       public void getMicroserviceProxyByWidgetIdTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
-                               .thenReturn("Success");
-               String acutualString = microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest,
-                               getMockedResponse(), 1);
-               assertTrue(acutualString.equals("{\"error\":\"Success\"}"));
-       }
-
-       @Test(expected = NullPointerException.class)
-       public void getMicroserviceProxyByWidgetIdNullPointerExceptionTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
-                               .thenThrow(nullPointerException);
-               microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest, getMockedResponse(), 1);
-       }
-
-       @Test
-       public void getMicroserviceProxyByWidgetIdExceptionTest() throws Exception {
-               HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.OK, "Success");
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(microserviceProxyService.proxyToDestinationByWidgetId(1, user, mockedRequest))
-                               .thenThrow(httpClientErrorException);
-               String acutualString = microserviceProxyController.getMicroserviceProxyByWidgetId(mockedRequest,
-                               getMockedResponse(), 1);
-               assertTrue(acutualString.equals("{\"error\":\"\"}"));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/PolicyControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/PolicyControllerTest.java
deleted file mode 100644 (file)
index 84b600b..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.BadRequestException;
-
-import org.json.simple.JSONObject;
-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.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.scheduler.SchedulerRestInterface;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyProperties;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyResponseWrapper;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyRestInterfaceFactory;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyRestInterfaceIfc;
-import org.openecomp.portalapp.portal.scheduler.policy.PolicyUtil;
-import org.openecomp.portalapp.portal.scheduler.policy.RestObject;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-import junit.framework.Assert;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ UserUtils.class, SystemProperties.class, PolicyProperties.class, PolicyRestInterfaceFactory.class,
-               PolicyUtil.class })
-public class PolicyControllerTest {
-
-       @Mock
-       SchedulerRestInterface schedulerRestInterface;
-
-       @InjectMocks
-       PolicyController policyController = new PolicyController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockEPUser mockUser = new MockEPUser();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Before
-       public void setUp() {
-
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(PolicyProperties.class);
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL)).thenReturn("/api/getConfig");
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_MECHID_VAL))
-                               .thenReturn("m06814@controller.dcae.ecomp.att.com");
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_CLIENT_PASSWORD_VAL))
-                               .thenReturn("OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0");
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_USERNAME_VAL)).thenReturn("testpdp");
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_PASSWORD_VAL))
-                               .thenReturn("OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt");
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_ENVIRONMENT_VAL)).thenReturn("TEST");
-               Mockito.when(SystemProperties.getProperty(PolicyProperties.POLICY_SERVER_URL_VAL))
-                               .thenReturn("https://policypdp-conexus-e2e.ecomp.cci.att.com:8081/pdp");
-
-       }
-
-       @SuppressWarnings({ "unchecked", "deprecation" })
-       @Test
-       public void getPolicyInfoTest1() throws Exception {
-
-               JSONObject jsonObject = Mockito.mock(JSONObject.class);
-               PowerMockito.mockStatic(PolicyRestInterfaceFactory.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               PolicyRestInterfaceIfc policyRestInterface = Mockito.mock(PolicyRestInterfaceIfc.class);
-               PowerMockito.mockStatic(PolicyUtil.class);
-               // RestObject restObj=Mockito.mock(RestObject.class);
-               PolicyResponseWrapper policyWrapper = Mockito.mock(PolicyResponseWrapper.class);
-               PowerMockito.when(PolicyUtil.wrapResponse(Matchers.any(RestObject.class))).thenReturn(policyWrapper);
-               Mockito.when(policyWrapper.getResponse()).thenReturn("Success");
-               Mockito.when(policyWrapper.getStatus()).thenReturn(200);
-
-               PowerMockito.when(PolicyRestInterfaceFactory.getInstance()).thenReturn(policyRestInterface);
-               Mockito.doNothing().when(policyRestInterface).Post(Matchers.anyString(), Matchers.anyObject(),
-                               Matchers.anyString(), Matchers.anyString(), Matchers.anyObject());
-
-               ResponseEntity<String> responsePolicy = policyController.getPolicyInfo(mockedRequest, jsonObject);
-               Assert.assertEquals(responsePolicy.getStatusCode(), HttpStatus.OK);
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test(expected = Exception.class)
-       public void getPolicyInfoTestexpected() throws Exception {
-
-               JSONObject jsonObject = Mockito.mock(JSONObject.class);
-               PowerMockito.mockStatic(PolicyRestInterfaceFactory.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               PolicyRestInterfaceIfc policyRestInterface = Mockito.mock(PolicyRestInterfaceIfc.class);
-               PowerMockito.mockStatic(PolicyUtil.class);
-               // RestObject restObj=Mockito.mock(RestObject.class);
-               PolicyResponseWrapper policyWrapper = Mockito.mock(PolicyResponseWrapper.class);
-               PowerMockito.when(PolicyUtil.wrapResponse(Matchers.any(RestObject.class))).thenReturn(policyWrapper);
-               Mockito.when(policyWrapper.getResponse()).thenThrow(new BadRequestException());
-               Mockito.when(policyWrapper.getStatus()).thenThrow(new BadRequestException());
-
-               PowerMockito.when(PolicyRestInterfaceFactory.getInstance()).thenReturn(policyRestInterface);
-               Mockito.doNothing().when(policyRestInterface).Post(Matchers.anyString(), Matchers.anyObject(),
-                               Matchers.anyString(), Matchers.anyString(), Matchers.anyObject());
-
-               policyController.getPolicyInfo(mockedRequest, jsonObject);
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerTest.java
deleted file mode 100644 (file)
index 142d5ff..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.service.PortalAdminServiceImpl;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.AuditServiceImpl;
-
-public class PortalAdminControllerTest extends MockitoTestSuite{
-
-       @InjectMocks
-       PortalAdminController portalAdminController = new PortalAdminController();
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-       
-       @Mock
-       PortalAdminService portalAdminService = new PortalAdminServiceImpl();
-
-       @Mock
-       AuditService auditService = new AuditServiceImpl();
-
-        
-       @Mock
-       EcompPortalUtils ecompPortalUtils = new EcompPortalUtils();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       MockEPUser mockUser = new MockEPUser();
-       
-       
-       @Test
-       public void getPortalAdminsTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<PortalAdmin> expectedPortalAdminsList = new ArrayList<PortalAdmin>();
-               PortalAdmin portalAdmin= new PortalAdmin();
-               
-               portalAdmin.setUserId((long) 1);
-               portalAdmin.setLoginId("guestT");
-               portalAdmin.setFirstName("Test_FirstName");
-               portalAdmin.setLastName("Test_LastName");
-               
-               expectedPortalAdminsList.add(portalAdmin);
-               
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               
-         Mockito.when(portalAdminService.getPortalAdmins()).thenReturn(expectedPortalAdminsList);
-         List<PortalAdmin> actualPortalAdminsList =  portalAdminController.getPortalAdmins(mockedRequest, mockedResponse);
-         assertEquals(actualPortalAdminsList,expectedPortalAdminsList);
-
-       }
-//     @Test
-//     public void getPortalAdminsIfUserIsNullTest()
-//     {
-//             EPUser user = null;
-//             Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-//
-//         assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
-//
-//     }
-       
-       @Test
-       public void getPortalAdminsIfUserIsSuperAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-                assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
-
-       }
-       
-       
-       
-       @Test
-       public void createPortalAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-       
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               String sbcid = "Test";
-               
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(portalAdminService.createPortalAdmin(sbcid)).thenReturn(expectedFieldValidator);
-               actualFieldValidator = portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse);
-        assertEquals(actualFieldValidator,expectedFieldValidator);
-
-       }
-               
-//     @Test
-//     public void createPortalAdminIfUserIsNullTest()
-//     {
-//             //EPUser user = null;
-//             Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
-//             String sbcid = "null";
-//             assertNull(portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse));
-//
-//     }
-       
-       @Test
-       public void createPortalAdminIfUserIsSuperAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               String sbcid = "Test";
-               assertNull(portalAdminController.createPortalAdmin(mockedRequest, sbcid, mockedResponse));
-
-       }
-                       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/RoleManageControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/RoleManageControllerTest.java
deleted file mode 100644 (file)
index 08cddd6..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.core.RoleController;
-import org.openecomp.portalapp.controller.core.RoleFunctionListController;
-import org.openecomp.portalapp.controller.core.RoleListController;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.RoleManageController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.ExternalAccessRolesService;
-import org.springframework.web.servlet.ModelAndView;
-
-public class RoleManageControllerTest {
-
-       
-       
-       @Mock
-        RoleController roleController;
-
-       @Mock
-    RoleListController roleListController;
-
-       @Mock
-    RoleFunctionListController roleFunctionListController;
-
-
-       @Mock
-       ExternalAccessRolesService externalAccessRolesService;
-       
-       @Mock
-       ExternalAccessRolesService externalAccessRolesService1 = null;
-       
-       @InjectMocks
-       RoleManageController roleManageController = new RoleManageController(); 
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-       
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-       
-       @Test
-       public void toggleRoleTest()
-       {
-               PortalRestResponse<String> portalRestResponse = new PortalRestResponse<String>();
-               portalRestResponse.setMessage("success");
-               portalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               portalRestResponse.setStatus(portalRestStatusEnum.OK);
-               
-               PortalRestResponse<String> expectedpPortalRestResponse=roleManageController.toggleRole(mockedRequest, mockedResponse);
-               assertEquals(portalRestResponse,expectedpPortalRestResponse);
-               
-       }
-       
-//     @Test
-//     public void toggleRoleExceptionTest()
-//     {
-//             PortalRestResponse<String> portalRestResponse = new PortalRestResponse<String>();
-//             portalRestResponse.setMessage("success");
-//             portalRestResponse.setResponse(null);
-//             PortalRestStatusEnum portalRestStatusEnum = null;
-//             portalRestResponse.setStatus(portalRestStatusEnum.OK);
-//             Mockito.doNothing().when(roleListController).toggleRole(mockedRequest, mockedResponse))).th
-//             getRoleListController().toggleRole(request, response)
-//             
-//             PortalRestResponse<String> expectedpPortalRestResponse=roleManageController.toggleRole(mockedRequest, mockedResponse);
-//             assertEquals(portalRestResponse,expectedpPortalRestResponse);
-//             
-//     }
-       @Test
-       public void removeRoleTest() throws Exception
-       {
-               ModelAndView modelandView = new ModelAndView("login.htm");
-               Mockito.when(roleListController.removeRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
-               ModelAndView expectedModelandView =     roleManageController.removeRole(mockedRequest, mockedResponse);
-               assertEquals(expectedModelandView, modelandView);
-       }
-       
-       @Test
-       public void saveRoleTest() throws Exception
-       {
-               ModelAndView modelandView = new ModelAndView("login.htm");
-               Mockito.when(roleController.saveRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
-               ModelAndView expectedModelandView =     roleManageController.saveRole(mockedRequest, mockedResponse);
-               assertEquals(expectedModelandView, modelandView);
-       }
-       
-       @Test
-       public void removeRoleRoleFunctionTest() throws Exception
-       {
-               ModelAndView modelandView = new ModelAndView("login.htm");
-               Mockito.when(roleController.removeRoleFunction(mockedRequest, mockedResponse)).thenReturn(modelandView);
-               ModelAndView expectedModelandView =     roleManageController.removeRoleRoleFunction(mockedRequest, mockedResponse);
-               assertEquals(expectedModelandView, modelandView);
-       }
-       
-       @Test
-       public void addRoleRoRoleFunctionTest() throws Exception
-       {
-               ModelAndView modelandView = new ModelAndView("login.htm");
-               Mockito.when(roleController.addRoleFunction(mockedRequest, mockedResponse)).thenReturn(modelandView);
-               ModelAndView expectedModelandView =     roleManageController.addRoleRoRoleFunction(mockedRequest, mockedResponse);
-               assertEquals(expectedModelandView, modelandView);
-       }
-       
-       @Test
-       public void removeChildRoleTest() throws Exception
-       {
-               ModelAndView modelandView = new ModelAndView("login.htm");
-               Mockito.when(roleController.removeChildRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
-               ModelAndView expectedModelandView =     roleManageController.removeChildRole(mockedRequest, mockedResponse);
-               assertEquals(expectedModelandView, modelandView);
-       }
-       
-       
-       @Test
-       public void getRoleTest() throws Exception
-       {
-               Mockito.doNothing().when(roleController).getRole(mockedRequest, mockedResponse);
-               roleManageController.getRole(mockedRequest, mockedResponse);
-       }
-       
-       @Test
-       public void getRolesTest() throws Exception
-       {
-               Mockito.doNothing().when(roleListController).getRoles(mockedRequest, mockedResponse);
-               roleManageController.getRoles(mockedRequest, mockedResponse);
-       }
-       
-       @Test
-       public void getRoleFunctionListTest() throws Exception
-       {
-               Mockito.doNothing().when(roleFunctionListController).getRoleFunctionList(mockedRequest, mockedResponse);
-               roleManageController.getRoleFunctionList(mockedRequest, mockedResponse);
-       }
-       
-       @Test
-       public void saveRoleFunctionTest() throws Exception
-       {
-               Mockito.doNothing().when(roleFunctionListController).saveRoleFunction(mockedRequest, mockedResponse, "test");
-               roleManageController.saveRoleFunction(mockedRequest, mockedResponse, "test");
-       }
-       
-       @Test
-       public void removeRoleFunctionTest() throws Exception
-       {
-               Mockito.doNothing().when(roleFunctionListController).removeRoleFunction(mockedRequest, mockedResponse, "test");
-               roleManageController.removeRoleFunction(mockedRequest, mockedResponse, "test");
-       }
-       
-       @Test
-       public void syncRolesTest() throws Exception
-       {
-               EPApp app = new EPApp();
-               Mockito.doNothing().when(externalAccessRolesService).syncApplicationRolesWithEcompDB(app);
-               roleManageController.syncRoles(app);
-       }
-       
-       
-       @Test
-       public void addeChildRoleTest() throws Exception
-       {
-               ModelAndView modelandView = new ModelAndView("login.htm");
-               Mockito.when(roleController.addChildRole(mockedRequest, mockedResponse)).thenReturn(modelandView);
-               ModelAndView expectedModelandView =     roleManageController.addChildRole(mockedRequest, mockedResponse);
-               assertEquals(expectedModelandView, modelandView);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/RolesApprovalSystemControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/RolesApprovalSystemControllerTest.java
deleted file mode 100644 (file)
index d7cdfe7..0000000
+++ /dev/null
@@ -1,373 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.RolesApprovalSystemController;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.transport.ExternalRequestFieldsValidator;
-
-public class RolesApprovalSystemControllerTest extends MockitoTestSuite {
-
-       @Mock
-       UserRolesService userRolesService;
-
-       @InjectMocks
-       RolesApprovalSystemController rolesApprovalSystemController = new RolesApprovalSystemController();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @Test
-       public void postUserProfileIfRolesNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Request has no roles");
-               expectedportalRestResponse.setResponse("save user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = null;
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void postUserProfileTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Saved Successfully");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
-                               "Saved Successfully");
-
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST"))
-                               .thenReturn(externalRequestFieldsValidator);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void postUserProfileFailureTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Received Bad String");
-               expectedportalRestResponse.setResponse("save user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
-                               "Received Bad String");
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST"))
-                               .thenReturn(externalRequestFieldsValidator);
-
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void postUserProfileExceptionTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse("save user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "POST")).thenThrow(nullPointerException);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .postUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void putUserProfileIfLoginIdNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Request has no login ID");
-               expectedportalRestResponse.setResponse("save user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId(null);
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void putUserProfileTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Updated Successfully");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
-                               "Updated Successfully");
-
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT"))
-                               .thenReturn(externalRequestFieldsValidator);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void putUserProfileFailureTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Received Bad String");
-               expectedportalRestResponse.setResponse("save user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
-                               "Received Bad String");
-
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT"))
-                               .thenReturn(externalRequestFieldsValidator);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
-
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void putUserProfileExceptionTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse("save user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "PUT")).thenThrow(nullPointerException);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .putUserProfile(mockedRequest, extSysUser, mockedResponse);
-
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void deleteUserProfileIfApplicationNameNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Request has no application name");
-               expectedportalRestResponse.setResponse("delete user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName(null);
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void deleteUserProfileIfMyloginrequestIdNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Request has no request ID");
-               expectedportalRestResponse.setResponse("delete user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId(null);
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void deleteUserProfileTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Deleted Successfully");
-               expectedportalRestResponse.setResponse("Success");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(true,
-                               "Success");
-
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE"))
-                               .thenReturn(externalRequestFieldsValidator);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void deleteUserProfileFailureTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("failed");
-               expectedportalRestResponse.setResponse("delete user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               ExternalRequestFieldsValidator externalRequestFieldsValidator = new ExternalRequestFieldsValidator(false,
-                               "failed");
-
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE"))
-                               .thenReturn(externalRequestFieldsValidator);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-
-       @Test
-       public void deleteUserProfileExceptionTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse("delete user profile failed");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               ExternalSystemUser extSysUser = new ExternalSystemUser();
-               extSysUser.setApplicationName("Test_App");
-               extSysUser.setLoginId("1");
-               extSysUser.setMyloginrequestId("Test");
-               List<ExternalSystemRoleApproval> externalSystemRoleApprovalList = new ArrayList<ExternalSystemRoleApproval>();
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApprovalList.add(externalSystemRoleApproval);
-               extSysUser.setRoles(externalSystemRoleApprovalList);
-               Mockito.when(userRolesService.setExternalRequestUserAppRole(extSysUser, "DELETE")).thenThrow(nullPointerException);
-               PortalRestResponse<String> actualportalRestResponse = rolesApprovalSystemController
-                               .deleteUserProfile(mockedRequest, extSysUser, mockedResponse);
-
-               assertEquals(expectedportalRestResponse, actualportalRestResponse);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SchedulerControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SchedulerControllerTest.java
deleted file mode 100644 (file)
index 755ec51..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.json.simple.JSONObject;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.scheduler.SchedulerProperties;
-import org.openecomp.portalapp.portal.scheduler.SchedulerRestInterface;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({UserUtils.class,SystemProperties.class})
-
-public class SchedulerControllerTest {
-
-       @Mock
-       SchedulerRestInterface schedulerRestInterface;
-       
-       
-
-       @InjectMocks
-       SchedulerController schedulerController = new SchedulerController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockEPUser mockUser = new MockEPUser();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test
-       public void  getTimeSlotsTest() throws Exception{
-               schedulerController.getTimeSlots(mockedRequest, "12");
-               
-       }
-       
-       @Test
-       public void postCreateNewVNFChangeTest() throws Exception{
-               //String testJsonData="{\"domain\":\"ChangeManagement\",\"scheduleName\":\"VnfUpgrade/DWF\",\"userId\":\"su7376\",\"domainData\":[{\"WorkflowName\":\"HEAT Stack Software Update for vNFs\",\"CallbackUrl\":\"http://127.0.0.1:8989/scheduler/v1/loopbacktest/vid\",\"CallbackData\":\"testing\"}],\"schedulingInfo\":{\"normalDurationInSeconds\":60,\"additionalDurationInSeconds\":60,\"concurrencyLimit\":60,\"policyId\":\"SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml\",\"vnfDetails\":[{\"groupId\":\"group1\",\"node\":[\"satmo415vbc\",\"satmo455vbc\"]}]}}";
-               JSONObject jsonObject =Mockito.mock(JSONObject.class);
-               
-               schedulerController.postCreateNewVNFChange(mockedRequest, jsonObject);
-       }
-       
-       @Test
-       public void postSubmitVnfChangeTimeslotsTest() throws Exception{
-               JSONObject jsonObject =Mockito.mock(JSONObject.class);
-               Mockito.when(jsonObject.get("scheduleId")).thenReturn("12");
-        PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.when(SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SUBMIT_NEW_VNF_CHANGE)).thenReturn("/v1/ChangeManagement/schedules/{scheduleId}/approvals");
-               schedulerController.postSubmitVnfChangeTimeslots(mockedRequest, jsonObject);
-       }
-       
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SessionCommunicationControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SessionCommunicationControllerTest.java
deleted file mode 100644 (file)
index e425e27..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
- package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.sessionmgt.SessionCommunicationController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.service.sessionmgt.ManageService;
-
-public class SessionCommunicationControllerTest {
-       
-
-       @Mock
-       ManageService manageService;
-
-       @InjectMocks
-       SessionCommunicationController SessionCommunicationController = new SessionCommunicationController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       NullPointerException nullPointerException = new NullPointerException();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-       MockEPUser mockUser = new MockEPUser();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       
-       @Test
-       public void getSessionSlotCheckIntervalTest() throws Exception
-       {
-               Mockito.when(manageService.fetchSessionSlotCheckInterval()).thenReturn(1);
-               int result = SessionCommunicationController.getSessionSlotCheckInterval(mockedRequest, mockedResponse);
-               assertEquals(result, 1);
-               
-       }
-
-       @Test
-       public void extendSessionTimeOutsTest() throws Exception
-       {
-               Mockito.doNothing().when(manageService).extendSessionTimeOuts("test");
-               Boolean result = SessionCommunicationController.extendSessionTimeOuts(mockedRequest, mockedResponse, "test");
-               assertEquals(result, true);
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java
deleted file mode 100644 (file)
index 8cf3e9c..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.net.URI;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLContext;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.conn.ssl.NoopHostnameVerifier;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.ssl.SSLContexts;
-import org.apache.http.ssl.TrustStrategy;
-import org.apache.http.util.EntityUtils;
-
-/**
- * Provides reusable features for test cases to get or post from an REST
- * endpoint, allowing use of HTTPS connections to servers that use self-signed
- * certificates.
- */
-public class SharedContextRestClient {
-
-       private static final Log logger = LogFactory.getLog(SharedContextRestClient.class);
-
-       /**
-        * Convenience method that builds and sends a GET request using properties
-        * to build the URI and populate header with credentials.
-        * 
-        * @param task
-        *            last component(s) of REST endpoint name; e.g., "get".
-        * @param contextId
-        * @param contextKey
-        * @return JSON string fetched
-        * @throws Exception
-        *             if the HTTP response code is anything other than OK.
-        */
-       public static String getJson(final SharedContextTestProperties properties, final String task,
-                       final String contextId, final String contextKey) throws Exception {
-               String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) //
-                               + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) //
-                               + '/' + task;
-               return getJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), //
-                               properties.getProperty(SharedContextTestProperties.PORT, -1), //
-                               properties.getProperty(SharedContextTestProperties.SECURE, true), //
-                               properties.getProperty(SharedContextTestProperties.UEBKEY), //
-                               properties.getProperty(SharedContextTestProperties.USERNAME), //
-                               properties.getProperty(SharedContextTestProperties.PASSWORD), requestPath, //
-                               contextId, //
-                               contextKey);
-       }
-
-       /**
-        * Constructs and sends a GET request using the specified values.
-        * 
-        * @param hostname
-        * @param port
-        *            ignored if negative
-        * @param secure
-        *            If true, uses https; else http.
-        * @param headerUebkey
-        * @param headerUsername
-        * @param headerPassword
-        * @param requestPath
-        *            full path of the REST endpoint
-        * @param contextId
-        * @param contextKey
-        * Ignored if null
-        * @return JSON result
-        */
-       public static String getJson(final String hostname, final int port, boolean secure, final String headerUebkey,
-                       final String headerUsername, final String headerPassword, final String requestPath, final String contextId,
-                       final String contextKey) throws Exception {
-
-               URIBuilder uriBuilder = new URIBuilder();
-               if (secure)
-                       uriBuilder.setScheme("https");
-               else
-                       uriBuilder.setScheme("http");
-               uriBuilder.setHost(hostname);
-               if (port > 0)
-                       uriBuilder.setPort(port);
-               uriBuilder.setPath(requestPath);
-               uriBuilder.addParameter("context_id", contextId);
-               if (contextKey != null)
-                       uriBuilder.addParameter("ckey", contextKey);
-               final URI uri = uriBuilder.build();
-
-               CloseableHttpClient httpClient;
-               if (secure) {
-                       // Tell HttpClient to accept any server certificate for HTTPS.
-                       // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error
-                       SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
-                               @Override
-                               public boolean isTrusted(final X509Certificate[] chain, final String authType)
-                                               throws CertificateException {
-                                       return true;
-                               }
-                       }).build();
-                       SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,
-                                       NoopHostnameVerifier.INSTANCE);
-                       httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
-               } else {
-                       httpClient = HttpClients.createDefault();
-               }
-
-               HttpGet httpGet = new HttpGet(uri);
-               httpGet.setHeader("uebkey", headerUebkey);
-               httpGet.setHeader("username", headerUsername);
-               httpGet.setHeader("password", headerPassword);
-
-               String json = null;
-               CloseableHttpResponse response = null;
-               try {
-                       logger.debug("GET from " + uri);
-                       response = httpClient.execute(httpGet);
-                       logger.info("Status is " + response.getStatusLine());
-                       if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK)
-                               throw new Exception("Status is " + response.getStatusLine().toString());
-                       HttpEntity entity = response.getEntity();
-                       if (entity == null) {
-                               logger.warn("Entity is null!");
-                       } else {
-                               // entity content length is never set.
-                               // this naively tries to read everything.
-                               json = EntityUtils.toString(entity);
-                               EntityUtils.consume(entity);
-                       }
-               } finally {
-                       if (response != null)
-                               response.close();
-               }
-               return json;
-       }
-
-       /**
-        * Convenience method that builds and sends a POST request using properties
-        * to build the URI and populate header with credentials.
-        * 
-        * @param path
-        *            last component(s) of REST endpoint name; e.g., "users" or
-        *            "user/ab1234/roles".
-        * @return JSON string fetched
-        * @throws Exception
-        *             if the HTTP response code is anything other than OK.
-        */
-       public static String postJson(final SharedContextTestProperties properties, final String path, final String json)
-                       throws Exception {
-               String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) //
-                               + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) //
-                               + '/' + path;
-               return postJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), //
-                               properties.getProperty(SharedContextTestProperties.PORT, -1), //
-                               properties.getProperty(SharedContextTestProperties.SECURE, true), //
-                               properties.getProperty(SharedContextTestProperties.UEBKEY), //
-                               properties.getProperty(SharedContextTestProperties.USERNAME), //
-                               properties.getProperty(SharedContextTestProperties.PASSWORD), //
-                               requestPath, //
-                               json);
-       }
-
-       /**
-        * Constructs and sends a POST request using the specified values.
-        * 
-        * @param hostname
-        * @param port
-        * @param secure
-        *            If true, uses https; else http.
-        * @param requestPath
-        *            full path of the REST endpoint
-        * @param headerUebkey
-        * @param headerUsername
-        * @param headerPassword
-        * @param json
-        *            Content to post
-        * @return JSON result
-        * @throws Exception
-        */
-       public static String postJson(final String hostname, final int port, boolean secure, final String headerUebkey,
-                       final String headerUsername, final String headerPassword, final String requestPath, final String json)
-                       throws Exception {
-
-               URIBuilder builder = new URIBuilder();
-               if (secure)
-                       builder.setScheme("https");
-               else
-                       builder.setScheme("http");
-               builder.setHost(hostname);
-               if (port > 0)
-                       builder.setPort(port);
-               builder.setPath(requestPath);
-               final URI uri = builder.build();
-
-               CloseableHttpClient httpClient;
-               if (secure) {
-                       // Tell HttpClient to accept any server certificate for HTTPS.
-                       // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error
-                       SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
-                               @Override
-                               public boolean isTrusted(final X509Certificate[] chain, final String authType)
-                                               throws CertificateException {
-                                       return true;
-                               }
-                       }).build();
-                       SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,
-                                       NoopHostnameVerifier.INSTANCE);
-                       httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
-               } else {
-                       httpClient = HttpClients.createDefault();
-               }
-               HttpPost httpPost = new HttpPost(uri);
-               httpPost.setHeader("uebkey", headerUebkey);
-               httpPost.setHeader("username", headerUsername);
-               httpPost.setHeader("password", headerPassword);
-
-               StringEntity postEntity = new StringEntity(json, ContentType.create("application/json", Consts.UTF_8));
-               httpPost.setEntity(postEntity);
-
-               String responseJson = null;
-               CloseableHttpResponse response = null;
-               try {
-                       logger.debug("POST to " + uri);
-                       response = httpClient.execute(httpPost);
-                       logger.info("Status is " + response.getStatusLine());
-                       if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK)
-                               throw new Exception("Status is " + response.getStatusLine().toString());
-
-                       HttpEntity entity = response.getEntity();
-                       if (entity == null) {
-                               logger.warn("Entity is null!");
-                       } else {
-                               long len = entity.getContentLength();
-                               if (len < 0)
-                                       logger.warn("Content length is -1");
-                               if (len < 2048) {
-                                       responseJson = EntityUtils.toString(entity);
-                                       logger.debug(responseJson);
-                               } else {
-                                       logger.warn("Not implemented - stream content");
-                               }
-                               EntityUtils.consume(entity);
-                       }
-               } finally {
-                       if (response != null)
-                               response.close();
-               }
-               return responseJson;
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java
deleted file mode 100644 (file)
index bdede7d..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-/*package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Assert;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-*//**
- * Tests the endpoints exposed by the Shared Context REST controller in Portal
- * Core.
- * 
- * @author clott
- *//*
-public class SharedContextRestControllerTest {
-
-       private final Log logger = LogFactory.getLog(getClass());
-
-       private final SharedContextTestProperties properties;
-
-       private final String ckey = "ckey";
-       private final String cvalue = "cvalue";
-       
-       // Supposed to be a Portal session ID
-       private final String cxid = UUID.randomUUID().toString();
-
-       private final String key = "key123";
-       private final String value1 = "first value";
-       private final String value2 = "second value";
-
-       public SharedContextRestControllerTest() throws IOException {
-               properties = new SharedContextTestProperties();
-       }
-
-       @SuppressWarnings("unchecked")
-       //@Test
-       public void test() throws Exception {
-               String response = null, val = null;
-               ObjectMapper mapper = new ObjectMapper();
-               Map<String, Object> responseMap, jsonMap;
-
-               logger.info("Get on empty context");
-               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
-               // Should not exist - just generated the UUID
-               Map<String, Object> responseMap1 = mapper.readValue(response, Map.class);
-               response = (String) responseMap1.get("response");
-               Assert.assertNull(response);
-
-               logger.info("Set a new context");
-               response = setContext(cxid, key, value1);
-               Assert.assertNotNull(response);
-               responseMap = mapper.readValue(response, Map.class);
-               String responseValue = (String) responseMap.get("response");
-               Assert.assertNotNull(responseValue);
-               Assert.assertEquals("added", responseValue);
-
-               logger.info("Get existing context");
-               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
-               responseMap = mapper.readValue(response, Map.class);
-               jsonMap = (Map<String,Object>) responseMap.get("response");
-               Assert.assertNotNull(jsonMap);
-               val = (String) jsonMap.get(cvalue);
-               Assert.assertEquals(val, value1);
-
-               logger.info("Overwrite exiting context");
-               response = setContext(cxid, key, value2);
-               Assert.assertNotNull(response);
-               responseMap = mapper.readValue(response, Map.class);
-               response = (String) responseMap.get("response");
-               Assert.assertNotNull(responseValue);
-               // Assert.assertEquals("replaced", responseValue);
-
-               logger.info("Get existing context to verify overwrite");
-               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
-               responseMap = mapper.readValue(response, Map.class);
-               jsonMap = (Map<String,Object>) responseMap.get("response");
-               Assert.assertNotNull(jsonMap);
-               val = (String) jsonMap.get(cvalue);
-               Assert.assertEquals(val, value2);
-
-               logger.info("Delete one context");
-               response = SharedContextRestClient.getJson(properties, "remove", cxid, key);
-               responseMap = mapper.readValue(response, Map.class);
-               response = (String) responseMap.get("response");
-               Assert.assertEquals(response, "removed");
-
-               logger.info("Clear the context");
-               response = SharedContextRestClient.getJson(properties, "clear", cxid, null);
-               Assert.assertEquals("", response);
-       }
-
-       private String setContext(String context, String id, String value) throws Exception {
-               ObjectMapper mapper = new ObjectMapper();
-               HashMap<String,String> stringMap = new HashMap<String,String>();
-               stringMap.put("context_id", cxid);
-               stringMap.put(ckey, key);
-               stringMap.put(cvalue, value2);
-               String json = mapper.writeValueAsString(stringMap);
-               String response = SharedContextRestClient.postJson(properties, "set", json);
-               return response;
-       }
-}
-*/
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java
deleted file mode 100644 (file)
index 1c84942..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * Trivial extension of Properties that populates itself from a known source.
- */
-public class SharedContextTestProperties extends Properties {
-
-       private static final long serialVersionUID = -4064100267979036550L;
-
-       // property names
-       public static final String HOSTNAME = "hostname";
-       public static final String PORT = "port";
-       public static final String SECURE = "secure";
-       public static final String APPNAME = "appname";
-       public static final String RESTPATH = "restpath";
-       public static final String UEBKEY = "uebkey";
-       public static final String USERNAME = "username";
-       public static final String PASSWORD = "password";
-
-       /**
-        * Expected on the classpath
-        */
-       private static final String propertiesFileName = "shared-context-test.properties";
-
-       /**
-        * Constructor populates itself from properties file found in same package.
-        * 
-        * @throws Exception
-        */
-       public SharedContextTestProperties() throws IOException {
-               InputStream inStream = getClass().getResourceAsStream(propertiesFileName);
-               if (inStream == null)
-                       throw new IOException("Failed to find file on classpath: " + propertiesFileName);
-               super.load(inStream);
-               inStream.close();
-       }
-
-       public int getProperty(final String name, final int defVal) throws NumberFormatException {
-               String prop = getProperty(name);
-               if (prop == null)
-                       return defVal;
-               return Integer.parseInt(prop);
-       }
-       
-       public boolean getProperty(final String name, final boolean defVal) {
-               String prop = getProperty(name);
-               if (prop == null)
-                       return false;
-               return Boolean.parseBoolean(prop);
-       }
-       
-       // Test this class
-       public static void main(String[] args) throws Exception {
-               SharedContextTestProperties p = new SharedContextTestProperties();
-               System.out.println("Property " + SharedContextTestProperties.HOSTNAME + " = "
-                               + p.getProperty(SharedContextTestProperties.HOSTNAME));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/TicketEventControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/TicketEventControllerTest.java
deleted file mode 100644 (file)
index ad696c2..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.TicketEventService;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(UserUtils.class)
-public class TicketEventControllerTest {
-
-       @Mock
-       UserNotificationService userNotificationService;
-       
-       @Mock
-       TicketEventService ticketEventService;
-       
-       @InjectMocks
-       TicketEventController ticketEventController = new TicketEventController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockEPUser mockUser = new MockEPUser();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test
-       public void saveUserValidationTest() throws Exception {
-               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
-               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               expectedPortalRestResponse.setMessage("Invalid Org User ID");
-               expectedPortalRestResponse.setResponse(null);
-               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site."
-                               + " The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  "
-                               + "\"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,"
-                               + "\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; "
-                               + "ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\","
-                               + "\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\","
-                               + "\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": "
-                               + "{\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      "
-                               + "\"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},"
-                               + "\"SubscriberInfo\": {\"UserList\": [\"guest\"] }}";
-
-               actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-                               mockedResponse, ticketEventJson);
-               assertEquals(actualPortalRestResponse, expectedPortalRestResponse);
-       }
-       
-       @Test
-       public void saveTest() throws Exception {
-               String UserIds[] = new String[1];
-               UserIds[0] = "guest";
-               ArrayList<EPUser> users = new ArrayList<>();
-               EPUser user = new EPUser();
-               user.setOrgUserId("guest");
-               user.setId((long)1);
-               users.add(user);
-               List<String> userIdlist = new ArrayList<>();
-               userIdlist.add("guest");
-               JsonNode application = null ;
-               String ticketEventJson = "{\"application\":\"cbus\",\"event\":{\"body\":{\"ticketStatePhrase\":\"We recently detected a problem with the equipment at your site. "
-                               + "The event is in queue for immediate work.\",\"ivrNotificationFlag\":\"1\",\"expectedRestoreDate\":0,\"bridgeTransport\":\"AOTS\",\"reptRequestType\":0,"
-                               + "\"ticketNum\":\"000002000857405\",\"assetID\":\"CISCO_1921C1_ISR_G2\",\"eventDate\":1490545134601,"
-                               + "\"eventAbstract\":\"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; "
-                               + "ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\","
-                               + "\"severity\":\"2 - Major\",\"ticketPriority\":\"3\",\"reportedCustomerImpact\":0,\"testAutoIndicator\":0,"
-                               + "\"supportGroupName\":\"US-TEST-ORT\",\"lastModifiedDate\":\"1487687703\",\"messageGroup\":\"SNMP\",\"csi\":0,\"mfabRestoredTime\":0},"
-                               + "\"header\":{\"timestamp\":\"2017-02-21T14:35:05.219+0000\",\"eventSource\":\"aotstm\",\"entityId\":\"000002000857405\",\"sequenceNumber\":2},"
-                               + "\"blinkMsgId\":\"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\":\"130.4.165.158\"},\"SubscriberInfo\":{\"UserList\":[\"guest\"]}}";
-               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
-               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               expectedPortalRestResponse.setMessage("processEventNotification: notification created");
-               expectedPortalRestResponse.setResponse("NotificationId");
-               
-               
-               Mockito.when(userNotificationService.getUsersByOrgIds(userIdlist)).thenReturn(users);
-               Mockito.when(ticketEventService.getNotificationHyperLink(application, "", "")).thenReturn("");
-               actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-                               mockedResponse, ticketEventJson);
-               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.OK) == 0);
-       }
-
-       @Test
-       public void saveTestForException() throws Exception {
-               String ticketEventJson = "\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-                               mockedResponse, ticketEventJson);
-               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-       }
-
-//     @Test
-//     public void saveTestForApplicationValid() throws Exception {
-//             String ticketEventJson = "{\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-//             PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-//                             mockedResponse, ticketEventJson);
-//             assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-//             assertEquals(actualPortalRestResponse.getMessage(), "application is mandatory");
-//
-//     }
-
-       @Test
-       public void saveTestForBodyValid() throws Exception {
-               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",\"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-                               mockedResponse, ticketEventJson);
-               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-               assertEquals(actualPortalRestResponse.getMessage(), "body is mandatory");
-       }
-
-       @Test
-       public void saveTestForEventSourceValid() throws Exception {
-               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-                               mockedResponse, ticketEventJson);
-               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-               assertEquals(actualPortalRestResponse.getMessage(), "Message Source is mandatory");
-       }
-
-       @Test
-       public void saveTestForUserListValid() throws Exception {
-               String ticketEventJson = "{\"application\": \"cbus\",\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\",  \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\",      \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {}}";
-               PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-                               mockedResponse, ticketEventJson);
-               assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-               assertEquals(actualPortalRestResponse.getMessage(), "At least one user Id is mandatory");
-       }
-       
-       @Test
-       public void saveTestForApplicationValid() throws Exception {
-       String ticketEventJson = "{\"event\": {\"body\": {\"ticketStatePhrase\": \"We recently detected a problem with the equipment at your site. The event is in queue for immediate work.\", \"ivrNotificationFlag\": \"1\",\"expectedRestoreDate\": 0,\"bridgeTransport\": \"AOTS\", \"reptRequestType\": 0,\"ticketNum\": \"000002000857405\",\"assetID\": \"CISCO_1921C1_ISR_G2\", \"eventDate\": 1490545134601,\"eventAbstract\": \"ospfIfConfigError trap received from Cisco_1921c1_ISR_G2 with arguments: ospfRouterId=Cisco_1921c1_ISR_G2; ospfIfIpAddress=1921c1_288266; ospfAddressLessIf=0; ospfPacketSrc=172.17.0.11; ospfConfigErrorType=2; ospfPacketType=1\",\"severity\": \"2 - Major\",\"ticketPriority\": \"3\",\"reportedCustomerImpact\": 0,\"testAutoIndicator\": 0,\"supportGroupName\": \"US-TEST-ORT\",\"lastModifiedDate\": \"1487687703\",\"messageGroup\": \"SNMP\",\"csi\": 0,\"mfabRestoredTime\": 0},\"header\": {\"timestamp\": \"2017-02-21T14:35:05.219+0000\",\"eventSource\": \"aotstm\",\"entityId\": \"000002000857405\", \"sequenceNumber\": 2 },\"blinkMsgId\": \"f38c071e-1a47-4b55-9e72-1db830100a61\",\"sourceIP\": \"130.4.165.158\"},\"SubscriberInfo\": {\"UserList\": [\"hk8777\"] }}";
-       PortalRestResponse<String> actualPortalRestResponse = ticketEventController.handleRequest(mockedRequest,
-       mockedResponse, ticketEventJson);
-       assertTrue(actualPortalRestResponse.getStatus().compareTo(PortalRestStatusEnum.ERROR) == 0);
-       assertEquals(actualPortalRestResponse.getMessage(), "Application is mandatory");
-
-       }
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserControllerTest.java
deleted file mode 100644 (file)
index b821b31..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.UserController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.portal.service.UserServiceImpl;
-import org.openecomp.portalapp.portal.transport.ProfileDetail;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(CipherUtil.class)
-public class UserControllerTest extends MockitoTestSuite {
-
-       @InjectMocks
-       UserController userController = new UserController();
-
-       @Mock
-       UserService userService = new UserServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void getLoggedinUserExceptionTest() {
-               EPUser epUser = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
-               PortalRestResponse<ProfileDetail> expectedResponse = new PortalRestResponse<ProfileDetail>();
-               expectedResponse.setMessage(null);
-               expectedResponse.setResponse(null);
-               PortalRestStatusEnum enu = null;
-               expectedResponse.setStatus(enu.ERROR);
-               PortalRestResponse<ProfileDetail> response = userController.getLoggedinUser(mockedRequest);
-               assertEquals(response, expectedResponse);
-       }
-
-       @Test
-       public void getLoggedinUserTest() throws Exception {
-               EPUser epUser = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
-               PortalRestResponse<ProfileDetail> expectedResponse = new PortalRestResponse<ProfileDetail>();
-               expectedResponse.setMessage("success");
-               ProfileDetail profileDetail = new ProfileDetail();
-               expectedResponse.setResponse(profileDetail);
-               PortalRestStatusEnum enu = null;
-               expectedResponse.setStatus(enu.OK);
-               PowerMockito.mockStatic(CipherUtil.class);
-               Mockito.when(CipherUtil.decrypt(epUser.getLoginPwd())).thenReturn("Password");
-               PortalRestResponse<ProfileDetail> response = userController.getLoggedinUser(mockedRequest);
-               assertEquals(response.getMessage(), expectedResponse.getMessage());
-               assertEquals(response.getStatus(), expectedResponse.getStatus());
-       }
-
-       @Test
-       public void modifyLoggedinUserIfProfileNullTest() {
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("java.lang.NullPointerException");
-               expectedResponse.setResponse(null);
-               PortalRestStatusEnum enu = null;
-               expectedResponse.setStatus(enu.ERROR);
-               ProfileDetail profileDetail = null;
-               PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
-               assertEquals(actualResponse, expectedResponse);
-               assertEquals(actualResponse.getStatus(), expectedResponse.getStatus());
-       }
-
-       @Test
-       public void modifyLoggedinUserExceptionTest() {
-               EPUser epUser = mockUser.mockEPUser();
-
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage(
-                               "java.lang.ClassCastException: com.sun.crypto.provider.AESCipher$General cannot be cast to javax.crypto.CipherSpi");
-               expectedResponse.setResponse(null);
-               PortalRestStatusEnum enu = null;
-               expectedResponse.setStatus(enu.ERROR);
-               ProfileDetail profileDetail = new ProfileDetail();
-               profileDetail.setFirstName("Test_FirstName");
-               profileDetail.setLastName("Test_LastName");
-               profileDetail.setEmail("Test_Email");
-               profileDetail.setLoginId("Test_LoginId");
-               profileDetail.setLoginPassword("Test_LoginPassword");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
-               PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
-               assertEquals(actualResponse, expectedResponse);
-
-       }
-
-       /*@Test
-       public void modifyLoggedinUserTest() throws Exception {
-               EPUser epUser = mockUser.mockEPUser();
-               PortalRestResponse<String> expectedResponse = new PortalRestResponse<String>();
-               expectedResponse.setMessage("success");
-               expectedResponse.setResponse(null);
-               PortalRestStatusEnum enu = null;
-               expectedResponse.setStatus(enu.OK);
-               ProfileDetail profileDetail = new ProfileDetail();
-               profileDetail.setFirstName("Test_FirstName");
-               profileDetail.setLastName("Test_LastName");
-               profileDetail.setEmail("Test_Email");
-               profileDetail.setLoginId("Test_LoginId");
-               profileDetail.setLoginPassword("Test_LoginPassword");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(epUser);
-               PowerMockito.mockStatic(CipherUtil.class);
-               Mockito.when(CipherUtil.decrypt(epUser.getLoginPwd())).thenReturn("Password");
-               PortalRestResponse<String> actualResponse = userController.modifyLoggedinUser(mockedRequest, profileDetail);
-               System.out.println(actualResponse);
-       }*/
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserNotificationControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserNotificationControllerTest.java
deleted file mode 100644 (file)
index ff08d8a..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-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.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.UserNotificationController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.service.UserNotificationService;
-import org.openecomp.portalapp.portal.service.UserNotificationServiceImpl;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemVO;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(UserUtils.class)
-public class UserNotificationControllerTest {
-
-       @Mock
-       FunctionalMenuService functionalMenuService = new FunctionalMenuServiceImpl();
-
-       @Mock
-       UserNotificationService userNotificationService = new UserNotificationServiceImpl();
-
-       @InjectMocks
-       UserNotificationController userNotificationController = new UserNotificationController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockEPUser mockUser = new MockEPUser();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test
-       public void getMenuIdRoleIdTest() {
-               List<FunctionalMenuRole> expectedMenuRoleList = new ArrayList<FunctionalMenuRole>();
-               FunctionalMenuRole functionalMenuRole = new FunctionalMenuRole();
-               functionalMenuRole.setId(new Integer(99999999));
-               functionalMenuRole.setMenuId((long) 137);
-               functionalMenuRole.setAppId(new Integer(456));
-               functionalMenuRole.setRoleId(new Integer(6214));
-               expectedMenuRoleList.add(functionalMenuRole);
-               List<FunctionalMenuRole> actualFunctionalMenuRoleList = null;
-               Mockito.when(functionalMenuService.getFunctionalMenuRole()).thenReturn(expectedMenuRoleList);
-               actualFunctionalMenuRoleList = userNotificationController.getMenuIdRoleId(mockedRequest, mockedResponse);
-               assertTrue(actualFunctionalMenuRoleList.equals(expectedMenuRoleList));
-
-       }
-
-       @Test
-       public void getNotificationsTest() {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EpNotificationItem> expectedEpNotificationList = new ArrayList<EpNotificationItem>();
-               EpNotificationItem epNotificationItem = new EpNotificationItem();
-               epNotificationItem.setNotificationId((long) 200);
-               expectedEpNotificationList.add(epNotificationItem);
-               PortalRestResponse<List<EpNotificationItem>> expectedportalRestResponse = new PortalRestResponse<List<EpNotificationItem>>();
-               expectedportalRestResponse.setMessage("success");
-               expectedportalRestResponse.setResponse(expectedEpNotificationList);
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               PortalRestResponse<List<EpNotificationItem>> actualPortalRestResponse = null;
-               Mockito.when(userNotificationService.getNotifications(user.getId())).thenReturn(expectedEpNotificationList);
-               actualPortalRestResponse = userNotificationController.getNotifications(mockedRequest, mockedResponse);
-               assertTrue(expectedportalRestResponse.equals(actualPortalRestResponse));
-
-       }
-
-       @Test
-       public void getNotificationsCatchesExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EpNotificationItem> expectedEpNotificationList = null;
-               PortalRestResponse<List<EpNotificationItem>> expectedportalRestResponse = new PortalRestResponse<List<EpNotificationItem>>();
-               expectedportalRestResponse.setMessage(null);
-               expectedportalRestResponse.setResponse(expectedEpNotificationList);
-               expectedportalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<List<EpNotificationItem>> actualPortalRestResponse = null;
-               Mockito.when(userNotificationService.getNotifications(user.getId())).thenThrow(new NullPointerException());
-               actualPortalRestResponse = userNotificationController.getNotifications(mockedRequest, mockedResponse);
-               assertTrue(expectedportalRestResponse.equals(actualPortalRestResponse));
-       }
-
-       @Test
-       public void getAdminNotificationsTest() {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EpNotificationItemVO> actualEpNotificationsList = new ArrayList<EpNotificationItemVO>();
-               List<EpNotificationItemVO> expectedEpNotificationsList = new ArrayList<EpNotificationItemVO>();
-               EpNotificationItemVO epNotificationItemVO = new EpNotificationItemVO();
-               epNotificationItemVO.setId((long) 1);
-               expectedEpNotificationsList.add(epNotificationItemVO);
-               Mockito.when(userNotificationService.getAdminNotificationVOS(Matchers.anyLong())).thenReturn(expectedEpNotificationsList);
-               actualEpNotificationsList = userNotificationController.getAdminNotifications(mockedRequest, mockedResponse);
-               assertTrue(actualEpNotificationsList.equals(expectedEpNotificationsList));
-       }
-
-       @Test
-       public void saveTestWhenNotificationIsNull() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
-               expectedPortalRestResponse.setMessage("FAILURE");
-               expectedPortalRestResponse.setResponse("Notification Header cannot be null or empty");
-               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-
-               EpNotificationItem notificationItem = null;
-               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
-               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
-       }
-
-       @Test
-       public void saveTestWhenEndTimeIsGreater() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
-               expectedPortalRestResponse.setMessage("FAILURE");
-               expectedPortalRestResponse.setResponse("End Time should be greater than  start time");
-               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               EpNotificationItem notificationItem = new EpNotificationItem();
-               notificationItem.setNotificationId((long) 1);
-               notificationItem.setMsgHeader("Test");
-               Date currentDate = new Date();
-               Calendar c = Calendar.getInstance();
-               c.setTime(currentDate);
-               c.add(Calendar.DATE, 1);
-               Date currentDatePlusOne = c.getTime();
-               notificationItem.setStartTime(currentDatePlusOne);
-               notificationItem.setEndTime(currentDate);
-
-               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
-               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
-
-       }
-
-       @Test
-       public void saveTestWhenNoRoleIDExists() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
-               expectedPortalRestResponse.setMessage("FAILURE");
-               expectedPortalRestResponse.setResponse("No Roles Ids Exist for the selected Roles");
-               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               EpNotificationItem notificationItem = new EpNotificationItem();
-               notificationItem.setNotificationId((long) 1);
-               notificationItem.setMsgHeader("Test");
-               notificationItem.setIsForAllRoles("N");
-               Date currentDate = new Date();
-               Calendar c = Calendar.getInstance();
-               c.setTime(currentDate);
-               c.add(Calendar.DATE, 1);
-               Date currentDatePlusOne = c.getTime();
-               notificationItem.setStartTime(currentDate);
-               notificationItem.setEndTime(currentDatePlusOne);
-               List<Long> roleList = new ArrayList<Long>();
-               notificationItem.setRoleIds(roleList);
-               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
-               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
-       }
-
-       @Test
-       public void saveTest() throws Exception {
-               EPUser user = mockUser.mockEPUser();
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute("user", user);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<String> actualPortalRestResponse = new PortalRestResponse<String>();
-               PortalRestResponse<String> expectedPortalRestResponse = new PortalRestResponse<String>();
-               expectedPortalRestResponse.setMessage("SUCCESS");
-               expectedPortalRestResponse.setResponse("");
-               expectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               EpNotificationItem notificationItem = new EpNotificationItem();
-               notificationItem.setNotificationId((long) 1);
-               notificationItem.setMsgHeader("Test");
-               notificationItem.setIsForAllRoles("Y");
-               Date currentDate = new Date();
-               Calendar c = Calendar.getInstance();
-               c.setTime(currentDate);
-               c.add(Calendar.DATE, 1);
-               Date currentDatePlusOne = c.getTime();
-               notificationItem.setStartTime(currentDate);
-               notificationItem.setEndTime(currentDatePlusOne);
-               List<Long> roleList = new ArrayList<Long>();
-               Long role1 = (long) 1;
-               roleList.add(role1);
-               notificationItem.setRoleIds(roleList);
-               HttpServletRequest request = mockitoTestSuite.getMockedRequest();
-               PowerMockito.mockStatic(UserUtils.class);
-               Mockito.when(UserUtils.getUserIdAsLong(request)).thenReturn((long) 1);
-               Mockito.when(userNotificationService.saveNotification(notificationItem)).thenReturn("Test");
-               actualPortalRestResponse = userNotificationController.save(mockedRequest, mockedResponse, notificationItem);
-               assertTrue(actualPortalRestResponse.equals(expectedPortalRestResponse));
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserRolesControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/UserRolesControllerTest.java
deleted file mode 100644 (file)
index 138c207..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.controller.UserRolesController;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EcompAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FieldsValidator.FieldName;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EcompPortalUtils.class, EPCommonSystemProperties.class, EcompAuditLog.class, SystemProperties.class})
-public class UserRolesControllerTest extends MockitoTestSuite {
-
-       String userid = "ab1234";
-
-       @Mock
-       UserRolesService userRolesService;
-       
-       @Mock
-       SearchService searchService;
-       
-       @Mock
-       AuditService auditService;
-       
-       @Mock
-       AdminRolesService adminRolesService;
-
-       @Mock
-       FieldsValidator fieldsValidator;
-
-       @InjectMocks
-       UserRolesController userRolesController = new UserRolesController();
-
-       @Mock
-       private DataAccessService dataAccessService;
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       @Mock
-       EPUser epuser;
-
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void putAppWithUserRoleRequestTest() {
-
-               FieldsValidator actualFieldsValidator = null;
-
-               AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser();
-               List<RoleInAppForUser> listofRoles = new ArrayList<RoleInAppForUser>();
-
-               appWithRolesForUser.setOrgUserId("guest");
-               appWithRolesForUser.setAppId((long) 550);
-               appWithRolesForUser.setAppName("D2 Services Analytics Dashboard");
-               appWithRolesForUser.setAppRoles(listofRoles);
-
-               RoleInAppForUser roleInAppForUser = new RoleInAppForUser();
-               roleInAppForUser.setIsApplied(false);
-               roleInAppForUser.setRoleId((long) 1);
-               roleInAppForUser.setRoleName("System Administrator");
-
-               RoleInAppForUser roleInAppForUser1 = new RoleInAppForUser();
-               roleInAppForUser1.setIsApplied(true);
-               roleInAppForUser1.setRoleId((long) 16);
-               roleInAppForUser1.setRoleName("Standard User");
-
-               listofRoles.add(roleInAppForUser);
-               listofRoles.add(roleInAppForUser1);
-               EPUser user = mockUser.mockEPUser();
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               List<FieldName> fields = new ArrayList<>();
-
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(fields);
-               expectedFieldValidator.setErrorCode(null);
-               HttpSession session = mockedRequest.getSession();
-               session.setAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME), user);
-
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(userRolesService.putUserAppRolesRequest(appWithRolesForUser, user))
-                               .thenReturn(expectedFieldValidator);
-
-               actualFieldsValidator = userRolesController.putAppWithUserRoleRequest(mockedRequest, appWithRolesForUser,
-                               mockedResponse);
-               assertEquals(expectedFieldValidator.getHttpStatusCode(), actualFieldsValidator.getHttpStatusCode());
-               assertEquals(expectedFieldValidator.getErrorCode(), actualFieldsValidator.getErrorCode());
-               assertEquals(expectedFieldValidator.getFields(), actualFieldsValidator.getFields());
-
-       }
-       
-       @Test
-       public void getPhoneBookSearchResultBadPermissionsTest() {
-               String searchString = "test";
-               String actualResult = null;
-               String expectedResult = null;
-               
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-               
-               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
-               assertEquals(expectedResult, actualResult);
-       
-       }
-       
-       @Test
-       public void getPhoneBookSearchResultValidationTest() {
-               String searchString = " t";
-               String actualResult = null;
-               String expectedResult = null;
-               
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-               
-               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
-               assertEquals(expectedResult, actualResult);
-       
-       }
-       
-       @Test
-       public void getPhoneBookSearchResultTest() {
-               String searchString = "test";
-               String actualResult = null;
-               String expectedResult = null;
-               
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-               
-               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
-               assertEquals(expectedResult, actualResult);
-       
-       }
-       
-       @Test
-       public void getAppsWithAdminRoleStateForUserTest(){
-               
-               String orgUserId = "hb123f";
-               AppsListWithAdminRole actualResult = new AppsListWithAdminRole();
-               AppsListWithAdminRole expectedResult = new AppsListWithAdminRole();
-               EPUser user = mockUser.mockEPUser();
-       //      PowerMockito.mockStatic(EcompPortalUtils.class);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId)).thenReturn(actualResult);
-               
-               actualResult = userRolesController.getAppsWithAdminRoleStateForUser(mockedRequest, orgUserId, mockedResponse);
-               assertEquals(expectedResult, actualResult);
-       }
-       
-       /*@Test
-       public void getAppsWithAdminRoleStateForUserBadRequestTest(){
-               
-               String orgUserId = "hb123f";
-               AppsListWithAdminRole actualResult = null;
-               AppsListWithAdminRole expectedResult = null;
-               EPUser user = mockUser.mockEPUser();
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               PowerMockito.when(EcompPortalUtils.legitimateUserId(orgUserId)).thenReturn(false);
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.getAppsWithAdminRoleStateForUser(orgUserId)).thenReturn(actualResult);
-               
-               actualResult = userRolesController.getAppsWithAdminRoleStateForUser(mockedRequest, orgUserId, mockedResponse);
-               assertEquals(expectedResult, actualResult);
-       }*/
-       
-       @Test
-       public void putAppsWithAdminRoleStateForUserBadStatusCodeTest(){
-               FieldsValidator actualFieldsValidator = null;
-               AppsListWithAdminRole newAppsListWithAdminRoles = new  AppsListWithAdminRole();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fieldNames = new ArrayList<FieldName>();
-               expectedFieldsValidator.setErrorCode(null);
-               expectedFieldsValidator.setFields(fieldNames);
-               expectedFieldsValidator.setHttpStatusCode((long)200);
-               
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               
-               actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
-               assertEquals(expectedFieldsValidator, actualFieldsValidator);
-       }
-       
-       
-       /*@Test
-       public void putAppsWithAdminRoleStateForUserTest() {
-               
-               FieldsValidator actualFieldsValidator = null;
-               AppsListWithAdminRole newAppsListWithAdminRoles = new  AppsListWithAdminRole();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(EcompAuditLog.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN)).thenReturn("1400");
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)).thenReturn("1400");
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP)).thenReturn("1400");
-               Mockito.when(SystemProperties.getProperty(SystemProperties.MDC_TIMER)).thenReturn("1400");
-               
-               actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
-
-               System.out.println(actualFieldsValidator);
-               Mockito.when(searchService.searchUsersInPhoneBook(searchString)).thenReturn(actualResult);
-               
-               actualResult = userRolesController.getPhoneBookSearchResult(mockedRequest, searchString, mockedResponse);
-               assertEquals(expectedResult, actualResult);
-       
-       }*/
-       
-       /*@Test
-       public void putAppsWithAdminRoleStateForUserTest(){
-               FieldsValidator actualFieldsValidator = null;
-               AppsListWithAdminRole newAppsListWithAdminRoles = new  AppsListWithAdminRole();
-               FieldsValidator expectedFieldsValidator = new FieldsValidator();
-               List<FieldName> fieldNames = new ArrayList<FieldName>();
-               expectedFieldsValidator.setErrorCode(null);
-               expectedFieldsValidator.setFields(fieldNames);
-               expectedFieldsValidator.setHttpStatusCode((long)200);
-               
-               EPUser user = mockUser.mockEPUser();
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               PowerMockito.mockStatic(EcompAuditLog.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(adminRolesService.setAppsWithAdminRoleStateForUser(newAppsListWithAdminRoles));
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-
-       //      Mockito.call(auditService.logActivity(auditLog, null));
-//             Mockito.when(SystemProperties.getProperty(EcompAuditLog.CD_ACTIVITY_UPDATE_ACCOUNT_ADMIN)).thenReturn("1400");
-//             Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_BEGIN_TIMESTAMP)).thenReturn("1400");
-//             Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.AUDITLOG_END_TIMESTAMP)).thenReturn("1400");
-//             Mockito.when(SystemProperties.getProperty(SystemProperties.MDC_TIMER)).thenReturn("1400");
-               
-               actualFieldsValidator = userRolesController.putAppsWithAdminRoleStateForUser(mockedRequest, newAppsListWithAdminRoles, mockedResponse);
-               assertEquals(expectedFieldsValidator, actualFieldsValidator);
-       }*/
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/WebAnalyticsExtAppControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/WebAnalyticsExtAppControllerTest.java
deleted file mode 100644 (file)
index 43f4019..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.AppsCacheService;
-import org.openecomp.portalapp.portal.service.AppsCacheServiceImple;
-import org.openecomp.portalapp.portal.transport.Analytics;
-import org.openecomp.portalsdk.core.onboarding.crossapi.PortalAPIResponse;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.AuditServiceImpl;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class,IOUtils.class,Object.class})
-public class WebAnalyticsExtAppControllerTest {
-
-       
-       
-       @InjectMocks
-       WebAnalyticsExtAppController webAnalyticsExtAppController = new WebAnalyticsExtAppController();
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-       
-       @Mock
-       AppsCacheService appCacheService = new AppsCacheServiceImple();
-
-       @Mock
-       AuditService auditService = new AuditServiceImpl();
-
-//     @Mock 
-//     InputStream analyticsFileStream;
-
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       /*@Test
-       public void getAnalyticsScriptTest() throws Exception
-       {
-               String expectedResponse = "http://www.ecomp.com";
-
-               InputStream analyticsFileStream = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(IOUtils.class);
-               Mockito.when(IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name())).thenReturn("PORTAL_ENV_URL");
-               Mockito.when(SystemProperties.getProperty("frontend_url")).thenReturn("http://www.ecomp.com/test");
-               String actualResponse = webAnalyticsExtAppController.getAnalyticsScript(mockedRequest);
-//     assertNull(webAnalyticsExtAppController.getAnalyticsScript(mockedRequest));
-               
-       //      System.out.println(actualResponse);
-               assertTrue(actualResponse.equals(expectedResponse));    
-       }*/
-
-       /*@Test
-       public void getAnalyticsScriptExceptionTest() throws Exception
-       {
-               String expectedResponse = "";
-               InputStream analyticsFileStream = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(IOUtils.class);
-               Mockito.when(IOUtils.toString(analyticsFileStream, StandardCharsets.UTF_8.name())).thenThrow(nullPointerException);
-               Mockito.when(SystemProperties.getProperty("frontend_url")).thenReturn("http://www.ecomp.com/test");
-       String actualResponse = webAnalyticsExtAppController.getAnalyticsScript(mockedRequest);
-         assertEquals(actualResponse,expectedResponse);
-       }*/
-
-       @Test
-       public void storeAnalyticsScriptIfAnalyticsNullTest() throws Exception
-       {
-               PortalAPIResponse       expectedPortalAPIResponse = new PortalAPIResponse(true, "error");
-               Analytics analytics= null;
-               Mockito.when(mockedRequest.getHeader("uebkey")).thenReturn(null);
-               PortalAPIResponse       actualPortalAPIResponse =       webAnalyticsExtAppController.storeAnalyticsScript(mockedRequest, analytics);
-               assertTrue(expectedPortalAPIResponse.getMessage().equals(actualPortalAPIResponse.getMessage()));
-               assertTrue(expectedPortalAPIResponse.getStatus().equals(actualPortalAPIResponse.getStatus()));  
-       }
-               
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogMarkupControllerTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/WidgetsCatalogMarkupControllerTest.java
deleted file mode 100644 (file)
index 7f8d6a4..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertTrue;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.WidgetServiceHeaders;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.ConsulHealthService;
-import org.openecomp.portalapp.portal.service.ConsulHealthServiceImpl;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.web.client.RestClientException;
-import org.springframework.web.client.RestTemplate;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({WidgetServiceHeaders.class, EcompPortalUtils.class})
-public class WidgetsCatalogMarkupControllerTest extends MockitoTestSuite {
-       
-       @InjectMocks
-       WidgetsCatalogMarkupController widgetsCatalogMarkupController = new WidgetsCatalogMarkupController();
-       
-       @Mock
-       ConsulHealthService consulHealthService = new ConsulHealthServiceImpl();
-       
-       @Mock
-       RestTemplate template = new RestTemplate();
-       
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-    @Mock
-    CipherUtil cipherUtil= new CipherUtil();
-    
-    @Mock
-    EcompPortalUtils ecompPortalUtils =new EcompPortalUtils();
-       
-       @Mock
-       WidgetServiceHeaders WidgetServiceHeaders ;
-       
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       @SuppressWarnings("static-access")
-       @Test
-       public void getWidgetMarkupTest() throws RestClientException, Exception
-       {
-               String whatService = "widgets-service";
-               PowerMockito.mockStatic(WidgetServiceHeaders.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               Mockito.when(template.getForObject(EcompPortalUtils.widgetMsProtocol() + "://" + consulHealthService.getServiceLocation(whatService, null) + "/widget/microservices/markup/" + 1, String.class,
-                               WidgetServiceHeaders.getInstance())).thenReturn("Success");
-               String response = widgetsCatalogMarkupController.getWidgetMarkup(mockedRequest, mockedResponse, 1);
-               assertTrue(response.equals("Success")); 
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties
deleted file mode 100644 (file)
index 938d11f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-###
-# ============LICENSE_START==========================================
-# ONAP Portal
-# ===================================================================
-# Copyright © 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============================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-###
-
-hostname= www.portal.onap.org
-# port = 80
-secure = true
-appname = ecompportal
-restpath = context
-uebkey = xgnLrmNmkfCRnIwa
-username = username
-password = password
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/core/MockEPUser.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/core/MockEPUser.java
deleted file mode 100644 (file)
index 4cc471b..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.core;
-
-import java.util.Date;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public class MockEPUser {
-
-       public EPUser mockEPUser() {
-
-               EPUser ePUser = new EPUser();
-               ePUser.setOrgId(null);
-               ePUser.setManagerId(null);
-               ePUser.setFirstName("test");
-               ePUser.setLastName("test");
-               ePUser.setMiddleInitial(null);
-               ePUser.setPhone(null);
-               ePUser.setFax(null);
-               ePUser.setCellular(null);
-               ePUser.setEmail(null);
-               ePUser.setAddressId(null);
-               ePUser.setAlertMethodCd(null);
-               ePUser.setHrid(null);
-               ePUser.setOrgUserId("guestT");
-               ePUser.setOrgCode(null);
-               ePUser.setAddress1(null);
-               ePUser.setAddress2(null);
-               ePUser.setCity(null);
-               ePUser.setState(null);
-               ePUser.setZipCode(null);
-               ePUser.setCountry(null);
-               ePUser.setOrgManagerUserId(null);
-               ePUser.setLocationClli(null);
-               ePUser.setBusinessCountryCode(null);
-               ePUser.setBusinessCountryName(null);
-               ePUser.setBusinessUnit(null);
-               ePUser.setBusinessUnitName(null);
-               ePUser.setDepartment(null);
-               ePUser.setDepartmentName(null);
-               ePUser.setCompanyCode(null);
-               ePUser.setCompany(null);
-               ePUser.setZipCodeSuffix(null);
-               ePUser.setJobTitle(null);
-               ePUser.setCommandChain(null);
-               ePUser.setSiloStatus(null);
-               ePUser.setCostCenter(null);
-               ePUser.setFinancialLocCode(null);
-
-               ePUser.setLoginId(null);
-               ePUser.setLoginPwd(null);
-               Date date = new Date();
-               ePUser.setLastLoginDate(date);
-               ePUser.setActive(true);
-               ePUser.setInternal(false);
-               ePUser.setSelectedProfileId(null);
-               ePUser.setTimeZoneId(null);
-               ePUser.setOnline(true);
-               ePUser.setChatId(null);
-               ePUser.setUserApps(null);
-               ePUser.setPseudoRoles(null);
-
-               ePUser.setId((long) -1);
-               return ePUser;
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AdminUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AdminUserAppTest.java
deleted file mode 100644 (file)
index c6160b2..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.AdminUserApp;
-
-public class AdminUserAppTest {
-
-       public AdminUserApp mockAdminUserApp(){
-               
-               AdminUserApp adminUserApp = new AdminUserApp();
-       
-               adminUserApp.setUserId((long)1);
-               adminUserApp.setFirstName("test");
-               adminUserApp.setLastName("test");
-               adminUserApp.setOrgUserId("test");
-               adminUserApp.setAppId((long)1);
-               adminUserApp.setAppName("test");
-               
-               return adminUserApp;
-       }
-       
-       @Test
-       public void adminUserAppTest(){
-               AdminUserApp adminUserApp = mockAdminUserApp();
-               
-               assertEquals(adminUserApp.getUser_Id(), new Long(1));
-               assertEquals(adminUserApp.getFirstName(), "test");
-               assertEquals(adminUserApp.getLastName(), "test");
-               assertEquals(adminUserApp.getOrgUserId(), "test");
-               assertEquals(adminUserApp.getAppName(), "test");
-               assertEquals(adminUserApp.getAppId(), new Long(1));
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AdminUserApplicationsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AdminUserApplicationsTest.java
deleted file mode 100644 (file)
index bf931a6..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.AdminUserApp;
-import org.openecomp.portalapp.portal.domain.AdminUserApplications;
-
-public class AdminUserApplicationsTest {
-
-       public AdminUserApplications mockAdminUserApplications(){
-               
-               AdminUserApp adminUserApp = new AdminUserApp();
-               
-               adminUserApp.setUserId((long)1);
-               adminUserApp.setFirstName("test");
-               adminUserApp.setLastName("test");
-               adminUserApp.setOrgUserId("test");
-               adminUserApp.setAppId((long)1);
-               adminUserApp.setAppName("test");
-               
-               AdminUserApplications adminUserApplications = new AdminUserApplications(adminUserApp);
-               
-               adminUserApplications.setUser_Id((long)1);
-               adminUserApplications.setFirstName("test");
-               adminUserApplications.setLastName("test");
-               adminUserApplications.setOrgUserId("test");     
-               return adminUserApplications;
-       }
-       
-       @Test
-       public void adminUserAppTest(){
-               AdminUserApplications adminUserApplications = mockAdminUserApplications();
-           AdminUserApp adminUserApp = new AdminUserApp();
-               
-               adminUserApp.setUserId((long)1);
-               adminUserApp.setFirstName("test");
-               adminUserApp.setLastName("test");
-               adminUserApp.setOrgUserId("test");
-               adminUserApp.setAppId((long)1);
-               adminUserApp.setAppName("test");
-               AdminUserApplications adminUserApplications1 = new AdminUserApplications(adminUserApp);
-               
-               assertEquals(adminUserApplications.getUser_Id(), new Long(1));
-               assertEquals(adminUserApplications.getFirstName(), "test");
-               assertEquals(adminUserApplications.getLastName(), "test");
-               assertEquals(adminUserApplications.getOrgUserId(), "test");
-               
-               
-               assertEquals(adminUserApplications1.getApps().get(0).getAppId(),adminUserApp.getAppId());
-               assertEquals(adminUserApplications1.getApps().get(0).getAppName(),adminUserApp.getAppName());
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AppContactUsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/AppContactUsTest.java
deleted file mode 100644 (file)
index 8043a9d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.AppContactUs;
-
-public class AppContactUsTest {
-
-       public AppContactUs  mockAppContactUs(){
-               AppContactUs appContactUs = new AppContactUs();
-               appContactUs.setDescription("test");
-               appContactUs.setContactEmail("test");
-               appContactUs.setContactName("test");
-               appContactUs.setUrl("test");
-               appContactUs.setActiveYN("test");
-                               
-               return appContactUs;
-       }
-       
-       @Test
-       public void mockAppContactUsTest(){
-               AppContactUs appContactUs = mockAppContactUs();
-               
-               assertEquals(appContactUs.getDescription(), "test");
-               assertEquals(appContactUs.getContactEmail(), "test");
-               assertEquals(appContactUs.getContactName(), "test");
-               assertEquals(appContactUs.getUrl(), "test");
-               assertEquals(appContactUs.getActiveYN(), "test");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/CentralRoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/CentralRoleFunctionTest.java
deleted file mode 100644 (file)
index fb0aee8..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-
-public class CentralRoleFunctionTest {
-
-       public CentralRoleFunction mockCentralRoleFunction(){
-               
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-                  
-                  centralRoleFunction.setCode("test");
-                  centralRoleFunction.setName("test");
-                  centralRoleFunction.setAppId((long)1);
-                  centralRoleFunction.setEditUrl("test");
-                  
-               return centralRoleFunction;
-       }
-       
-       @Test
-       public void centralRoleFunctionTest(){
-               CentralRoleFunction centralRoleFunction = mockCentralRoleFunction();
-               
-               assertEquals(centralRoleFunction.getAppId(), new Long(1));
-               assertEquals(centralRoleFunction.getCode(), "test");
-               assertEquals(centralRoleFunction.getName(), "test");
-               assertEquals(centralRoleFunction.getEditUrl(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPAppRoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPAppRoleFunctionTest.java
deleted file mode 100644 (file)
index 0b46857..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-
-public class EPAppRoleFunctionTest {
-
-       public EPAppRoleFunction mockEPAppRoleFunction(){
-               EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
-               epAppRoleFunction.setRoleId((long)1);
-               epAppRoleFunction.setAppId((long)1);
-               epAppRoleFunction.setCode("test");
-               
-               return epAppRoleFunction;
-       }
-       
-       @Test
-       public void epAppRoleFunctionTest(){
-               EPAppRoleFunction epAppRoleFunction = mockEPAppRoleFunction();
-               
-               assertEquals(epAppRoleFunction.getRoleId(), new Long(1));
-               assertEquals(epAppRoleFunction.getAppId(), new Long(1));
-               assertEquals(epAppRoleFunction.getCode(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPAppTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPAppTest.java
deleted file mode 100644 (file)
index 0838309..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPApp;
-
-public class EPAppTest {
-
-       public EPApp mockEPApp(){
-               EPApp epApp = new EPApp();
-                               
-               epApp.setName("test");
-               epApp.setImageUrl("test");
-               epApp.setDescription("test");
-               epApp.setNotes("test");
-               epApp.setUrl("test");
-               epApp.setAlternateUrl("test");
-               epApp.setAppRestEndpoint("test");
-               epApp.setMlAppName("test");
-               epApp.setMlAppAdminId("test");
-               epApp.setMotsId((long)1);
-               epApp.setUsername("test");
-               epApp.setAppPassword("test");
-               epApp.setOpen(false);
-               epApp.setEnabled(false);
-               epApp.setUebTopicName("test");
-               epApp.setUebSecret("test");
-               epApp.setAppType(1);
-               epApp.setCentralAuth(false);
-               epApp.setNameSpace("test");
-               
-               return epApp;
-       }
-       
-       @Test
-       public void epAppTest(){
-               EPApp epApp = mockEPApp();
-               
-               assertEquals(epApp.getName(), "test");
-               assertEquals(epApp.getImageUrl(), "test");
-               assertEquals(epApp.getDescription(), "test");
-               assertEquals(epApp.getNotes(), "test");
-               assertEquals(epApp.getUrl(), "test");
-               assertEquals(epApp.getAlternateUrl(), "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.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.getNameSpace(), "test");
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPEndpointAccountTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPEndpointAccountTest.java
deleted file mode 100644 (file)
index db40763..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPEndpointAccount;
-
-public class EPEndpointAccountTest {
-
-       public EPEndpointAccount mockEPEndpointAccount(){
-               EPEndpointAccount epEndpointAccount = new EPEndpointAccount();
-               
-               epEndpointAccount.setEp_id((long)1);
-               epEndpointAccount.setAccount_id((long)1);
-               epEndpointAccount.setId((long)1);
-               
-               return epEndpointAccount;
-       }
-       
-       @Test
-       public void epEndpointAccount(){
-               EPEndpointAccount epEndpointAccount = mockEPEndpointAccount();
-               assertEquals(epEndpointAccount.getEp_id(), new Long(1));
-               assertEquals(epEndpointAccount.getAccount_id(), new Long(1));
-               assertEquals(epEndpointAccount.getId(), new Long(1));
-               
-               assertEquals(epEndpointAccount.toString(), "EPEndpointAccount [id=1, ep_id=1, account_id=1]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPEndpointTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPEndpointTest.java
deleted file mode 100644 (file)
index 76cd580..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPEndpoint;
-
-public class EPEndpointTest {
-
-       public EPEndpoint mockEPEndpoint(){
-               EPEndpoint epEndpoint = new EPEndpoint();
-               
-               epEndpoint.setId((long)1);
-               epEndpoint.setName("test");
-               
-               return epEndpoint;
-       }
-       
-       @Test
-       public void epEndpointTest(){
-               EPEndpoint epEndpoint = mockEPEndpoint();
-               
-               assertEquals(epEndpoint.getId(), new Long(1));
-               assertEquals(epEndpoint.getName(), "test");
-               assertEquals("EPEndpoint [id=1, name=test]", epEndpoint.toString());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPRoleTest.java
deleted file mode 100644 (file)
index 891ad0e..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPRole;
-
-public class EPRoleTest {
-
-       public EPRole mockEPRole(){
-               EPRole epRole = new EPRole();
-               
-               epRole.setName("test");
-               epRole.setActive(false);
-               epRole.setPriority(1);
-               epRole.setAppId((long)1);
-               epRole.setAppRoleId((long)1);
-                  
-               return epRole;
-       }
-       
-       @Test
-       public void epRoleTest(){
-               EPRole epRole = mockEPRole();
-               
-               assertEquals(epRole.getName(), "test");
-               assertEquals(epRole.getActive(), false);
-               assertEquals(epRole.getPriority().toString(),"1");
-               assertEquals(epRole.getAppId(), new Long(1));
-               assertEquals(epRole.getAppRoleId(), new Long(1));
-               
-               assertEquals(epRole.toString(), "[Id = null, name = test]");
-
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppCatalogRolesTest.java
deleted file mode 100644 (file)
index 7090d49..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppCatalogRoles;
-
-public class EPUserAppCatalogRolesTest {
-
-       public EPUserAppCatalogRoles mockEPUserAppCatalogRoles(){
-               EPUserAppCatalogRoles epUserAppCatalogRoles = new EPUserAppCatalogRoles();
-                               
-               epUserAppCatalogRoles.setRequestedRoleId((long)1);
-               epUserAppCatalogRoles.setRolename("test");
-               epUserAppCatalogRoles.setRequestStatus("status");
-               epUserAppCatalogRoles.setAppId((long)1);
-               
-               return epUserAppCatalogRoles;
-       }
-       
-       @Test
-       public void epUserAppCatalogRolesTest(){
-               EPUserAppCatalogRoles epUserAppCatalogRoles = mockEPUserAppCatalogRoles();
-               
-               assertEquals(epUserAppCatalogRoles.getRequestedRoleId(), new Long(1));
-               assertEquals(epUserAppCatalogRoles.getRolename(), "test");
-               assertEquals(epUserAppCatalogRoles.getRequestStatus(), "status");
-               assertEquals(epUserAppCatalogRoles.getAppId(), new Long(1));
-               
-               assertEquals("EPUserAppCatalogRoles [requestedRoleId=1, rolename=test, requestStatus=status, appId=1]", epUserAppCatalogRoles.toString());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetailTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesRequestDetailTest.java
deleted file mode 100644 (file)
index 93405f1..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequest;
-import org.openecomp.portalapp.portal.domain.EPUserAppRolesRequestDetail;
-
-public class EPUserAppRolesRequestDetailTest {
-
-       public EPUserAppRolesRequestDetail mockEPUserAppRolesRequestDetail(){
-               
-               EPUserAppRolesRequest epUserAppRolesRequest = new EPUserAppRolesRequest();
-               epUserAppRolesRequest.setUserId((long)1);
-               epUserAppRolesRequest.setAppId((long)1);
-               epUserAppRolesRequest.setCreated(new Date());
-               epUserAppRolesRequest.setUpdatedDate(new Date());
-               epUserAppRolesRequest.setRequestStatus("test");
-                       
-               EPUserAppRolesRequestDetail epUserAppRolesRequestDetail = new EPUserAppRolesRequestDetail();
-               epUserAppRolesRequestDetail.setReqRoleId((long)1);
-               epUserAppRolesRequestDetail.setReqType("test");
-               epUserAppRolesRequestDetail.setEpRequestIdData(epUserAppRolesRequest);
-               
-               return epUserAppRolesRequestDetail;
-       }
-       
-       @Test
-       public void epUserAppRolesRequestDetailTest(){
-               
-               EPUserAppRolesRequest epUserAppRolesRequest = new EPUserAppRolesRequest();
-               epUserAppRolesRequest.setUserId((long)1);
-               epUserAppRolesRequest.setAppId((long)1);
-               epUserAppRolesRequest.setCreated(new Date());
-               epUserAppRolesRequest.setUpdatedDate(new Date());
-               epUserAppRolesRequest.setRequestStatus("test");
-               
-               EPUserAppRolesRequestDetail epUserAppRolesRequestDetail = mockEPUserAppRolesRequestDetail();
-               
-               EPUserAppRolesRequestDetail epUserAppRolesRequestDetail1 = new EPUserAppRolesRequestDetail();
-               epUserAppRolesRequestDetail1.setReqRoleId((long)1);
-               epUserAppRolesRequestDetail1.setReqType("test");
-               epUserAppRolesRequestDetail1.setEpRequestIdData(epUserAppRolesRequest);
-               
-               assertEquals(epUserAppRolesRequestDetail.getReqRoleId(), new Long(1));
-               assertEquals(epUserAppRolesRequestDetail.getReqType(), "test");
-       }               
-               
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppRolesTest.java
deleted file mode 100644 (file)
index eede33e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppRoles;
-
-public class EPUserAppRolesTest {
-
-       public EPUserAppRoles mockEPUserAppRoles(){
-               EPUserAppRoles epUserAppRoles = new EPUserAppRoles();
-               
-               epUserAppRoles.setRoleId((long)1);
-               epUserAppRoles.setAppId((long)1); 
-               
-               return epUserAppRoles;
-       }
-       
-       @Test
-       public void epUserAppRolesTest(){
-               EPUserAppRoles epUserAppRoles = mockEPUserAppRoles();
-               
-               assertEquals(epUserAppRoles.getRoleId(), new Long(1));
-               assertEquals(epUserAppRoles.getAppId(), new Long(1));
-               assertEquals("EpUserAppRoles [roleId=1, appId=1]", epUserAppRoles.toString());
-       }
-}
-
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppTest.java
deleted file mode 100644 (file)
index 1ab2f67..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-
-public class EPUserAppTest {
-
-       public EPUserApp mockEPUserApp(){
-               
-               EPApp epApp = new EPApp();
-               epApp.setName("test");
-               epApp.setImageUrl("test");
-               epApp.setDescription("test");
-               epApp.setNotes("test");
-               epApp.setUrl("test");
-               epApp.setAlternateUrl("test");
-               epApp.setAppRestEndpoint("test");
-               epApp.setMlAppName("test");
-               epApp.setMlAppAdminId("test");
-               epApp.setMotsId((long)1);
-               epApp.setUsername("test");
-               epApp.setAppPassword("test");
-                       
-               
-               //Role
-               EPRole epRole = new EPRole();
-               epRole.setName("test");
-               epRole.setActive(false);
-               epRole.setPriority(1);
-               epRole.setAppId((long)1);
-               epRole.setAppRoleId((long)1);
-               
-               EPUserApp user = new EPUserApp();
-               user.setUserId((long)1);
-               user.setApp(epApp);
-               user.setRole(epRole);
-               user.setPriority((short)32767);
-               
-               
-               return user;
-       }
-       
-       @Test
-       public void userTest(){
-               EPUserApp user = mockEPUserApp();
-               
-               EPApp epApp = new EPApp();
-               epApp.setName("test");
-               epApp.setImageUrl("test");
-               epApp.setDescription("test");
-               epApp.setNotes("test");
-               epApp.setUrl("test");
-               epApp.setAlternateUrl("test");
-               epApp.setAppRestEndpoint("test");
-               epApp.setMlAppName("test");
-               epApp.setMlAppAdminId("test");
-               epApp.setMotsId((long)1);
-               epApp.setUsername("test");
-               epApp.setAppPassword("test");
-               user.setApp(epApp);
-               
-               //Role
-               EPRole epRole = new EPRole();
-               epRole.setName("test");
-               epRole.setActive(false);
-               epRole.setPriority(1);
-               epRole.setAppId((long)1);
-               epRole.setAppRoleId((long)1);
-               
-               
-        assertEquals(user.getUserId(),Long.valueOf(1));
-               assertEquals(user.getApp(), epApp); 
-               assertEquals(user.getPriority().getClass(), Short.class);
-       
-               assertEquals(user.toString(), "[u: 1; a: null, r: null; appRoleId: 1]");
-               
-               assertEquals(user.hashCode(), user.hashCode());
-               
-               
-               }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppsManualSortPreferenceTest.java
deleted file mode 100644 (file)
index fdf864b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppsManualSortPreference;
-
-public class EPUserAppsManualSortPreferenceTest {
-
-       public EPUserAppsManualSortPreference mockEPUserAppsManualSortPreference(){
-               
-               EPUserAppsManualSortPreference epUserAppsManualSortPreference = new EPUserAppsManualSortPreference();
-               epUserAppsManualSortPreference.setUserId(1);
-               epUserAppsManualSortPreference.setAppId((long)1);
-               epUserAppsManualSortPreference.setAppManualSortOrder(1);
-               
-               return epUserAppsManualSortPreference;
-       }
-       
-       @Test
-       public void epUserAppsManualSortPreferenceTest(){
-       
-               EPUserAppsManualSortPreference epUserAppsManualSortPreference = mockEPUserAppsManualSortPreference();
-               
-               assertEquals(epUserAppsManualSortPreference.getUserId(), 1);
-               assertEquals(epUserAppsManualSortPreference.getAppId(), new Long(1));
-               assertEquals(epUserAppsManualSortPreference.getAppManualSortOrder(), 1);
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserAppsSortPreferenceTest.java
deleted file mode 100644 (file)
index 9e608fd..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserAppsSortPreference;
-
-public class EPUserAppsSortPreferenceTest {
-
-       public EPUserAppsSortPreference mockEPUserAppsSortPreferenceTest(){
-
-               EPUserAppsSortPreference epUserAppsSortPreference = new EPUserAppsSortPreference();
-               epUserAppsSortPreference.setUserId(1);
-               epUserAppsSortPreference.setSortPref("test");
-               epUserAppsSortPreference.setId((long)1);
-               epUserAppsSortPreference.setCreated(new Date());
-               epUserAppsSortPreference.setModified(new Date());
-               epUserAppsSortPreference.setModifiedId((long)1);
-               epUserAppsSortPreference.setRowNum((long)1);
-               epUserAppsSortPreference.setAuditTrail(null);
-               
-               return epUserAppsSortPreference;
-       }
-       
-       @Test
-       public void epUserAppsSortPreferenceTest() {
-               EPUserAppsSortPreference epUserAppsSortPreference = mockEPUserAppsSortPreferenceTest();
-               
-               assertEquals(epUserAppsSortPreference.getUserId(), 1);
-               assertEquals(epUserAppsSortPreference.getSortPref(), "test");
-               assertEquals(epUserAppsSortPreference.getId(), new Long(1));
-//             assertEquals(epUserAppsSortPreference.getCreated(), new Date());
-//             assertEquals(epUserAppsSortPreference.getModified(), new Date());
-               assertEquals(epUserAppsSortPreference.getModifiedId(), new Long(1));
-               assertEquals(epUserAppsSortPreference.getRowNum(), new Long(1));
-               assertEquals(epUserAppsSortPreference.getAuditTrail(), null);
-               
-               
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserNotificationTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserNotificationTest.java
deleted file mode 100644 (file)
index 88c02ae..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUserNotification;
-
-public class EPUserNotificationTest {
-
-       public EPUserNotification mockEPUserNotification(){
-               
-               EPUserNotification epUserNotification = new EPUserNotification();
-                               
-               epUserNotification.setUserId((long)1);
-               epUserNotification.setNotificationId((long)1);
-               epUserNotification.setViewed("test");
-               epUserNotification.setUpdateTime(new Date());           
-               
-               return epUserNotification;
-       }
-       
-       @Test
-       public void epUserNotificationTest(){
-               EPUserNotification epUserNotification = mockEPUserNotification();
-               
-               assertEquals(epUserNotification.getUserId(), new Long(1));
-               assertEquals(epUserNotification.getNotificationId(), new Long(1));
-               assertEquals(epUserNotification.getViewed(), "test");
-       //      assertEquals(epUserNotification.getUpdateTime(), new Date());
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPUserTest.java
deleted file mode 100644 (file)
index 1561cb8..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public class EPUserTest {
-
-       public EPUser mockEPUser(){
-               
-               EPUser epUser = new EPUser();
-               
-               epUser.setId((long)1);
-               epUser.setManagerId((long) 1234);
-               epUser.setFirstName("test");
-               epUser.setLastName("test");
-               epUser.setMiddleInitial("test");
-               epUser.setPhone("test");
-               epUser.setFax("test");
-               epUser.setCellular("test");
-               epUser.setEmail("test");
-               epUser.setAddressId((long) 123); 
-               epUser.setAlertMethodCd("test");
-               epUser.setHrid("test");
-               epUser.setOrgUserId("test");
-               epUser.setOrgCode("test");
-               epUser.setAddress1("test");
-               epUser.setAddress2("test");
-               epUser.setCity("test");
-               epUser.setState("test");
-               epUser.setZipCode("test");
-               epUser.setCountry("test");
-               epUser.setOrgManagerUserId("test");
-               epUser.setLocationClli("test");
-               epUser.setBusinessCountryCode("test");
-               epUser.setBusinessCountryName("test");
-               epUser.setBusinessUnit("test");
-               epUser.setBusinessUnitName("test");
-               epUser.setDepartment("test");
-               epUser.setDepartmentName("test");
-               epUser.setCompanyCode("test");
-               epUser.setCompany("test");
-               epUser.setZipCodeSuffix("test");
-               epUser.setJobTitle("test");
-               epUser.setCommandChain("test");
-               epUser.setSiloStatus("test");
-               epUser.setCostCenter("test");
-               epUser.setFinancialLocCode("test");
-               epUser.setLoginId("test");
-               epUser.setLoginPwd("test");
-               epUser.setLastLoginDate(new Date());
-               epUser.setActive(false);
-               epUser.setInternal(false);
-               epUser.setSelectedProfileId((long) 12345);
-               epUser.setTimeZoneId((long) 12345);
-               epUser.setOnline(false);
-               epUser.setChatId("test");
-               return epUser;
-                                   
-       }
-       
-       @Test
-       public void userTest(){
-               EPUser user = mockEPUser();
-               
-               assertEquals(user.getId(), new Long(1));
-               assertEquals(user.getManagerId(), new Long(1234));
-               assertEquals(user.getFirstName(), "test");
-               assertEquals(user.getLastName(), "test");
-               assertEquals(user.getMiddleInitial(), "test");
-               assertEquals(user.getPhone(), "test");
-               assertEquals(user.getFax(), "test");
-               assertEquals(user.getCellular(), "test");               
-               assertEquals(user.getEmail(), "test");
-               assertEquals(user.getAddressId(), new Long(123) );
-               assertEquals(user.getAlertMethodCd(), "test");
-               assertEquals(user.getHrid(), "test");
-               assertEquals(user.getOrgUserId(), "test");
-               assertEquals(user.getOrgCode(), "test");
-               assertEquals(user.getAddress1(), "test");
-               assertEquals(user.getAddress2(), "test");
-               assertEquals(user.getState(), "test");
-               assertEquals(user.getZipCode(), "test");
-               assertEquals(user.getCountry(), "test");
-               assertEquals(user.getOrgManagerUserId(), "test");
-               assertEquals(user.getLocationClli(), "test");
-               assertEquals(user.getBusinessCountryCode(), "test");
-               assertEquals(user.getBusinessCountryName(), "test");
-               assertEquals(user.getBusinessUnit(), "test");
-               assertEquals(user.getBusinessUnitName(), "test");
-               assertEquals(user.getDepartment(), "test");
-               assertEquals(user.getDepartmentName(), "test");
-               assertEquals(user.getCompanyCode(), "test");
-               assertEquals(user.getCompany(), "test");
-               assertEquals(user.getZipCodeSuffix(), "test");
-               assertEquals(user.getJobTitle(), "test");
-               assertEquals(user.getCommandChain(), "test");
-               assertEquals(user.getSiloStatus(), "test");
-               assertEquals(user.getFinancialLocCode(), "test");
-               assertEquals(user.getLoginId(), "test");
-               assertEquals(user.getLoginPwd(), "test");
-               assertEquals(user.getActive(), false);
-               assertEquals(user.getInternal(), false);
-               assertEquals(user.getSelectedProfileId(), new Long (12345));
-               assertEquals(user.getTimeZoneId(), new Long (12345));
-               assertEquals(user.getChatId(), "test");
-               
-               //assertEquals(user.toString(), "EPUser [orgId=null, managerId=1234, firstName=test, middleInitial=test, lastName=test, phone=test, fax=test, cellular=test, email=test, addressId=123, alertMethodCd=test, hrid=test, orgUserId=test, orgCode=test, address1=test, address2=test, city=test, state=test, zipCode=test, country=test, orgManagerUserId=test, locationClli=test, businessCountryCode=test, businessCountryName=test, businessUnit=test, businessUnitName=test, department=test, departmentName=test, companyCode=test, company=test, zipCodeSuffix=test, jobTitle=test, commandChain=test, siloStatus=test, costCenter=test, financialLocCode=test, loginId=test, loginPwd=test, lastLoginDate=Tue Sep 05 11:04:49 EDT 2017, active=false, internal=false, selectedProfileId=12345, timeZoneId=12345, online=false, chatId=test, isGuest=false, userApps=[], pseudoRoles=[]]");
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EPWidgetsManualSortPreferenceTest.java
deleted file mode 100644 (file)
index 61054ab..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPWidgetsManualSortPreference;
-
-public class EPWidgetsManualSortPreferenceTest {
-
-       public EPWidgetsManualSortPreference mockEPWidgetsManualSortPreference(){
-               EPWidgetsManualSortPreference epWidgetsManualSortPreference = new EPWidgetsManualSortPreference();
-                               
-               epWidgetsManualSortPreference.setUserId(1);
-               epWidgetsManualSortPreference.setWidgetId((long)1);
-               epWidgetsManualSortPreference.setWidgetRow(1);
-               epWidgetsManualSortPreference.setWidgetCol(1);
-               epWidgetsManualSortPreference.setWidgetWidth(1);
-               epWidgetsManualSortPreference.setWidgetHeight(1);
-                               
-               return epWidgetsManualSortPreference;
-       }
-       
-       @Test
-       public void epWidgetsManualSortPreferenceTest(){
-               EPWidgetsManualSortPreference epWidgetsManualSortPreference = mockEPWidgetsManualSortPreference();
-               
-               assertEquals(epWidgetsManualSortPreference.getWidgetId(), new Long(1));
-               assertEquals(epWidgetsManualSortPreference.getUserId(), 1);
-               assertEquals(epWidgetsManualSortPreference.getWidgetRow(), 1);
-               assertEquals(epWidgetsManualSortPreference.getWidgetCol(), 1);
-               assertEquals(epWidgetsManualSortPreference.getWidgetHeight(), 1);
-               assertEquals(epWidgetsManualSortPreference.getWidgetWidth(), 1);
-               
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EcompAppRoleIdTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EcompAppRoleIdTest.java
deleted file mode 100644 (file)
index 3adfa23..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EcompAppRoleId;
-
-public class EcompAppRoleIdTest {
-       
-       public EcompAppRoleId mockEcompAppRoleId(){
-               
-               EcompAppRoleId ecompAppRoleId = new EcompAppRoleId();
-               
-               ecompAppRoleId.setAppId((long)1);
-               ecompAppRoleId.setAppName("test");
-               ecompAppRoleId.setRoleId(1);
-               ecompAppRoleId.setRoleName("test");
-                               
-               return ecompAppRoleId;
-       }
-       
-       @Test
-       public void ecompAppRoleIdTest(){
-               
-       EcompAppRoleId ecompAppRoleId = mockEcompAppRoleId();
-       
-       assertEquals(ecompAppRoleId.getAppId(), new Long(1));
-       assertEquals(ecompAppRoleId.getAppName(), "test");
-       assertEquals(ecompAppRoleId.getRoleId().toString(), "1");
-       assertEquals(ecompAppRoleId.getRoleName(), "test");
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EcompAppRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/EcompAppRoleTest.java
deleted file mode 100644 (file)
index 6b6dd67..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EcompAppRole;
-
-public class EcompAppRoleTest {
-
-       public EcompAppRole mockEcompAppRole(){
-               EcompAppRole ecompAppRole = new EcompAppRole();
-               
-               ecompAppRole.setAppId((long)1);
-               ecompAppRole.setAppName("test");
-               ecompAppRole.setRoleId(1);
-               ecompAppRole.setRoleName("test");
-               
-               return ecompAppRole;
-       }
-       
-       @Test
-       public void ecompAppRoleTest(){
-               EcompAppRole ecompAppRole = mockEcompAppRole();
-               
-               assertEquals(ecompAppRole.getAppId(), new Long(1));
-               assertEquals(ecompAppRole.getAppName(), "test");
-               assertEquals(ecompAppRole.getRoleId().toString(), "1");
-               assertEquals(ecompAppRole.getRoleName(), "test");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalRoleDetailsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalRoleDetailsTest.java
deleted file mode 100644 (file)
index 1220aa1..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-import org.openecomp.portalapp.portal.domain.ExternalRoleDetails;
-
-public class ExternalRoleDetailsTest {
-
-       public ExternalRoleDetails mockExternalRoleDetails(){
-               
-               List<EPAppRoleFunction> epAppRoleFunctionList = new ArrayList<EPAppRoleFunction>();
-               
-               EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
-               epAppRoleFunction.setRoleId((long)1);
-               epAppRoleFunction.setAppId((long)1);
-               epAppRoleFunction.setCode("test");
-               
-               epAppRoleFunctionList.add(epAppRoleFunction);
-               
-               ExternalRoleDetails externalRoleDetails = new ExternalRoleDetails();
-               
-               externalRoleDetails.setName("test");
-               externalRoleDetails.setActive(false);
-               externalRoleDetails.setPriority(1);
-               externalRoleDetails.setAppId((long)1);
-               externalRoleDetails.setAppRoleId((long)1);
-               externalRoleDetails.setPerms(epAppRoleFunctionList);
-               
-               return externalRoleDetails;
-       }
-       
-       @Test
-       public void externalRoleDetailsTest(){
-               
-               List<EPAppRoleFunction> epAppRoleFunctionList = new ArrayList<EPAppRoleFunction>();
-               
-               EPAppRoleFunction epAppRoleFunction = new EPAppRoleFunction();
-               epAppRoleFunction.setRoleId((long)1);
-               epAppRoleFunction.setAppId((long)1);
-               epAppRoleFunction.setCode("test");
-               
-               epAppRoleFunctionList.add(epAppRoleFunction);
-               
-               ExternalRoleDetails externalRoleDetails = mockExternalRoleDetails();
-               
-               assertEquals(externalRoleDetails.getAppId(), new Long(1));
-               assertEquals(externalRoleDetails.getAppRoleId(), new Long(1));
-               assertEquals(externalRoleDetails.getPriority().toString(), "1");
-               assertEquals(externalRoleDetails.getName(), "test");
-               assertEquals(externalRoleDetails.getPriority().toString(),  "1");
-               assertEquals(externalRoleDetails.getPerms().size(), epAppRoleFunctionList.size());
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccessTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalSystemAccessTest.java
deleted file mode 100644 (file)
index d5c964f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.ExternalSystemAccess;
-
-public class ExternalSystemAccessTest {
-       
-       public ExternalSystemAccess mockExternalSystemAccess(){
-               ExternalSystemAccess externalSystemAccess = new ExternalSystemAccess("test", false);
-       
-               externalSystemAccess.setKey("test");
-               externalSystemAccess.setAccessValue(false);
-               
-               return externalSystemAccess;
-       }
-
-       @Test
-       public void externalSystemAccessTest(){
-               ExternalSystemAccess externalSystemAccess = mockExternalSystemAccess();
-               
-               assertEquals(externalSystemAccess.getKey(), "test");
-               assertEquals(externalSystemAccess.getAccessValue(), false);
-       }
-}
-
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalSystemRoleApprovalTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ExternalSystemRoleApprovalTest.java
deleted file mode 100644 (file)
index cfc6ab4..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.externalsystemapproval.model.ExternalSystemRoleApproval;
-
-public class ExternalSystemRoleApprovalTest {
-
-       public ExternalSystemRoleApproval mockExternalSystemRoleApproval(){
-               ExternalSystemRoleApproval externalSystemRoleApproval = new ExternalSystemRoleApproval();
-               externalSystemRoleApproval.setRoleName("test");
-               
-               return externalSystemRoleApproval;              
-       }
-       
-       @Test
-       public void externalSystemRoleApprovalTest(){
-               ExternalSystemRoleApproval externalSystemRoleApproval = mockExternalSystemRoleApproval();
-               
-               assertEquals(externalSystemRoleApproval.getRoleName(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppIDTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/FunctionalMenuItemWithAppIDTest.java
deleted file mode 100644 (file)
index 17a3c32..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
-
-public class FunctionalMenuItemWithAppIDTest {
-
-       public FunctionalMenuItemWithAppID mockFunctionalMenuItemWithAppID(){
-               FunctionalMenuItemWithAppID functionalMenuItemWithAppID = new FunctionalMenuItemWithAppID();
-       
-               functionalMenuItemWithAppID.setRestrictedApp(false);
-               functionalMenuItemWithAppID.setUrl("test");
-               
-               
-               return functionalMenuItemWithAppID;
-       }
-       
-       @Test
-       public void functionalMenuItemWithAppIDTest(){
-               FunctionalMenuItemWithAppID functionalMenuItemWithAppID = mockFunctionalMenuItemWithAppID();
-
-               assertEquals(functionalMenuItemWithAppID.toString(), "FunctionalMenuItem [menuId=null, column=null, text=null, parentMenuId=null, url=test, active_yn=null, appid=null, roles=null, restrictedApp=false]");
-       
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/GetAccessResultIdTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/GetAccessResultIdTest.java
deleted file mode 100644 (file)
index b0cf94d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.GetAccessResultId;
-
-public class GetAccessResultIdTest {
-       
-       public GetAccessResultId mockGetAccessResultId(){
-               
-               GetAccessResultId getAccessResultIdObj = new GetAccessResultId();
-               getAccessResultIdObj.setEcompFunction("test");
-               getAccessResultIdObj.setAppName("test");
-               getAccessResultIdObj.setRoleName("test");
-               
-               return getAccessResultIdObj;
-       }
-
-       @Test
-       public void getAccessResultIdObjTest(){
-               GetAccessResultId getAccessResultIdObj = mockGetAccessResultId();
-               
-               assertEquals(getAccessResultIdObj.getEcompFunction(), "test");
-               assertEquals(getAccessResultIdObj.getAppName(), "test");
-               assertEquals(getAccessResultIdObj.getRoleName(), "test");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/MicroserviceDataTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/MicroserviceDataTest.java
deleted file mode 100644 (file)
index c668108..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import java.util.ArrayList;
-import java.util.List;
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.MicroserviceData;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-
-public class MicroserviceDataTest {
-
-       public MicroserviceData mockMicroserviceData(){
-               
-               MicroserviceData microserviceData= new MicroserviceData();
-               
-               List<MicroserviceParameter> parameterList = new ArrayList<MicroserviceParameter>();
-               
-               MicroserviceParameter microserviceParameter = new MicroserviceParameter();
-               microserviceParameter.setId((long)1);
-               microserviceParameter.setServiceId((long)1);
-               microserviceParameter.setPara_key("test");
-               microserviceParameter.setPara_value("test");
-               parameterList.add(microserviceParameter);
-               
-               microserviceData.setId((long)1);
-               microserviceData.setName("test");
-               microserviceData.setActive("test");
-               microserviceData.setDesc("test");
-               microserviceData.setAppId((long)1);
-               microserviceData.setUrl("test");
-               microserviceData.setSecurityType("test");
-               microserviceData.setUsername("test");
-               microserviceData.setPassword("test");
-               
-               
-               return microserviceData;
-       }
-       
-       @Test
-       public void microserviceDataTest(){
-               MicroserviceData microserviceData= mockMicroserviceData();
-               
-               assertEquals(microserviceData.getId(), new Long(1));
-               assertEquals(microserviceData.getName(), "test");
-               assertEquals(microserviceData.getActive(), "test");
-               assertEquals(microserviceData.getDesc(), "test");
-       //      assertEquals(microserviceData.getAppId(), new long(1));
-               assertEquals(microserviceData.getUrl(), "test");
-               assertEquals(microserviceData.getSecurityType(), "test");
-               assertEquals(microserviceData.getUsername(), "test");
-               assertEquals(microserviceData.getPassword(), "test");
-               
-               assertEquals(microserviceData.toString(), "MicroserviceData [id=1, name=test, desc=test, appId=1, "
-                               + "url=test, securityType=test, username=test, password=test, parameterList=null]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/MicroserviceParameterTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/MicroserviceParameterTest.java
deleted file mode 100644 (file)
index 112fc0d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.MicroserviceParameter;
-
-public class MicroserviceParameterTest {
-       
-       public MicroserviceParameter mockMicroserviceParameter(){
-               MicroserviceParameter microserviceParameter = new MicroserviceParameter();
-                               
-               microserviceParameter.setId((long)1);
-               microserviceParameter.setServiceId((long)1);
-               microserviceParameter.setPara_key("test");
-               microserviceParameter.setPara_value("test");
-               
-               return microserviceParameter;
-       }
-
-       @Test
-       public void microserviceParameterTest(){
-               MicroserviceParameter microserviceParameter = mockMicroserviceParameter();
-               assertEquals(microserviceParameter.getId(), new Long(1));
-               assertEquals(microserviceParameter.getServiceId(),(long)1);
-               assertEquals(microserviceParameter.getPara_key(), "test");
-               assertEquals(microserviceParameter.getPara_value(), "test");
-               
-               assertEquals(microserviceParameter.toString(), "MicroserviceParameter [id=1, serviceId=1, para_key=test, para_value=test]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/PersUserAppSelectionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/PersUserAppSelectionTest.java
deleted file mode 100644 (file)
index 1a06b05..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.PersUserAppSelection;
-
-public class PersUserAppSelectionTest {
-
-       public PersUserAppSelection mockPersUserAppSelection(){
-               
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setUserId((long)1);
-               persUserAppSelection.setAppId((long)1);
-               persUserAppSelection.setStatusCode("test");
-               
-               return persUserAppSelection;
-       }
-       
-       @Test
-       public void persUserAppSelectionTest(){
-               
-               PersUserAppSelection persUserAppSelection1 = new PersUserAppSelection((long)1, (long)1, (long)1,"test");
-               
-               PersUserAppSelection persUserAppSelection = mockPersUserAppSelection();
-               
-               assertEquals(persUserAppSelection.getUserId(), new Long(1));
-               assertEquals(persUserAppSelection.getAppId(), new Long(1));
-               assertEquals(persUserAppSelection.getStatusCode(), "test");
-               assertEquals(persUserAppSelection1.hashCode(), new PersUserAppSelection((long)1, (long)1, (long)1,"test").hashCode());
-               assertEquals(persUserAppSelection1, new PersUserAppSelection((long)1, (long)1, (long)1,"test"));
-               assertTrue(persUserAppSelection1.equals(new PersUserAppSelection((long)1, (long)1, (long)1,"test")));
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelectionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/PersUserWidgetSelectionTest.java
deleted file mode 100644 (file)
index 10a4bcb..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.PersUserWidgetSelection;
-
-public class PersUserWidgetSelectionTest {
-
-       public PersUserWidgetSelection mockPersUserWidgetSelection(){
-               
-               PersUserWidgetSelection persUserWidgetSelection = new PersUserWidgetSelection();
-               
-               persUserWidgetSelection.setUserId((long)1);
-               persUserWidgetSelection.setWidgetId((long)1);
-               persUserWidgetSelection.setStatusCode("test");
-               
-               return persUserWidgetSelection;
-       }
-       
-       @Test
-       public void persUserWidgetSelectionTest(){
-               PersUserWidgetSelection persUserWidgetSelection = mockPersUserWidgetSelection();
-               
-               PersUserWidgetSelection persUserWidgetSelection1 = new PersUserWidgetSelection((long)1, (long)1, (long)1, "test");
-               
-               assertEquals(persUserWidgetSelection.getUserId(), new Long(1));
-               assertEquals(persUserWidgetSelection.getWidgetId(), new Long(1));
-               assertEquals(persUserWidgetSelection.getStatusCode(), "test");
-               assertEquals(persUserWidgetSelection1,  new PersUserWidgetSelection((long)1, (long)1, (long)1, "test"));
-               assertTrue(persUserWidgetSelection1.equals(new PersUserWidgetSelection((long)1, (long)1, (long)1,"test")));
-               assertEquals(persUserWidgetSelection.hashCode(), persUserWidgetSelection1.hashCode());
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ResultTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/ResultTest.java
deleted file mode 100644 (file)
index cd558cf..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.model.Result;
-
-public class ResultTest {
-       
-       public Result mockResult(){
-               
-               Result result= new Result("test");
-               
-               result.setResult("test");
-               return result;
-       }
-
-       @Test
-       public void resultTest(){
-               
-               Result result = mockResult();           
-               result.setResult("test");
-               
-               assertEquals(result.getResult(), "test");
-               
-       }
-       
-                               
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/SharedContextTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/SharedContextTest.java
deleted file mode 100644 (file)
index da00649..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.SharedContext;
-
-public class SharedContextTest {
-
-       public SharedContext mockSharedContext(){
-               
-               SharedContext sharedContext = new SharedContext();
-               sharedContext.setId((long)1);
-               sharedContext.setCreate_time(new Date());
-               sharedContext.setContext_id("test");
-               sharedContext.setCkey("test");
-               sharedContext.setCvalue("test");
-               
-               return sharedContext;
-       }
-       
-       @Test
-       public void sharedContextTest(){
-               SharedContext sharedContext = mockSharedContext();
-               
-               assertEquals(sharedContext.getId(), new Long(1));
-       //      assertEquals(sharedContext.getCreate_time(), new Date());
-               assertEquals(sharedContext.getContext_id(), "test");
-               assertEquals(sharedContext.getCkey(), "test");
-               assertEquals(sharedContext.getCvalue(), "test");
-               
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/UserIdRoleIdTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/UserIdRoleIdTest.java
deleted file mode 100644 (file)
index 10a1f21..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.UserIdRoleId;
-
-public class UserIdRoleIdTest {
-
-       public UserIdRoleId mockUserIdRoleId(){
-               UserIdRoleId userIdRoleId = new UserIdRoleId();
-               userIdRoleId.setUser_Id("test");
-               userIdRoleId.setRoleId("test");
-               userIdRoleId.setOrgUserId("test");
-               userIdRoleId.setAppId("test");
-               
-               return userIdRoleId;
-       }
-       
-       @Test
-       public void userIdRoleIdTest(){
-               UserIdRoleId userIdRoleId = mockUserIdRoleId();
-               
-               assertEquals(userIdRoleId.getUser_Id(), "test");
-               assertEquals(userIdRoleId.getRoleId(), "test");
-               assertEquals(userIdRoleId.getOrgUserId(), "test");
-               assertEquals(userIdRoleId.getAppId(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameterTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetCatalogParameterTest.java
deleted file mode 100644 (file)
index 101896a..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.WidgetCatalogParameter;
-
-public class WidgetCatalogParameterTest {
-
-       public WidgetCatalogParameter mockWidgetCatalogParameter(){
-               WidgetCatalogParameter widgetCatalogParameter = new WidgetCatalogParameter();
-               
-               widgetCatalogParameter.setId((long)1);
-               widgetCatalogParameter.setWidgetId((long)1);
-               widgetCatalogParameter.setUserId((long)1);
-               widgetCatalogParameter.setParamId((long)1);
-               widgetCatalogParameter.setUser_value("test");
-               
-               return widgetCatalogParameter;
-       }
-       
-       @Test
-       public void widgetCatalogParameterTest(){
-               WidgetCatalogParameter widgetCatalogParameter = mockWidgetCatalogParameter();
-               
-               assertEquals(widgetCatalogParameter.getId(), new Long(1));
-               assertEquals(widgetCatalogParameter.getWidgetId(), new Long(1));
-               assertEquals(widgetCatalogParameter.getUserId(), new Long(1));
-               assertEquals(widgetCatalogParameter.getParamId(), new Long(1));
-               assertEquals(widgetCatalogParameter.getUser_value(), "test");
-               assertEquals(widgetCatalogParameter.toString(), "WidgetCatalogParameter [id=1, widgetId=1, userId=1, paramId=1, user_value=test]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetCatalogTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetCatalogTest.java
deleted file mode 100644 (file)
index 4c7844f..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.*;
-import static org.junit.Assert.assertEquals;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.App;
-import org.openecomp.portalapp.portal.domain.RoleApp;
-import org.openecomp.portalapp.portal.domain.WidgetCatalog;
-
-public class WidgetCatalogTest {
-
-       public WidgetCatalog mockWidgetCatalog() {
-
-               WidgetCatalog widgetCatalog = new WidgetCatalog();
-
-               Set<RoleApp> roleAppSet = new HashSet<RoleApp>();
-               // App
-               App app = new App();
-               app.setAppId((long) 1);
-               app.setAppName("test");
-
-               // RoleApp
-               RoleApp roleApp = new RoleApp();
-               roleApp.setRoleId((long) 1);
-               roleApp.setRoleName("test");
-               roleApp.setApp(app);
-               roleApp.setWidgets(null);
-
-               roleAppSet.add(roleApp);
-
-               widgetCatalog.setId((long) 1);
-               widgetCatalog.setName("test");
-               widgetCatalog.setDesc("test");
-               widgetCatalog.setFileLocation("test");
-               widgetCatalog.setAllowAllUser("test");
-               widgetCatalog.setServiceId((long) 1);
-               widgetCatalog.setSortOrder("test");
-               widgetCatalog.setStatusCode("test");
-
-               widgetCatalog.setWidgetRoles(roleAppSet);
-
-               return widgetCatalog;
-
-       }
-       
-       @Test
-       public void widgetCatalogTest() {
-
-               // App
-               App app = new App();
-               app.setAppId((long) 1);
-               app.setAppName("test");
-
-               Set<RoleApp> roleAppSet = new HashSet<RoleApp>();
-               // RoleApp
-               RoleApp roleApp = new RoleApp();
-               roleApp.setRoleId((long) 1);
-               roleApp.setRoleName("test");
-               roleApp.setApp(app);
-               roleApp.setWidgets(null);
-
-               roleAppSet.add(roleApp);
-
-               WidgetCatalog widgetCatalog = mockWidgetCatalog();
-
-       
-               assertEquals(widgetCatalog.getId(), (long)1);
-               assertEquals(widgetCatalog.getName(), "test");
-               assertEquals(widgetCatalog.getDesc(), "test");
-               assertEquals(widgetCatalog.getFileLocation(), "test");
-               assertEquals(widgetCatalog.getAllowAllUser(), "test");
-               assertEquals(widgetCatalog.getServiceId(), new Long (1));
-               assertEquals(widgetCatalog.getSortOrder(), "test");
-               assertEquals(widgetCatalog.getStatusCode(), "test");
-               assertEquals(widgetCatalog.getWidgetRoles().size(),1);
-               
-               assertEquals("WidgetCatalog [id=1, name=test, desc=test, fileLocation=test, allowAllUser=test]", widgetCatalog.toString());
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetParameterResultTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetParameterResultTest.java
deleted file mode 100644 (file)
index 65a984d..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.WidgetParameterResult;
-
-public class WidgetParameterResultTest {
-
-       public WidgetParameterResult mockWidgetParameterResult(){
-                               
-               WidgetParameterResult widgetParameterResult = new WidgetParameterResult();
-               widgetParameterResult.setParam_id((long)1);
-               widgetParameterResult.setParam_key("test");
-               widgetParameterResult.setUser_value("test");
-               widgetParameterResult.setDefault_value("test");
-               
-               return widgetParameterResult;
-       }
-       
-       @Test
-       public void widgetParameterResultTest(){
-               
-               WidgetParameterResult widgetParameterResult = mockWidgetParameterResult();
-               
-               assertEquals(widgetParameterResult.getParam_key(), "test");
-               assertEquals(widgetParameterResult.getParam_id(), new Long(1));
-               assertEquals(widgetParameterResult.getUser_value(), "test");
-               assertEquals(widgetParameterResult.getDefault_value(), "test");
-               
-               assertEquals("WidgetParameterResult [param_id=1, param_key=test, user_value=test, default_value=test]", widgetParameterResult.toString());
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/domain/WidgetTest.java
deleted file mode 100644 (file)
index d9abd91..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.domain;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.domain.Widget;
-
-public class WidgetTest {
-
-       public Widget mockWidget(){
-               
-               Widget widget = new Widget();
-               widget.setName("test");
-               widget.setWidth(100);
-               widget.setHeight(100);
-               widget.setUrl("test");
-               widget.setAppId((long)1);
-                               
-               return widget;
-       }
-        
-       @Test
-       public void widgetTest(){
-               Widget widget = mockWidget();
-               
-               assertEquals(widget.getName(), "test");
-               assertTrue(widget.getWidth() == 100);
-               assertTrue(widget.getHeight() == 100);
-               assertEquals(widget.getUrl(), "test");
-               assertEquals(widget.getAppId(), new Long(1)); 
-               
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/exceptions/NoHealthyServiceExceptionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/exceptions/NoHealthyServiceExceptionTest.java
deleted file mode 100644 (file)
index f67b0e2..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.exceptions;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.exceptions.NoHealthyServiceException;
-
-public class NoHealthyServiceExceptionTest {
-
-       public NoHealthyServiceException mockNoHealthyServiceException(){
-               NoHealthyServiceException noHealthyServiceException = new NoHealthyServiceException("test");
-               
-               return noHealthyServiceException;
-       }
-       
-       @Test
-       public void noHealthyServiceExceptionTest(){
-               NoHealthyServiceException noHealthyServiceException = mockNoHealthyServiceException();
-               
-       //      assertEquals(noHealthyServiceException, new NoHealthyServiceException("test"));
-               assertEquals(noHealthyServiceException.toString(), "NoHealthyServiceException [] test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java
deleted file mode 100644 (file)
index 6ba142b..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.framework;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-@RunWith(MockitoJUnitRunner.class)
-public class MockitoTestSuite {
-
-
-       public MockHttpServletRequestWrapper mockedRequest = new MockHttpServletRequestWrapper(
-                       Mockito.mock(HttpServletRequest.class));
-       public HttpServletResponse mockedResponse = Mockito.mock(HttpServletResponse.class);
-
-       public MockHttpServletRequestWrapper getMockedRequest() {
-               return mockedRequest;
-       }
-
-       public HttpServletResponse getMockedResponse() {
-               return mockedResponse;
-       }
-
-       public class MockHttpServletRequestWrapper extends HttpServletRequestWrapper {
-
-               HttpSession session = Mockito.mock(HttpSession.class);
-
-               public MockHttpServletRequestWrapper(HttpServletRequest request) {
-                       super(request);
-
-               }
-
-               @Override
-               public HttpSession getSession() {
-
-                       return session;
-               }
-
-               @Override
-               public HttpSession getSession(boolean create) {
-
-                       return session;
-               }
-
-       }
-    
-       @Test
-       public void test()
-       {
-               assert(true);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java
deleted file mode 100644 (file)
index 651f7f6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.listener;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class HealthMonitorTest {
-
-       @Test
-       public void initialFlagsTest() {
-               assertEquals(false, HealthMonitor.isBackEndUp());
-               assertEquals(false, HealthMonitor.isFrontEndUp());
-               assertEquals(false, HealthMonitor.isDatabaseUp());
-               assertEquals(false, HealthMonitor.isUebUp());
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/lm/FusionLicenseManagerImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/lm/FusionLicenseManagerImplTest.java
deleted file mode 100644 (file)
index ecdf415..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.lm;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Date;
-
-import org.junit.Test;
-import org.openecomp.portalapp.lm.FusionLicenseManagerImpl;
-
-public class FusionLicenseManagerImplTest {
-
-               
-       @Test
-       public void FusionLicenseManagerImplTest(){
-               FusionLicenseManagerImpl fusionLicenseManagerImpl = new FusionLicenseManagerImpl();
-               
-               String nvlReturn = null;
-               
-               int installLicenseInt = fusionLicenseManagerImpl.installLicense();      
-               nvlReturn = fusionLicenseManagerImpl.nvl("test");               
-               Date expiredDateReturn = fusionLicenseManagerImpl.getExpiredDate();
-               
-               assertEquals(installLicenseInt, 0);             
-               assertEquals(nvlReturn, null); 
-               assertEquals(expiredDateReturn, null);  
-       
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/lm/LicenseableClassImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/lm/LicenseableClassImplTest.java
deleted file mode 100644 (file)
index 64a0489..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.lm;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.FileNotFoundException;
-
-import org.junit.Test;
-import org.openecomp.portalapp.lm.LicenseableClassImpl;
-
-public class LicenseableClassImplTest {
-
-       @Test
-       public void licenseableClassImplTest() throws FileNotFoundException{
-               LicenseableClassImpl licenseableClassImpl = new LicenseableClassImpl();
-               
-               String appNameReturn = licenseableClassImpl.getApplicationName();
-               java.io.InputStream inputStream = licenseableClassImpl.getPublicKeystoreAsInputStream();
-               String aliasReturn = licenseableClassImpl.getAlias();
-               String pswdReturn = licenseableClassImpl.getKeyPasswd();
-               String pkPswd = licenseableClassImpl.getPublicKeystorePassword();
-               String cpPswd = licenseableClassImpl.getCipherParamPassword();
-               
-               assertEquals(appNameReturn, "");
-               assertEquals(inputStream, null);
-               assertEquals(aliasReturn, "");
-               assertEquals(pswdReturn, "");
-               assertEquals(pkPswd, "");
-               assertEquals(cpPswd, "");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppCatalogItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppCatalogItemTest.java
deleted file mode 100644 (file)
index b87deb2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.model;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
-
-public class AppCatalogItemTest {
-
-       public AppCatalogItem mockAppCatalogItem(){
-               AppCatalogItem appCatalogItem = new AppCatalogItem();
-               
-               appCatalogItem.setAlternateUrl("test");
-               appCatalogItem.setMlAppName("test");
-               
-               return appCatalogItem;
-       }
-       
-       @Test
-       public void appCatalogItemTest(){
-               AppCatalogItem appCatalogItem = mockAppCatalogItem();
-               
-               AppCatalogItem appCatalogItem1 = new AppCatalogItem();
-               appCatalogItem1.setAlternateUrl("test");
-               appCatalogItem1.setMlAppName("test");
-               
-               assertEquals(appCatalogItem.getAlternateUrl(), appCatalogItem1.getAlternateUrl());
-               assertEquals(appCatalogItem.getMlAppName(), appCatalogItem1.getMlAppName());
-
-               assertEquals(appCatalogItem.toString(), "AppCatalogItem [id=null, name=null, access=null, select=null, pending=null]");
-               assertEquals(appCatalogItem.hashCode(), appCatalogItem1.hashCode());
-               assertTrue(appCatalogItem.equals(appCatalogItem1));
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppCategoryFunctionsItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppCategoryFunctionsItemTest.java
deleted file mode 100644 (file)
index 9c31aa4..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-
-public class AppCategoryFunctionsItemTest {
-
-       public AppCategoryFunctionsItem mockAppCategoryFunctionsItem(){
-               AppCategoryFunctionsItem appCategoryFunctionsItem = new AppCategoryFunctionsItem();
-               
-               appCategoryFunctionsItem.setRowId("test");
-               appCategoryFunctionsItem.setAppId("test");
-               appCategoryFunctionsItem.setApplication("test");
-               appCategoryFunctionsItem.setFunctions("test");
-               
-               return appCategoryFunctionsItem;
-       }
-       
-       @Test
-       public void appCategoryFunctionsItemTest(){
-               AppCategoryFunctionsItem appCategoryFunctionsItem = mockAppCategoryFunctionsItem();
-               
-               AppCategoryFunctionsItem appCategoryFunctionsItem1 = new AppCategoryFunctionsItem();
-               
-               appCategoryFunctionsItem1.setRowId("test");
-               appCategoryFunctionsItem1.setAppId("test");
-               appCategoryFunctionsItem1.setApplication("test");
-               appCategoryFunctionsItem1.setFunctions("test");
-               
-               assertEquals(appCategoryFunctionsItem.getRowId(), appCategoryFunctionsItem1.getRowId());
-               assertEquals(appCategoryFunctionsItem.getAppId(), appCategoryFunctionsItem1.getAppId());
-               assertEquals(appCategoryFunctionsItem.getApplication(), appCategoryFunctionsItem1.getApplication());
-               assertEquals(appCategoryFunctionsItem.getFunctions(), appCategoryFunctionsItem1.getFunctions());
-               assertEquals(appCategoryFunctionsItem.toString(), "AppCategoryFunctionsItem [rowId=test, appId=test, application=test, category=null, functions=test]");
-               assertEquals(appCategoryFunctionsItem.hashCode(), appCategoryFunctionsItem1.hashCode());
-               assertTrue(appCategoryFunctionsItem.equals(appCategoryFunctionsItem1));
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppContactUsItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/AppContactUsItemTest.java
deleted file mode 100644 (file)
index effb006..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.model;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-
-public class AppContactUsItemTest {
-       
-       public AppContactUsItem mockAppContactUsItem(){
-               AppContactUsItem appContactUsItem = new AppContactUsItem();
-                               
-               appContactUsItem.setAppId((long)1);
-               appContactUsItem.setAppName("test");
-               appContactUsItem.setDescription("test");
-               appContactUsItem.setContactName("test");
-               appContactUsItem.setContactEmail("test");
-               appContactUsItem.setUrl("test");
-               appContactUsItem.setActiveYN("test");
-               
-               return appContactUsItem;
-       }
-
-       @Test
-       public void appContactUsItemTest(){
-               AppContactUsItem appContactUsItem = mockAppContactUsItem();
-               
-               AppContactUsItem appContactUsItem1 = new AppContactUsItem();
-               appContactUsItem1.setAppId((long)1);
-               appContactUsItem1.setAppName("test");
-               appContactUsItem1.setDescription("test");
-               appContactUsItem1.setContactName("test");
-               appContactUsItem1.setContactEmail("test");
-               appContactUsItem1.setUrl("test");
-               appContactUsItem1.setActiveYN("test");
-               
-               assertEquals(appContactUsItem.getAppId(), appContactUsItem1.getAppId());
-               assertEquals(appContactUsItem.getAppName(), appContactUsItem1.getAppName());
-               assertEquals(appContactUsItem.getDescription(), appContactUsItem1.getDescription());
-               assertEquals(appContactUsItem.getContactName(), appContactUsItem1.getContactName());
-               assertEquals(appContactUsItem.getContactEmail(), appContactUsItem1.getContactEmail());
-               assertEquals(appContactUsItem.getUrl(), appContactUsItem1.getUrl());
-               assertEquals(appContactUsItem.getActiveYN(), appContactUsItem1.getActiveYN());
-               assertEquals(appContactUsItem.toString(), "AppContactUsItem [appId=1, appName=test, description=test, contactName=test, contactEmail=test, url=test, activeYN=test]");
-               assertEquals(appContactUsItem.hashCode(), appContactUsItem1.hashCode());
-               assertTrue(appContactUsItem.equals(appContactUsItem1));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/SearchResultItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/model/SearchResultItemTest.java
deleted file mode 100644 (file)
index e9c3faa..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.model;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-
-public class SearchResultItemTest {
-
-       public SearchResultItem mockSearchResultItem(){
-               SearchResultItem searchResultItem = new SearchResultItem();
-                               
-               searchResultItem.setRowId("test");
-               searchResultItem.setCategory("test");
-               searchResultItem.setName("test");
-               searchResultItem.setTarget("test");
-               searchResultItem.setUuid("test");
-               
-               return searchResultItem;
-       }
-       
-       @Test
-       public void searchResultItemTest(){
-               SearchResultItem searchResultItem = mockSearchResultItem();
-               
-               SearchResultItem searchResultItem1 = new SearchResultItem();
-               searchResultItem1.setRowId("test");
-               searchResultItem1.setCategory("test");
-               searchResultItem1.setName("test");
-               searchResultItem1.setTarget("test");
-               searchResultItem1.setUuid("test");
-               
-               assertEquals(searchResultItem.getRowId(), searchResultItem.getRowId());
-               assertEquals(searchResultItem.getCategory(), searchResultItem.getCategory());
-               assertEquals(searchResultItem.getName(), searchResultItem.getName());
-               assertEquals(searchResultItem.getTarget(), searchResultItem.getTarget());
-               assertEquals(searchResultItem.getUuid(), searchResultItem.getUuid());
-               assertEquals(searchResultItem.toString(), searchResultItem.toString());
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/AppContactUsServiceImplTest.java
deleted file mode 100644 (file)
index e80087e..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.AppContactUs;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.ecomp.model.AppCategoryFunctionsItem;
-import org.openecomp.portalapp.portal.ecomp.model.AppContactUsItem;
-import org.openecomp.portalapp.portal.service.AppContactUsService;
-import org.openecomp.portalapp.portal.service.AppContactUsServiceImpl;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-
-public class AppContactUsServiceImplTest {
-
-       
-     @Mock
-        DataAccessService dataAccessService = new DataAccessServiceImpl();
-    
-     @Mock
-     AppContactUsService AppContactUsService = new AppContactUsServiceImpl();
-     
-     @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-     @InjectMocks
-     AppContactUsServiceImpl appContactUsServiceImpl = new AppContactUsServiceImpl();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       
-       public EPApp getApp() {
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(true);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-               return app;
-       }
-       @Test
-       public void getAppContactUsTest() throws Exception
-       {
-               
-               List<AppContactUsItem> contactUsItemList  = new ArrayList<>();
-               AppContactUsItem appContactUsItem= new AppContactUsItem();
-               appContactUsItem.setAppName("testNew");
-               contactUsItemList.add(appContactUsItem);
-               AppContactUsItem appContactUsItem1= new AppContactUsItem();
-               appContactUsItem1.setAppName("test");
-               contactUsItemList.add(appContactUsItem1);
-               Mockito.when(dataAccessService.executeNamedQuery("getAppContactUsItems", null, null)).thenReturn(contactUsItemList);
-               List<AppContactUsItem> expectedcontactUsItemList = appContactUsServiceImpl.getAppContactUs();
-               assertEquals(expectedcontactUsItemList, contactUsItemList);             
-       }
-       
-       @Test
-       public void getAppsAndContactsTest() throws Exception
-       {
-               List<AppContactUsItem> contactUsItemList  = new ArrayList<>();
-               AppContactUsItem appContactUsItem= new AppContactUsItem();
-               appContactUsItem.setAppName("testNew");
-               contactUsItemList.add(appContactUsItem);
-               AppContactUsItem appContactUsItem1= new AppContactUsItem();
-               appContactUsItem1.setAppName("test");
-               contactUsItemList.add(appContactUsItem1);
-               Mockito.when(dataAccessService.executeNamedQuery("getAppsAndContacts", null, null)).thenReturn(contactUsItemList);
-               List<AppContactUsItem> expectedcontactUsItemList = appContactUsServiceImpl.getAppsAndContacts();
-               assertEquals(expectedcontactUsItemList, contactUsItemList);             
-       }
-       
-       @Test
-       public void getAppCategoryFunctionsTest() throws Exception
-       {
-               List<AppCategoryFunctionsItem> list  = new ArrayList<>();
-               Mockito.when(dataAccessService.executeNamedQuery("getAppCategoryFunctions", null, null)).thenReturn(list);
-               List<AppCategoryFunctionsItem> expectedlist = appContactUsServiceImpl.getAppCategoryFunctions();
-               assertEquals(list, expectedlist); 
-       }
-       
-       @Test(expected = java.lang.Exception.class)
-       public void saveAppContactUsTest() throws Exception
-       {
-               HashMap<String, Object> map = new HashMap<String, Object>();
-               List<AppContactUsItem> contactUsModelList = new ArrayList<>();
-               AppContactUsItem appContactUsItem= new AppContactUsItem();
-               appContactUsItem.setAppId((long) 1);
-               contactUsModelList.add(appContactUsItem);
-               AppContactUs appContact = new AppContactUs();
-               Mockito.when(dataAccessService.getDomainObject(AppContactUs.class, 1, map)).thenReturn(appContact);
-               EPApp app = getApp();
-               Mockito.when(dataAccessService.getDomainObject(EPApp.class, 1, new HashMap<String, Object>())).thenReturn(app);
-               AppContactUs contactUs  = new AppContactUs();
-               contactUs.setApp(app);
-               contactUs.setDescription(appContactUsItem.getDescription());
-               contactUs.setContactName(appContactUsItem.getContactName());
-               contactUs.setContactEmail(appContactUsItem.getContactEmail());
-               contactUs.setActiveYN(appContactUsItem.getActiveYN());
-               contactUs.setUrl(appContactUsItem.getUrl());
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(contactUs,map);
-               appContactUsServiceImpl.saveAppContactUs(contactUsModelList);
-       }
-       
-       @Test(expected = java.lang.NullPointerException.class)
-       public void deleteContactUsTest() throws Exception
-       {
-               HashMap<String, Object> map = new HashMap<String, Object>();
-               AppContactUs contactUs = new AppContactUs();
-               Mockito.when((AppContactUs) dataAccessService.getDomainObject(AppContactUs.class, 1, map)).thenReturn(contactUs);
-               appContactUsServiceImpl.deleteContactUs((long) 1);
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/DashboardSearchServiceImplTest.java
deleted file mode 100644 (file)
index 853ecbe..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-
-public class DashboardSearchServiceImplTest {
-       
-       @Mock
-       DataAccessService dataAccessService;
-       
-       @InjectMocks
-       DashboardSearchServiceImpl dashboardSearchServiceImpl = new DashboardSearchServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       NullPointerException nullPointerException = new NullPointerException();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-       MockEPUser mockUser = new MockEPUser();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-    
-       @Test
-       public void searchResultsTest()
-       {
-               Map<String, String> params = new HashMap<>();
-               params.put("userId", "guestT");
-               params.put("searchQuery", "test");
-               
-               List<SearchResultItem> list = new ArrayList<>();
-               SearchResultItem searchResultItem= new SearchResultItem();
-               searchResultItem.setCategory("test");
-               list.add(searchResultItem);
-               Mockito.when(dataAccessService.executeNamedQuery("searchPortal", params, null)).thenReturn(list);
-               Map<String, List<SearchResultItem>> result  =   dashboardSearchServiceImpl.searchResults("guestT", "test");
-               assertTrue(result.keySet().contains("test"));
-       }
-       
-       @Test
-       public void getRelatedUsersTest()
-       {
-               List<String> activeUsers = new ArrayList<>();
-               Map<String, String> params = new HashMap<>();
-               params.put("userId", "guestT");
-               Mockito.when(dataAccessService.executeNamedQuery("relatedUsers", params, null)).thenReturn(activeUsers);
-               List<String> expectedActiveUsers  =     dashboardSearchServiceImpl.getRelatedUsers("guestT");
-               assertEquals(expectedActiveUsers,activeUsers);
-       }
-       @Test
-       public void getWidgetDataTest()
-       {
-               CommonWidgetMeta CommonWidgetMeta = null;
-               Map<String, String> params = new HashMap<>();
-               params.put("cat", "test");
-               @SuppressWarnings("unchecked")
-               List<CommonWidget> widgetItems = new ArrayList<>();
-               CommonWidget commonWidget = new CommonWidget();
-               widgetItems.add(commonWidget);
-               Mockito.when(dataAccessService.executeNamedQuery("getCommonWidgetItem", params, null)).thenReturn(widgetItems);
-               CommonWidgetMeta expectedCommonWidgetMeta =dashboardSearchServiceImpl.getWidgetData("test");
-               assertEquals(expectedCommonWidgetMeta.getCategory(), "test");
-       }
-       
-       @Test
-       public void saveWidgetDataBulkTest()
-       {
-               CommonWidgetMeta CommonWidgetMeta = new CommonWidgetMeta();
-               List<CommonWidget> widgetList = new ArrayList<>();
-               CommonWidget commonWidget = new CommonWidget();
-               widgetList.add(commonWidget);
-               CommonWidgetMeta.setItems(widgetList);
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(commonWidget, null);
-        assertEquals(dashboardSearchServiceImpl.saveWidgetDataBulk(CommonWidgetMeta), "success");
-       }
-       
-       @Test
-       public void saveWidgetDataTest()
-       {
-               CommonWidget commonWidget = new CommonWidget();
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(commonWidget, null);
-                assertEquals(dashboardSearchServiceImpl.saveWidgetData(commonWidget), "success");
-       }
-       
-       @Test
-       public void deleteWidgetDataTest()
-       {
-               CommonWidget commonWidget = new CommonWidget();
-               Mockito.doNothing().when(dataAccessService).deleteDomainObject(commonWidget, null);
-                assertEquals(dashboardSearchServiceImpl.deleteWidgetData(commonWidget), "success");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceCentralizedImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceCentralizedImplTest.java
deleted file mode 100644 (file)
index 072d634..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.hibernate.SessionFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceCentralizedImpl;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class EPRoleFunctionServiceCentralizedImplTest {
-
-       
-       @Mock
-       DataAccessService dataAccessService;
-       
-       @Mock
-       SessionFactory sessionFactory;
-
-       @InjectMocks
-       EPRoleFunctionServiceCentralizedImpl ePRoleFunctionServiceCentralizedImpl = new EPRoleFunctionServiceCentralizedImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       NullPointerException nullPointerException = new NullPointerException();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-       MockEPUser mockUser = new MockEPUser();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       
-       @Test
-       public void getRoleFunctions()
-       {
-               List<CentralRoleFunction> getRoleFuncList = new ArrayList<>();
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-               getRoleFuncList.add(centralRoleFunction);
-               List<RoleFunction> getRoleFuncListOfPortal = new ArrayList<>();
-               RoleFunction roleFunction = new RoleFunction();
-               getRoleFuncListOfPortal.add(roleFunction);
-               final Map<String, Long> params = new HashMap<>();
-               params.put("appId", (long) 1);
-               Mockito.when(dataAccessService.executeNamedQuery("getAllRoleFunctions", params, null)).thenReturn(getRoleFuncList);
-               List<RoleFunction> expectedGetRoleFuncListOfPortal = ePRoleFunctionServiceCentralizedImpl.getRoleFunctions();
-               assertEquals(expectedGetRoleFuncListOfPortal.size(),getRoleFuncListOfPortal.size());
-       }
-       
-       @Test
-       public void getRoleFunctionsNewTest()
-       {
-               HttpSession session = mockedRequest.getSession();
-               EPUser user = mockUser.mockEPUser();
-               user.setId((long) 1);
-               String userId = user.getId().toString();
-               final Map<String, String> params = new HashMap<>();
-               params.put("userId", userId);           
-               @SuppressWarnings("unused")
-               List getRoleFuncListOfPortal = new ArrayList<>();
-               Mockito.when(dataAccessService.executeNamedQuery("getRoleFunctionsOfUser", params, null)).thenReturn(getRoleFuncListOfPortal);
-               Set<String> getRoleFuncListOfPortalSet = ePRoleFunctionServiceCentralizedImpl.getRoleFunctions(mockedRequest, user);
-               assertTrue(getRoleFuncListOfPortalSet.size() == 0);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleFunctionServiceImplTest.java
deleted file mode 100644 (file)
index 288b854..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionServiceImpl;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ SystemProperties.class, EPUserUtils.class })
-public class EPRoleFunctionServiceImplTest {
-
-       @Mock
-       DataAccessService dataAccessService;
-
-       @InjectMocks
-       EPRoleFunctionServiceImpl ePRoleFunctionServiceImpl = new EPRoleFunctionServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       NullPointerException nullPointerException = new NullPointerException();
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-       MockEPUser mockUser = new MockEPUser();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-
-       @Test
-       public void getRoleFunctionsTest() {
-               List<RoleFunction> functions = new ArrayList<>();
-               Mockito.when(dataAccessService.getList(RoleFunction.class, null)).thenReturn(functions);
-               List<RoleFunction> expectedFunctions = ePRoleFunctionServiceImpl.getRoleFunctions();
-               assertEquals(expectedFunctions, functions);
-       }
-
-       @Test
-       public void getRoleFunctionsRequestTest() {
-               EPUser user = mockUser.mockEPUser();
-               HashSet roleFunctions = new HashSet<>();
-               PowerMockito.mockStatic(SystemProperties.class);
-               HttpSession session = mockedRequest.getSession();
-               Mockito.when(session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)))
-                               .thenReturn(roleFunctions);
-               HashSet expectedRoleFunctions = (HashSet) ePRoleFunctionServiceImpl.getRoleFunctions(mockedRequest, user);
-               assertEquals(expectedRoleFunctions, roleFunctions);
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void getRoleFunctionsRequestIfNullTest() {
-               EPUser user = mockUser.mockEPUser();
-               HashSet roleFunctions = null;
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPUserUtils.class);
-               HttpSession session = mockedRequest.getSession();
-               Mockito.when(session.getAttribute(SystemProperties.getProperty(SystemProperties.ROLE_FUNCTIONS_ATTRIBUTE_NAME)))
-                               .thenReturn(roleFunctions);
-               HashMap roles = new HashMap<>();
-               EPRole role = new EPRole();
-               SortedSet<RoleFunction> roleFunctionSet = new TreeSet<RoleFunction>();
-               RoleFunction rolefun = new RoleFunction();
-               roleFunctionSet.add(rolefun);
-               role.setRoleFunctions(roleFunctionSet);
-               roles.put((long) 1, role);
-               Mockito.when(EPUserUtils.getRoles(mockedRequest)).thenReturn(roles);
-               HashSet expectedRoleFunctions = (HashSet) ePRoleFunctionServiceImpl.getRoleFunctions(mockedRequest, user);
-               assertTrue(expectedRoleFunctions.size() == 1);
-
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/EPRoleServiceImplTest.java
deleted file mode 100644 (file)
index 1a2d76c..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.service.EPRoleServiceImpl;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.domain.RoleFunction;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-
-public class EPRoleServiceImplTest {
-
-       @Mock
-       DataAccessService dataAccessService;
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @InjectMocks
-       EPRoleServiceImpl ePRoleServiceImpl = new EPRoleServiceImpl();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void getRoleFunctionsTest() {
-               List<RoleFunction> roleFunctionList = new ArrayList<>();
-               Mockito.when(dataAccessService.getList(RoleFunction.class, null)).thenReturn(roleFunctionList);
-               List<RoleFunction> expectedRoleFunctionList = ePRoleServiceImpl.getRoleFunctions();
-               assertEquals(roleFunctionList, expectedRoleFunctionList);
-       }
-
-       @Test
-       public void getAvailableChildRolesIfRoleIdIsNullTest() {
-               List<EPRole> roleList = new ArrayList<>();
-               EPRole role = new EPRole();
-               EPRole role1 = new EPRole();
-               role.addChildRole(role1);
-               roleList.add(role);
-               Mockito.when(dataAccessService.getList(EPRole.class, null)).thenReturn(roleList);
-               List<EPRole> expectedRoleList = ePRoleServiceImpl.getAvailableChildRoles(null);
-               assertEquals(roleList, expectedRoleList);
-       }
-
-       // @Test
-       // public void getAvailableChildRolesIfRoleIdNotNullTest()
-       // {
-       // List<EPRole> roleList = new ArrayList<>();
-       // EPRole role = new EPRole();
-       // EPRole role1= new EPRole();
-       // role.addChildRole(role1);
-       // roleList.add(role);
-       // Mockito.when(dataAccessService.getDomainObject(EPRole.class, 1,
-       // null)).thenReturn(role);
-       // Mockito.when(dataAccessService.getList(EPRole.class,
-       // null)).thenReturn(roleList);
-       //
-       // List<EPRole> expectedRoleList =
-       // ePRoleServiceImpl.getAvailableChildRoles((long) 1);
-       // System.out.println(expectedRoleList);
-       // assertEquals(roleList,expectedRoleList);
-       // }
-       //
-       @Test
-       public void getRoleFunctionTest() {
-               RoleFunction roleFunction = new RoleFunction();
-               Mockito.when(dataAccessService.getDomainObject(RoleFunction.class, "test", null)).thenReturn(roleFunction);
-               RoleFunction expectedRoleFunction = ePRoleServiceImpl.getRoleFunction("test");
-               assertEquals(expectedRoleFunction, roleFunction);
-       }
-
-       @Test
-       public void saveRoleFunctionTest() {
-               EPRole role = new EPRole();
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(role, null);
-               ePRoleServiceImpl.saveRole(role);
-       }
-
-       @Test
-       public void deleteRoleFunctionTest() {
-               RoleFunction roleFunction = new RoleFunction();
-               Mockito.doNothing().when(dataAccessService).deleteDomainObject(roleFunction, null);
-               ePRoleServiceImpl.deleteRoleFunction(roleFunction);
-       }
-
-       @Test
-       public void getRoleTest() {
-               EPRole role = null;
-               Mockito.when(dataAccessService.getDomainObject(EPRole.class, 1, null)).thenReturn(role);
-               EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1);
-               assertEquals(expectedRole, role);
-       }
-
-       @Test
-       public void getRoleIfappIdNullTest() {
-               assertNull(ePRoleServiceImpl.getRole(null, null));
-
-       }
-
-       @Test
-       public void getRoleIfappIdNotNullTest() {
-               List<EPRole> roles = new ArrayList<>();
-               EPRole role = new EPRole();
-               roles.add(role);
-               String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
-               Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
-               EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1, (long) 1);
-               assertEquals(expectedRole, role);
-
-       }
-
-       @Test
-       public void getRoleIfListSizeIsMoreThan1Test() {
-               List<EPRole> roles = new ArrayList<>();
-               EPRole role = new EPRole();
-               EPRole role1 = new EPRole();
-               roles.add(role);
-               roles.add(role1);
-               String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
-               Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
-               EPRole expectedRole = ePRoleServiceImpl.getRole((long) 1, (long) 1);
-               assertEquals(expectedRole, role);
-
-       }
-
-       @Test
-       public void getRoleIfListSizeIsEmptyTest() {
-               List<EPRole> roles = new ArrayList<>();
-               String sql = "SELECT * FROM fn_role where APP_ID = 1 AND APP_ROLE_ID = 1";
-               Mockito.when(dataAccessService.executeSQLQuery(sql, EPRole.class, null)).thenReturn(roles);
-               assertNull(ePRoleServiceImpl.getRole((long) 1, (long) 1));
-
-       }
-
-       @Test
-       public void saveRoleTest() {
-               EPRole role = new EPRole();
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(role, null);
-               ePRoleServiceImpl.saveRole(role);
-       }
-
-       @Test
-       public void deleteRoleTest() {
-               EPRole role = new EPRole();
-               Mockito.doNothing().when(dataAccessService).deleteDomainObject(role, null);
-               ePRoleServiceImpl.deleteRole(role);
-       }
-
-       @Test
-       public void getAvailableRolesTest() {
-               List<EPRole> roleList = new ArrayList<>();
-               Mockito.when(dataAccessService.getList(EPRole.class, null)).thenReturn(roleList);
-               List<EPRole> expectedRoleList = ePRoleServiceImpl.getAvailableRoles();
-               assertEquals(expectedRoleList, roleList);
-       }
-
-       @Test
-       public void getAppRolesTest() {
-               final Map<String, String> portalParams = null;
-               List<EPRole> roleList = new ArrayList<>();
-               Mockito.when(dataAccessService.executeNamedQuery("getPortalAppRoles", portalParams, null)).thenReturn(roleList);
-               assertNull(ePRoleServiceImpl.getAppRole("test", (long) 1));
-
-       }
-
-       @SuppressWarnings("unchecked")
-       @Test
-       public void getAppRolesIfNotPortalTest() {
-               final Map<String, String> params = null;
-               List<EPRole> roleList = new ArrayList<>();
-               EPRole role = new EPRole();
-               EPRole role1 = new EPRole();
-               roleList.add(role);
-               roleList.add(role1);
-               Mockito.when((List<EPRole>) dataAccessService.executeNamedQuery("getAppRoles", params, null))
-                               .thenReturn(roleList);
-               List<EPRole> expectedRoleList = (List<EPRole>) ePRoleServiceImpl.getAppRole("test", (long) 10);
-               System.out.println(expectedRoleList);
-
-       }
-
-       @Test
-       public void saveRoleFunction() {
-               RoleFunction domainRoleFunction = new RoleFunction();
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(domainRoleFunction, null);
-               ePRoleServiceImpl.saveRoleFunction(domainRoleFunction);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/ExternalAccessRolesServiceImplTest.java
deleted file mode 100644 (file)
index f1103fb..0000000
+++ /dev/null
@@ -1,428 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPAppRoleFunction;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.transport.EcompUserRoles;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.domain.Role;
-import org.openecomp.portalsdk.core.restful.domain.EcompUser;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-import org.openecomp.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.HttpHeaders;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.client.HttpClientErrorException;
-import org.springframework.web.client.RestTemplate;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ EcompPortalUtils.class, SystemProperties.class, EPCommonSystemProperties.class })
-public class ExternalAccessRolesServiceImplTest {
-       @Mock
-       DataAccessService dataAccessService1 = new DataAccessServiceImpl();
-
-       @Mock
-       RestTemplate template = new RestTemplate();
-
-       @InjectMocks
-       ExternalAccessRolesServiceImpl externalAccessRolesServiceImpl = new ExternalAccessRolesServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-       String uebKey = "test-ueb-key";
-
-       public EPApp mockApp() {
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 10);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(false);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-               return app;
-       }
-
-       @Test
-       public void getAppRolesIfAppIsPortalTest() throws Exception {
-               List<EPRole> applicationRoles = new ArrayList<>();
-               Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
-               List<EPRole> expectedApplicationRoles = externalAccessRolesServiceImpl.getAppRoles((long) 1);
-               assertEquals(expectedApplicationRoles, applicationRoles);
-       }
-
-       @Test
-       public void getAppRolesTest() throws Exception {
-               List<EPRole> applicationRoles = new ArrayList<>();
-               Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
-               List<EPRole> expectedApplicationRoles = externalAccessRolesServiceImpl.getAppRoles((long) 10);
-               assertEquals(expectedApplicationRoles, applicationRoles);
-       }
-
-       // @SuppressWarnings("null")
-       // @Test(expected = java.lang.Exception.class)
-       // public void getAppRolesExceptionTest() throws Exception{
-       // List<EPRole> applicationRoles = new ArrayList<>();
-       // DataAccessService dataAccessService = null ;
-       // Mockito.when(dataAccessService.getList(EPRole.class, "where app_id = 10",
-       // null, null)).thenThrow(nullPointerException);
-       // List<EPRole> expectedApplicationRoles =
-       // externalAccessRolesServiceImpl.getAppRoles((long) 10);
-       // assertEquals(expectedApplicationRoles,applicationRoles);
-       // }
-
-       @Test(expected = java.lang.Exception.class)
-       public void getAppExceptionTest() throws Exception {
-               List<EPApp> app = new ArrayList<>();
-               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
-                               .thenReturn(app);
-               List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
-               assertEquals(app, expectedapp);
-       }
-
-       @Test(expected = java.lang.Exception.class)
-       public void getAppTest() throws Exception {
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = mockApp();
-               appList.add(app);
-               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
-                               .thenReturn(appList);
-               List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
-       }
-
-       @Test
-       public void getAppErrorTest() throws Exception {
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = mockApp();
-               app.setId((long) 1);
-               appList.add(app);
-               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
-                               .thenReturn(appList);
-               List<EPApp> expectedapp = externalAccessRolesServiceImpl.getApp(uebKey);
-               assertEquals(appList, expectedapp);
-       }
-
-       @Test
-       public void addRoleTest() throws Exception {
-               HttpHeaders headers = new HttpHeaders();
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               String uebKey = "test-ueb-key";
-               Role role = new Role();
-               role.setId((long) 25);
-               EPApp app = mockApp();
-               app.setEnabled(true);
-               app.setId((long) 10);
-               app.setNameSpace("test_namesapce");
-               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-               List<EPApp> appList = new ArrayList<>();
-               appList.add(app);
-               List<EPRole> roleList = new ArrayList<>();
-               EPRole ePRole = new EPRole();
-               role.setName("Test Role");
-               roleList.add(ePRole);
-               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
-                               .thenReturn(appList);
-               Mockito.when(dataAccessService1.getList(EPRole.class, " where app_role_id = " + role.getId() + " and app_id ="+app.getId(), null, null)).thenReturn(roleList);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL))
-                               .thenReturn("Testurl");
-               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.CREATED);
-               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.POST),
-                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
-
-               assertTrue(externalAccessRolesServiceImpl.addRole(role, uebKey));
-       }
-
-
-       @Test
-       public void addRoleMethodNotAllowedTest() throws Exception {
-               HttpHeaders headers = new HttpHeaders();
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(EPCommonSystemProperties.class);
-               Role role = new Role();
-               role.setId((long) 25);
-               EPApp app = mockApp();
-               app.setEnabled(true);
-               app.setId((long) 10);
-               app.setNameSpace("test_namesapce");
-               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-               List<EPApp> appList = new ArrayList<>();
-               appList.add(app);
-               List<EPRole> roleList = new ArrayList<>();
-               EPRole ePRole = new EPRole();
-               role.setName("Test Role");
-               roleList.add(ePRole);
-               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null))
-                               .thenReturn(appList);
-               
-               Mockito.when(dataAccessService1.getList(EPRole.class, " where app_role_id = " + role.getId() + " and app_id ="+app.getId(), null, null)).thenReturn(roleList);
-//             Mockito.when(dataAccessService1.getList(EPRole.class, " where app_role_id = " + role.getId(), null, null))
-//                             .thenReturn(roleList);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL))
-                               .thenReturn("Testurl");
-               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.METHOD_NOT_ALLOWED);
-               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.POST),
-                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
-
-               assertFalse(externalAccessRolesServiceImpl.addRole(role, uebKey));
-       }
-
-       public EPApp getApp() {
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(true);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-               return app;
-       }
-
-       @Test
-       public void deleteCentralRoleFunctionTest() throws Exception {
-               final Map<String, String> params = new HashMap<>();
-               EPApp app = mockApp();
-               params.put("functionCode", "menu_fun_code");
-               params.put("appId", String.valueOf(10));
-               List<CentralRoleFunction> centralRoleFunctionList = new ArrayList<>();
-               CentralRoleFunction domainCentralRoleFunction = new CentralRoleFunction();
-               domainCentralRoleFunction.setCode("menu_fun_code");
-               centralRoleFunctionList.add(domainCentralRoleFunction);
-               Mockito.when(dataAccessService1.executeNamedQuery("getRoleFunction", params, null))
-                               .thenReturn(centralRoleFunctionList);
-               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.OK);
-               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.DELETE),
-                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
-               HttpHeaders headers = new HttpHeaders();
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-
-               Mockito.doNothing().when(dataAccessService1).deleteDomainObjects(EPAppRoleFunction.class,
-                               "app_id = " + app.getId() + " and function_cd = '" + "menu_fun_code" + "'", null);
-
-               assertTrue(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
-       }
-       @Test
-       public void deleteCentralRoleFunctionFailTest() throws Exception {
-               final Map<String, String> params = new HashMap<>();
-               EPApp app = mockApp();
-               params.put("functionCode", "menu_fun_code");
-               params.put("appId", String.valueOf(10));
-               List<CentralRoleFunction> centralRoleFunctionList = new ArrayList<>();
-               CentralRoleFunction domainCentralRoleFunction = new CentralRoleFunction();
-               domainCentralRoleFunction.setCode("menu_fun_code");
-               centralRoleFunctionList.add(domainCentralRoleFunction);
-               HttpClientErrorException httpClientErrorException = new HttpClientErrorException(HttpStatus.NOT_FOUND);
-               Mockito.when(dataAccessService1.executeNamedQuery("getRoleFunction", params, null))
-                               .thenReturn(centralRoleFunctionList);
-               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.NOT_FOUND);
-               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.DELETE),
-                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenThrow(httpClientErrorException);
-               HttpHeaders headers = new HttpHeaders();
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-
-               Mockito.doNothing().when(dataAccessService1).deleteDomainObjects(EPAppRoleFunction.class,
-                               "app_id = " + app.getId() + " and function_cd = '" + "menu_fun_code" + "'", null);
-
-               assertTrue(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
-       }
-
-       @Test
-       public void deleteCentralRoleFunctionExceptionTest() {
-               final Map<String, String> params = new HashMap<>();
-               EPApp app = mockApp();
-               params.put("functionCd", "menu_fun_code");
-               params.put("appId", String.valueOf(10));
-               List<CentralRoleFunction> centralRoleFunctionList = new ArrayList<>();
-               CentralRoleFunction domainCentralRoleFunction = new CentralRoleFunction();
-               domainCentralRoleFunction.setCode("menu_fun_code");
-               centralRoleFunctionList.add(domainCentralRoleFunction);
-               Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params, null))
-                               .thenThrow(nullPointerException);
-               assertFalse(externalAccessRolesServiceImpl.deleteCentralRoleFunction("menu_fun_code", app));
-       }
-
-       @Test
-       public void getUserTest() {
-               List<EPUser> userList = new ArrayList<>();
-               EPUser user = mockUser.mockEPUser();
-               userList.add(user);
-               Mockito.when(dataAccessService1.getList(EPUser.class, " where org_user_id = '" + "guestT" + "'", null, null))
-                               .thenReturn(userList);
-               List<EPUser> expectedUserList = externalAccessRolesServiceImpl.getUser("guestT");
-               assertEquals(expectedUserList, userList);
-       }
-    
-       
-       public void saveCentralRoleFunctionTest() throws Exception {
-               CentralRoleFunction centralRoleFunction = new CentralRoleFunction();
-               centralRoleFunction.setCode("menu_test");
-               EPApp app = mockApp();
-               app.setId((long) 1);
-               final Map<String, String> params = new HashMap<>();
-               params.put("functionCd", "menu_test");
-               params.put("appId", String.valueOf(1));
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               HttpHeaders headers = new HttpHeaders();
-               Mockito.when(EcompPortalUtils.base64encodeKeyForAAFBasicAuth()).thenReturn(headers);
-               List<CentralRoleFunction> appRoleFunc  = new ArrayList<>();
-               appRoleFunc.add(centralRoleFunction);
-               Mockito.when(dataAccessService1.executeNamedQuery("getAppFunctionDetails", params,
-                               null)).thenReturn(appRoleFunc);
-               ResponseEntity<String> addResponse = new ResponseEntity<>(HttpStatus.OK);
-               Mockito.when(template.exchange(Matchers.anyString(), Matchers.eq(HttpMethod.GET),
-                               Matchers.<HttpEntity<String>>any(), Matchers.eq(String.class))).thenReturn(addResponse);
-       }
-       
-//     @Test
-//     public void getAllAppUsersIfAppIsPortalTest() throws Exception
-//     {
-//             List<EPApp> expectedapps =  new ArrayList<>();
-//             EPApp app = new EPApp();
-//             app.setEnabled(true);
-//             app.setId((long) 1);
-//             expectedapps.add(app);
-//             List<EPRole> applicationRoles = new ArrayList<>();
-//             Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
-//             Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null)).thenReturn(expectedapps);
-//             externalAccessRolesServiceImpl.getAllAppUsers(uebKey);
-//     }
-       
-       
-       @Test
-       public void getAllAppUsersTest() throws Exception
-       {
-               List<EPApp> expectedapps =  new ArrayList<>();
-               EPApp app = new EPApp();
-               app.setEnabled(true);
-               app.setId((long) 10);
-               expectedapps.add(app);
-               List<EPRole> applicationRoles = new ArrayList<>();
-               Mockito.when(dataAccessService1.getList(EPRole.class, "test", null, null)).thenReturn(applicationRoles);
-               Mockito.when(dataAccessService1.getList(EPApp.class, " where ueb_key = '" + uebKey + "'", null, null)).thenReturn(expectedapps);
-               final Map<String, Long> appParams = new HashMap<>();
-               appParams.put("appId", app.getId());
-               List<EcompUserRoles> userList = new ArrayList<>();
-               EcompUserRoles ecompUserRoles = new EcompUserRoles();
-               ecompUserRoles.setOrgUserId("guestT");
-               ecompUserRoles.setRoleId((long) 1);
-               ecompUserRoles.setRoleName("test");
-               
-               EcompUserRoles ecompUserRoles2 = new EcompUserRoles();
-               ecompUserRoles2.setOrgUserId("guestT");
-               ecompUserRoles2.setRoleId((long) 2);
-               ecompUserRoles2.setRoleName("test new");
-               userList.add(ecompUserRoles);
-               userList.add(ecompUserRoles2);
-               
-               Mockito.when(dataAccessService1.executeNamedQuery("ApplicationUserRoles", appParams, null)).thenReturn(userList);
-               List<EcompUser> usersfinalList = externalAccessRolesServiceImpl.getAllAppUsers(uebKey);
-               assertEquals(usersfinalList.get(0).getRoles().size(), 2);
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/FunctionalMenuMockServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/FunctionalMenuMockServiceImplTest.java
deleted file mode 100644 (file)
index 62a3f85..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.FunctionalMenuItemWithAppID;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuServiceImpl;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({SystemProperties.class, EPCommonSystemProperties.class})
-public class FunctionalMenuMockServiceImplTest {
-
-       @Mock
-       FunctionalMenuService functionalMenuService;
-       
-       @Mock
-       DataAccessService dataAccessService;
-       
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-    @InjectMocks
-       FunctionalMenuServiceImpl functionalMenuServiceImpl= new FunctionalMenuServiceImpl();
-       
-       @Test
-       public void assignHelpURLsTest(){
-               List<FunctionalMenuItem> menuItems = new ArrayList<FunctionalMenuItem>();
-               FunctionalMenuItem functionalMenuItem1 = new FunctionalMenuItem();
-               functionalMenuItem1.text = "Contact Us";
-               FunctionalMenuItem functionalMenuItem2 = new FunctionalMenuItem();
-               functionalMenuItem2.text = "Get Access";
-               FunctionalMenuItem functionalMenuItem3 = new FunctionalMenuItem();
-               functionalMenuItem3.text = "User Guide";                
-               menuItems.add(functionalMenuItem1);
-               menuItems.add(functionalMenuItem2);
-               menuItems.add(functionalMenuItem3);
-               
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(EPCommonSystemProperties.USER_GUIDE_URL)).thenReturn("http://todo_enter_user_guide_link");
-//             Mockito.doNothing().when(functionalMenuServiceImpl).assignHelpURLs(menuItems);
-               functionalMenuServiceImpl.assignHelpURLs(menuItems);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsTest(){
-               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, "
-                               + "fn_menu_functional_roles r WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  "
-                               + "UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  "
-                               + "WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
-                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
-                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-                
-                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-                
-                actualResult = functionalMenuServiceImpl.getFunctionalMenuItems(true);
-                assertEquals(actualResult, expectedResult);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsNegativeTest(){
-               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, "
-                               + "fn_menu_functional_roles r WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  "
-                               + "UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  "
-                               + "WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
-                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
-                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-                
-                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-                
-                actualResult = functionalMenuServiceImpl.getFunctionalMenuItems(false);
-                assertEquals(actualResult, expectedResult);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsForNotificationTreeTest(){
-               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, fn_menu_functional_roles r "
-                               + "WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id,"
-                               + " m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
-                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
-                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-                
-                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-                
-                actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForNotificationTree(true);
-                assertEquals(actualResult, expectedResult);
-               
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsForNotificationNegativeTreeTest(){
-               String sql = "SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn, r.app_id FROM fn_menu_functional m, fn_menu_functional_roles r "
-                               + "WHERE m.menu_id = r.menu_id  AND UPPER(m.active_yn) = 'Y'  AND r.role_id != '900'  UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id,"
-                               + " m.url, m.active_yn,-1 app_id  FROM fn_menu_functional m  WHERE m.url=''  AND UPPER(m.active_yn) = 'Y'";
-                List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
-                List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-                
-                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-                
-                actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForNotificationTree(false);
-                assertEquals(actualResult, expectedResult);            
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsForAppTest(){
-               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn  "
-                               + "FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a, fn_menu_functional_roles mr  "
-                               + "WHERE  mr.app_id='1'  AND mr.menu_id = m.menu_id  AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y' AND a.menu_id = m.menu_id  "
-                               + "AND a.ancestor_menu_id = m1.menu_id";
-               Integer appId = 1;
-               List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
-               List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-                
-                Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-                
-                actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForApp(appId);
-                assertEquals(actualResult, expectedResult);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsForUserTest(){
-               String orgUserId = "test";
-               String sql = "SELECT DISTINCT m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m.active_yn  "
-                               + "FROM fn_menu_functional m, fn_menu_functional m1, fn_menu_functional_ancestors a,  fn_menu_functional_roles mr, fn_user u , fn_user_role ur  "
-                               + "WHERE  u.org_user_id='test'  AND u.user_id = ur.user_id  AND ur.app_id = mr.app_id  AND (ur.role_id = mr.role_id      OR ur.role_id = '999')  "
-                               + "AND m.menu_id = mr.menu_id  AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y'  AND a.menu_id = m.menu_id  "
-                               + "AND a.ancestor_menu_id = m1.menu_id  UNION  select m1.menu_id, m1.column_num, m1.text, m1.parent_menu_id, m1.url, m1.active_yn  "
-                               + "FROM fn_menu_functional m, fn_menu_functional_roles mr, fn_menu_functional m1,  fn_menu_functional_ancestors a  where a.menu_id = m.menu_id  AND a.ancestor_menu_id = m1.menu_id  AND m.menu_id != m1.menu_id  AND m.menu_id = mr.menu_id  AND mr.role_id = '900'  AND UPPER(m.active_yn) = 'Y' AND UPPER(m1.active_yn) ='Y'  UNION  SELECT m.menu_id, m.column_num, m.text, m.parent_menu_id, m.url, m.active_yn  FROM fn_menu_functional m  WHERE m.text in ('Favorites','Get Access','Contact Us','Support','User Guide','Help')";
-               List<FunctionalMenuItem> actualResult = new ArrayList<FunctionalMenuItem>();
-               List<FunctionalMenuItem> expectedResult = new ArrayList<FunctionalMenuItem>();
-                
-               Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(expectedResult);
-                
-               actualResult = functionalMenuServiceImpl.getFunctionalMenuItemsForUser(orgUserId);
-               assertEquals(actualResult, expectedResult);             
-       }
-       
-       @Test
-       public void getFunctionalMenuItemDetailsTest(){
-               Integer menuid = 1;
-               String sql = "SELECT * FROM fn_menu_functional_roles WHERE menu_id = '1'";
-               FunctionalMenuItem actualResult = null;
-               FunctionalMenuItem expectedResult = null;
-               List<FunctionalMenuRole> roleItems = new ArrayList<FunctionalMenuRole>();
-               Mockito.when(dataAccessService.executeSQLQuery(sql, FunctionalMenuItemWithAppID.class, null)).thenReturn(roleItems);
-                
-               actualResult = functionalMenuServiceImpl.getFunctionalMenuItemDetails(menuid);
-               assertEquals(actualResult, expectedResult);             
-       }
-               
-       @Test
-       public void getFavoriteItemsTest(){
-               Long userId = (long)1;
-               String sql = "SELECT DISTINCT f.user_id,f.menu_id,m.text,m.url  "
-                               + "FROM fn_menu_favorites f, fn_menu_functional m, fn_menu_functional_roles mr  "
-                               + "WHERE f.user_id='1' AND f.menu_id = m.menu_id  AND f.menu_id = mr.menu_id  AND mr.role_id != '900' ";
-               List<FavoritesFunctionalMenuItemJson> actualResult = new ArrayList<FavoritesFunctionalMenuItemJson>();
-               List<FavoritesFunctionalMenuItemJson> expectedResult = new ArrayList<FavoritesFunctionalMenuItemJson>();
-                
-               Mockito.when(dataAccessService.executeSQLQuery(sql, FavoritesFunctionalMenuItemJson.class, null)).thenReturn(expectedResult);
-                
-               actualResult = functionalMenuServiceImpl.getFavoriteItems(userId);
-               assertEquals(actualResult, expectedResult);             
-       }       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/GetAccessServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/GetAccessServiceImplTest.java
deleted file mode 100644 (file)
index 4d887c4..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.GetAccessResult;
-import org.openecomp.portalapp.portal.service.GetAccessServiceImpl;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.DataAccessServiceImpl;
-
-public class GetAccessServiceImplTest {
-
-       
-    @Mock
-       DataAccessService dataAccessService = new DataAccessServiceImpl();
-    @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-    
-    @InjectMocks
-    GetAccessServiceImpl getAccessServiceImpl = new GetAccessServiceImpl();
-
-    MockEPUser mockUser = new MockEPUser();
-    
-    @Test
-       public void getAppAccessListTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Map<String, Long> params = new HashMap<>();
-               params.put("userId", user.getId());
-               List<GetAccessResult> appAccessList = new ArrayList<>();
-               Mockito.when(dataAccessService.executeNamedQuery("getAppAccessFunctionRole", params, null)).thenReturn(appAccessList);
-               
-               List<GetAccessResult> expectedAppAccessList =   getAccessServiceImpl.getAppAccessList(user);
-               assertEquals(expectedAppAccessList, appAccessList); 
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/LicenseableClassImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/LicenseableClassImplTest.java
deleted file mode 100644 (file)
index e3b3d8f..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import java.io.IOException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.lm.LicenseableClassImpl;
-
-public class LicenseableClassImplTest {
-       
-       @InjectMocks
-       LicenseableClassImpl licenseableClassImpl= new LicenseableClassImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-       @Test
-       public void getApplicationNameTest()
-       {               
-               assertEquals(licenseableClassImpl.getApplicationName(), "");
-       }
-       @Test
-       public void getPublicKeystoreAsInputStreamTest() throws IOException
-       {               
-               assertNull(licenseableClassImpl.getPublicKeystoreAsInputStream());
-       }
-       @Test
-       public void getAliasTest()
-       {               
-               assertEquals(licenseableClassImpl.getAlias(), "");
-       }
-       @Test
-       public void getKeyPasswdTest()
-       {               
-               assertEquals(licenseableClassImpl.getKeyPasswd(), "");
-       }
-       @Test
-       public void getPublicKeystorePasswordTest()
-       {               
-               assertEquals(licenseableClassImpl.getPublicKeystorePassword(), "");
-       }
-       @Test
-       public void getCipherParamPasswordTest()
-       {               
-               assertEquals(licenseableClassImpl.getPublicKeystorePassword(), "");
-       }
-       @Test
-       public void getClassToLicenseTest()
-       {               
-               assertEquals(licenseableClassImpl.getClassToLicense(), LicenseableClassImpl.class);
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/ManifestServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/ManifestServiceImplTest.java
deleted file mode 100644 (file)
index 26973b9..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.jar.Attributes;
-
-import javax.servlet.ServletContext;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.service.ManifestServiceImpl;
-
-public class ManifestServiceImplTest {
-
-       @Mock
-       ServletContext context;
-
-       @Mock
-       ServletContext context1 = null;
-
-       @InjectMocks
-       ManifestServiceImpl manifestServiceImpl = new ManifestServiceImpl();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test
-       public void getWebappManifestTest() throws IOException {
-               final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
-               InputStream inputStream = new ByteArrayInputStream("test data".getBytes());
-               Mockito.when(context.getResourceAsStream(MANIFEST_RESOURCE_PATH)).thenReturn(inputStream);
-               Attributes attributes = manifestServiceImpl.getWebappManifest();
-               assertTrue(attributes.size() == 0);
-       }
-
-       @Test(expected = java.lang.NullPointerException.class)
-       public void getWebappManifestExceptionTest() throws IOException {
-               final String MANIFEST_RESOURCE_PATH = "/META-INF/MANIFEST.MF";
-               InputStream inputStream = new ByteArrayInputStream("test data".getBytes());
-               Mockito.when(context1.getResourceAsStream(MANIFEST_RESOURCE_PATH)).thenThrow(nullPointerException);
-               Attributes attributes = manifestServiceImpl.getWebappManifest();
-               assertTrue(attributes.size() == 0);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/service/PersUserAppServiceImplTest.java
deleted file mode 100644 (file)
index 14e3f9f..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.domain.PersUserAppSelection;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.PersUserAppServiceImpl;
-import org.openecomp.portalapp.portal.service.UserRolesService;
-import org.openecomp.portalapp.portal.core.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-
-public class PersUserAppServiceImplTest {
-
-       @Mock
-       DataAccessService dataAccessService;
-       @Mock
-       AdminRolesService adminRolesService;
-       @Mock
-       UserRolesService userRolesService;
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @InjectMocks
-       PersUserAppServiceImpl persUserAppServiceImpl = new PersUserAppServiceImpl();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-
-       public EPApp getApp() {
-               EPApp app = new EPApp();
-               app.setName("Test");
-               app.setImageUrl("test");
-               app.setDescription("test");
-               app.setNotes("test");
-               app.setUrl("test");
-               app.setId((long) 1);
-               app.setAppRestEndpoint("test");
-               app.setAlternateUrl("test");
-               app.setName("test");
-               app.setMlAppName("test");
-               app.setMlAppAdminId("test");
-               app.setUsername("test");
-               app.setAppPassword("test");
-               app.setOpen(true);
-               app.setEnabled(false);
-               app.setUebKey("test");
-               app.setUebSecret("test");
-               app.setUebTopicName("test");
-               app.setAppType(1);
-               return app;
-       }
-
-       @Test(expected = IllegalArgumentException.class)
-       public void setPersUserAppValueIfUserNull() {
-               persUserAppServiceImpl.setPersUserAppValue(null, null, false, false);
-       }
-
-       @Test
-       public void setPersUserAppValueTest() {
-               EPApp app = getApp();
-               EPUser user = mockUser.mockEPUser();
-               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setId((long) 1);
-               persUserAppSelectionList.add(persUserAppSelection);
-               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
-                               .thenReturn(persUserAppSelectionList);
-               Mockito.doNothing().when(dataAccessService).deleteDomainObject(persUserAppSelection, null);
-               persUserAppServiceImpl.setPersUserAppValue(user, app, false, true);
-       }
-
-       @Test
-       public void setPersUserAppValueIfSelectTest() {
-               EPApp app = getApp();
-               EPUser user = mockUser.mockEPUser();
-               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setId((long) 1);
-               persUserAppSelectionList.add(persUserAppSelection);
-               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
-                               .thenReturn(persUserAppSelectionList);
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
-               persUserAppServiceImpl.setPersUserAppValue(user, app, true, true);
-       }
-
-       @Test
-       public void setPersUserAppValueIfOpenTest() {
-               EPApp app = getApp();
-               app.setOpen(false);
-               EPUser user = mockUser.mockEPUser();
-               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setId((long) 1);
-               persUserAppSelectionList.add(persUserAppSelection);
-               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
-                               .thenReturn(persUserAppSelectionList);
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
-               persUserAppServiceImpl.setPersUserAppValue(user, app, true, true);
-       }
-
-       @Test
-       public void setPersUserAppValueIfAppNotOpenTest() {
-               EPApp app = getApp();
-               app.setOpen(false);
-               EPUser user = mockUser.mockEPUser();
-               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setId((long) 1);
-               persUserAppSelectionList.add(persUserAppSelection);
-               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
-                               .thenReturn(persUserAppSelectionList);
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               List<EPUserApp> roles = new ArrayList<>();
-               EPUserApp epUserApp = new EPUserApp();
-               roles.add(epUserApp);
-               Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
-               persUserAppServiceImpl.setPersUserAppValue(user, app, true, false);
-       }
-
-       @Test
-       public void setPersUserAppValueIfNotPortalAdminTest() {
-               EPApp app = getApp();
-               app.setOpen(false);
-               EPUser user = mockUser.mockEPUser();
-               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setId((long) 1);
-               persUserAppSelectionList.add(persUserAppSelection);
-               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
-                               .thenReturn(persUserAppSelectionList);
-               Mockito.doNothing().when(dataAccessService).deleteDomainObject(persUserAppSelection, null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               List<EPUserApp> roles = new ArrayList<>();
-               EPUserApp epUserApp = new EPUserApp();
-               roles.add(epUserApp);
-               Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
-               persUserAppServiceImpl.setPersUserAppValue(user, app, true, false);
-       }
-
-       @Test
-       public void setPersUserAppValueNewTest() {
-               EPApp app = getApp();
-               app.setOpen(false);
-               EPUser user = mockUser.mockEPUser();
-               List<PersUserAppSelection> persUserAppSelectionList = new ArrayList<>();
-               PersUserAppSelection persUserAppSelection = new PersUserAppSelection();
-               persUserAppSelection.setId((long) 1);
-               persUserAppSelectionList.add(persUserAppSelection);
-               Mockito.when(dataAccessService.getList(PersUserAppSelection.class, "test", null, null))
-                               .thenReturn(persUserAppSelectionList);
-               Mockito.doNothing().when(dataAccessService).saveDomainObject(persUserAppSelection, null);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               List<EPUserApp> roles = new ArrayList<>();
-               EPUserApp epUserApp = new EPUserApp();
-               roles.add(epUserApp);
-               Mockito.when(userRolesService.getCachedAppRolesForUser(app.getId(), user.getId())).thenReturn(roles);
-               persUserAppServiceImpl.setPersUserAppValue(user, app, false, false);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AnalyticsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AnalyticsTest.java
deleted file mode 100644 (file)
index ea37b92..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.Analytics;
-
-public class AnalyticsTest {
-
-       public Analytics mockAnalytics(){
-               Analytics analytics = new Analytics();
-                               
-               analytics.setAction("test");
-               analytics.setPage("test");
-               analytics.setFunction("test");
-               analytics.setUserid("test");
-               analytics.setType("test");
-               
-               return analytics;
-       }
-       
-       @Test
-       public void analyticsTest(){
-               Analytics analytics = mockAnalytics();
-               
-               assertEquals(analytics.getAction(), "test");
-               assertEquals(analytics.getPage(), "test");
-               assertEquals(analytics.getFunction(), "test");
-               assertEquals(analytics.getUserid(), "test");
-               assertEquals(analytics.getType(), "test");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalizationTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppCatalogPersonalizationTest.java
deleted file mode 100644 (file)
index d2c9286..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-
-public class AppCatalogPersonalizationTest {
-       
-       public AppCatalogPersonalization mockAppCatalogPersonalization(){
-               AppCatalogPersonalization appCatalogPersonalization = new AppCatalogPersonalization();
-               
-               return appCatalogPersonalization;
-       }
-       
-       @Test
-       public void appCatalogPersonalizationTest(){
-               AppCatalogPersonalization appCatalogPersonalization = mockAppCatalogPersonalization();
-               
-               AppCatalogPersonalization appCatalogPersonalization1 = new AppCatalogPersonalization();
-               
-               assertEquals(appCatalogPersonalization.hashCode(), appCatalogPersonalization1.hashCode());
-               assertTrue(appCatalogPersonalization.equals(appCatalogPersonalization1));
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdminTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppNameIdIsAdminTest.java
deleted file mode 100644 (file)
index cb52c50..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-
-public class AppNameIdIsAdminTest {
-
-       public AppNameIdIsAdmin mockAppNameIdIsAdmin(){
-               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
-               appNameIdIsAdmin.setId((long)1);
-               appNameIdIsAdmin.setAppName("test");
-               appNameIdIsAdmin.setRestrictedApp(false);
-               appNameIdIsAdmin.setIsAdmin(false);
-               return appNameIdIsAdmin;
-       }
-       
-       @Test
-       public void appNameIdIsAdminTest(){
-               AppNameIdIsAdmin appNameIdIsAdmin = mockAppNameIdIsAdmin(); 
-               
-               AppNameIdIsAdmin appNameIdIsAdmin1 = new AppNameIdIsAdmin();
-               appNameIdIsAdmin1.setId((long)1);
-               appNameIdIsAdmin1.setAppName("test");
-               appNameIdIsAdmin1.setRestrictedApp(false);
-               appNameIdIsAdmin1.setIsAdmin(false);
-               
-               assertEquals(appNameIdIsAdmin.getId(), new Long(1));
-               assertEquals(appNameIdIsAdmin.getAppName(), "test");
-               assertEquals(appNameIdIsAdmin.getRestrictedApp(), false);
-               assertEquals(appNameIdIsAdmin.getIsAdmin(), false);
-               
-               assertEquals(appNameIdIsAdmin.toString(), "AppNameIdIsAdmin [id=1, appName=test, isAdmin=false, restrictedApp=false]");
-               assertEquals(appNameIdIsAdmin.hashCode(), appNameIdIsAdmin1.hashCode());
-               assertTrue(appNameIdIsAdmin.equals(appNameIdIsAdmin1));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUserTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppWithRolesForUserTest.java
deleted file mode 100644 (file)
index 1be7622..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import org.openecomp.portalapp.portal.transport.AppWithRolesForUser;
-
-public class AppWithRolesForUserTest {
-
-       public AppWithRolesForUser mockAppWithRolesForUser(){
-               AppWithRolesForUser appWithRolesForUser = new AppWithRolesForUser();
-               
-       //      List<RoleInAppForUser> appRoles = new ArrayList<RoleInAppForUser>();            
-               
-               appWithRolesForUser.setOrgUserId("test");
-               appWithRolesForUser.setAppId((long)1);
-               appWithRolesForUser.setAppName("test");
-               appWithRolesForUser.setAppRoles(null);
-               
-               return appWithRolesForUser;
-       }
-       
-       @Test
-       public void roleInAppForUserTest(){
-               AppWithRolesForUser appWithRolesForUser = mockAppWithRolesForUser();
-               
-               assertEquals(appWithRolesForUser.getOrgUserId(), "test");
-               assertEquals(appWithRolesForUser.getAppId(), new Long(1));
-               assertEquals(appWithRolesForUser.getAppName(), "test");
-               assertEquals(appWithRolesForUser.getAppRoles(), null);
-               assertEquals(appWithRolesForUser.toString(), "AppWithRolesForUser [orgUserId=test, appId=1, appName=test, appRoles=null]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/AppsListWithAdminRoleTest.java
deleted file mode 100644 (file)
index 0b0edc8..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import java.util.ArrayList;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.AppNameIdIsAdmin;
-import org.openecomp.portalapp.portal.transport.AppsListWithAdminRole;
-
-public class AppsListWithAdminRoleTest {
-       
-       public AppsListWithAdminRole mockAppsListWithAdminRole(){
-               AppsListWithAdminRole appsListWithAdminRole = new AppsListWithAdminRole();
-               
-               ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
-               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
-               appsRoles.add(appNameIdIsAdmin);
-               
-               appsListWithAdminRole.setOrgUserId("test");
-               appsListWithAdminRole.setAppsRoles(appsRoles);
-               
-               return appsListWithAdminRole;
-       }
-
-       @Test
-       public void appsListWithAdminRoleTest(){
-               AppsListWithAdminRole appsListWithAdminRole = mockAppsListWithAdminRole();
-               
-               AppsListWithAdminRole appsListWithAdminRole1 = new AppsListWithAdminRole();
-               
-               ArrayList<AppNameIdIsAdmin> appsRoles = new ArrayList<AppNameIdIsAdmin>();
-               AppNameIdIsAdmin appNameIdIsAdmin = new AppNameIdIsAdmin();
-               appsRoles.add(appNameIdIsAdmin);
-               
-               appsListWithAdminRole1.setOrgUserId("test");
-               appsListWithAdminRole1.setAppsRoles(appsRoles);
-                               
-               assertEquals(appsListWithAdminRole.getOrgUserId(), "test");
-               assertEquals(appsListWithAdminRole.getAppsRoles(), appsRoles);
-               
-               assertTrue(appsListWithAdminRole.equals(appsListWithAdminRole1));
-               assertEquals(appsListWithAdminRole.hashCode(), appsListWithAdminRole1.hashCode());
-               assertEquals(appsListWithAdminRole.toString(), "AppsListWithAdminRole [orgUserId=test, appsRoles=[AppNameIdIsAdmin [id=null, appName=null, isAdmin=null, restrictedApp=null]]]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BulkUploadRoleFunctionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BulkUploadRoleFunctionTest.java
deleted file mode 100644 (file)
index 327060a..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.BulkUploadRoleFunction;
-
-public class BulkUploadRoleFunctionTest {
-
-       public BulkUploadRoleFunction mockBulkUploadRoleFunction(){
-               
-               BulkUploadRoleFunction bulkUploadRoleFunction = new BulkUploadRoleFunction();
-                                               
-               bulkUploadRoleFunction.setFunctionName("test");
-               bulkUploadRoleFunction.setFunctionCd("test");
-               
-               return bulkUploadRoleFunction;
-       }
-       
-       @Test
-       public void bulkUploadRoleFunctionTest(){
-               BulkUploadRoleFunction bulkUploadRoleFunction = mockBulkUploadRoleFunction();
-               
-               BulkUploadRoleFunction bulkUploadRoleFunction1 = new BulkUploadRoleFunction();
-               
-               bulkUploadRoleFunction1.setFunctionName("test");
-               bulkUploadRoleFunction1.setFunctionCd("test");
-               
-               assertEquals(bulkUploadRoleFunction.getFunctionCd(), "test");
-               assertEquals(bulkUploadRoleFunction.getFunctionName(), "test");
-               assertEquals(bulkUploadRoleFunction.hashCode(), bulkUploadRoleFunction1.hashCode());
-               assertTrue(bulkUploadRoleFunction.equals(bulkUploadRoleFunction1));
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BulkUploadUserRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BulkUploadUserRolesTest.java
deleted file mode 100644 (file)
index 5469ff6..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.BulkUploadUserRoles;
-
-public class BulkUploadUserRolesTest {
-
-       public BulkUploadUserRoles mockBulkUploadUserRoles(){
-               BulkUploadUserRoles bulkUploadUserRoles = new BulkUploadUserRoles();
-                               
-               bulkUploadUserRoles.setRoleName("test");
-               bulkUploadUserRoles.setOrgUserId("test");
-               bulkUploadUserRoles.setAppNameSpace("test");
-               
-               return bulkUploadUserRoles;
-       }
-       
-       @Test
-       public void bulkUploadUserRolesTest(){
-               BulkUploadUserRoles bulkUploadUserRoles = mockBulkUploadUserRoles();
-               
-               BulkUploadUserRoles bulkUploadUserRoles1 = new BulkUploadUserRoles();
-               
-               bulkUploadUserRoles1.setRoleName("test");
-               bulkUploadUserRoles1.setOrgUserId("test");
-               bulkUploadUserRoles1.setAppNameSpace("test");
-               
-               assertEquals(bulkUploadUserRoles.getRoleName(), "test");
-               assertEquals(bulkUploadUserRoles.getOrgUserId(), "test");
-               assertEquals(bulkUploadUserRoles.getAppNameSpace(), "test");
-               
-               assertEquals(bulkUploadUserRoles.hashCode(), bulkUploadUserRoles1.hashCode());
-               assertTrue(bulkUploadUserRoles.equals(bulkUploadUserRoles1));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRoleTest.java
deleted file mode 100644 (file)
index b01da14..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class BusinessCardApplicationRoleTest {
-
-       public BusinessCardApplicationRole mockBusinessCardApplicationRole(){
-               BusinessCardApplicationRole businessCardApplicationRole = new BusinessCardApplicationRole();
-               
-               return businessCardApplicationRole;
-       }
-       
-       @Test
-       public void businessCardApplicationRoleTest(){
-               BusinessCardApplicationRole businessCardApplicationRole = mockBusinessCardApplicationRole();
-               
-               BusinessCardApplicationRole businessCardApplicationRole1 = new BusinessCardApplicationRole();
-               
-               assertEquals(businessCardApplicationRole.hashCode(), businessCardApplicationRole1.hashCode());
-               assertTrue(businessCardApplicationRole.equals(businessCardApplicationRole1));
-               assertEquals(businessCardApplicationRole.toString(), "BusinessCardUserApplicationRoles [appName=null, roleName=null]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRolesListTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/BusinessCardApplicationRolesListTest.java
deleted file mode 100644 (file)
index a6ecb2f..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class BusinessCardApplicationRolesListTest {
-
-       public BusinessCardApplicationRolesList mockBusinessCardApplicationRolesList(){
-               BusinessCardApplicationRolesList businessCardApplicationRolesList = new BusinessCardApplicationRolesList();
-               
-               return businessCardApplicationRolesList;
-       }
-       
-       @Test
-       public void businessCardApplicationRolesListTest(){
-               BusinessCardApplicationRolesList businessCardApplicationRolesList = mockBusinessCardApplicationRolesList();
-               
-               BusinessCardApplicationRolesList businessCardApplicationRolesList1 = new BusinessCardApplicationRolesList();
-               
-               assertEquals(businessCardApplicationRolesList.hashCode(), businessCardApplicationRolesList1.hashCode());
-               assertTrue(businessCardApplicationRolesList.equals(businessCardApplicationRolesList1));
-               assertEquals(businessCardApplicationRolesList.toString(), "BusinessCardUserAppRoles [appName=null, roleNames=null]");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralAppTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralAppTest.java
deleted file mode 100644 (file)
index 69acdaa..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.CentralApp;
-
-public class CentralAppTest {
-
-       public CentralApp mockCentralApp(){
-               CentralApp centralApp = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
-                               "test", "test", "test", "test", null, "test", "test", "test", "test");
-       
-
-       /*      public CentralApp(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name,
-                               String imageUrl, String description, String notes, String url, String alternateUrl, String restEndpoint,
-                               String mlAppName, String mlAppAdminId, String motsId, String appPassword, String open, String enabled,
-                               byte[] thumbnail, String username, String uebKey, String uebSecret, String uebTopicName)*/
-               
-               centralApp.setId((long)1);
-               centralApp.setCreatedId((long)1);
-               centralApp.setModifiedId((long)1);
-               centralApp.setRowNum((long)1);
-               centralApp.setName("test");
-               centralApp.setImageUrl("test");
-               centralApp.setDescription("test");
-               centralApp.setNotes("test");
-               centralApp.setUrl("test");
-               centralApp.setAlternateUrl("test");
-               centralApp.setRestEndpoint("test");
-               centralApp.setMlAppName("test");
-               centralApp.setMlAppAdminId("test");
-               centralApp.setMotsId("test");
-               centralApp.setAppPassword("test");
-               centralApp.setOpen("test");
-               centralApp.setEnabled("test");
-               centralApp.setUsername("test");
-               centralApp.setUebKey("test");
-               centralApp.setUebSecret("test");
-               centralApp.setUebTopicName("test");
-               
-               return centralApp;
-       }
-       
-       @Test
-       public void centralAppTest(){
-               CentralApp centralApp = mockCentralApp();
-               
-               CentralApp centralApp1 =  new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
-                               "test", "test", "test", "test", null, "test", "test", "test", "test");
-               
-               /*centralApp1.setId((long)1);
-               centralApp1.setCreatedId((long)1);
-               centralApp1.setModifiedId((long)1);
-               centralApp1.setRowNum((long)1);
-               centralApp1.setName("test");
-               centralApp1.setImageUrl("test");
-               centralApp1.setDescription("test");
-               centralApp1.setNotes("test");
-               centralApp1.setUrl("test");
-               centralApp1.setAlternateUrl("test");
-               centralApp1.setRestEndpoint("test");
-               centralApp1.setMlAppName("test");
-               centralApp1.setMlAppAdminId("test");
-               centralApp1.setMotsId("test");
-               centralApp1.setAppPassword("test");
-               centralApp1.setOpen("test");
-               centralApp1.setEnabled("test");
-               centralApp1.setUsername("test");
-               centralApp1.setUebKey("test");
-               centralApp1.setUebSecret("test");
-               centralApp1.setUebTopicName("test");*/
-               
-               assertEquals(centralApp.getId(), new Long(1));
-               assertEquals(centralApp.getCreatedId(), new Long(1));
-               assertEquals(centralApp.getModifiedId(), new Long(1));
-               assertEquals(centralApp.getRowNum(), new Long(1));
-               assertEquals(centralApp.getName(), "test");
-               assertEquals(centralApp.getImageUrl(), "test");
-               assertEquals(centralApp.getDescription(), "test");
-               assertEquals(centralApp.getNotes(), "test");
-               assertEquals(centralApp.getUrl(), "test");
-               assertEquals(centralApp.getAlternateUrl(), "test");
-               assertEquals(centralApp.getRestEndpoint(), "test");
-               assertEquals(centralApp.getMlAppName(), "test");
-               assertEquals(centralApp.getMlAppAdminId(), "test");
-               assertEquals(centralApp.getMotsId(), "test");
-               assertEquals(centralApp.getAppPassword(), "test");
-               assertEquals(centralApp.getOpen(), "test");
-               assertEquals(centralApp.getEnabled(), "test");
-               assertEquals(centralApp.getUsername(), "test");
-               assertEquals(centralApp.getUebKey(), "test");
-               assertEquals(centralApp.getUebSecret(), "test");
-               assertEquals(centralApp.getUebTopicName(), "test");
-               
-               assertTrue(centralApp.equals(centralApp1));
-               assertEquals(centralApp.hashCode(), centralApp1.hashCode());
-               /*      assertTrue(centralApp.equals(new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
-                               "test", "test", "test", "test", null, "test", "test", "test", "test")));*/
-       }
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralRoleTest.java
deleted file mode 100644 (file)
index 0ec0a30..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-public class CentralRoleTest {
-
-       public CentralRole mockCentralRole(){
-               CentralRole centralRole = new CentralRole((long)1, null, null, (long)1, (long)1, (long)1,
-                               "test", false, 1, null, null, null);
-           
-           centralRole.setId((long)1);
-           centralRole.setCreatedId((long)1);
-           centralRole.setModifiedId((long)1);
-           centralRole.setRowNum((long)1);
-           centralRole.setName("test");
-           centralRole.setActive(false);
-           centralRole.setPriority(1);
-           
-           centralRole.setCreated(null);
-           centralRole.setModified(null);
-           centralRole.setRoleFunctions(null);
-           centralRole.setChildRoles(null);
-           centralRole.setParentRoles(null);
-           
-               return centralRole;
-       }
-       
-       @Test
-       public void centralRoleTest(){
-               CentralRole centralRole = mockCentralRole();
-               
-               CentralRole centralRole1 = new CentralRole((long)1, null, null, (long)1, (long)1, (long)1,
-                               "test", false, 1, null, null, null);
-               
-               CentralRole centralRole2 = new CentralRole((long)1, "test");
-               
-               assertEquals(centralRole.getId(), new Long(1));
-               assertEquals(centralRole.getCreatedId(), new Long(1));
-               assertEquals(centralRole.getModifiedId(), new Long(1));
-               assertEquals(centralRole.getRowNum(), new Long(1));
-               assertEquals(centralRole.getName(), "test");
-               assertEquals(centralRole.isActive(), false);
-               assertEquals(centralRole.getCreated(), null);
-               assertEquals(centralRole.getModified(), null);
-               assertEquals(centralRole.getRoleFunctions(), null);
-               assertEquals(centralRole.getChildRoles(), null);
-               assertEquals(centralRole.getParentRoles(), null);               
-               assertEquals(centralRole.getPriority().toString(), "1");
-               assertEquals(centralRole.hashCode(), centralRole1.hashCode());
-               assertTrue(centralRole.equals(centralRole1));
-               assertEquals(centralRole, centralRole1);
-               assertEquals(centralRole2, new CentralRole((long)1, "test"));
-       }
-       
-       
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserAppTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserAppTest.java
deleted file mode 100644 (file)
index 9b4b5f8..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.CentralApp;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.transport.CentralUserApp;
-
-public class CentralUserAppTest {
-
-       public CentralUserApp mockCentralUserApp(){
-               CentralUserApp centralUserApp = new CentralUserApp();
-                               
-               CentralApp app = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
-                               "test", "test", "test", "test", null, "test", "test", "test", "test");
-               
-               CentralRole role = new CentralRole();
-                
-               centralUserApp.setUserId((long)1);
-               centralUserApp.setApp(app);
-               centralUserApp.setRole(role);
-               centralUserApp.setPriority((short) 123);
-               
-               return centralUserApp;
-       }
-       
-       @Test
-       public void centralUserAppTest(){
-               CentralUserApp centralUserApp = mockCentralUserApp();
-               
-               CentralApp app1 = new CentralApp((long)1, null, null, (long)1, (long)1, (long)1, "test", "test", "test", "test", "test", "test", "test", "test", "test", 
-                               "test", "test", "test", "test", null, "test", "test", "test", "test");
-               
-               CentralRole role1 = new CentralRole();
-               
-               assertEquals(centralUserApp.getUserId(), new Long(1));
-               assertEquals(centralUserApp.getPriority(), new Short((short) 123));
-               assertEquals(centralUserApp.getApp(), app1);
-               assertEquals(centralUserApp.getRole(), role1);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/CentralUserTest.java
deleted file mode 100644 (file)
index aad881b..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.CentralRole;
-import org.openecomp.portalapp.portal.transport.CentralUser;
-import org.openecomp.portalapp.portal.transport.CentralUserApp;
-
-public class CentralUserTest {
-
-       public CentralUser mockCentralUser(){
-               Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
-               Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
-               CentralUser centralUser = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
-                               (long)1, "test", "test", "test", "test", "test",
-                               "test", "test", (long)1, "test", "test", "test",
-                               "test", "test", "test", "test", "test", "test", "test",
-                               "test", "test", "test", "test",
-                               "test", "test", "test", "test", "test",
-                               "test", "test", "test", "test", "test",
-                               "test", "test", "test", "test", null,
-                               false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
-               
-               return centralUser;
-       }
-       
-       @Test
-       public void centralRoleTest(){
-               CentralUser centralUser = mockCentralUser();
-               
-               Set<CentralUserApp> userApps = new HashSet<CentralUserApp>();
-               Set<CentralRole> pseudoRoles = new HashSet<CentralRole>();
-               CentralUser centralUser1 = new CentralUser((long)1, null, null, (long)1, (long)1, (long)1, (long)1,
-                               (long)1, "test", "test", "test", "test", "test",
-                               "test", "test", (long)1, "test", "test", "test",
-                               "test", "test", "test", "test", "test", "test", "test",
-                               "test", "test", "test", "test",
-                               "test", "test", "test", "test", "test",
-                               "test", "test", "test", "test", "test",
-                               "test", "test", "test", "test", null,
-                               false, false, (long)1, (long)1, false, "test", userApps, pseudoRoles);
-               
-               
-               assertEquals(centralUser, centralUser1);
-               assertEquals(centralUser.hashCode(), centralUser1.hashCode());
-               assertTrue(centralUser.equals(centralUser1));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPAppsManualPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPAppsManualPreferenceTest.java
deleted file mode 100644 (file)
index 0d4c09a..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPAppsManualPreference;
-
-public class EPAppsManualPreferenceTest {
-
-       public EPAppsManualPreference mockEPAppsManualPreference(){
-               EPAppsManualPreference epAppsManualPreference = new EPAppsManualPreference();
-                               
-               epAppsManualPreference.setAppid((long)1);
-               epAppsManualPreference.setCol(1);
-               epAppsManualPreference.setHeaderText("test");
-               epAppsManualPreference.setImageLink("test");
-               epAppsManualPreference.setOrder(1);
-               epAppsManualPreference.setRestrictedApp(false);
-               epAppsManualPreference.setRow(1);
-               epAppsManualPreference.setSizeX(1);
-               epAppsManualPreference.setSizeY(1);
-               epAppsManualPreference.setSubHeaderText("test");
-               epAppsManualPreference.setUrl("test");
-               epAppsManualPreference.setAddRemoveApps(false);
-               
-               return epAppsManualPreference;
-       }
-       
-       @Test
-       public void epAppsManualPreferenceTest(){
-               
-               EPAppsManualPreference epAppsManualPreference = mockEPAppsManualPreference();
-               
-               assertEquals(epAppsManualPreference.getAppid(), new Long(1));
-               assertEquals(epAppsManualPreference.getCol(), 1);
-               assertEquals(epAppsManualPreference.getHeaderText(), "test");
-               assertEquals(epAppsManualPreference.getImageLink(), "test");
-               assertEquals(epAppsManualPreference.getOrder(), 1);
-               assertEquals(epAppsManualPreference.isRestrictedApp(), false);
-               assertEquals(epAppsManualPreference.getRow(), 1);
-               assertEquals(epAppsManualPreference.getSizeX(), 1);
-               assertEquals(epAppsManualPreference.getSizeY(), 1);
-               assertEquals(epAppsManualPreference.getSubHeaderText(), "test");
-               assertEquals(epAppsManualPreference.getUrl(), "test");
-               assertEquals(epAppsManualPreference.isAddRemoveApps(), false);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPAppsSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPAppsSortPreferenceTest.java
deleted file mode 100644 (file)
index 693cd61..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPAppsSortPreference;
-
-public class EPAppsSortPreferenceTest {
-
-       public EPAppsSortPreference mockEPAppsSortPreference(){
-               EPAppsSortPreference epAppsSortPreference = new EPAppsSortPreference();
-               
-               epAppsSortPreference.setIndex(1);
-               epAppsSortPreference.setValue("test");
-               epAppsSortPreference.setTitle("test");
-               
-               return epAppsSortPreference;
-       }
-       
-       @Test
-       public void epAppsSortPreferenceTest(){
-               EPAppsSortPreference epAppsSortPreference = mockEPAppsSortPreference();
-               
-               assertEquals(epAppsSortPreference.getIndex(), 1);
-               assertEquals(epAppsSortPreference.getValue(), "test");
-               assertEquals(epAppsSortPreference.getTitle(), "test");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPDeleteAppsManualSortPrefTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPDeleteAppsManualSortPrefTest.java
deleted file mode 100644 (file)
index 9dc739a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPDeleteAppsManualSortPref;
-
-public class EPDeleteAppsManualSortPrefTest {
-
-       public EPDeleteAppsManualSortPref mockEPDeleteAppsManualSortPref(){
-               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = new EPDeleteAppsManualSortPref();
-               
-               epDeleteAppsManualSortPref.setAppId((long)1);
-               epDeleteAppsManualSortPref.setSelect(false);
-               epDeleteAppsManualSortPref.setPending(false);
-
-               return epDeleteAppsManualSortPref;
-       }
-       
-       @Test
-       public void epDeleteAppsManualSortPrefTest(){
-               EPDeleteAppsManualSortPref epDeleteAppsManualSortPref = mockEPDeleteAppsManualSortPref();
-               
-               assertEquals(epDeleteAppsManualSortPref.getAppId(), new Long(1));
-               assertEquals(epDeleteAppsManualSortPref.isSelect(), false);
-               assertEquals(epDeleteAppsManualSortPref.isPending(), false);
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPUserAppCurrentRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPUserAppCurrentRolesTest.java
deleted file mode 100644 (file)
index 6bb70f7..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPUserAppCurrentRoles;
-
-public class EPUserAppCurrentRolesTest {
-
-       public EPUserAppCurrentRoles mockEPUserAppCurrentRoles(){
-               EPUserAppCurrentRoles epUserAppCurrentRoles = new EPUserAppCurrentRoles();
-                       
-               epUserAppCurrentRoles.setRoleName("test");
-               epUserAppCurrentRoles.setUserId((long)1);
-               epUserAppCurrentRoles.setPriority("test");
-               epUserAppCurrentRoles.setRoleId((long)1);
-               
-               return epUserAppCurrentRoles;
-       }
-       
-       @Test
-       public void epUserAppCurrentRolesTest(){
-               EPUserAppCurrentRoles epUserAppCurrentRoles = mockEPUserAppCurrentRoles();
-               
-               EPUserAppCurrentRoles epUserAppCurrentRoles1 = new EPUserAppCurrentRoles();
-               
-               epUserAppCurrentRoles1.setRoleName("test");
-               epUserAppCurrentRoles1.setUserId((long)1);
-               epUserAppCurrentRoles1.setPriority("test");
-               epUserAppCurrentRoles1.setRoleId((long)1);
-               
-               assertEquals(epUserAppCurrentRoles.getRoleName(), "test");
-               assertEquals(epUserAppCurrentRoles.getUserId(), new Long(1));
-               assertEquals(epUserAppCurrentRoles.getRoleId(), new Long(1));
-               assertEquals(epUserAppCurrentRoles.getPriority(), "test");
-               assertEquals(epUserAppCurrentRoles.hashCode(), epUserAppCurrentRoles1.hashCode());
-               assertTrue(epUserAppCurrentRoles.equals(epUserAppCurrentRoles1));
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPWidgetsSortPreferenceTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EPWidgetsSortPreferenceTest.java
deleted file mode 100644 (file)
index 5b94b09..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EPWidgetsSortPreference;
-
-public class EPWidgetsSortPreferenceTest {
-       
-       public EPWidgetsSortPreference mockEPWidgetsSortPreference(){
-               EPWidgetsSortPreference epWidgetsSortPreference = new EPWidgetsSortPreference();
-                               
-               epWidgetsSortPreference.setSizeX(1);
-               epWidgetsSortPreference.setSizeY(1);
-               epWidgetsSortPreference.setHeaderText("test");
-               epWidgetsSortPreference.setUrl("test");
-               epWidgetsSortPreference.setWidgetid((long)1);
-               epWidgetsSortPreference.setWidgetIdentifier("test");
-               epWidgetsSortPreference.setRow(1);
-               epWidgetsSortPreference.setCol(1);
-               
-               return epWidgetsSortPreference;
-       }
-       
-       @Test
-       public void epWidgetsSortPreferenceTest(){
-               EPWidgetsSortPreference epWidgetsSortPreference = mockEPWidgetsSortPreference();
-               
-               assertEquals(epWidgetsSortPreference.getSizeX(), 1);
-               assertEquals(epWidgetsSortPreference.getSizeY(), 1);
-               assertEquals(epWidgetsSortPreference.getHeaderText(), "test");
-               assertEquals(epWidgetsSortPreference.getUrl(), "test");
-               assertEquals(epWidgetsSortPreference.getWidgetid(), new Long(1));
-               assertEquals(epWidgetsSortPreference.getWidgetIdentifier(), "test");
-               assertEquals(epWidgetsSortPreference.getRow(), 1);
-               assertEquals(epWidgetsSortPreference.getRow(), 1);
-               
-       }
-       
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EcompUserAppRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EcompUserAppRolesTest.java
deleted file mode 100644 (file)
index 4bfb98b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EcompUserAppRoles;
-
-public class EcompUserAppRolesTest {
-
-       public EcompUserAppRoles mockEcompUserAppRoles(){
-               EcompUserAppRoles ecompUserAppRoles = new EcompUserAppRoles();
-                       
-               ecompUserAppRoles.setAppId("test");
-               ecompUserAppRoles.setUserId((long)1);
-               ecompUserAppRoles.setPriority("test");
-               ecompUserAppRoles.setRoleId((long)1);
-               ecompUserAppRoles.setRoleName("test");
-               
-               return ecompUserAppRoles;
-       }
-       
-       @Test
-       public void ecompUserAppRolesTest(){
-               
-               EcompUserAppRoles ecompUserAppRoles = mockEcompUserAppRoles();
-               
-               assertEquals(ecompUserAppRoles.getAppId(), "test");
-               assertEquals(ecompUserAppRoles.getPriority(), "test");
-               assertEquals(ecompUserAppRoles.getRoleName(), "test");
-               assertEquals(ecompUserAppRoles.getUserId(), new Long(1));
-               assertEquals(ecompUserAppRoles.getRoleId(), new Long(1));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemExtVOTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemExtVOTest.java
deleted file mode 100644 (file)
index 41a12f9..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpNotificationItemExtVO;
-
-public class EpNotificationItemExtVOTest {
-
-       public EpNotificationItemExtVO mockEpNotificationItemExtVO(){
-               EpNotificationItemExtVO epNotificationItemExtVO = new EpNotificationItemExtVO();
-               
-               //epNotificationItemExtVO.setActiveYn("abc");
-               epNotificationItemExtVO.setMsgHeader("test");
-               epNotificationItemExtVO.setMsgDescription("test");
-               epNotificationItemExtVO.setPriority(1);
-               epNotificationItemExtVO.setCreatorId(1);
-               epNotificationItemExtVO.setLoginId("test");
-               
-               return epNotificationItemExtVO;
-       }
-       
-       @Test
-       public void epNotificationItemExtVOTest(){
-               EpNotificationItemExtVO epNotificationItemExtVO = mockEpNotificationItemExtVO();
-               
-               assertEquals(epNotificationItemExtVO.getMsgHeader(), "test");
-               assertEquals(epNotificationItemExtVO.getMsgDescription(), "test");
-               assertEquals(epNotificationItemExtVO.getPriority().toString(), "1");
-               assertEquals(epNotificationItemExtVO.getCreatorId().toString(), "1");
-               assertEquals(epNotificationItemExtVO.getLoginId(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemTest.java
deleted file mode 100644 (file)
index 2961a2d..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpNotificationItem;
-
-public class EpNotificationItemTest {
-       
-       public EpNotificationItem mockEpNotificationItem(){
-               EpNotificationItem epNotificationItem = new EpNotificationItem();
-               
-               epNotificationItem.setNotificationId((long)1);
-               epNotificationItem.setIsForOnlineUsers("test");
-               epNotificationItem.setIsForAllRoles("test");
-               epNotificationItem.setActiveYn("test");
-               epNotificationItem.setMsgHeader("test");
-               epNotificationItem.setMsgDescription("test");
-               epNotificationItem.setMsgSource("test");
-               
-               epNotificationItem.setPriority((long)1);
-               epNotificationItem.setCreatedId((long)1);
-               epNotificationItem.setNotificationHyperlink("test");
-               
-               return epNotificationItem;
-       }
-       
-       @Test
-       public void epNotificationItemTest(){
-               EpNotificationItem epNotificationItem = mockEpNotificationItem();
-               
-               EpNotificationItem epNotificationItem1 = new EpNotificationItem();
-               epNotificationItem1.setNotificationId((long)1);
-               epNotificationItem1.setIsForOnlineUsers("test");
-               epNotificationItem1.setIsForAllRoles("test");
-               epNotificationItem1.setActiveYn("test");
-               epNotificationItem1.setMsgHeader("test");
-               epNotificationItem1.setMsgDescription("test");
-               epNotificationItem1.setMsgSource("test");
-               
-               epNotificationItem1.setPriority((long)1);
-               epNotificationItem1.setCreatedId((long)1);
-               epNotificationItem1.setNotificationHyperlink("test");
-               
-               assertEquals(epNotificationItem.getNotificationId(), new Long(1));
-               assertEquals(epNotificationItem.getIsForOnlineUsers(), "test");
-               assertEquals(epNotificationItem.getIsForAllRoles(), "test");
-               assertEquals(epNotificationItem.getActiveYn(), "test");
-               assertEquals(epNotificationItem.getMsgHeader(), "test");
-               assertEquals(epNotificationItem.getMsgDescription(), "test");
-               assertEquals(epNotificationItem.getMsgSource(), "test");
-               assertEquals(epNotificationItem.getPriority(), new Long(1));
-               assertEquals(epNotificationItem.getCreatedId(), new Long(1));
-               assertEquals(epNotificationItem.getNotificationHyperlink(), "test");
-               
-               assertEquals(epNotificationItem.toString(), "EpNotificationItem [notificationId=1, isForOnlineUsers=test, isForAllRoles=test, activeYn=test, msgHeader=test, msgDescription=test, msgSource=test, startTime=null, endTime=null, priority=1, creatorId=null, createdDate=null, roles=null, roleIds=null]");
-               assertEquals(epNotificationItem.hashCode(), epNotificationItem1.hashCode());
-               assertTrue(epNotificationItem.equals(epNotificationItem1));
-                               
-       }
-
-}
-
-
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemVOTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpNotificationItemVOTest.java
deleted file mode 100644 (file)
index 9cf1458..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class EpNotificationItemVOTest {
-
-       public EpNotificationItemVO mockEpNotificationItemVO(){
-               EpNotificationItemVO epNotificationItemVO = new EpNotificationItemVO();
-                               
-               epNotificationItemVO.setNotificationId(1);
-               epNotificationItemVO.setIsForOnlineUsers('a');
-               epNotificationItemVO.setIsForAllRoles('a');
-               epNotificationItemVO.setActiveYn('a');
-               epNotificationItemVO.setMsgHeader("test");
-               epNotificationItemVO.setMsgDescription("test");
-               epNotificationItemVO.setMsgSource("test");
-               epNotificationItemVO.setPriority(1);
-               epNotificationItemVO.setCreatorId(1);
-               epNotificationItemVO.setLoginId("test");
-               epNotificationItemVO.setNotificationHyperlink("test");
-               
-                return epNotificationItemVO;
-       }
-       
-       @Test
-       public void epNotificationItemVOTest(){
-               EpNotificationItemVO epNotificationItemVO = mockEpNotificationItemVO();
-               
-               assertEquals(epNotificationItemVO.getNotificationId().toString(), "1");
-               /*assertEquals(epNotificationItemVO.getIsForOnlineUsers(), 'a');
-               assertEquals(epNotificationItemVO.getIsForAllRoles(), 'a');
-               assertEquals(epNotificationItemVO.getActiveYn(), 'a');*/
-               assertEquals(epNotificationItemVO.getMsgHeader(), "test");
-               assertEquals(epNotificationItemVO.getMsgDescription(), "test");
-               assertEquals(epNotificationItemVO.getMsgSource(), "test");
-               assertEquals(epNotificationItemVO.getPriority().toString(), "1");
-               assertEquals(epNotificationItemVO.getCreatorId().toString(), "1");
-               assertEquals(epNotificationItemVO.getLoginId(), "test");
-               assertEquals(epNotificationItemVO.getNotificationHyperlink(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpRoleNotificationItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/EpRoleNotificationItemTest.java
deleted file mode 100644 (file)
index 6ebc0ff..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.EpRoleNotificationItem;
-
-public class EpRoleNotificationItemTest {
-       
-       public EpRoleNotificationItem mockEpRoleNotificationItem(){
-               EpRoleNotificationItem epRoleNotificationItem = new EpRoleNotificationItem();
-               
-               epRoleNotificationItem.setId((long)1);
-               epRoleNotificationItem.setNotificationId((long)1);
-               epRoleNotificationItem.setRoleId(1);
-               epRoleNotificationItem.setRecvUserId(1);
-               
-               return epRoleNotificationItem;
-       }
-       
-       @Test
-       public void epRoleNotificationItemTest(){
-               EpRoleNotificationItem epRoleNotificationItem = mockEpRoleNotificationItem();
-               
-               assertEquals(epRoleNotificationItem.getId(), new Long(1));
-               assertEquals(epRoleNotificationItem.getNotificationId(), new Long(1));
-               assertEquals(epRoleNotificationItem.getRoleId().toString(), "1");
-               assertEquals(epRoleNotificationItem.getRecvUserId().toString(), "1");
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsDetailTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsDetailTest.java
deleted file mode 100644 (file)
index 60f718c..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPermsDetail;
-
-public class ExternalAccessPermsDetailTest {
-
-       public ExternalAccessPermsDetail mockExternalAccessPermsDetail(){
-               ExternalAccessPermsDetail externalAccessPermsDetail = new ExternalAccessPermsDetail();
-                               
-               List<String> roles = new ArrayList<String>();
-               
-               externalAccessPermsDetail.setType("test");
-               externalAccessPermsDetail.setInstance("test");
-               externalAccessPermsDetail.setAction("test");
-               externalAccessPermsDetail.setDescription("test");
-               externalAccessPermsDetail.setRoles(roles);
-               
-               return externalAccessPermsDetail;
-       }
-       
-       @Test
-       public void externalAccessPermsDetailTest(){
-               ExternalAccessPermsDetail externalAccessPermsDetail = mockExternalAccessPermsDetail();
-               
-               List<String> roles = new ArrayList<String>();
-               
-               assertEquals(externalAccessPermsDetail.getType(), "test");
-               assertEquals(externalAccessPermsDetail.getInstance(), "test");
-               assertEquals(externalAccessPermsDetail.getAction(), "test");
-               assertEquals(externalAccessPermsDetail.getDescription(), "test");
-               assertEquals(externalAccessPermsDetail.getRoles(), roles);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessPermsTest.java
deleted file mode 100644 (file)
index e8a212d..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPerms;
-
-public class ExternalAccessPermsTest {
-
-       public ExternalAccessPerms mockExternalAccessPerms(){
-               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
-                               
-               externalAccessPerms.setType("test");
-               externalAccessPerms.setInstance("test");
-               externalAccessPerms.setAction("test");
-               externalAccessPerms.setDescription("test");
-               
-               return externalAccessPerms;
-       }
-       
-       @Test
-       public void externalAccessPermsTest(){
-               ExternalAccessPerms externalAccessPerms = mockExternalAccessPerms();
-               
-               ExternalAccessPerms externalAccessPerms1 = new ExternalAccessPerms("test", "test", "test");
-               ExternalAccessPerms externalAccessPerms2 = new ExternalAccessPerms("test", "test", "test", "test");
-               ExternalAccessPerms externalAccessPerms3 = new ExternalAccessPerms();
-               externalAccessPerms3.setType("test");
-               externalAccessPerms3.setInstance("test");
-               externalAccessPerms3.setAction("test");
-               externalAccessPerms3.setDescription("test");
-               
-               assertEquals(externalAccessPerms.getType(), "test");
-               assertEquals(externalAccessPerms.getInstance(), "test");
-               assertEquals(externalAccessPerms.getAction(), "test");
-               assertEquals(externalAccessPerms.getDescription(), "test");
-               assertEquals(externalAccessPerms.hashCode(), externalAccessPerms3.hashCode());
-               
-               assertTrue(externalAccessPerms1.equals(new ExternalAccessPerms("test", "test", "test")));
-               assertTrue(externalAccessPerms2.equals(new ExternalAccessPerms("test", "test", "test", "test")));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessRolePermsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessRolePermsTest.java
deleted file mode 100644 (file)
index 6bdcb3b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessPerms;
-import org.openecomp.portalapp.portal.transport.ExternalAccessRolePerms;
-
-public class ExternalAccessRolePermsTest {
-
-       public ExternalAccessRolePerms mockExternalAccessRolePerms(){
-               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
-               externalAccessPerms.setAction("test");
-               externalAccessPerms.setDescription("test");
-               externalAccessPerms.setInstance("test");
-               externalAccessPerms.setType("test");
-               ExternalAccessRolePerms ExternalAccessRolePerms = new ExternalAccessRolePerms(externalAccessPerms, "test");
-               
-               return ExternalAccessRolePerms;
-       }
-       
-       @Test
-       public void externalAccessRolePermsTest(){
-               ExternalAccessPerms externalAccessPerms = new ExternalAccessPerms();
-               externalAccessPerms.setAction("test");
-               externalAccessPerms.setDescription("test");
-               externalAccessPerms.setInstance("test");
-               externalAccessPerms.setType("test");
-               
-               ExternalAccessRolePerms ExternalAccessRolePerms = mockExternalAccessRolePerms();
-               
-               assertEquals(ExternalAccessRolePerms.getRole(), "test");
-               assertEquals(ExternalAccessRolePerms.getPerm(), externalAccessPerms);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessRoleTest.java
deleted file mode 100644 (file)
index 11ff44b..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessRole;
-
-public class ExternalAccessRoleTest {
-
-       public ExternalAccessRole mockExternalAccessRole(){
-               ExternalAccessRole externalAccessRole = new ExternalAccessRole();
-               
-               externalAccessRole.setName("test");
-               externalAccessRole.setDescription("test");
-               
-               return externalAccessRole;
-       }
-       
-       @Test
-       public void externalAccessRoleTest(){
-               ExternalAccessRole externalAccessRole = mockExternalAccessRole();
-               
-               assertEquals(externalAccessRole.getName(), "test");
-               assertEquals(externalAccessRole.getDescription(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserRoleDetailTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserRoleDetailTest.java
deleted file mode 100644 (file)
index d332b60..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUserRoleDetail;
-import org.openecomp.portalapp.portal.transport.ExternalRoleDescription;
-
-public class ExternalAccessUserRoleDetailTest {
-
-       public ExternalAccessUserRoleDetail mockExternalAccessUserRoleDetail(){
-               
-               ExternalRoleDescription externalRoleDescription = new ExternalRoleDescription();
-               externalRoleDescription.setId("test");
-               externalRoleDescription.setName("test");
-               externalRoleDescription.setActive("test");
-               externalRoleDescription.setPriority("test");
-               externalRoleDescription.setAppId("test");
-               externalRoleDescription.setAppRoleId("test");
-                           
-               ExternalAccessUserRoleDetail externalAccessUserRoleDetail = new ExternalAccessUserRoleDetail("test", externalRoleDescription);
-               
-               externalAccessUserRoleDetail.setName("test");
-               externalAccessUserRoleDetail.setDescription(externalRoleDescription);
-               return externalAccessUserRoleDetail;
-       }
-       
-       @Test
-       public void externalAccessUserRoleDetailTest(){
-               ExternalAccessUserRoleDetail externalAccessUserRoleDetail = mockExternalAccessUserRoleDetail();
-               
-               ExternalRoleDescription externalRoleDescription1 = new ExternalRoleDescription();
-               externalRoleDescription1.setId("test");
-               externalRoleDescription1.setName("test");
-               externalRoleDescription1.setActive("test");
-               externalRoleDescription1.setPriority("test");
-               externalRoleDescription1.setAppId("test");
-               externalRoleDescription1.setAppRoleId("test");
-                           
-               ExternalAccessUserRoleDetail externalAccessUserRoleDetail1 = new ExternalAccessUserRoleDetail("test", externalRoleDescription1);
-               
-               assertEquals(externalAccessUserRoleDetail.getName(), externalAccessUserRoleDetail1.getName());
-               assertEquals(externalAccessUserRoleDetail.getDescription(), externalAccessUserRoleDetail1.getDescription());
-               assertEquals(externalAccessUserRoleDetail.hashCode(), externalAccessUserRoleDetail1.hashCode());
-               assertTrue(externalAccessUserRoleDetail.equals(externalAccessUserRoleDetail1));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalAccessUserTest.java
deleted file mode 100644 (file)
index 1c6a819..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalAccessUser;
-
-public class ExternalAccessUserTest {
-
-       public ExternalAccessUser mockExternalAccessUser(){
-               ExternalAccessUser externalAccessUser = new ExternalAccessUser("test", "test");
-               
-               return externalAccessUser;
-       }
-       
-       @Test
-       public void externalAccessUserTest(){
-               ExternalAccessUser externalAccessUser = mockExternalAccessUser();
-               
-               assertEquals(externalAccessUser.getRole(), "test");
-               assertEquals(externalAccessUser.getUser(), "test");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalRoleDescriptionTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/ExternalRoleDescriptionTest.java
deleted file mode 100644 (file)
index f99f54f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.ExternalRoleDescription;
-
-public class ExternalRoleDescriptionTest {
-
-       public ExternalRoleDescription mockExternalRoleDescription(){
-               
-               ExternalRoleDescription externalRoleDescription = new ExternalRoleDescription();
-                           
-           externalRoleDescription.setId("test");
-           externalRoleDescription.setName("test");
-           externalRoleDescription.setActive("test");
-           externalRoleDescription.setPriority("test");
-           externalRoleDescription.setAppId("test");
-           externalRoleDescription.setAppRoleId("test");
-           
-               return externalRoleDescription;
-       }
-       
-       @Test
-       public void externalRoleDescriptionTest(){
-               ExternalRoleDescription externalRoleDescription = mockExternalRoleDescription();
-               
-               assertEquals(externalRoleDescription.getId(), "test");
-               assertEquals(externalRoleDescription.getName(), "test");
-               assertEquals(externalRoleDescription.getActive(), "test");
-               assertEquals(externalRoleDescription.getPriority(), "test");
-               assertEquals(externalRoleDescription.getAppId(), "test");
-               assertEquals(externalRoleDescription.getAppRoleId(), "test");
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/FunctionalMenuItemTest.java
deleted file mode 100644 (file)
index 15b27de..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-
-public class FunctionalMenuItemTest {
-       
-       public FunctionalMenuItem mockFunctionalMenuItem(){
-               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
-               
-               List<Integer> roles = new ArrayList<Integer>();
-               
-               functionalMenuItem.setRestrictedApp(false);
-               functionalMenuItem.setUrl("test");
-               functionalMenuItem.setRoles(roles);
-               
-               return functionalMenuItem;
-       }
-       
-       @Test
-       public void functionalMenuItemTest(){
-               FunctionalMenuItem functionalMenuItem = mockFunctionalMenuItem();
-               
-               FunctionalMenuItem functionalMenuItem1 = mockFunctionalMenuItem();
-               
-               List<Integer> roles = new ArrayList<Integer>();
-               
-               functionalMenuItem1.setRestrictedApp(false);
-               functionalMenuItem1.setUrl("test");
-               functionalMenuItem1.setRoles(roles);
-               
-               assertEquals(functionalMenuItem.getRoles(), functionalMenuItem1.getRoles());
-               assertEquals(functionalMenuItem.toString(), "FunctionalMenuItem [menuId=null, column=null, text=null, parentMenuId=null, url=test, active_yn=null, appid=null, roles=[], restrictedApp=false]");
-               // assertTrue(functionalMenuItem.normalize(), functionalMenuItem1.normalize());
-       }
-
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRoleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/FunctionalMenuRoleTest.java
deleted file mode 100644 (file)
index ea170e1..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuRole;
-
-public class FunctionalMenuRoleTest {
-
-       public FunctionalMenuRole mockFunctionalMenuRole(){
-               FunctionalMenuRole functionalMenuRole = new FunctionalMenuRole();
-               
-               functionalMenuRole.setId(1);
-               functionalMenuRole.setMenuId((long)1);
-               functionalMenuRole.setAppId(1);
-               functionalMenuRole.setRoleId(1);
-               
-               return functionalMenuRole;
-       }
-       
-       @Test
-       public void functionalMenuRoleTest(){
-               FunctionalMenuRole functionalMenuRole = mockFunctionalMenuRole();
-               
-               FunctionalMenuRole functionalMenuRole1 = new FunctionalMenuRole();
-               functionalMenuRole1.setId(1);
-               functionalMenuRole1.setMenuId((long)1);
-               functionalMenuRole1.setAppId(1);
-               functionalMenuRole1.setRoleId(1);
-                                
-               assertEquals(functionalMenuRole.getId().toString(), "1");
-               assertEquals(functionalMenuRole.getMenuId(), new Long(1));
-               assertEquals(functionalMenuRole.getAppId().toString(), "1");
-               assertEquals(functionalMenuRole.getRoleId().toString(), "1");
-               assertEquals(functionalMenuRole.toString(), "FunctionalMenuRole [id=1, menuId=1, appId=1, roleId=1]");
-               assertTrue(functionalMenuRole.equals(functionalMenuRole1));
-               assertEquals(functionalMenuRole.hashCode(), functionalMenuRole1.hashCode());
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/RemoteUserWithRolesTest.java
deleted file mode 100644 (file)
index c54bdf9..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.RemoteRole;
-import org.openecomp.portalapp.portal.transport.RemoteUserWithRoles;
-
-public class RemoteUserWithRolesTest {
-
-       public RemoteUserWithRoles mockRemoteUserWithRoles(){
-               RemoteUserWithRoles remoteUserWithRoles = new RemoteUserWithRoles();
-               
-               List<RemoteRole> roles = new ArrayList<RemoteRole>();
-               RemoteRole remoteRole = new RemoteRole();
-               remoteRole.setId((long)1);
-               remoteRole.setName("test");
-               roles.add(remoteRole);
-               
-               remoteUserWithRoles.setOrgId((long)1);
-               remoteUserWithRoles.setManagerId((long)1);
-               remoteUserWithRoles.setFirstName("test");
-               remoteUserWithRoles.setMiddleInitial("test");
-               remoteUserWithRoles.setLastName("test");
-               remoteUserWithRoles.setPhone("test");
-               remoteUserWithRoles.setEmail("test");
-               remoteUserWithRoles.setHrid("test");
-               remoteUserWithRoles.setOrgUserId("test");
-               remoteUserWithRoles.setOrgCode("test");
-               remoteUserWithRoles.setOrgManagerUserId("test");
-               remoteUserWithRoles.setJobTitle("test");
-               remoteUserWithRoles.setLoginId("test");
-               remoteUserWithRoles.setActive(false);
-               remoteUserWithRoles.setRoles(roles);
-               
-               return remoteUserWithRoles;
-       }
-       
-       @Test
-       public void remoteUserWithRolesTest(){
-               RemoteUserWithRoles remoteUserWithRoles = mockRemoteUserWithRoles();
-               
-               assertEquals(remoteUserWithRoles.getOrgId(), new Long(1));
-               assertEquals(remoteUserWithRoles.getManagerId(), new Long(1));
-               assertEquals(remoteUserWithRoles.getFirstName(), "test");
-               assertEquals(remoteUserWithRoles.getMiddleInitial(), "test");
-               assertEquals(remoteUserWithRoles.getLastName(), "test");
-               assertEquals(remoteUserWithRoles.getPhone(), "test");
-               assertEquals(remoteUserWithRoles.getEmail(), "test");
-               assertEquals(remoteUserWithRoles.getHrid(), "test");
-               assertEquals(remoteUserWithRoles.getOrgUserId(), "test");
-               assertEquals(remoteUserWithRoles.getOrgCode(), "test");
-               assertEquals(remoteUserWithRoles.getOrgManagerUserId(), "test");
-               assertEquals(remoteUserWithRoles.getJobTitle(), "test");
-               assertEquals(remoteUserWithRoles.getLoginId(), "test");
-               assertEquals(remoteUserWithRoles.getActive(), false);
-               assertEquals(remoteUserWithRoles.getRoles().size(), 1);
-               assertEquals(remoteUserWithRoles.toString(), "RemoteUserWithRoles [orgId=1, managerId=1, firstName=test, middleInitial=test, lastName=test, phone=test, "
-                               + "email=test, hrid=test, orgUserId=test, orgCode=test, orgManagerUserId=test, jobTitle=test, loginId=test, active=false, roles=[RemoteRole [id=1, name=test]]]");
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/RoleInAppForUserTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/RoleInAppForUserTest.java
deleted file mode 100644 (file)
index 5348f68..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.RoleInAppForUser;
-
-public class RoleInAppForUserTest {
-
-       public RoleInAppForUser mockRoleInAppForUser(){
-               RoleInAppForUser roleInAppForUser = new RoleInAppForUser((long)1 , "test");
-               roleInAppForUser.setRoleId((long)1);
-               roleInAppForUser.setRoleName("test");
-               roleInAppForUser.setIsApplied(false);
-               
-               return roleInAppForUser;
-       }
-       
-       @Test
-       public void roleInAppForUserTest(){
-               RoleInAppForUser roleInAppForUser = mockRoleInAppForUser();
-               
-               RoleInAppForUser roleInAppForUser1 = new RoleInAppForUser((long)1 , "test");
-               roleInAppForUser1.setRoleId((long)1);
-               roleInAppForUser1.setRoleName("test");
-               roleInAppForUser1.setIsApplied(false);
-               
-               assertEquals(roleInAppForUser.getRoleId(), new Long(1));
-               assertEquals(roleInAppForUser.getRoleName(), "test");
-               assertEquals(roleInAppForUser.getIsApplied(), false);
-               
-               assertEquals(roleInAppForUser.toString(), "RoleInAppForUser [roleId=1, roleName=test, isApplied=false]");
-               assertTrue(roleInAppForUser.equals(roleInAppForUser1));
-               assertEquals(roleInAppForUser.hashCode(), roleInAppForUser1.hashCode());
-               //constructor
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/UserApplicationRolesTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/UserApplicationRolesTest.java
deleted file mode 100644 (file)
index 625f058..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.RemoteRole;
-import org.openecomp.portalapp.portal.transport.UserApplicationRoles;
-
-public class UserApplicationRolesTest {
-
-       public UserApplicationRoles mockUserApplicationRoles(){
-               UserApplicationRoles userApplicationRoles = new UserApplicationRoles();
-               
-               List<RemoteRole> roles = new ArrayList<RemoteRole>();
-               RemoteRole remoteRole = new RemoteRole();
-               remoteRole.setId((long)1);
-               remoteRole.setName("test");
-               roles.add(remoteRole);
-               
-               userApplicationRoles.setAppId((long)1);
-               userApplicationRoles.setOrgUserId("test");
-               userApplicationRoles.setFirstName("test");
-               userApplicationRoles.setLastName("test");
-               userApplicationRoles.setRoles(roles);
-               
-               return userApplicationRoles;
-       }
-       
-       @Test
-       public void userApplicationRolesTest(){
-               UserApplicationRoles userApplicationRoles = mockUserApplicationRoles();
-               
-               UserApplicationRoles userApplicationRoles1 = new UserApplicationRoles();
-               
-               List<RemoteRole> roles = new ArrayList<RemoteRole>();
-               RemoteRole remoteRole = new RemoteRole();
-               remoteRole.setId((long)1);
-               remoteRole.setName("test");
-               roles.add(remoteRole);
-               
-               userApplicationRoles1.setAppId((long)1);
-               userApplicationRoles1.setOrgUserId("test");
-               userApplicationRoles1.setFirstName("test");
-               userApplicationRoles1.setLastName("test");
-               userApplicationRoles1.setRoles(roles);
-               
-               assertEquals(userApplicationRoles.getAppId(), userApplicationRoles1.getAppId());
-               assertEquals(userApplicationRoles.getOrgUserId(), userApplicationRoles1.getOrgUserId());
-               assertEquals(userApplicationRoles.getFirstName(), userApplicationRoles1.getFirstName());
-               assertEquals(userApplicationRoles.getLastName(), userApplicationRoles1.getLastName());
-               assertEquals(userApplicationRoles.getRoles(), userApplicationRoles1.getRoles());
-               
-               
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitleTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/UserWithNameSurnameTitleTest.java
deleted file mode 100644 (file)
index 2238bf9..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.*;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-
-public class UserWithNameSurnameTitleTest {
-
-       @Test
-       public void userWithNameSurnameTitleTest(){
-               
-               UserWithNameSurnameTitle userWithNameSurnameTitle = new UserWithNameSurnameTitle("test", "test", "test", "test");
-               
-               assertEquals(userWithNameSurnameTitle, new UserWithNameSurnameTitle("test", "test", "test", "test"));
-               assertEquals(userWithNameSurnameTitle.hashCode(), new UserWithNameSurnameTitle("test", "test", "test", "test").hashCode());
-               assertTrue(userWithNameSurnameTitle.equals(new UserWithNameSurnameTitle("test", "test", "test", "test")));
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/WidgetCatalogPersonalizationTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/transport/WidgetCatalogPersonalizationTest.java
deleted file mode 100644 (file)
index 236990c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-import org.openecomp.portalapp.portal.transport.WidgetCatalogPersonalization;
-
-public class WidgetCatalogPersonalizationTest {
-
-       public WidgetCatalogPersonalization mockWidgetCatalogPersonalization(){
-               WidgetCatalogPersonalization widgetCatalogPersonalization = new WidgetCatalogPersonalization();
-               
-               widgetCatalogPersonalization.setWidgetId((long)1);
-               widgetCatalogPersonalization.setSelect(false);
-               return widgetCatalogPersonalization;
-       }
-       
-       @Test
-       public void widgetCatalogPersonalizationTest(){
-               WidgetCatalogPersonalization widgetCatalogPersonalization = mockWidgetCatalogPersonalization();
-               
-               assertEquals(widgetCatalogPersonalization.getWidgetId(), new Long(1));
-               assertEquals(widgetCatalogPersonalization.getSelect(), false);
-       }
-}
diff --git a/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java b/ecomp-portal-BE-common/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java
deleted file mode 100644 (file)
index 4a1e58b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class EcompPortalUtilsTest {
-
-       @Test
-       public void legitimateAttuidSuccessTest() {
-               assertEquals(true, EcompPortalUtils.legitimateUserId("mm016f"));
-       }
-
-       @Test
-       public void legitimateAttuidFailureTest() {
-               assertEquals(false, EcompPortalUtils.legitimateUserId("1#@23456"));
-       }
-}
index f3fcea6..8bb0dd6 100644 (file)
@@ -1,5 +1,6 @@
 /catalina.base_IS_UNDEFINED/
 /target/
 /catalina.base_IS_UNDEFINED/
 /target/
+jacoco.exec
 .classpath
 .project
 .settings/
 .classpath
 .project
 .settings/
index e3f273d..0b091f5 100644 (file)
@@ -14,38 +14,52 @@ https://www.eclipse.org/m2e-wtp/
 
 ## Release Notes
 
 
 ## Release Notes
 
-Version 1.3.0 (Amsterdam), November 2017
+Version 2.1 
+- [PORTAL-145] Harden code to address SQL injecton, XSS vulnerabilities
+- [PORTAL-156] Left menu are showing web analytics items and missing plus icons on Account Details page
+- [Portal-148] ONAP Portal Beijing does not accept logins; currently OIDC code is disabled; please check the web.xml
+  Long term solution is being worked on.
+- [Portal-140] Portal role synch error with partner apps
+- [Portal-111] To get Centralized apps on Roles and Role Functions page;
+   Create, Edit and Delete calls for Roles and Role Functions
+- [Portal-121] GUI controls overlapping on app onboarding dialog
+- [Portal-133] Replace ECOMP wording from contact us page with ONAP
+- [Portal-88] Unable to deselect widget on Widget catalog page
+- [Portal-111] Centralized Role Management Task(Integration to AAF)
+- [PORTAL-157] OpenID connect conflicting with spring security
+- [Portal-174] missing DB statement in DML script(Users, Roles Page fix)
+
+Version 1.1.0 (Amsterdam), November 2017
 - [Portal-6] Updates to License and Trademark in the PORTAL Source Code
 - [Portal-7] Improvements added as part of the rebasing process
 - [Portal-17] Remove jfree related items
 - [Portal-6] Updates to License and Trademark in the PORTAL Source Code
 - [Portal-7] Improvements added as part of the rebasing process
 - [Portal-17] Remove jfree related items
-- [PORTAL-21] FE changes to OS for AAF centralization and name space field; DB script updates for EcompPortalDDLMySql_1710_Common.sql under ecomp-portal-DB-common, EcompPortalDMLMySql_1710_OS.sql under ecomp-portal-DB-os
-- [Portal-30] Failed to communicate with the widget microservice
-- [Portal-35] Replaced the portal logo with onap logo on the login screen
+- [PORTAL-21] FE changes to OS for AAF centralization and name space field; DB script updates for EcompPortalDDLMySql_1710_Common.sql under ecomp-portal-DB-common, EcompPortalDMLMySql_1710_OS.sql under ecomp-portal-DB-os;
+- [Portal-30] Failed to communicate with the widget microservice: Fixed
+- [Portal-35] Replaced the portal logo with onap logo on the login screen.
 - [Portal-40] Fix to add user roles 
 - [Portal-45] Fix to update an existing app on Application Onboarding
 - [Portal-47] Fix to eliminate duplicate roles on Users page
 - [Portal-48] Fix to save a new app on Application onboarding
 - [Portal-49] image icon is missing on Widget corner
 - [Portal-40] Fix to add user roles 
 - [Portal-45] Fix to update an existing app on Application Onboarding
 - [Portal-47] Fix to eliminate duplicate roles on Users page
 - [Portal-48] Fix to save a new app on Application onboarding
 - [Portal-49] image icon is missing on Widget corner
-- [Portal-50] Enabled the junit coverage in ONAP
-- [Portal-50] Fix to get the Sonar coverage for ONAP
-- [Portal-59] Fix to to display Portal users on User page
-- [Portal-61] Fixed the routing problem, loaded data and changed the notification hyperlink 
 - [Portal-63] remove att_abs_tpls*.js and greensock url
 - [Portal-69] unable to pick role in Functional Menu Update
 - [Portal-63] remove att_abs_tpls*.js and greensock url
 - [Portal-69] unable to pick role in Functional Menu Update
-- [Portal-72] Sonar scan - resolving severity Blocker issues 
 - [Portal-73] unable to onboard new Application fix
 - [Portal-73] unable to onboard new Application fix
+- [Portal-50] Enabled the junit coverage in ONAP
 - [Portal-76] Edit functional menu modal doesn't show
 - [Portal-76] Edit functional menu modal doesn't show
+- [Portal-61] Fixed the routing problem, loaded data and changed the notification hyperlink 
 - [Portal-77] Changes to remove preview image and update the new image automatically on App onbarding page
 - [Portal-82] Unable to pick Role in Widget onboarding for assigned app
 - [Portal-77] Changes to remove preview image and update the new image automatically on App onbarding page
 - [Portal-82] Unable to pick Role in Widget onboarding for assigned app
-- [Portal-86] Remove internal att.com usages from tests and other files
 - [Portal-94] Unable to see the updates on Edit Functional Menu
 - [Portal-94] Unable to see the updates on Edit Functional Menu
-- [Portal-102] Fixed the page refresh issue on App Account Management page
-- [Portal-103] Fix to enhanced notification ticket source for ONAP
 - [Portal-104] Replaced mysql DB connector with mariaDB
 - [Portal-104] Replaced mysql DB connector with mariaDB
+- [Portal-72] Sonar scan - resolving severity Blocker issues 
+- [Portal-103] Fix to enhanced notification ticket source for ONAP
+- [Portal-50] Fix to get the Sonar coverage for ONAP
+- [Portal-86] Remove internal att.com usages from tests and other files (rework)
+- [Portal-102] Fixed the page refresh issue on App Account Management page
 - [Portal-104] replace mysql DB connector with mariaDB connector
 - [Portal-104] replace mysql DB connector with mariaDB connector
-- [Portal-116] Empty Widgets on Home page - widget uploaded with a wrong format in db 
+- [Portal-116] Empty Widgets on Home page - widget onboarded with a wrong format in database
+- [Portal-59] Fix to to display Portal users on User page
 - [Portal-125] Fixed the missing role assignment when adding a user in portal
 - [Portal-125] Fixed the missing role assignment when adding a user in portal
-- [Portal-127] Remove GreenSock license code from b2b library; upgrade to EPSDK 1.3.1
 
 Version 1.0.0, February 2017
 - Initial release
 
 Version 1.0.0, February 2017
 - Initial release
index 473d0ee..f2855b7 100644 (file)
@@ -1,13 +1,14 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
+
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>1.3.0</version>
+               <version>2.2</version>
        </parent>
 
        </parent>
 
-       <artifactId>ecompportal-be-os</artifactId>
+       <artifactId>portal-be-os</artifactId>
        <packaging>war</packaging>
 
        <properties>
        <packaging>war</packaging>
 
        <properties>
@@ -79,7 +80,7 @@
                                                <!-- specify the order in which these should be applied -->
                                                <overlay>
                                                        <groupId>org.onap.portal</groupId>
                                                <!-- specify the order in which these should be applied -->
                                                <overlay>
                                                        <groupId>org.onap.portal</groupId>
-                                                       <artifactId>ecompportal-be-common</artifactId>
+                                                       <artifactId>portal-be-common</artifactId>
                                                </overlay>
                                                <overlay>
                                                        <groupId>org.onap.portal.sdk</groupId>
                                                </overlay>
                                                <overlay>
                                                        <groupId>org.onap.portal.sdk</groupId>
                <!-- EcompPortal common overlay -->
                <dependency>
                        <groupId>org.onap.portal</groupId>
                <!-- EcompPortal common overlay -->
                <dependency>
                        <groupId>org.onap.portal</groupId>
-                       <artifactId>ecompportal-be-common</artifactId>
+                       <artifactId>portal-be-common</artifactId>
                        <version>${project.version}</version>
                        <type>war</type>
                </dependency>
                <dependency>
                        <groupId>org.onap.portal</groupId>
                        <version>${project.version}</version>
                        <type>war</type>
                </dependency>
                <dependency>
                        <groupId>org.onap.portal</groupId>
-                       <artifactId>ecompportal-be-common</artifactId>
+                       <artifactId>portal-be-common</artifactId>
                        <version>${project.version}</version>
                        <type>jar</type>
                        <classifier>classes</classifier>
                </dependency>
                        <version>${project.version}</version>
                        <type>jar</type>
                        <classifier>classes</classifier>
                </dependency>
+               <dependency>
+                       <groupId>org.onap.portal</groupId>
+                       <artifactId>portal-be-common</artifactId>
+                       <version>${project.version}</version>
+                       <type>jar</type>
+                       <classifier>tests</classifier>
+                       <scope>test</scope>
+               </dependency>
                <dependency>
                        <groupId>org.onap.portal.sdk</groupId>
                        <artifactId>epsdk-fw</artifactId>
                <dependency>
                        <groupId>org.onap.portal.sdk</groupId>
                        <artifactId>epsdk-fw</artifactId>
                        <artifactId>epsdk-analytics</artifactId>
                        <version>${epsdk.version}</version>
                </dependency>
                        <artifactId>epsdk-analytics</artifactId>
                        <version>${epsdk.version}</version>
                </dependency>
+               <dependency>
+                       <groupId>org.json</groupId>
+                       <artifactId>json</artifactId>
+                       <version>20171018</version>
+               </dependency>
                <!-- Referenced by some poms and needed for testing; do NOT use "test" 
                        scope here. -->
                <dependency>
                <!-- Referenced by some poms and needed for testing; do NOT use "test" 
                        scope here. -->
                <dependency>
                <dependency>
                        <groupId>org.mitre</groupId>
                        <artifactId>openid-connect-client</artifactId>
                <dependency>
                        <groupId>org.mitre</groupId>
                        <artifactId>openid-connect-client</artifactId>
-                       <version>1.2.2</version>
+                       <version>1.3.1</version>
                        <exclusions>
                                <exclusion>
                                        <groupId>org.codehaus.jackson</groupId>
                        <exclusions>
                                <exclusion>
                                        <groupId>org.codehaus.jackson</groupId>
                                </exclusion>
                        </exclusions>
                </dependency>
                                </exclusion>
                        </exclusions>
                </dependency>
-               <dependency>
+<!--           <dependency>
                        <groupId>org.springframework.security</groupId>
                        <artifactId>spring-security-taglibs</artifactId>
                        <version>3.2.8.RELEASE</version>
                        <groupId>org.springframework.security</groupId>
                        <artifactId>spring-security-taglibs</artifactId>
                        <version>3.2.8.RELEASE</version>
                                        <artifactId>*</artifactId>
                                </exclusion>
                        </exclusions>
                                        <artifactId>*</artifactId>
                                </exclusion>
                        </exclusions>
-               </dependency>
+               </dependency> -->
                <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
                <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
 
                </plugins>
        </reporting>
 
                </plugins>
        </reporting>
-
 </project>
 </project>
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/LoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/LoginStrategy.java
new file mode 100644 (file)
index 0000000..767bd52
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.authentication;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public interface LoginStrategy {
+       public boolean login(HttpServletRequest request, HttpServletResponse response)  throws Exception;
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/OpenIdConnectLoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/OpenIdConnectLoginStrategy.java
new file mode 100644 (file)
index 0000000..cbe4b35
--- /dev/null
@@ -0,0 +1,123 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.authentication;
+
+import java.util.HashSet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.mitre.openid.connect.model.UserInfo;
+import org.onap.portalapp.command.EPLoginBean;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalapp.util.SessionCookieUtil;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+
+public class OpenIdConnectLoginStrategy extends org.onap.portalsdk.core.auth.LoginStrategy implements org.onap.portalapp.authentication.LoginStrategy {
+       
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class);
+       
+       private static final String GLOBAL_LOCATION_KEY = "Location";
+
+       @SuppressWarnings("rawtypes")
+       public boolean login(HttpServletRequest request, HttpServletResponse response) throws Exception{
+               
+               logger.info("Attempting Login");                                                                                                
+               
+               //check both authentication cookie and authentication header
+               UserInfo  userInfo = (UserInfo) request.getAttribute("userInfo");
+                               
+               if (userInfo != null && !StringUtils.isEmpty(userInfo.getPreferredUsername())) {                                                                                                
+                       //package the userid in the login form for processing
+                       EPLoginBean commandBean = new EPLoginBean();
+                       commandBean.setOrgUserId(userInfo.getPreferredUsername());
+
+                       EPUser user = new EPUser();
+                               
+                       user.setOrgUserId(userInfo.getPreferredUsername());
+                       user.setEmail(userInfo.getEmail());
+                       user.setFirstName(userInfo.getName());
+                       user.setLastName(userInfo.getFamilyName());
+                       
+                       //store the currently logged in user's information in the session
+                       EPUserUtils.setUserSession(request, user,  new HashSet(), new HashSet(), SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM),null);
+
+                       logger.info(EELFLoggerDelegate.errorLogger, request.getContextPath());
+                       SessionCookieUtil.preSetUp(request, response);  
+                       return true;
+               } else {
+                       // in case authentication cookie is missing, send 401 UNAUTHORIZED to client and it will redirect to Logon
+                       try {
+                               String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
+                               String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL);
+                               logger.info(EELFLoggerDelegate.errorLogger, "Authentication Mechanism: '" + authentication + "'.");
+                               
+                               if (authentication == null || authentication.equals("") || authentication.trim().equals("OIDC")) {                              
+                                   response.sendRedirect("oid-login");
+                               } else {
+                                       logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
+                                       response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
+                               response.setHeader(GLOBAL_LOCATION_KEY, loginUrl);
+                           }
+                       } catch(Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "login failed", e);
+                       }
+               }
+               return false;
+       }
+
+       @Override
+       public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               String message = "Method not implmented; Cannot be called";
+               logger.error(EELFLoggerDelegate.errorLogger, message);
+               throw new Exception(message);
+       }
+
+       @Override
+       public String getUserId(HttpServletRequest request) throws PortalAPIException {
+               String message = "Method not implmented; Cannot be called";
+               logger.error(EELFLoggerDelegate.errorLogger, message);
+               throw new PortalAPIException(message);
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/SimpleLoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/authentication/SimpleLoginStrategy.java
new file mode 100644 (file)
index 0000000..55a0f10
--- /dev/null
@@ -0,0 +1,131 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.authentication;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.command.EPLoginBean;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalapp.util.SessionCookieUtil;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.menu.MenuProperties;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+
+public class SimpleLoginStrategy extends org.onap.portalsdk.core.auth.LoginStrategy implements LoginStrategy{
+       
+       @Autowired
+       private EPLoginService loginService;
+
+       @Autowired
+       private EPRoleFunctionService ePRoleFunctionService;
+       
+       private static final String GLOBAL_LOCATION_KEY = "Location";
+       
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SimpleLoginStrategy.class);
+       
+       public boolean login(HttpServletRequest request, HttpServletResponse response) throws Exception{
+               logger.info("Attempting 'Simple' Login");                                                                                               
+               
+               //check both authentication cookie and authentication header
+               String  orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response);
+               
+               if (!StringUtils.isEmpty(orgUserId)) {                                                                                                  
+                       // package the userid in the login form for processing
+                       EPLoginBean commandBean = new EPLoginBean();
+                       commandBean.setOrgUserId(orgUserId);
+                       commandBean = loginService.findUser(commandBean, (String)request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), null);
+
+                        // in case authentication has passed but user is not in the ECOMP data base, return a Guest User to the home page.
+                       if (commandBean.getUser() == null) {
+                       }
+                       else {
+                               // store the currently logged in user's information in the session
+                               EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(), commandBean.getBusinessDirectMenu(), "", ePRoleFunctionService);
+                               logger.info(EELFLoggerDelegate.debugLogger, commandBean.getUser().getOrgUserId() + " exists in the the system.");
+                       }
+                       
+                       logger.info(EELFLoggerDelegate.errorLogger, request.getContextPath());
+                       SessionCookieUtil.preSetUp(request, response);
+                       return true;
+               } else {
+                       // in case authentication cookie is missing, send 401 UNAUTHORIZED to client and it will redirect to Logon
+                       try {
+                               String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
+                               String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL);
+                               logger.info(EELFLoggerDelegate.errorLogger, "Authentication Mechanism: '" + authentication + "'.");
+                               if (authentication == null || authentication.equals("") || authentication.trim().equals("BOTH")) {
+                               
+                                       logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
+                                   response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
+                           response.setHeader(GLOBAL_LOCATION_KEY, loginUrl); //returnUrl + "/index.htm");
+                       }else {
+                                       logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
+                                       response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
+                               response.setHeader(GLOBAL_LOCATION_KEY, loginUrl); //returnUrl + "/index.htm");
+                           }
+                       } catch(Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "login failed", e);
+                       }
+               }
+
+               return false;
+
+       }
+
+       @Override
+       public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               String message = "Method not implmented; Cannot be called";
+               logger.error(EELFLoggerDelegate.errorLogger, message);
+               throw new Exception(message);
+       }
+
+       @Override
+       public String getUserId(HttpServletRequest request) throws PortalAPIException {
+               String message = "Method not implmented; Cannot be called";
+               logger.error(EELFLoggerDelegate.errorLogger, message);
+               throw new PortalAPIException(message);
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppConfig.java
new file mode 100644 (file)
index 0000000..b6d384d
--- /dev/null
@@ -0,0 +1,412 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.conf;
+
+import static com.att.eelf.configuration.Configuration.MDC_ALERT_SEVERITY;
+import static com.att.eelf.configuration.Configuration.MDC_INSTANCE_UUID;
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_IP_ADDRESS;
+import static com.att.eelf.configuration.Configuration.MDC_SERVICE_INSTANCE_ID;
+import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME;
+
+import java.net.InetAddress;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.portalapp.authentication.LoginStrategy;
+import org.onap.portalapp.authentication.OpenIdConnectLoginStrategy;
+import org.onap.portalapp.authentication.SimpleLoginStrategy;
+import org.onap.portalapp.controller.core.LogoutController;
+import org.onap.portalapp.controller.core.SDKLoginController;
+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.interceptor.PortalResourceInterceptor;
+import org.onap.portalapp.portal.interceptor.SessionTimeoutInterceptor;
+import org.onap.portalapp.portal.listener.HealthMonitor;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPLoginServiceImpl;
+import org.onap.portalapp.portal.service.ExternalAccessRolesService;
+import org.onap.portalapp.portal.service.UserRolesService;
+import org.onap.portalapp.portal.transport.ExternalAuthUserRole;
+import org.onap.portalapp.portal.transport.ExternalRoleDescription;
+import org.onap.portalapp.portal.ueb.EPUebHelper;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.scheduler.RegistryAdapter;
+import org.onap.portalapp.uebhandler.FunctionalMenuHandler;
+import org.onap.portalapp.uebhandler.InitUebHandler;
+import org.onap.portalapp.uebhandler.MainUebHandler;
+import org.onap.portalapp.uebhandler.WidgetNotificationHandler;
+import org.onap.portalsdk.core.conf.AppConfig;
+import org.onap.portalsdk.core.conf.Configurable;
+import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.objectcache.AbstractCacheManager;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.service.FnMenuService;
+import org.onap.portalsdk.core.service.FnMenuServiceImpl;
+import org.onap.portalsdk.core.util.CacheManager;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScan.Filter;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Profile;
+import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.web.servlet.ViewResolver;
+import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+
+@Configuration
+@EnableWebMvc
+@ComponentScan(basePackages = {"org.onap", "org.openecomp" }, excludeFilters = {
+               @Filter(value = { LogoutController.class, SDKLoginController.class}, type = FilterType.ASSIGNABLE_TYPE) })
+@Profile("src")
+@EnableAsync
+@EnableScheduling
+
+public class ExternalAppConfig extends AppConfig implements Configurable {
+
+       private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       
+       @Autowired
+       private UserRolesService userRolesService;
+       
+       @Autowired
+       private ExternalAccessRolesService externalAccessRolesService;
+
+       private RegistryAdapter schedulerRegistryAdapter;
+
+       String UEB_APP_KEY = PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY); 
+       
+       public ViewResolver viewResolver() {
+               return super.viewResolver();
+       }
+
+       @Override
+       public void addResourceHandlers(ResourceHandlerRegistry registry) {
+               registry.addResourceHandler("/app/fusion/**").addResourceLocations("/app/fusion/");
+               registry.addResourceHandler("/static/**").addResourceLocations("/static/");
+               registry.addResourceHandler("/images/**").addResourceLocations("/images/");
+               registry.addResourceHandler("/**").addResourceLocations("/public/");
+       }
+
+       @PostConstruct
+       private void init() {
+               String remotecentralizedsystemaccess = SystemProperties.getProperty(EPCommonSystemProperties.REMOTE_CENTRALIZED_SYSTEM_ACCESS);
+               try {
+                       // Loading defaults
+                       MDC.put(MDC_SERVICE_NAME, EPSystemProperties.ECOMP_PORTAL_BE);
+                       MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
+                       MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
+                       MDC.put(MDC_SERVICE_INSTANCE_ID, "");
+                       MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.severity());
+                       MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID));
+                       if(remotecentralizedsystemaccess.equalsIgnoreCase("true")){
+                               importFromExternalAuth();
+                       }                       
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
+               }
+       }
+       
+       /**
+        * Does a sync on functions, roles and role functions based on namespace 
+        * for all the centralized applications between AAF and ONAP, updates
+        * fn_user and fn_user_role with user information from AAF.
+        * 
+        */
+       private void importFromExternalAuth() throws Exception {
+               JSONArray aafAppRoles = new JSONArray();
+               JSONArray aafUserList = new JSONArray();
+               List<EPApp> appList;
+               //to get all centralized apps           
+               List<EPApp> centralizedAppList = dataAccessService.executeNamedQuery("getCentralizedApps", null, null);         
+               if(centralizedAppList != null && centralizedAppList.size() > 0){
+                       for(int i = 0; i < centralizedAppList.size(); i++){
+                               //syncRoles(does a sync on functions, roles and role functions)
+                               externalAccessRolesService.syncApplicationRolesWithEcompDB(centralizedAppList.get(i));
+                               //retrieve roles based on NS
+                               aafAppRoles = externalAccessRolesService.getAppRolesJSONFromExtAuthSystem(centralizedAppList.get(i));
+                               if(aafAppRoles != null && aafAppRoles.length() > 0){
+                                       for(int j = 0; j < aafAppRoles.length(); j++){
+                                               ObjectMapper mapper = new ObjectMapper();
+                                               String name = aafAppRoles.getJSONObject(j).getString("name");
+                                               String desc = aafAppRoles.getJSONObject(j).getString("description");
+                                               ExternalRoleDescription externalRoleDescription = mapper.readValue(desc, ExternalRoleDescription.class);
+                                               aafUserList = externalAccessRolesService.getAllUsersByRole(name);       
+                                               if(aafUserList != null && aafUserList.length() > 0){
+                                                       for(int k = 0; k < aafUserList.length(); k++){
+                                                               EPUser user = null;
+                                                               List<EPUser> usersList = null;                                                          
+                                                               List<EPUserApp> userRolesList = new ArrayList<EPUserApp>();
+                                                               JSONObject userRole = (JSONObject) aafUserList.get(k);
+                                                               Gson gson = new Gson();
+                                                               ExternalAuthUserRole userRoleObj = gson.fromJson(userRole.toString(), ExternalAuthUserRole.class);
+                                                               if(userRoleObj.getUser() != null){
+                                                                       userRoleObj.setUser(userRoleObj.getUser().substring(0, userRoleObj.getUser().indexOf("@")));
+                                                               }                                                       
+                                                               //for each role and user in that role, check if user exists in fn_user. If not, add 
+                                                               Map<String, String> orgUserId = new HashMap<>();
+                                                               orgUserId.put("orgUserIdValue", userRoleObj.getUser());
+                                                               usersList = dataAccessService.executeNamedQuery("epUserAppId", orgUserId, null);
+                                                               if(usersList != null && usersList.size() > 0){
+                                                                       user = usersList.get(0);
+                                                               }                                                       
+                                                               if(user == null){
+                                                                       // add user to fn_user(needs to be revisited after getting user info from AAF PORTAL-172)                                                               
+                                                               }
+                                                               //for each role and user in that role, check if user exists in fn_user_role. If not, add 
+                                                               /*userRolesList = userRolesService.getUserRolesList(centralizedAppList.get(0).getId(), user.getId(), Long.valueOf(externalRoleDescription.getId()));
+                                                               if(userRolesList == null || userRolesList.isEmpty()){                                                           
+                                                                       // add userRole to fn_user_role(needs to be revisited after getting user info from AAF PORTAL-172)
+                                                               }*/
+                                                       }
+                                               }
+                                               
+                                       }
+                               }
+                       }                       
+               }
+       }
+                       
+       public DataAccessService dataAccessService() {
+               return super.dataAccessService();
+       }
+
+       public String[] tileDefinitions() {
+               return super.tileDefinitions();
+       }
+
+       public List<String> addTileDefinitions() {
+               List<String> definitions = new ArrayList<String>();
+               definitions.add("/WEB-INF/defs/definitions.xml");
+               return definitions;
+       }
+
+       @Bean
+       public AbstractCacheManager cacheManager() {
+               return new CacheManager();
+       }
+
+       @Bean
+       public SessionTimeoutInterceptor sessionTimeoutInterceptor() {
+               return new SessionTimeoutInterceptor();
+       }
+
+       @Bean
+       public PortalResourceInterceptor portalResourceInterceptor() {
+               return new PortalResourceInterceptor();
+       }
+
+       @Bean
+       public EPLoginService eploginService() {
+               return new EPLoginServiceImpl();
+       }
+
+       @Bean
+       public org.onap.portalsdk.core.auth.LoginStrategy coreLoginStrategy() {
+               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC"))
+                       return new OpenIdConnectLoginStrategy();
+               else
+                       return new SimpleLoginStrategy();
+       }
+
+       @Bean
+       public LoginStrategy loginStrategy() {
+
+               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC"))
+                       return new OpenIdConnectLoginStrategy();
+               else
+                       return new SimpleLoginStrategy();
+       }
+
+       public FnMenuService fnMenuService() {
+               return new FnMenuServiceImpl();
+       }
+
+       @Override
+       public void addInterceptors(InterceptorRegistry registry) {
+               // registry.addInterceptor(new
+               // StaticResourcesInterceptor()).addPathPatterns("/index.htm",
+               // "/applicationsHome", "/widgetsHome", "/admins", "/users",
+               // "/applications", "/widgets");
+               // Excludes login/logout pages and REST endpoints used by other
+               // application servers.
+
+               registry.addInterceptor(sessionTimeoutInterceptor()).excludePathPatterns("/oid-login", "/portalApi/healthCheck",
+                               "/portalApi/healthCheck/", "/portalApi/healthCheckSuspend", "/portalApi/healthCheckSuspend/",
+                               "/portalApi/healthCheckResume", "/portalApi/healthCheckResume/", "/login_external",
+                               "/login_external.htm*", "login", "/login.htm*", "/auxapi/*", "/context/*", "/api*",
+                               "/single_signon.htm", "/single_signon", "/dashboard", "/OpenSourceLogin.htm");
+
+               registry.addInterceptor(portalResourceInterceptor());
+
+       }
+
+       /**
+        * Creates and returns a new instance of a {@link SchedulerFactoryBean} and
+        * populates it with triggers.
+        *
+        * @return New instance of {@link SchedulerFactoryBean}
+        */
+
+       @Bean
+       public EPUebHelper epUebHelper() {
+               return new EPUebHelper();
+       }
+
+       @Bean
+       public HealthMonitor healthMonitor() {
+               return new HealthMonitor();
+       }
+
+       /**
+        * Creates and returns a new instance of a {@link MainUebHandler}.
+        * 
+        * @return New instance of {@link MainUebHandler}.
+        */
+       @Bean
+       public MainUebHandler mainUebHandler() {
+               return new MainUebHandler();
+       }
+
+       /**
+        * Creates and returns a new instance of a {@link InitUebHandler}.
+        * 
+        * @return New instance of {@link InitUebHandler}.
+        */
+       @Bean
+       public InitUebHandler initUebHandler() {
+               return new InitUebHandler();
+       }
+
+       /**
+        * Creates and returns a new instance of a {@link WidgetNotificationHandler}
+        * .
+        * 
+        * @return New instance of {@link WidgetNotificationHandler}.
+        */
+       @Bean
+       public WidgetNotificationHandler widgetNotificationHandler() {
+               return new WidgetNotificationHandler();
+       }
+
+       /**
+        * Creates and returns a new instance of a {@link FunctionalMenuHandler} .
+        * 
+        * @return New instance of {@link FunctionalMenuHandler}.
+        */
+       @Bean
+       public FunctionalMenuHandler functionalMenuHandler() {
+               return new FunctionalMenuHandler();
+       }
+
+       /**
+        * Creates and returns a new instance of a {@link SchedulerFactoryBean} and
+        * populates it with triggers.
+        *
+        * @return New instance of {@link SchedulerFactoryBean}
+        * @throws Exception if dataSource fails
+        */
+       // APPLICATIONS REQUIRING QUARTZ SHOULD RESTORE ANNOTATION
+       @Bean // ANNOTATION COMMENTED OUT
+       public SchedulerFactoryBean schedulerFactoryBean() throws Exception {
+               SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
+               scheduler.setConfigLocation(appApplicationContext.getResource("WEB-INF/conf/quartz.properties"));
+               scheduler.setDataSource(dataSource());
+               scheduler.setTriggers(schedulerRegistryAdapter.getTriggers());
+               scheduler.setSchedulerName(getScheduleName());
+               return scheduler;
+       }
+
+       protected String getScheduleName() {
+               final String CRON_SITE_NAME = "cron_site_name";
+               String cronSiteVal = "Default";
+               try {
+                       cronSiteVal = SystemProperties.getProperty(CRON_SITE_NAME);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getScheduleName failed", e);
+                       logger.warn(EELFLoggerDelegate.errorLogger,
+                                       "Cron site name not added in property file, using Default value");
+               }
+
+               String cronSiteName = cronSiteVal != null ? cronSiteVal : "";
+
+               SimpleDateFormat dateFormat = new SimpleDateFormat();
+               dateFormat.applyPattern("YYYYMMdd");
+               String currentDateStr = dateFormat.format(Calendar.getInstance().getTime());
+
+               return "Scheduler" + "_" + currentDateStr + "_" + cronSiteName;
+       }
+
+       /**
+        * Sets the scheduler registry adapter.
+        *
+        * @param schedulerRegistryAdapter
+        *            Scheduler registry adapter
+        */
+       @Autowired
+       public void setSchedulerRegistryAdapter(final RegistryAdapter schedulerRegistryAdapter) {
+               this.schedulerRegistryAdapter = schedulerRegistryAdapter;
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/ExternalAppInitializer.java
new file mode 100644 (file)
index 0000000..62051b1
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.conf;
+
+import java.util.Arrays;
+
+import org.onap.portalsdk.core.conf.AppInitializer;
+
+public class ExternalAppInitializer extends  AppInitializer{
+       
+       
+       @Override
+    protected Class<?>[] getRootConfigClasses() {
+       return super.getRootConfigClasses();
+    }
+  
+    @Override
+    protected Class<?>[] getServletConfigClasses() {
+//     Class<?>[] configClasses =  super.getServletConfigClasses();
+//     Class<?>[] additionalConfigClasses  = Arrays.copyOf(configClasses, configClasses.length);
+//     addConfigClass(additionalConfigClasses, ExternalAppConfig.class);
+//     return additionalConfigClasses;
+//     
+       return new Class[] {ExternalAppConfig.class};
+    }
+    
+    static Class<?>[] addConfigClass(Class<?>[] a, Class<?> e) {
+        a  = Arrays.copyOf(a, a.length + 1);
+        a[a.length - 1] = e;
+        return a;
+    }
+  
+    /*
+     * URL request will direct to the Spring dispatcher for processing
+     */
+    @Override
+    protected String[] getServletMappings() {
+       return super.getServletMappings();
+    }
+}
+
+
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/conf/HibernateMappingLocations.java
new file mode 100644 (file)
index 0000000..f340ec3
--- /dev/null
@@ -0,0 +1,61 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.conf;
+
+import org.onap.portalsdk.core.conf.HibernateMappingLocatable;
+import org.springframework.context.annotation.Profile;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.stereotype.Component;
+
+@Component
+@Profile("src")
+public class HibernateMappingLocations implements HibernateMappingLocatable {
+
+       public Resource[] getMappingLocations() {
+               return new Resource[] { new ClassPathResource("../fusion/orm/Fusion.hbm.xml"),
+                               new ClassPathResource("../fusion/orm/EP.hbm.xml"),
+                               new ClassPathResource("../fusion/orm/Workflow.hbm.xml") };
+       }
+
+       @Override
+       public String[] getPackagesToScan() {
+               return new String[] { "org.onap","org.openecomp" };
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..0f0cf27
--- /dev/null
@@ -0,0 +1,133 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPUnRestrictedBaseController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping("/")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@Profile("src")
+public class ECOMPLogoutController extends EPUnRestrictedBaseController{
+       
+       private EPUser user;
+       private static final String EP_SERVICE = "EPService";
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ECOMPLogoutController.class);
+
+       @EPAuditLog
+       @RequestMapping(value = {"/logout.htm" }, method = RequestMethod.GET)
+       public ModelAndView logOut(HttpServletRequest request,
+                                                               HttpServletResponse response) throws Exception {
+       
+               ModelAndView modelView = null;
+                               
+               chatRoomLogout(request);
+               logger.debug(EELFLoggerDelegate.debugLogger, "ECOMPLogoutController.handleRequestInternal - Logout request received.");
+               
+               modelView = new ModelAndView("redirect:login.htm");
+               
+               /**
+               if (UserUtils.isClientMobileDevice(request)){
+               modelView.setViewName(modelView.getViewName().concat("?viewType=mobile"));
+               }
+               */
+               String cookieDoamin = EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN);
+               Cookie epCookie = new Cookie(EP_SERVICE, "");
+               epCookie.setMaxAge(0);
+               epCookie.setDomain(cookieDoamin);
+               epCookie.setPath("/");
+               
+               Cookie appHeaderCookie = new Cookie("show_app_header", "");
+               appHeaderCookie.setMaxAge(0);
+               appHeaderCookie.setDomain(cookieDoamin);
+               appHeaderCookie.setPath("/");
+               
+               Cookie appTabCookie = new Cookie("cookieTabs", "");
+               appTabCookie.setMaxAge(0);
+               appTabCookie.setDomain(cookieDoamin);
+               appTabCookie.setPath("/");
+               
+               Cookie appVisInvisTabCookie = new Cookie("visInVisCookieTabs", "");
+               appVisInvisTabCookie.setMaxAge(0);
+               appVisInvisTabCookie.setDomain(cookieDoamin);
+               appVisInvisTabCookie.setPath("/");
+               
+           response.addCookie(epCookie);       
+           response.addCookie(appHeaderCookie);
+           response.addCookie(appTabCookie);
+           response.addCookie(appVisInvisTabCookie);
+               request.getSession().invalidate();
+               
+               logger.debug(EELFLoggerDelegate.debugLogger, "ECOMPLogoutController.handleRequestInternal - Successfully processed the logout request.");
+               
+               return modelView;
+       }
+       
+       @EPMetricsLog
+       public void chatRoomLogout(HttpServletRequest request){
+               request = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest(); 
+               setUser(EPUserUtils.getUserSession(request));
+       }
+       
+       public EPUser getUser() {
+               return user;
+       }
+       
+       public void setUser(EPUser user) {
+               this.user = user;
+       }
+}
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
new file mode 100644 (file)
index 0000000..273a0b1
--- /dev/null
@@ -0,0 +1,413 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.json.JSONObject;
+import org.onap.portalapp.command.EPLoginBean;
+import org.onap.portalapp.controller.EPUnRestrictedBaseController;
+import org.onap.portalapp.portal.domain.SharedContext;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalapp.portal.service.SharedContextService;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalapp.util.SessionCookieUtil;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.menu.MenuProperties;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.util.StopWatch;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.util.WebUtils;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Controller
+@RequestMapping("/")
+public class LoginController extends EPUnRestrictedBaseController implements LoginService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginController.class);
+
+       public static final String DEFAULT_SUCCESS_VIEW = "applicationsHome";
+       public static final String DEFAULT_FAILURE_VIEW = "login";
+       public static final String ERROR_MESSAGE_KEY = "error";
+       public static final String REDIRECT_URL = "redirectUrl";
+       public static final String REDIRECT_COLON = "redirect:";
+
+       @Autowired
+       private EPLoginService loginService;
+       @Autowired
+       private SharedContextService sharedContextService;
+       @Autowired
+       private EPRoleFunctionService ePRoleFunctionService;
+
+       private String viewName = "login";
+
+       private String welcomeView;
+
+       @RequestMapping(value = { "/login.htm" }, method = RequestMethod.GET)
+       public ModelAndView login(HttpServletRequest request) {
+               Map<String, Object> model = new HashMap<String, Object>();
+               String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
+               String loginPage;
+               if (authentication == null || "".equals(authentication) || "OICD".equals(authentication.trim()))
+                       loginPage = "openIdLogin";
+               else
+                       loginPage = getViewName();
+               return new ModelAndView(loginPage, "model", model);
+       }
+
+       @SuppressWarnings("rawtypes")
+       @RequestMapping(value = { "/open_source/login" }, method = RequestMethod.POST)
+       @ResponseBody
+       public String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception {
+
+               ObjectMapper mapper = new ObjectMapper();
+               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+               JsonNode root = mapper.readTree(request.getReader());
+
+               EPLoginBean commandBean = new EPLoginBean();
+               String loginId = root.get("loginId").textValue();
+               String password = root.get("password").textValue();
+               commandBean.setLoginId(loginId);
+               commandBean.setLoginPwd(CipherUtil.encrypt(password));
+               HashMap additionalParamsMap = new HashMap();
+               StringBuilder sbAdditionalInfo = new StringBuilder();
+
+               commandBean = getLoginService().findUser(commandBean,
+                               (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap);
+               String fullURL = getFullURL(request);
+               if (commandBean.getUser() == null) {
+                       String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage()
+                                       : "login.error.external.invalid";
+                       logger.info(EELFLoggerDelegate.debugLogger, "loginId {} does not exist in the the DB.", loginId);
+                       sbAdditionalInfo.append(String.format("But the Login-Id: %s doesn't exist in the Database. Request-URL: %s",
+                                       loginId, fullURL));
+                       return loginErrorMessage;
+               } else {
+                       // store the currently logged in user's information in the session
+                       EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
+                                       commandBean.getBusinessDirectMenu(),
+                                       SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM), ePRoleFunctionService);
+
+                       try {
+                               logger.info(EELFLoggerDelegate.debugLogger, "loginValidate: store user info into share context begins");
+                               String sessionId = request.getSession().getId();
+                               List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
+                               if (existingSC == null || existingSC.isEmpty()) {
+                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME,
+                                                       commandBean.getUser().getFirstName());
+                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME,
+                                                       commandBean.getUser().getLastName());
+                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL,
+                                                       commandBean.getUser().getEmail());
+                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID,
+                                                       commandBean.getLoginId());
+                               }
+
+                       } catch (Exception e) {
+                               logger.info(EELFLoggerDelegate.errorLogger, "loginValidate: failed the shared context adding process ",
+                                               e);
+                       }
+                       logger.info(EELFLoggerDelegate.debugLogger,
+                                       "loginValidate: PresetUp the EP service cookie and intial sessionManagement");
+
+                       SessionCookieUtil.preSetUp(request, response);
+                       SessionCookieUtil.setUpUserIdCookie(request, response, loginId);
+
+                       JSONObject j = new JSONObject("{success: success}");
+
+                       return j.toString();
+               }
+       }
+
+       /*
+        * Work around a bug in ecompsdkos version 1.1.0 which hard-codes this endpoint.
+        */
+       @RequestMapping(value = { "/process_csp" }, method = RequestMethod.GET)
+       public ModelAndView processCsp(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               return processSingleSignOn(request, response);
+       }
+       /*
+        * Remove this method after epsdk-app-common/.../SingleSignOnController.java is
+        * repaired.
+        */
+
+       @RequestMapping(value = { "/processSingleSignOn" }, method = RequestMethod.GET)
+       public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception {
+
+               Map<Object, Object> model = new HashMap<Object, Object>();
+               HashMap<Object, Object> additionalParamsMap = new HashMap<Object, Object>();
+               EPLoginBean commandBean = new EPLoginBean();
+               MDC.put(MDC_KEY_REQUEST_ID, getRequestId(request));
+               // get userId from cookie
+               String orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response);
+               logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: begins with orgUserId {}", orgUserId);
+
+               StringBuilder sbAdditionalInfo = new StringBuilder();
+               validateDomain(request);
+               if (orgUserId == null || orgUserId.length() == 0) {
+                       model.put(ERROR_MESSAGE_KEY, SystemProperties.MESSAGE_KEY_LOGIN_ERROR_COOKIE_EMPTY);
+                       if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
+                               return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl="
+                                               + request.getParameter(REDIRECT_URL));
+                       } else {
+                               return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm");
+                       }
+               } else {
+
+                       StopWatch stopWatch = new StopWatch("LoginController.Login");
+                       stopWatch.start();
+
+                       try {
+                               logger.info(EELFLoggerDelegate.debugLogger,
+                                               "Operation findUser is started to locate user {}  in the database.", orgUserId);
+                               commandBean.setLoginId(orgUserId);
+                               commandBean.setOrgUserId(orgUserId);
+                               commandBean = getLoginService().findUser(commandBean,
+                                               (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY),
+                                               additionalParamsMap);
+
+                               stopWatch.stop();
+                               MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms");
+                               logger.info(EELFLoggerDelegate.debugLogger, "Operation findUser is completed.");
+                       } catch (Exception e) {
+                               stopWatch.stop();
+                               MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms");
+                               logger.info(EELFLoggerDelegate.errorLogger, "processSingleSignOn failed on user " + orgUserId, e);
+                       } finally {
+                               MDC.remove(EPSystemProperties.MDC_TIMER);
+                       }
+
+                       sbAdditionalInfo.append("Login attempt is succeeded. ");
+                       String fullURL = getFullURL(request);
+                       if (commandBean.getUser() == null) {
+                               logger.info(EELFLoggerDelegate.debugLogger,
+                                               "processSingleSignOn: loginId {} does not exist in the the DB.", orgUserId);
+
+                               sbAdditionalInfo.append(String.format(
+                                               "But the Login-Id: %s doesn't exist in the Database. Created a Guest Session. Request-URL: %s",
+                                               orgUserId, fullURL));
+                               validateDomain(request);
+                               if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
+                                       return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl="
+                                                       + request.getParameter(REDIRECT_URL));
+                               } else {
+                                       return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm");
+                               }
+                       } else {
+
+                               sbAdditionalInfo.append(
+                                               String.format("Login-Id: %s, Login-Method: %s, Request-URL: %s", orgUserId, "", fullURL));
+                               logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: now set up user session for {}",
+                                               orgUserId);
+
+                               EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
+                                               commandBean.getBusinessDirectMenu(),
+                                               SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM), ePRoleFunctionService);
+                               logger.info(EELFLoggerDelegate.debugLogger,
+                                               "processSingleSignOn: now set up user session for {} finished", orgUserId);
+
+                               // Store user's information into share context
+                               try {
+                                       logger.info(EELFLoggerDelegate.debugLogger,
+                                                       "processSingleSignOn: store user info into share context begins");
+                                       String sessionId = request.getSession().getId();
+                                       List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
+                                       if (existingSC == null || existingSC.isEmpty()) {
+                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME,
+                                                               commandBean.getUser().getFirstName());
+                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME,
+                                                               commandBean.getUser().getLastName());
+                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL,
+                                                               commandBean.getUser().getEmail());
+                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID,
+                                                               commandBean.getLoginId());
+                                       }
+                               } catch (Exception e) {
+                                       logger.info(EELFLoggerDelegate.errorLogger,
+                                                       "processSingleSignOn: failed the shared context adding process", e);
+                               }
+
+                               logger.info(EELFLoggerDelegate.debugLogger,
+                                               "processSingleSignOn: PresetUp the EP service cookie and intial sessionManagement");
+                               SessionCookieUtil.preSetUp(request, response);
+                               SessionCookieUtil.setUpUserIdCookie(request, response, orgUserId);
+                               logger.info(EELFLoggerDelegate.debugLogger,
+                                               "processSingleSignOn: PresetUp the EP service cookie and intial sessionManagement completed");
+                               logger.info(EELFLoggerDelegate.debugLogger,
+                                               commandBean.getUser().getOrgUserId() + " exists in the the system.");
+
+                               // get redirectUrl from URL parameter
+                               validateDomain(request);
+                               if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
+                                       String forwardUrl = URLDecoder.decode(request.getParameter(REDIRECT_URL), "UTF-8");
+                                       // clean cookie
+                                       Cookie cookie2 = new Cookie(REDIRECT_URL, "");
+                                       // ONAP does not use https
+                                       cookie2.setSecure(false);
+                                       cookie2.setMaxAge(0);
+                                       cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
+                                       cookie2.setPath("/");
+                                       response.addCookie(cookie2);
+                                       return new ModelAndView(REDIRECT_COLON + forwardUrl);
+                               }
+
+                               // first check if redirectUrl exists or not
+                               if (WebUtils.getCookie(request, REDIRECT_URL) != null) {
+                                       String forwardUrl = WebUtils.getCookie(request, REDIRECT_URL).getValue();
+                                       // clean cookie
+                                       Cookie cookie2 = new Cookie(REDIRECT_URL, "");
+                                       // ONAP does not use https
+                                       cookie2.setSecure(false);
+                                       cookie2.setMaxAge(0);
+                                       cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
+                                       cookie2.setPath("/");
+                                       response.addCookie(cookie2);
+
+                                       return new ModelAndView(REDIRECT_COLON + forwardUrl);
+                               }
+                       }
+               }
+
+               // if user has been authenticated, now take them to the welcome page.
+               logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: Now return to application home page");
+               return new ModelAndView(REDIRECT_COLON + SystemProperties.getProperty(EPSystemProperties.FE_URL));
+       }
+
+       private void validateDomain(HttpServletRequest request) throws MalformedURLException {
+               final String returnToAppUrl = request.getParameter(REDIRECT_URL);
+               if (StringUtils.isNotBlank(returnToAppUrl)) {
+                       String hostName = new URL(returnToAppUrl).getHost();
+                       if (StringUtils.isNotBlank(hostName)
+                                       && !hostName.endsWith(EPSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN))) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "processSingleSignOn ()  accessing Unauthorized url  :" + hostName);
+                               throw new SecurityException("accessing Unauthorized url : " + hostName);
+                       }
+               }
+       }
+
+       private String getFullURL(HttpServletRequest request) {
+               if (request != null) {
+                       String requestURL = request.getRequestURL().toString();
+                       String queryString = request.getQueryString();
+                       if (queryString == null) {
+                               return requestURL;
+                       } else {
+                               return requestURL + "?" + queryString;
+                       }
+               }
+               return "";
+       }
+
+       private String getRequestId(HttpServletRequest request) {
+               Enumeration<String> headerNames = request.getHeaderNames();
+               String requestId = "";
+               while (headerNames.hasMoreElements()) {
+                       String headerName = headerNames.nextElement();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getRequestId: header {} has value {}", headerName,
+                                       request.getHeader(headerName));
+                       if (headerName.equalsIgnoreCase(SystemProperties.ECOMP_REQUEST_ID)) {
+                               requestId = request.getHeader(headerName);
+                               break;
+                       }
+               }
+               return requestId.isEmpty() ? UUID.randomUUID().toString() : requestId;
+       }
+
+       public String getWelcomeView() {
+               return welcomeView;
+       }
+
+       public void setWelcomeView(String welcomeView) {
+               this.welcomeView = welcomeView;
+       }
+
+       @Override
+       public String getViewName() {
+               return viewName;
+       }
+
+       @Override
+       public void setViewName(String viewName) {
+               this.viewName = viewName;
+       }
+
+       public EPLoginService getLoginService() {
+               return loginService;
+       }
+
+       public void setLoginService(EPLoginService loginService) {
+               this.loginService = loginService;
+       }
+
+       public SharedContextService getSharedContextService() {
+               return sharedContextService;
+       }
+
+       public void setSharedContextService(SharedContextService sharedContextService) {
+               this.sharedContextService = sharedContextService;
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/LoginService.java
new file mode 100644 (file)
index 0000000..41e07a8
--- /dev/null
@@ -0,0 +1,54 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+public interface LoginService {
+       
+       public ModelAndView login(HttpServletRequest request);
+       
+       public @ResponseBody String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception;
+       
+       public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception;
+
+}
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
new file mode 100644 (file)
index 0000000..d20a460
--- /dev/null
@@ -0,0 +1,99 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalsdk.core.auth.LoginStrategy;
+import org.onap.portalsdk.core.controller.UnRestrictedBaseController;
+import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
+import org.onap.portalsdk.core.service.LoginService;
+import org.onap.portalsdk.core.service.ProfileService;
+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.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping("/")
+public class ONAPLoginController extends UnRestrictedBaseController {
+       @Autowired
+       ProfileService service;
+       @Autowired
+       private LoginService loginService;
+       @Autowired
+       private LoginStrategy loginStrategy;
+       String viewName;
+
+       @RequestMapping(value = { "/doLogin" }, method = RequestMethod.GET)
+       public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               return loginStrategy.doLogin(request, response);
+       }
+
+       public String getJessionId(HttpServletRequest request) {
+               return request.getSession().getId();
+       }
+
+       protected void initateSessionMgtHandler(HttpServletRequest request) {
+               String jSessionId = getJessionId(request);
+               PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request));
+       }
+
+       public String getViewName() {
+               return viewName;
+       }
+
+       public void setViewName(String viewName) {
+               this.viewName = viewName;
+       }
+
+       public LoginService getLoginService() {
+               return loginService;
+       }
+
+       public void setLoginService(LoginService loginService) {
+               this.loginService = loginService;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..0435dba
--- /dev/null
@@ -0,0 +1,102 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import java.security.Principal;
+import java.util.Set;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority;
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+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.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping("/")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class ONAPWelcomeController extends EPRestrictedBaseController{
+       String viewName;
+               
+       @RequestMapping(value = "/index.htm", method = RequestMethod.GET)
+    public String getIndexPage(HttpServletRequest request) {
+               return "/index";
+    }
+       
+       @RequestMapping(value = {"/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}, method = RequestMethod.GET)
+    public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) {
+               return "forward:/index.html";
+    }
+       
+       protected String getViewName() {
+               return viewName;
+       }
+       
+       protected void setViewName(String viewName) {
+               this.viewName = viewName;
+       }
+       
+       //@Resource(name = "namedAdmins")
+       private Set<SubjectIssuerGrantedAuthority> admins;
+       
+       @RequestMapping("/user")
+       public String user(Principal p) {
+               return "oid-user";
+       }
+
+       @RequestMapping("/admin")
+       public String admin(Model model, Principal p) {
+
+               model.addAttribute("admins", admins);
+
+               return "oid-admin";
+       }
+       @RequestMapping("/oid-login")
+       public ModelAndView login(Principal p) {                
+               return new ModelAndView("openIdLogin");
+       }       
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/OpenCollaborationController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/OpenCollaborationController.java
new file mode 100644 (file)
index 0000000..5348f23
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import java.util.HashMap;
+import java.util.Map;
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/PeerBroadcastSocket.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/PeerBroadcastSocket.java
new file mode 100644 (file)
index 0000000..170c3ce
--- /dev/null
@@ -0,0 +1,124 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.controller;
+
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Map;
+
+import javax.websocket.OnClose;
+import javax.websocket.OnMessage;
+import javax.websocket.OnOpen;
+import javax.websocket.Session;
+import javax.websocket.server.ServerEndpoint;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@ServerEndpoint("/opencontact")
+public class PeerBroadcastSocket {
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PeerBroadcastSocket.class);
+
+       public static Map<String, Object> channelMap = new Hashtable<String, Object>();
+       public Map<String, String> sessionMap = new Hashtable<String, String>();
+       ObjectMapper mapper = new ObjectMapper();
+
+       @OnMessage
+       public void message(String message, Session session) {
+               try {
+                       // JSONObject jsonObject = new JSONObject(message);
+                       @SuppressWarnings("unchecked")
+                       Map<String, Object> jsonObject = mapper.readValue(message, Map.class);
+                       try {
+                               Object from = jsonObject.get("from");
+                               if (from != null) {
+                                       if(channelMap.get(from.toString()) == null) {
+                                               channelMap.put(from.toString(), session);
+                                               sessionMap.put(session.getId(), from.toString());
+                                       }
+                               }
+                       } catch (Exception je) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to read value" + je.getMessage());
+                       }
+
+                       try {
+                               Object to = jsonObject.get("to");
+                               if (to == null)
+                                       return;
+                               Object toSessionObj = channelMap.get(to);
+                               if (toSessionObj != null) {
+                                       Session toSession = null;
+                                       toSession = (Session) toSessionObj;
+                                       toSession.getBasicRemote().sendText(message);
+                               }
+
+                       } catch (Exception ex) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to send text" + ex.getMessage());
+                       }
+
+               } catch (Exception ex) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Failed" + ex.getMessage());
+               }
+
+       }
+
+       @OnOpen
+       public void open(Session session) {
+               logger.info(EELFLoggerDelegate.debugLogger, "Channel opened");
+       }
+
+       @OnClose
+       public void close(Session session) {
+               String channel = sessionMap.get(session.getId());
+               if (channel != null) {
+                       Object sessObj = channelMap.get(channel);
+                       if (sessObj != null) {
+                               try {
+                                       ((Session) sessObj).close();
+                               } catch (IOException e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to close" + e.getMessage());
+                               }
+                       }
+                       channelMap.remove(channel);
+               }
+               logger.info(EELFLoggerDelegate.debugLogger, "Channel closed");
+       }
+
+}
+
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssFilter.java
new file mode 100644 (file)
index 0000000..11d1a44
--- /dev/null
@@ -0,0 +1,158 @@
+
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.filter;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ReadListener;
+import javax.servlet.ServletException;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.http.HttpStatus;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.web.filter.OncePerRequestFilter;
+
+public class SecurityXssFilter extends OncePerRequestFilter {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SecurityXssFilter.class);
+
+       private static final String APPLICATION_JSON = "application/json";
+
+       private static final String ERROR_BAD_REQUEST = "{\"error\":\"BAD_REQUEST\"}";
+
+       private SecurityXssValidator validator = SecurityXssValidator.getInstance();
+
+       public class RequestWrapper extends HttpServletRequestWrapper {
+
+               private ByteArrayOutputStream cachedBytes;
+
+               public RequestWrapper(HttpServletRequest request) {
+                       super(request);
+               }
+
+               @Override
+               public ServletInputStream getInputStream() throws IOException {
+                       if (cachedBytes == null)
+                               cacheInputStream();
+
+                       return new CachedServletInputStream();
+               }
+
+               @Override
+               public BufferedReader getReader() throws IOException {
+                       return new BufferedReader(new InputStreamReader(getInputStream()));
+               }
+
+               private void cacheInputStream() throws IOException {
+                       cachedBytes = new ByteArrayOutputStream();
+                       IOUtils.copy(super.getInputStream(), cachedBytes);
+               }
+
+               public class CachedServletInputStream extends ServletInputStream {
+                       private ByteArrayInputStream input;
+
+                       public CachedServletInputStream() {
+                               input = new ByteArrayInputStream(cachedBytes.toByteArray());
+                       }
+
+                       @Override
+                       public int read() throws IOException {
+                               return input.read();
+                       }
+
+                       @Override
+                       public boolean isFinished() {
+                               return false;
+                       }
+
+                       @Override
+                       public boolean isReady() {
+                               return false;
+                       }
+
+                       @Override
+                       public void setReadListener(ReadListener readListener) {
+
+                       }
+
+               }
+       }
+
+       @Override
+       protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
+                       throws ServletException, IOException {
+               if (validateRequestType(request)) {
+                       request = new RequestWrapper(request);
+                       String requestData = IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8.toString());
+                       try {
+                               if (StringUtils.isNotBlank(requestData) && validator.denyXSS(requestData)) {
+                                       response.setContentType(APPLICATION_JSON);
+                                       response.setStatus(HttpStatus.SC_BAD_REQUEST);
+                                       response.getWriter().write(ERROR_BAD_REQUEST);
+                                       throw new SecurityException(ERROR_BAD_REQUEST);
+                               }
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "doFilterInternal() failed due to BAD_REQUEST", e);
+                               response.getWriter().close();
+                               return;
+                       }
+                       filterChain.doFilter(request, response);
+
+               } else {
+                       filterChain.doFilter(request, response);
+               }
+
+       }
+
+       private boolean validateRequestType(HttpServletRequest request) {
+               return (request.getMethod().equalsIgnoreCase("POST") || request.getMethod().equalsIgnoreCase("PUT")
+                               || request.getMethod().equalsIgnoreCase("DELETE"));
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/filter/SecurityXssValidator.java
new file mode 100644 (file)
index 0000000..4d6a9fe
--- /dev/null
@@ -0,0 +1,207 @@
+/*-
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright © 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.filter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.regex.Pattern;
+
+import org.apache.commons.lang.NotImplementedException;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringEscapeUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.owasp.esapi.ESAPI;
+import org.owasp.esapi.codecs.Codec;
+import org.owasp.esapi.codecs.MySQLCodec;
+import org.owasp.esapi.codecs.MySQLCodec.Mode;
+import org.owasp.esapi.codecs.OracleCodec;
+
+public class SecurityXssValidator {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SecurityXssValidator.class);
+
+       private static final String MYSQL_DB = "mysql";
+       private static final String ORACLE_DB = "oracle";
+       private static final String MARIA_DB = "mariadb";
+       private static final int FLAGS = Pattern.CASE_INSENSITIVE | Pattern.MULTILINE | Pattern.DOTALL;
+       static SecurityXssValidator validator = null;
+       private static Codec instance;
+       private static final Lock lock = new ReentrantLock();
+
+       public static SecurityXssValidator getInstance() {
+
+               if (validator == null) {
+                       lock.lock();
+                       try {
+                               if (validator == null)
+                                       validator = new SecurityXssValidator();
+                       } finally {
+                               lock.unlock();
+                       }
+               }
+
+               return validator;
+       }
+
+       private SecurityXssValidator() {
+               // Avoid anything between script tags
+               XSS_INPUT_PATTERNS.add(Pattern.compile("<script>(.*?)</script>", FLAGS));
+
+               // avoid iframes
+               XSS_INPUT_PATTERNS.add(Pattern.compile("<iframe(.*?)>(.*?)</iframe>", FLAGS));
+
+               // Avoid anything in a src='...' type of expression
+               XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\'(.*?)\\\'", FLAGS));
+
+               XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*\\\"(.*?)\\\"", FLAGS));
+
+               XSS_INPUT_PATTERNS.add(Pattern.compile("src[\r\n]*=[\r\n]*([^>]+)", FLAGS));
+
+               // Remove any lonesome </script> tag
+               XSS_INPUT_PATTERNS.add(Pattern.compile("</script>", FLAGS));
+
+               XSS_INPUT_PATTERNS.add(Pattern.compile(".*(<script>|</script>).*", FLAGS));
+
+               XSS_INPUT_PATTERNS.add(Pattern.compile(".*(<iframe>|</iframe>).*", FLAGS));
+
+               // Remove any lonesome <script ...> tag
+               XSS_INPUT_PATTERNS.add(Pattern.compile("<script(.*?)>", FLAGS));
+
+               // Avoid eval(...) expressions
+               XSS_INPUT_PATTERNS.add(Pattern.compile("eval\\((.*?)\\)", FLAGS));
+
+               // Avoid expression(...) expressions
+               XSS_INPUT_PATTERNS.add(Pattern.compile("expression\\((.*?)\\)", FLAGS));
+
+               // Avoid javascript:... expressions
+               XSS_INPUT_PATTERNS.add(Pattern.compile(".*(javascript:|vbscript:).*", FLAGS));
+
+               // Avoid onload= expressions
+               XSS_INPUT_PATTERNS.add(Pattern.compile(".*(onload(.*?)=).*", FLAGS));
+       }
+
+       private List<Pattern> XSS_INPUT_PATTERNS = new ArrayList<Pattern>();
+
+       /**
+        * * This method takes a string and strips out any potential script injections.
+        * 
+        * @param value
+        * @return String - the new "sanitized" string.
+        */
+       public String stripXSS(String value) {
+
+               try {
+
+                       if (StringUtils.isNotBlank(value)) {
+
+                               value = StringEscapeUtils.escapeHtml4(value);
+
+                               value = ESAPI.encoder().canonicalize(value);
+
+                               // Avoid null characters
+                               value = value.replaceAll("\0", "");
+
+                               for (Pattern xssInputPattern : XSS_INPUT_PATTERNS) {
+                                       value = xssInputPattern.matcher(value).replaceAll("");
+                               }
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "stripXSS() failed", e);
+               }
+
+               return value;
+       }
+
+       public Boolean denyXSS(String value) {
+               Boolean flag = Boolean.FALSE;
+               try {
+                       if (StringUtils.isNotBlank(value)) {
+                               value = ESAPI.encoder().canonicalize(value);
+                               for (Pattern xssInputPattern : XSS_INPUT_PATTERNS) {
+                                       if (xssInputPattern.matcher(value).matches()) {
+                                               flag = Boolean.TRUE;
+                                               break;
+                                       }
+
+                               }
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "denyXSS() failed", e);
+               }
+
+               return flag;
+       }
+
+       public Codec getCodec() {
+               try {
+                       if (null == instance) {
+                               if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER), MYSQL_DB)
+                                               || StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER),
+                                                               MARIA_DB)) {
+                                       instance = new MySQLCodec(Mode.STANDARD);
+
+                               } else if (StringUtils.containsIgnoreCase(SystemProperties.getProperty(SystemProperties.DB_DRIVER),
+                                               ORACLE_DB)) {
+                                       instance = new OracleCodec();
+                               } else {
+                                       throw new NotImplementedException("Handling for data base \""
+                                                       + SystemProperties.getProperty(SystemProperties.DB_DRIVER) + "\" not yet implemented.");
+                               }
+                       }
+
+               } catch (Exception ex) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getCodec() failed", ex);
+               }
+               return instance;
+
+       }
+
+       public List<Pattern> getXSS_INPUT_PATTERNS() {
+               return XSS_INPUT_PATTERNS;
+       }
+
+       public void setXSS_INPUT_PATTERNS(List<Pattern> xSS_INPUT_PATTERNS) {
+               XSS_INPUT_PATTERNS = xSS_INPUT_PATTERNS;
+       }
+
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..364899d
--- /dev/null
@@ -0,0 +1,135 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.json.JSONObject;
+import org.onap.portalapp.portal.controller.AppsController;
+import org.onap.portalapp.portal.domain.EPUser;
+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.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.PersUserAppService;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.util.EPUserUtils;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class AppsOSController extends AppsController {
+       
+       static final String FAILURE = "failure";
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsOSController.class);
+
+       @Autowired
+       AdminRolesService adminRolesService;
+       @Autowired
+       EPAppService appService;
+       @Autowired
+       PersUserAppService persUserAppService;
+       @Autowired
+       UserService userService;
+
+       
+       
+       /**
+        * Create new application's contact us details.
+        * 
+        * @param contactUs
+        * @return
+        */
+       @RequestMapping(value = "/portalApi/saveNewUser", method = RequestMethod.POST, produces = "application/json")
+       public PortalRestResponse<String> saveNewUser(HttpServletRequest request,@RequestBody EPUser newUser) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               if (newUser == null)
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE,
+                                       "New User cannot be null or empty");
+               
+               if (!(adminRolesService.isSuperAdmin(user) || adminRolesService.isAccountAdmin(user))){
+                       if(!user.getLoginId().equalsIgnoreCase(newUser.getLoginId()))
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE,
+                                               "UnAuthorized");
+               }
+                       
+        String checkDuplicate = request.getParameter("isCheck");
+               String saveNewUser = FAILURE;
+               try {
+                       saveNewUser = userService.saveNewUser(newUser,checkDuplicate);
+               } catch (Exception e) {
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveNewUser, e.getMessage());
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveNewUser, "");
+       }
+       
+       @RequestMapping(value = { "/portalApi/currentUserProfile/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
+       public String getCurrentUserProfile(HttpServletRequest request, @PathVariable("loginId") String loginId) {
+               
+               Map<String,String> map = new HashMap<String,String>();
+               EPUser user = null;
+               try {
+                        user = (EPUser) userService.getUserByUserId(loginId).get(0);
+                        map.put("firstName", user.getFirstName());
+                    map.put("lastName", user.getLastName());
+                    map.put("email", user.getEmail());
+                        map.put("loginId", user.getLoginId());
+                        map.put("loginPwd",user.getLoginPwd());
+                        map.put("middleInitial",user.getMiddleInitial());
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to get user info", e);
+               }
+
+               JSONObject j = new JSONObject(map);;
+               return j.toString();
+       }
+
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..7670f88
--- /dev/null
@@ -0,0 +1,262 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.controller.DashboardSearchResultController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/portalApi/search")
+public class DashboardSearchResultController extends EPRestrictedBaseController {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardSearchResultController.class);
+
+       @Autowired
+       private DashboardSearchService searchService;
+
+       /**
+        * Gets all widgets by type: NEW or RESOURCE
+        * 
+        * @param request
+        * @param resourceType
+        *            Request parameter.
+        * @return Rest response wrapped around a CommonWidgetMeta object.
+        */
+       @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
+                       @RequestParam String resourceType) {
+               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
+                               searchService.getWidgetData(resourceType));
+       }
+
+       /**
+        * Saves all: news and resources
+        * 
+        * @param commonWidgetMeta
+        *            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")
+       public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta);
+               if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals(""))
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
+                                       "Category cannot be null or empty");
+               // validate dates
+               for (CommonWidget cw : commonWidgetMeta.getItems()) {
+                       String err = validateCommonWidget(cw);
+                       if (err != null)
+                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
+               }
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.saveWidgetDataBulk(commonWidgetMeta));
+       }
+
+       /**
+        * Saves one: news or resource
+        * 
+        * @param commonWidget
+        *            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")
+       public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget);
+               if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals(""))
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
+                                       "Cateogry cannot be null or empty");
+               String err = validateCommonWidget(commonWidget);
+               if (err != null)
+                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.saveWidgetData(commonWidget));
+       }
+
+       /**
+        * Used by the validate function
+        */
+       private final SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd");
+
+       /**
+        * Validates the content of a common widget.
+        * 
+        * @param cw
+        * @return null on success; an error message if validation fails.
+        * @throws Exception
+        */
+       private String validateCommonWidget(CommonWidget cw) {
+               try {
+                       if (cw.getEventDate() != null && cw.getEventDate().trim().length() > 0)
+                               yearMonthDayFormat.parse(cw.getEventDate());
+               } catch (ParseException ex) {
+                       return ex.toString();
+               }
+               return null;
+       }
+
+       /**
+        * Deletes one: news or resource
+        * 
+        * @param commonWidget
+        *            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")
+       public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) {
+               logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget);
+               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
+                               searchService.deleteWidgetData(commonWidget));
+       }
+
+       /**
+        * Searches all portal for the input string.
+        * 
+        * @param request
+        * @param searchString
+        * @return Rest response wrapped around a Map of String to List of Search
+        *         Result Item.
+        */
+       @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request,
+                       @RequestParam String searchString) {
+
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (user == null) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
+                                               "searchPortal: User object is null? - check logs",
+                                               new HashMap<String, List<SearchResultItem>>());
+                       } else if (searchString == null || searchString.trim().length() == 0) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null",
+                                               new HashMap<String, List<SearchResultItem>>());
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'",
+                                               user.getLoginId(), searchString);
+                               Map<String, List<SearchResultItem>> results = searchService.searchResults(user.getLoginId(),
+                                               searchString);
+                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchPortal failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
+                                       new HashMap<String, List<SearchResultItem>>());
+               }
+       }
+
+       /**
+        * Gets all active users.
+        * 
+        * TODO: should only the superuser be allowed to use this API?
+        * 
+        * @param request
+        * @return Rest response wrapped around a list of String
+        */
+       @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json")
+       public List<String> getActiveUsers(HttpServletRequest request) {
+               List<String> activeUsers = null;
+               List<String> onlineUsers = new ArrayList<>();
+               try {
+                       EPUser user = EPUserUtils.getUserSession(request);
+                       String userId = user.getOrgUserId();
+
+                       activeUsers = searchService.getRelatedUsers(userId);
+                       HashSet<String> usersSet = (HashSet<String>) CollaborateList.getInstance().getAllUserName();
+                       for (String users : activeUsers) {
+                               if (usersSet.contains(users)) {
+                                       onlineUsers.add(users);
+                               }
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e);
+               }
+               return onlineUsers;
+       }
+
+       /**
+        * Gets only those users that are 'related' to the currently logged-in user.
+        * 
+        * @param request
+        * @return Rest response wrapped around a List of String
+        */
+       @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json")
+       public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               try {
+                       if (user == null) {
+                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "User object is null? - check logs",
+                                               new ArrayList<>());
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "activeUsers: searching for user {}", user.getLoginId());
+                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",
+                                               searchService.getRelatedUsers(user.getLoginId()));
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "activeUsers failed", e);
+                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
+                                       new ArrayList<>());
+               }
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..f877587
--- /dev/null
@@ -0,0 +1,148 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.io.IOException;
+import java.util.List;
+
+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;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.portal.utils.PortalConstants;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+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.RestController;
+
+@RestController
+@RequestMapping(PortalConstants.REST_AUX_API)
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseController {
+       
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppsRestfulController.class);
+       
+       @Autowired
+       FunctionalMenuService functionalMenuService;
+       
+       @Autowired
+       EPLoginService epLoginService;
+       
+       @Autowired
+       AdminRolesService adminRolesService;
+       
+       @RequestMapping(value={"/getFavorites"}, method = RequestMethod.GET,produces = "application/json")
+       public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               String loginId                  = "";
+               String userAgent                = "";
+               List<FavoritesFunctionalMenuItemJson> favorites = null;
+               
+               loginId                 = request.getHeader(EPSystemProperties.MDC_LOGIN_ID);
+               userAgent               = MDC.get(EPSystemProperties.PARTNER_NAME);
+                               
+               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
+               logger.info(EELFLoggerDelegate.errorLogger, "getFavorites request was received from " + userAgent + " for the user " + loginId + ".");
+               if (epUser==null || epUser.getId()==null) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "No User record found for the LoginId '" + loginId + "' in the database.");
+                       throw new Exception("Received null for Login-Id.");
+               } else {
+                       favorites = functionalMenuService.getFavoriteItems(epUser.getId());
+                       FieldsValidator fieldsValidator = new FieldsValidator();
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+                       
+                       EcompPortalUtils.logAndSerializeObject("/auxapi/getFavorites", "result = ", favorites);
+               }
+               
+               return favorites;
+       }
+       
+       @RequestMapping(value={"/functionalMenuItemsForUser"}, method = RequestMethod.GET,produces = "application/json")
+       public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request, HttpServletResponse response) throws Exception {
+               String loginId                  = "";
+               String userAgent                = "";
+               List<FunctionalMenuItem> fnMenuItems = null;
+               
+               loginId                 = request.getHeader("LoginId");
+               userAgent               = MDC.get(EPSystemProperties.PARTNER_NAME);
+
+               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
+               logger.info(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemsForUser request was received from " + userAgent + " for the user " + loginId + ".");
+               if (epUser==null || epUser.getId()==null) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "No User record found for the LoginId '" + loginId + "' in the database.");
+                       throw new Exception("Received null for Login-Id.");
+               } else if (adminRolesService.isSuperAdmin(epUser)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
+                       fnMenuItems = functionalMenuService.getFunctionalMenuItems();
+               }
+               else {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
+                       fnMenuItems = functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId());
+               }
+               
+               FieldsValidator fieldsValidator = new FieldsValidator();
+               response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               
+               EcompPortalUtils.logAndSerializeObject("/auxapi/functionalMenuItemsForUser", "result = ", fnMenuItems);
+               
+               return fnMenuItems;
+       }
+       
+       @ExceptionHandler(Exception.class)
+       protected void handleBadRequests(Exception e, HttpServletResponse response) throws IOException {
+               logger.warn(EELFLoggerDelegate.errorLogger, "Handling bad request", e);
+               response.sendError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/controller/PortalAdminController.java
new file mode 100644 (file)
index 0000000..45fb2f4
--- /dev/null
@@ -0,0 +1,156 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.controller.EPRestrictedBaseController;
+import org.onap.portalapp.portal.controller.PortalAdminController;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.PortalAdminService;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.PortalAdmin;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class PortalAdminController extends EPRestrictedBaseController {
+       @Autowired
+       PortalAdminService portalAdminService;
+       @Autowired
+       AdminRolesService adminRolesService;
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalAdminController.class);
+
+       @RequestMapping(value = { "/portalApi/portalAdmins" }, method = RequestMethod.GET, produces = "application/json")
+       public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<PortalAdmin> portalAdmins = null;
+               if (user == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, null user");
+                       EcompPortalUtils.setBadPermissions(user, response, "getPortalAdmins");
+               } else if (!adminRolesService.isSuperAdmin(user)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, bad permissions");
+                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
+               } else {
+                       // return the list of portal admins
+                       portalAdmins = portalAdminService.getPortalAdmins();
+                       logger.debug(EELFLoggerDelegate.debugLogger, "portalAdmins: called getPortalAdmins()");
+                       EcompPortalUtils.logAndSerializeObject("/portalApi/getPortalAdmins", "result =", portalAdmins);
+               }
+
+               return portalAdmins;
+       }
+
+       /**
+        * RESTful service method to create a new portal admin. Requirement: you
+        * must be the Ecomp portal super admin user.
+        */
+
+       @RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
+       public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userid,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (user == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin, null user");
+                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
+               } else if (!adminRolesService.isSuperAdmin(user)) {
+                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin bad permissions");
+                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
+               } else {
+                       fieldsValidator = portalAdminService.createPortalAdmin(userid);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               }
+               EcompPortalUtils.logAndSerializeObject("/portalAdmin", "POST result =", response.getStatus());
+
+               return fieldsValidator;
+       }
+
+       @RequestMapping(value = { "/portalApi/portalAdmin/{orgUserId}" }, method = RequestMethod.DELETE)
+       public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("orgUserId") Long orgUserId,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               FieldsValidator fieldsValidator = null;
+               if (!adminRolesService.isSuperAdmin(user)) {
+                       EcompPortalUtils.setBadPermissions(user, response, "deletePortalAdmin");
+               } else {
+                       fieldsValidator = portalAdminService.deletePortalAdmin(orgUserId);
+                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
+               }
+               EcompPortalUtils.logAndSerializeObject("/portalAdmin", "DELETE result =", response.getStatus());
+
+               return fieldsValidator;
+       }
+       
+       @RequestMapping(value = { "/portalApi/adminAppsRoles/{appId}" }, method = RequestMethod.GET, produces = "application/json")
+       public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
+                       HttpServletResponse response) {
+               EPUser user = EPUserUtils.getUserSession(request);
+               List<EPRole> rolesByApp = null;
+
+               try {
+                       if (user == null) {
+                               EcompPortalUtils.setBadPermissions(user, response, "getUserApps");
+                       } else {
+                               rolesByApp = adminRolesService.getRolesByApp(user, appId);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "getRolesByApp failed", e);
+               }
+
+               return rolesByApp;
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/interceptor/SessionTimeoutInterceptor.java
new file mode 100644 (file)
index 0000000..e05e25c
--- /dev/null
@@ -0,0 +1,118 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.interceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.authentication.LoginStrategy;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalapp.util.SessionCookieUtil;
+import org.onap.portalsdk.core.controller.FusionBaseController;
+import org.onap.portalsdk.core.domain.support.CollaborateList;
+import org.onap.portalsdk.core.exception.SessionExpiredException;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.method.HandlerMethod;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+public class SessionTimeoutInterceptor extends HandlerInterceptorAdapter {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionTimeoutInterceptor.class);
+
+       @Autowired
+       private LoginStrategy loginStrategy;
+
+       public SessionTimeoutInterceptor() {
+       }
+
+       public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
+                       throws Exception {
+
+               if (!isHandlerMethod(handler))
+                       return false;
+
+               HandlerMethod method = (HandlerMethod) handler;
+
+               if (!isFusionController(method.getBean()))
+                       return false;
+
+               if (method.getBean() instanceof FusionBaseController) {
+                       FusionBaseController controller = (FusionBaseController) method.getBean();
+
+                       if (!controller.isAccessible()) {
+                               try {
+                                       EPUser user = EPUserUtils.getUserSession(request);
+
+                                       if (request.getRequestURI().indexOf("logout.htm") > -1) {
+                                               CollaborateList.delUserName(user.getOrgUserId());
+                                               throw new SessionExpiredException();
+                                       } else {
+                                               resetSessionMaxIdleTimeOut(request);
+                                               CollaborateList.addUserName(user.getOrgUserId());
+                                       }
+                               } catch (Exception e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "preHandle failed", e);
+                                       return false;
+                               }
+
+                       }
+
+               }
+
+               return true;
+       }
+
+       private void resetSessionMaxIdleTimeOut(HttpServletRequest request) {
+               SessionCookieUtil.resetSessionMaxIdleTimeOut(request);
+
+       }
+
+       private boolean isFusionController(Object controller) {
+               if (controller instanceof FusionBaseController)
+                       return true;
+               return false;
+       }
+
+       private boolean isHandlerMethod(Object controller) {
+               if (controller instanceof HandlerMethod)
+                       return true;
+               return false;
+       }
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..ab235ca
--- /dev/null
@@ -0,0 +1,225 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.logging.aop;
+
+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.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum;
+import org.springframework.beans.factory.annotation.Autowired;
+
+@Aspect
+@org.springframework.context.annotation.Configuration
+public class EPEELFLoggerAspect {
+       
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPEELFLoggerAspect.class);
+
+       @Autowired
+       EPEELFLoggerAdvice epAdvice;
+       
+       /*
+        * Point-cut expression to handle all INCOMING_REST_MESSAGES
+        */
+       @Pointcut("execution(public * org.onap.portalapp.portal.controller.*.*(..))")
+       public void incomingAuditMessages() {}
+       
+       /*
+        * Handles all INCOMING_REST_MESSAGES from kpiDashboard
+        */
+       @Pointcut("execution(public * org.onap.portalapp.kpidash.controller.*.*(..))")
+       public void kpiDashboardAuditMessages() {}
+
+       /*
+        * Point-cut expression to handle all session management INCOMING_REST_MESSAGES
+        */
+       @Pointcut("execution(public * org.onap.portalapp.controller.sessionmgt.*.*(..))")
+       public void sessionMgtIncomingAuditMessages() {}
+       
+       /*
+        * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES
+        */
+       @Pointcut("execution(public * org.onap.portalapp.controller.core.UserProfileController.*(..))")
+       public void userProfileIncomingAuditMessages() {}
+       
+       /*
+        * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES
+        */
+       @Pointcut("execution(public * org.onap.portalapp.controller.ONAPWelcomeController.*(..))")
+       public void welcomeIncomingAuditMessages() {}
+       
+       /*
+        * Point-cut expression to handle INCOMING Logout Rest Messages
+        */
+       @Pointcut("execution(public * org.onap.portalapp.controller.ECOMPLogoutController.*(..))")
+       public void logoutAuditMessages() {}
+
+       
+       /*
+        * Point-cut expression which handles all the OUTGOING_REST_MESSAGES.
+        */
+       @Pointcut("execution(public * org.onap.portalapp.portal.service.ApplicationsRestClientServiceImpl.*(..))")
+       public void outgoingAuditMessages() {}
+       
+       /*
+        * Point-cut expression to handle all the session management OUTGOING_REST_MESSAGES.
+        */
+       @Pointcut("execution(public * org.onap.portalapp.service.sessionmgt.SessionCommunication.*(..))")
+       public void sessionMgtOutgoingAuditMessages() {}
+       
+       /*
+        * Point-cut expression which handles all the LDAP_PHONEBOOK_USER_SEARCH calls.
+        */
+       @Pointcut("execution(public * org.onap.portalapp.portal.service.EPLdapServiceImpl.*(..))")
+       public void phoneBookSearchAuditMessages() {}
+       
+       /*
+        * Handles Audit, Metrics & Debug logging for the point-cut
+        * expression defined at class-level
+        */
+       @Around("(incomingAuditMessages() || kpiDashboardAuditMessages() || sessionMgtIncomingAuditMessages() || "
+                       + "userProfileIncomingAuditMessages() || welcomeIncomingAuditMessages()) && @within(epAuditLog)")
+       public Object incomingAuditMessagesAroundClass(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
+       }
+       
+       /*
+        * Handles Audit, Metrics & Debug logging for the point-cut
+        * expression defined at class-level
+        */
+       @Around("(outgoingAuditMessages() || sessionMgtOutgoingAuditMessages()) && @within(epAuditLog)")
+       public Object outgoingAuditMessagesAroundClass(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.OUTGOING_REST_MESSAGE);
+       }
+       
+       
+       /*
+        * Handles Audit, Metrics & Debug logging for the point-cut
+        * expression defined at method-level
+        */
+       @Around("(outgoingAuditMessages() || sessionMgtOutgoingAuditMessages()) && @annotation(epAuditLog)")
+       public Object outgoingAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.OUTGOING_REST_MESSAGE);
+       }
+       
+       /*
+        * Handles Audit, Metrics & Debug logging for the point-cut
+        * expression defined at method-level
+        */
+       @Around("(incomingAuditMessages() || kpiDashboardAuditMessages() || sessionMgtIncomingAuditMessages() ||"
+                       + "userProfileIncomingAuditMessages() || welcomeIncomingAuditMessages()) && @annotation(epAuditLog)")
+       public Object incomingAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
+       }
+       
+       @Around("@annotation(epAuditLog)")
+       public Object loginAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.FE_LOGIN_ATTEMPT);
+       }
+       
+       @Around("logoutAuditMessages() && @annotation(epAuditLog)")
+       public Object logoutAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.FE_LOGOUT);
+       }
+       
+       @Around("phoneBookSearchAuditMessages() && @annotation(epAuditLog)")
+       public Object phonebookSearchAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH);
+       }
+       
+       private Object logAroundMethod(ProceedingJoinPoint joinPoint, SecurityEventTypeEnum securityEventType) throws Throwable {
+               //Before
+               Object[] passOnArgs = new Object[] {joinPoint.getSignature().getDeclaringType().getName(), joinPoint.getSignature().getName()};
+               Object[] returnArgs = epAdvice.before(securityEventType, joinPoint.getArgs(), passOnArgs);
+               
+               //Call the actual method
+               Object result = null;
+               String statusCode = "COMPLETE";
+               String responseCode = "200";
+               try {
+                       result = joinPoint.proceed();
+               } catch(Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "logAroundMethod failed", e);
+                       statusCode = "ERROR";
+                       responseCode = "500"; //Internal server error
+               }
+               
+               //Check the result
+               if (securityEventType!=null) {
+                       if (result==null) {
+                               statusCode = "ERROR";
+                               //Check if there is an internal response code
+                               //and use it if the caller function has configured it.
+                               responseCode = epAdvice.getInternalResponseCode();
+                               if (responseCode==null||responseCode=="") {
+                                       responseCode = "500"; //Internal server error
+                               }
+                       } else if (result instanceof FieldsValidator) {
+                               FieldsValidator fieldsValidator = (FieldsValidator) result;
+                               if (fieldsValidator!=null && fieldsValidator.httpStatusCode!=null) {
+                                       responseCode = fieldsValidator.httpStatusCode.toString();
+                               }
+                       }
+               }
+               
+               //After
+               epAdvice.after(securityEventType, statusCode, responseCode, joinPoint.getArgs(), returnArgs, passOnArgs);
+               
+               return result;
+       }
+       
+       //Metrics Logging
+       @Pointcut("execution(* *(..))")
+    public void performMetricsLogging() {}
+       
+       @Around("performMetricsLogging() && @within(epMetricsLog)")
+       public Object metricsLoggingAroundClass(ProceedingJoinPoint joinPoint, EPMetricsLog epMetricsLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, null);
+       }
+       
+       @Around("performMetricsLogging() && @annotation(epMetricsLog)")
+       public Object metricsLoggingAroundMethod(ProceedingJoinPoint joinPoint, EPMetricsLog epMetricsLog) throws Throwable {
+               return this.logAroundMethod(joinPoint, null);
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheService.java
new file mode 100644 (file)
index 0000000..0ffe246
--- /dev/null
@@ -0,0 +1,58 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.portalapp.portal.service;
+
+import org.onap.portalapp.portal.domain.EPApp;
+
+public interface AppsCacheService {
+       
+       /**
+        * returns an app by id from the cache
+        * @param appId
+        * @return corresponding App
+        */
+       EPApp getApp(Long appId);
+       
+       /**
+        * returns the corresponding application endpoint
+        * @param appId
+        * @return if appId exists in cache, then return corresponding application endpoint, null otherwise.
+        */
+       String getAppEndpoint(Long appId);
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/AppsCacheServiceImple.java
new file mode 100644 (file)
index 0000000..f884d4e
--- /dev/null
@@ -0,0 +1,124 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.service.AppsCacheService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+@Service("appsCacheService")
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class AppsCacheServiceImple implements AppsCacheService {
+       @Autowired
+       EPAppService appsService;
+       
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsCacheServiceImple.class);
+       
+       private static long updateTime = 0;
+       private static final int cacheUpdateIntervalInSeconds = 10;
+       
+       private static volatile Map<Long, EPApp> appsMap;
+       
+       @PostConstruct
+       public void init() {
+               this.refreshAppsMap();
+       }
+
+       private Map<Long, EPApp> refreshAppsMap() {
+               long now = System.currentTimeMillis();
+               
+               if(noNeedToUpdate(now))
+                       return null;
+               
+               synchronized (this) {
+                       if(noNeedToUpdate(now))
+                               return null;
+                       List<EPApp> allApps = appsService.getAppsFullList();
+                       Map<Long, EPApp> newAppsMap = new HashMap<Long, EPApp>();
+                       for (EPApp app : allApps) {
+                               newAppsMap.put(app.getId(), app);
+                       }
+                       // Switch cache with the new one.
+                       appsMap = newAppsMap;
+                       updateTime = now;
+               }
+               
+               return appsMap;
+       }
+
+       private boolean noNeedToUpdate(long now) {
+               long secondsPassed = (now - updateTime)/1000;
+               if(secondsPassed < cacheUpdateIntervalInSeconds){
+                       logger.debug(EELFLoggerDelegate.debugLogger, "no need to refresh yet, seconds since last refresh: " + secondsPassed + ", refresh interval (sec) = " + cacheUpdateIntervalInSeconds);
+                       return true; // no need to update cache
+               }
+               return false; // its time to update
+       }
+
+       @Override
+       public String getAppEndpoint(Long appId) {
+               refreshAppsMap();
+               EPApp app = appsMap.get(appId);
+               if(app != null)
+                       return app.getAppRestEndpoint();
+               return null;
+       }
+       
+       @Override
+       public EPApp getApp(Long appId) {
+               refreshAppsMap();
+               EPApp app = appsMap.get(appId);
+               if(app != null)
+                       return app;
+               return null;            
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/EPAppServiceImpl.java
new file mode 100644 (file)
index 0000000..ca32104
--- /dev/null
@@ -0,0 +1,178 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.net.MalformedURLException;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.UUID;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.EPAppCommonServiceImpl;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.OnboardingApp;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.att.nsa.cambria.client.CambriaClientFactory;
+import com.att.nsa.cambria.client.CambriaTopicManager;
+
+@Service("epAppService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class EPAppServiceImpl extends EPAppCommonServiceImpl implements EPAppService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAppServiceImpl.class);
+
+       private static Object syncRests = new Object();
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       @Override
+       public List<EPApp> getUserRemoteApps(String id) {
+               StringBuilder query = new StringBuilder();
+               query.append("SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where ");
+               query.append("FN_USER_ROLE.USER_ID = " + id + " AND FN_USER_ROLE.ROLE_ID != " + SUPER_ADMIN_ROLE_ID);
+               query.append(" AND FN_APP.ENABLED = 'Y'");
+               TreeSet<EPApp> distinctApps = new TreeSet<EPApp>();
+               @SuppressWarnings("unchecked")
+               List<EPApp> adminApps = dataAccessService.executeSQLQuery(query.toString(), EPApp.class, null);
+               for (EPApp app : adminApps) {
+                       distinctApps.add(app);
+               }
+               List<EPApp> userApps = new ArrayList<EPApp>();
+               userApps.addAll(distinctApps);
+               return userApps;
+       }
+
+       @Override
+       protected void updateRestrictedApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator,
+                       EPUser user) {
+               synchronized (syncRests) {
+                       boolean result = false;
+                       Session localSession = null;
+                       Transaction transaction = null;
+                       try {
+                               localSession = sessionFactory.openSession();
+                               transaction = localSession.beginTransaction();
+                               EPApp app;
+                               if (appId == null) {
+                                       app = new EPApp();
+                                       /*
+                                        * In the parent class, the UEB code is responsible for generating the
+                                        * keys/secret/mailbox but UEB Messaging is not actually being used currently;
+                                        * may be used in future at which point we can just remove this method and
+                                        * depend on parent class's method So, using UUID generator to generate the
+                                        * unique key instead.
+                                        */
+                                       String uuidStr = UUID.randomUUID().toString();
+                                       String appKey = uuidStr;
+                                       String appSecret = uuidStr;
+                                       String appMailboxName = "ECOMP-PORTAL-OUTBOX";
+                                       onboardingApp.setUebTopicName(appMailboxName);
+                                       onboardingApp.setUebKey(appKey);
+                                       onboardingApp.setUebSecret(appSecret);
+                               } else {
+                                       app = (EPApp) localSession.get(EPApp.class, appId);
+                                       if (app == null || app.getId() == null) {
+                                               // App is already deleted!
+                                               transaction.commit();
+                                               localSession.close();
+                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
+                                               return;
+                                       }
+                               }
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "updateRestrictedApp: about to call createAppFromOnboarding");
+                               createAppFromOnboarding(app, onboardingApp, localSession);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "updateRestrictedApp: finished calling createAppFromOnboarding");
+                               localSession.saveOrUpdate(app);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "updateRestrictedApp: finished calling localSession.saveOrUpdate");
+                               // Enable or disable all menu items associated with this app
+                               setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "updateRestrictedApp: finished calling setFunctionalMenuItemsEnabled");
+                               transaction.commit();
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "updateRestrictedApp: finished calling transaction.commit");
+                               result = true;
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "updateRestrictedApp failed", e);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
+                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
+                               EcompPortalUtils.rollbackTransaction(transaction,
+                                               "updateRestrictedApp rollback, exception = " + e.toString());
+                       } finally {
+                               EcompPortalUtils.closeLocalSession(localSession, "updateRestrictedApp");
+                       }
+                       if (!result) {
+                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+                       }
+               }
+
+       }
+
+       @Override
+       public CambriaTopicManager getTopicManager(List<String> urlList, String key, String secret)
+                       throws MalformedURLException, GeneralSecurityException {
+               return CambriaClientFactory.createTopicManager(null, urlList, key, secret);
+       }
+
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/SearchService.java
new file mode 100644 (file)
index 0000000..44fd7ca
--- /dev/null
@@ -0,0 +1,58 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle;
+
+public interface SearchService {
+
+       public String searchUsersInPhoneBook(String searchString);
+       
+       public String searchUsersInFnTable(String searchString);
+
+       public List<UserWithNameSurnameTitle> searchUsersByName(EPUser attrUser);
+       
+       public List<UserWithNameSurnameTitle> searchUsersByUserId(EPUser attrUser);
+       
+       public EPUser searchUserByUserId(String orgUserId);
+
+}
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
new file mode 100644 (file)
index 0000000..8a2f726
--- /dev/null
@@ -0,0 +1,214 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.portal.service.SearchServiceImpl;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Service("searchService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class SearchServiceImpl implements SearchService {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SearchServiceImpl.class);
+       
+       // TODO: the values below should be defined in other place
+       private static final int maxSizeOfSearchResult = 100;
+
+       @Autowired
+       UserService userService;
+
+       @Override
+       public String searchUsersInPhoneBook(String searchString) {
+               return searchUsersInFnTable(searchString);
+       }
+       
+       @Override
+       public String searchUsersInFnTable(String searchString) {
+               String orgUserId = null;
+               List<String> tokens = EcompPortalUtils.parsingByRegularExpression(searchString, " ");
+               for (int i = 0; i < tokens.size(); i++) { // find userid if possible and remove it from tokens
+                       if (tokens.get(i).matches(".*\\d+.*")) {
+                               orgUserId = tokens.get(i);
+                               tokens.remove(i);
+                       }
+               }
+               while (tokens.size() > 2) { // we use no more then first 2 tokens (userId is removed, see above)
+                       tokens.remove(tokens.size() - 1);
+               }
+               EPUser attrUser = new EPUser();
+               attrUser.setOrgUserId(orgUserId);
+               List<UserWithNameSurnameTitle> resultOfSearch = new ArrayList<UserWithNameSurnameTitle>(), resultOfAdditionalSearch = null;
+               if (tokens.size() == 2) {
+                       attrUser.setFirstName(tokens.get(0));
+                       attrUser.setLastName(tokens.get(1));
+                       resultOfSearch = this.searchUsersByName(attrUser);
+                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
+                       resultOfSearch = this.removeWrongLastNames(resultOfSearch, tokens.get(1));
+                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
+                               attrUser.setFirstName(tokens.get(1));
+                               attrUser.setLastName(tokens.get(0));
+                               resultOfAdditionalSearch = this.searchUsersByName(attrUser);
+                               resultOfAdditionalSearch = this.removeWrongFirstNames(resultOfAdditionalSearch, tokens.get(1));
+                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
+                       }
+               } else if (tokens.size() == 1) {
+                       attrUser.setFirstName(tokens.get(0));
+                       resultOfSearch = this.searchUsersByName(attrUser);
+                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
+                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
+                               attrUser.setFirstName(null);
+                               attrUser.setLastName(tokens.get(0));
+                               resultOfAdditionalSearch = this.searchUsersByName(attrUser);
+                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
+                       }
+               } else if (orgUserId != null) {
+                       resultOfSearch = this.searchUsersByUserId(attrUser);
+               }
+               if (resultOfAdditionalSearch != null) {
+                       resultOfSearch.addAll(resultOfAdditionalSearch);
+               }
+               resultOfSearch = this.cutSearchResultToMaximumSize(resultOfSearch);
+               ObjectMapper mapper = new ObjectMapper();
+               String result = "[]";
+               try {
+                       result = mapper.writeValueAsString(resultOfSearch);
+               } catch (JsonProcessingException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInFnTable failed", e);
+               }
+               return result;
+       }
+
+       
+       @SuppressWarnings("rawtypes")
+       public List<UserWithNameSurnameTitle> searchUsersByUserId(EPUser attrUser) {
+               List<UserWithNameSurnameTitle> foundUsers = new ArrayList<UserWithNameSurnameTitle>();
+               try {
+                       List searchResult = this.userService.getUserByUserId(attrUser.getOrgUserId());
+                       for (Object obj : searchResult) {
+                               EPUser user = (EPUser) obj;
+                               UserWithNameSurnameTitle foundUser = new UserWithNameSurnameTitle(user.getOrgUserId(), user.getFirstName(), user.getLastName(), user.getJobTitle());
+                               foundUsers.add(foundUser);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByUserId failed", e);
+               }
+               return foundUsers;
+       }
+       
+       @SuppressWarnings("rawtypes")
+       public List<UserWithNameSurnameTitle> searchUsersByName(EPUser attrUser) {
+               List<UserWithNameSurnameTitle> foundUsers = new ArrayList<UserWithNameSurnameTitle>();
+               try {
+                       List searchResult = this.userService.getUserByFirstLastName(attrUser.getFirstName(),attrUser.getLastName());
+                       for (Object obj : searchResult) {
+                               EPUser user = (EPUser) obj;
+                               UserWithNameSurnameTitle foundUser = new UserWithNameSurnameTitle(user.getOrgUserId(), user.getFirstName(), user.getLastName(), user.getJobTitle());
+                               foundUsers.add(foundUser);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByName failed", e);
+               }
+               return foundUsers;
+       }
+
+       private List<UserWithNameSurnameTitle> removeWrongFirstNames(List<UserWithNameSurnameTitle> resultOfSearch, String firstName) {
+               firstName = firstName.toUpperCase();
+               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
+                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
+                       if ((user.firstName == null) || !user.firstName.toUpperCase().startsWith(firstName)) {
+                               resultOfSearch.remove(i);
+                       }
+               }
+               return resultOfSearch;
+       }
+
+       private List<UserWithNameSurnameTitle> removeWrongLastNames(List<UserWithNameSurnameTitle> resultOfSearch, String lastName) {
+               lastName = lastName.toUpperCase();
+               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
+                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
+                       if ((user.lastName == null) || !user.lastName.toUpperCase().startsWith(lastName)) {
+                               resultOfSearch.remove(i);
+                       }
+               }
+               return resultOfSearch;
+       }
+
+       private List<UserWithNameSurnameTitle> cutSearchResultToMaximumSize(List<UserWithNameSurnameTitle> resultOfSearch) {
+               for (int i = resultOfSearch.size() - 1; i >= maxSizeOfSearchResult; i--) {
+                       resultOfSearch.remove(i);
+               }
+               return resultOfSearch;
+       }
+
+
+       @SuppressWarnings("rawtypes")
+       @Override
+       public EPUser searchUserByUserId(String orgUserId) {
+               List<EPUser> foundUsers = new ArrayList<EPUser>();
+               try {
+                       List searchResult = this.userService.getUserByUserId(orgUserId);
+                       for (Object obj : searchResult) {
+                               EPUser user = (EPUser) obj;
+                               foundUsers.add(user);
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId failed", e);
+                       return null;
+               }
+               return foundUsers.get(0);
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..bf71bc0
--- /dev/null
@@ -0,0 +1,56 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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;
+
+import com.fasterxml.jackson.databind.JsonNode;
+
+@Service("ticketService")
+public class TicketEventServiceImpl implements TicketEventService{
+
+       @Override
+       public String getNotificationHyperLink(JsonNode application, String ticket, String eventSource) {
+               String hyperlink = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_SYSTEM_NOTIFICATION_URL)+ticket;
+               return hyperlink;
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserRolesServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserRolesServiceImpl.java
new file mode 100644 (file)
index 0000000..c0d14f6
--- /dev/null
@@ -0,0 +1,123 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.apache.cxf.transport.http.HTTPException;
+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.logging.aop.EPMetricsLog;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Service("userRolesService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class UserRolesServiceImpl extends UserRolesCommonServiceImpl implements UserRolesService {
+
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+       
+       private EPUser getUserFromRemoteApp(String orgUserId, EPApp app,
+                       ApplicationsRestClientService applicationsRestClientService) throws HTTPException {
+               EPUser user = applicationsRestClientService.get(EPUser.class, app.getId(),
+                               String.format("/user/%s", orgUserId));
+               return user;
+       }
+
+       private static void createNewUserOnRemoteApp(String orgUserId, EPApp app,
+                       ApplicationsRestClientService applicationsRestClientService, SearchService searchService,
+                       ObjectMapper mapper) throws Exception {
+               EPUser client = searchService.searchUserByUserId(orgUserId);
+               if (client == null) {
+                       String msg = "cannot create user " + orgUserId + ", because he/she cannot be found in phonebook.";
+                       logger.error(EELFLoggerDelegate.errorLogger, msg);
+                       throw new Exception(msg);
+               }
+               client.setLoginId(orgUserId);
+               client.setActive(true);
+               // The remote doesn't care about other apps, and this has caused
+               // serialization problems - infinite recursion.
+               client.getEPUserApps().clear();
+               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+               String userAsString = mapper.writeValueAsString(client);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               "about to post new client to remote application, users json = " + userAsString);
+               applicationsRestClientService.post(EPUser.class, app.getId(), userAsString, String.format("/user", orgUserId));
+       }
+
+       public static void persistExternalRoleInEcompDb(EPRole externalAppRole, Long appId, EPRoleService roleService) {
+               externalAppRole.setAppId(appId);
+               externalAppRole.setAppRoleId(externalAppRole.getId());
+               externalAppRole.setId(null); // We will persist a new role, with ecomp
+                                                                               // role id which will be different than
+                                                                               // external app role id.
+
+               roleService.saveRole(externalAppRole);
+               logger.debug(EELFLoggerDelegate.debugLogger,
+                               String.format("ECOMP persists role from app:%d, app roleId: %d, roleName: %s", appId,
+                                               externalAppRole.getAppRoleId(), externalAppRole.getName()));
+       }
+
+       @Override
+       public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId) {
+               // Find the records for this user-app combo, if any
+               String filter = " where user_id = " + Long.toString(userId) + " and app_id = " + Long.toString(appId);
+               @SuppressWarnings("unchecked")
+               List<EPUserApp> roleList = dataAccessService.getList(EPUserApp.class, filter, null, null);
+               logger.debug(EELFLoggerDelegate.debugLogger, "getCachedAppRolesForUser: list size is {}", roleList.size());
+               return roleList;
+       }
+
+       
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserService.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserService.java
new file mode 100644 (file)
index 0000000..2d14942
--- /dev/null
@@ -0,0 +1,52 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+
+public interface UserService {
+       
+       List getUserByUserId(String orgUserId);
+       
+       List getUserByFirstLastName(String firstName, String lastName);
+       
+       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception;
+       
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/service/UserServiceImpl.java
new file mode 100644 (file)
index 0000000..eeb0193
--- /dev/null
@@ -0,0 +1,275 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.portal.service.UserServiceImpl;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalsdk.core.FusionObject.Utilities;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+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.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service("userService")
+@Transactional
+public class UserServiceImpl implements UserService {
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserServiceImpl.class);
+
+       @Autowired
+       private DataAccessService dataAccessService;
+
+       public DataAccessService getDataAccessService() {
+               return dataAccessService;
+       }
+
+       public void setDataAccessService(DataAccessService dataAccessService) {
+               this.dataAccessService = dataAccessService;
+       }
+
+       @SuppressWarnings("rawtypes")
+       @Override
+       public List getUserByUserId(String userId) {
+
+               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
+                       List<EPUser> users = new ArrayList<EPUser>();
+                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
+                       BufferedReader in = null;
+                       HttpURLConnection con = null;
+                       try {
+                               String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
+                               URL obj = new URL(url);
+
+                               con = (HttpURLConnection) obj.openConnection();
+
+                               // optional default is GET
+                               con.setRequestMethod("GET");
+                               con.setConnectTimeout(3000);
+                               con.setReadTimeout(8000);
+
+                               StringBuffer response = new StringBuffer();
+
+                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+                               String inputLine;
+                               while ((inputLine = in.readLine()) != null)
+                                       response.append(inputLine);
+                               JSONObject jObject = new JSONObject(response.toString()); // json
+                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
+                               for (int i = 0; i < jsonUsers.length(); i++) {
+                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
+                                       EPUser eachUser = new EPUser();
+                                       eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
+                                       eachUser.setFirstName(eachObject.get("givenName").toString());
+                                       eachUser.setLastName(eachObject.get("familyName").toString());
+                                       eachUser.setEmail(eachObject.get("email").toString());
+                                       users.add(eachUser);
+                               }
+
+                               for (int i = 0; i < users.size(); i++) {
+
+                                       if (Utilities.nvl(userId).length() > 0) {
+                                               if (!userId.equalsIgnoreCase(users.get(i).getOrgUserId())) {
+                                                       continue;
+                                               }
+                                       }
+                                       filterdUsers.add(users.get(i));
+
+                               }
+
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed", e);
+                       } finally {
+                               try {
+                                       in.close();
+                                       con.disconnect();
+                               } catch (IOException e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId 2 failed", e);
+                               }
+                       }
+
+                       return filterdUsers;
+
+               } else {
+
+                       List list = null;
+                       StringBuffer criteria = new StringBuffer();
+                       criteria.append(" where org_user_id = '").append(userId).append("'");
+                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
+                       return (list == null || list.size() == 0) ? null : list;
+
+               }
+
+       }
+
+       @SuppressWarnings("rawtypes")
+       @Override
+       public List getUserByFirstLastName(String firstName, String lastName) {
+
+               if (!SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
+
+                       List list = null;
+                       StringBuffer criteria = new StringBuffer();
+                       if (firstName != null)
+                               criteria.append(" where first_name = '").append(firstName).append("'");
+                       if (lastName != null)
+                               criteria.append(" where last_name = '").append(lastName).append("'");
+                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
+                       return (list == null || list.size() == 0) ? null : list;
+
+               } else {
+
+                       List<EPUser> users = new ArrayList<EPUser>();
+                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
+                       BufferedReader in = null;
+                       HttpURLConnection con = null;
+                       try {
+                               String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
+                               URL obj = new URL(url);
+
+                               con = (HttpURLConnection) obj.openConnection();
+
+                               // optional default is GET
+                               con.setRequestMethod("GET");
+                               con.setConnectTimeout(3000);
+                               con.setReadTimeout(8000);
+
+                               StringBuffer response = new StringBuffer();
+
+                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+                               String inputLine;
+                               while ((inputLine = in.readLine()) != null)
+                                       response.append(inputLine);
+                               JSONObject jObject = new JSONObject(response.toString()); // json
+                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
+                               for (int i = 0; i < jsonUsers.length(); i++) {
+                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
+                                       EPUser eachUser = new EPUser();
+                                       eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
+                                       eachUser.setFirstName(eachObject.get("givenName").toString());
+                                       eachUser.setLastName(eachObject.get("familyName").toString());
+                                       eachUser.setEmail(eachObject.get("email").toString());
+                                       users.add(eachUser);
+                               }
+
+                               for (int i = 0; i < users.size(); i++) {
+
+                                       if (Utilities.nvl(firstName).length() > 0) {
+                                               if (!firstName.equalsIgnoreCase(users.get(i).getFirstName())) {
+                                                       continue;
+                                               }
+                                       }
+                                       if (Utilities.nvl(lastName).length() > 0) {
+                                               if (!lastName.equalsIgnoreCase(users.get(i).getLastName())) {
+                                                       continue;
+                                               }
+                                       }
+
+                                       filterdUsers.add(users.get(i));
+
+                               }
+
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed", e);
+                       } finally {
+                               try {
+                                       in.close();
+                                       con.disconnect();
+                               } catch (IOException e) {
+                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName 2 failed", e);
+                               }
+                       }
+
+                       return filterdUsers;
+               }
+
+       }
+
+       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception {
+               try {
+                       List list = null;
+                       StringBuffer criteria = new StringBuffer();
+                       criteria.append(" where org_user_id = '").append(newUser.getLoginId()).append("'");
+                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
+                       if (list == null || list.size() == 0) {
+                               newUser.setActive(true);
+                               newUser.setOrgUserId(newUser.getLoginId());
+                               newUser.setLoginPwd(CipherUtil.encryptPKC(newUser.getLoginPwd()));
+                               getDataAccessService().saveDomainObject(newUser, null);
+                       } else {
+                               if (checkDuplicate.equals("Yes")) {
+                                       // userId already exist in database
+                                       return "Record already exist";
+                               } else {
+
+                                       EPUser oldUser = (EPUser) list.get(0);
+                                       oldUser.setFirstName(newUser.getFirstName());
+                                       oldUser.setLastName(newUser.getLastName());
+                                       oldUser.setMiddleInitial(newUser.getMiddleInitial());
+                                       if (!oldUser.getLoginPwd().equals(newUser.getLoginPwd()))
+                                               oldUser.setLoginPwd(CipherUtil.encryptPKC(newUser.getLoginPwd()));
+                                       else
+                                               oldUser.setLoginPwd(newUser.getLoginPwd());
+                                       getDataAccessService().saveDomainObject(oldUser, null);
+
+                               }
+
+                       }
+
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "saveNewUser failed", e);
+                       throw new Exception(e);
+               }
+               return "success";
+       };
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/transport/OnboardingApp.java
new file mode 100644 (file)
index 0000000..f37c4b1
--- /dev/null
@@ -0,0 +1,107 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.transport;
+
+public class OnboardingApp {
+
+       public Long id;
+
+       public String name;
+
+       public String imageUrl;
+       
+       public String imageLink;
+
+       public String description;
+
+       public String notes;
+
+       public String url;
+
+       public String alternateUrl;
+
+       public String restUrl;
+
+       public Boolean isOpen;
+
+       public Boolean isEnabled;
+
+       public String username;
+
+       public String appPassword;
+
+       public String thumbnail;
+       
+       public String uebTopicName;
+       
+       public String uebKey;
+       
+       public String uebSecret;
+       
+       public Boolean restrictedApp;
+       
+       public Boolean isCentralAuth;
+       
+       public String nameSpace;
+
+       public void normalize() {
+               this.name = (this.name == null) ? "" : this.name.trim();
+               this.username = (this.username == null) ? "" : this.username.trim();
+               this.appPassword = (this.appPassword == null) ? "" : this.appPassword.trim();
+       }
+
+       public void setUebTopicName(String topicName) {
+               this.uebTopicName = topicName;
+       }
+
+       public void setUebKey(String key) {
+               this.uebKey = key;
+       }
+       
+       public void setUebSecret(String secret) {
+               this.uebSecret = secret;
+       }
+       
+       // 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 setRestrictedApp(Boolean restrictedApp) {
+               this.restrictedApp = restrictedApp;
+       }
+}
+
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebHelper.java
new file mode 100644 (file)
index 0000000..5c92b5d
--- /dev/null
@@ -0,0 +1,220 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ueb;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EcompApp;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.logging.format.EPAppMessagesEnum;
+import org.onap.portalapp.portal.logging.logic.EPLogUtil;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.ueb.Helper;
+import org.onap.portalsdk.core.onboarding.ueb.Publisher;
+import org.onap.portalsdk.core.onboarding.ueb.UebException;
+import org.onap.portalsdk.core.onboarding.ueb.UebManager;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsg;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+@Component
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class EPUebHelper {
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
+
+       @Autowired
+       EPAppService appsService;
+
+       @Autowired
+       private SessionFactory sessionFactory;
+
+       @SuppressWarnings("unused")
+       private Publisher epPublisher;
+
+       public EPUebHelper() {
+
+       }
+
+       //
+       // This should only be called by the ECOMP Portal App, other Apps have just one
+       // publisher and use appPublisher
+       //
+       @SuppressWarnings("unused")
+       @EPMetricsLog
+       public void refreshPublisherList() {
+               Session localSession = null;
+               boolean addedPublisher = false;
+
+               try {
+                       localSession = sessionFactory.openSession();
+
+                       List<EcompApp> apps = appsService.getEcompAppAppsFullList();
+                       for (int i = 0; i < apps.size(); i++) {
+                               if ((apps.get(i).isEnabled()) && (apps.get(i).getUebTopicName() != null)
+                                               && !(apps.get(i).getUebTopicName().toUpperCase().contains("ECOMP-PORTAL-INBOX"))) {
+                                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                                       "UEBManager adding publisher for " + apps.get(i).getUebTopicName());
+                                       UebManager.getInstance().addPublisher(apps.get(i).getUebTopicName());
+                                       addedPublisher = true;
+                               } else if ((apps.get(i).getId() != 1) && // App may have been disabled, remove the publisher
+                                               !(apps.get(i).isEnabled())) {
+                                       if (apps.get(i).getUebTopicName() != null) {
+                                               UebManager.getInstance().removePublisher(apps.get(i).getUebTopicName());
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebSystemError, "add/remove Publisher");
+                       logger.error(EELFLoggerDelegate.errorLogger, "refreshPublisherList failed", e);
+               }
+
+               // publisherList.print();
+
+               if (addedPublisher == true) // Give publishers time to initialize
+               {
+                       Helper.sleep(400);
+               }
+       }
+
+       // @PostConstruct
+       // @EPMetricsLog
+       public void initUeb() {
+               try {
+                       epPublisher = new Publisher(PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
+                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
+                                       PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, e.getMessage());
+                       logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
+               }
+
+               Thread thread = new Thread("EPUebManager: postConstructMethod - refreshPublisherList") {
+                       public void run() {
+                               refreshPublisherList();
+                       }
+               };
+               if (thread != null) {
+                       thread.start();
+               }
+       }
+
+       @EPMetricsLog
+       public void addPublisher(EPApp app) {
+               // TODO Auto-generated method stub
+               try {
+                       UebManager.getInstance().addPublisher(app.getUebTopicName());
+               } catch (UebException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "addPublisher failed", e);
+               }
+       }
+
+       public boolean checkAvailability() {
+
+               //
+               // Test existence of topic at UEB url
+               //
+               //
+               //
+               boolean available = true;
+               LinkedList<String> urlList = (LinkedList<String>) Helper.uebUrlList();
+               if (!urlList.isEmpty()) {
+                       String url = "http://" + urlList.getFirst() + ":3904/topics/"
+                                       + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME);
+                       if (!url.isEmpty()) {
+                               try {
+                                       URL siteURL = new URL(url);
+                                       HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
+                                       connection.setRequestMethod("GET");
+                                       connection.connect();
+
+                                       int code = connection.getResponseCode();
+                                       if (code == 200) {
+                                               available = true;
+                                       } else {
+                                               EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, url);
+                                               available = false;
+                                               logger.warn(EELFLoggerDelegate.errorLogger,
+                                                               "Warning! UEB topic existence check failed, topic = " + url);
+                                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                                               "Warning! UEB topic existence check failed, topic = " + url);
+                                       }
+                               } catch (Exception e) {
+                                       available = false;
+                                       logger.error(EELFLoggerDelegate.errorLogger, "checkAvailability failed", e);
+                               }
+                       }
+               }
+               return available;
+       }
+
+       public boolean MessageCanBeSentToTopic() {
+
+               boolean sentMsgSuccessfully = false;
+
+               UebMsg msg = new UebMsg();
+               msg.putSourceTopicName(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
+               msg.putPayload("Pinging topic for health check");
+               msg.putMsgType(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK);
+
+               try {
+                       // epPublisher.send(msg);
+                       sentMsgSuccessfully = true;
+               } catch (Exception e) {
+                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckUebClusterError);
+                       sentMsgSuccessfully = false;
+                       logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to "
+                                       + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME), e);
+               }
+
+               return sentMsgSuccessfully;
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/portal/ueb/EPUebMsgTypes.java
new file mode 100644 (file)
index 0000000..7e49f8f
--- /dev/null
@@ -0,0 +1,45 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.ueb;
+
+import org.onap.portalsdk.core.onboarding.ueb.UebMsgTypes;
+
+public interface EPUebMsgTypes extends UebMsgTypes {
+
+       public static final String UEB_MSG_TYPE_HEALTH_CHECK = "uebHealthCheckPing";
+}
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
new file mode 100644 (file)
index 0000000..f9b69e9
--- /dev/null
@@ -0,0 +1,61 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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;
+
+@Configuration
+@PropertySources({ 
+       @PropertySource ("/WEB-INF/conf/system.properties"),
+       @PropertySource ("/WEB-INF/conf/sql.properties"),
+    @PropertySource ("/WEB-INF/fusion/conf/fusion.properties"),
+       @PropertySource (value = "file:${catalina.home}/conf/system.properties", ignoreResourceNotFound = true),
+       @PropertySource (value = "file:${catalina.home}/conf/fusion.properties", ignoreResourceNotFound = true)
+       })
+
+/**
+ * Contains properties specific to the ONAP version of the ECOMP Portal.
+ */
+public class EPSystemProperties extends EPCommonSystemProperties {
+       public static final String CONTACT_US_URL = "contact_us_link";
+       public static final String ECOMP_CONTEXT_ROOT = "context_root";
+
+}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogJob.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogJob.java
new file mode 100644 (file)
index 0000000..b553ff3
--- /dev/null
@@ -0,0 +1,63 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.scheduler;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.quartz.DisallowConcurrentExecution;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.quartz.PersistJobDataAfterExecution;
+import org.springframework.scheduling.quartz.QuartzJobBean;
+
+@PersistJobDataAfterExecution
+@DisallowConcurrentExecution
+public class LogJob extends QuartzJobBean {
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LogJob.class);
+
+       @Override
+       protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
+               // JobDataMap dataMap = ctx.getJobDetail().getJobDataMap();
+               // int cnt = dataMap.getInt("");
+               // JobKey jobKey = ctx.getJobDetail().getKey();
+               logger.info(EELFLoggerDelegate.debugLogger,
+                               (Runtime.getRuntime().maxMemory() + " " + Runtime.getRuntime().maxMemory()));
+
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogRegistry.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/LogRegistry.java
new file mode 100644 (file)
index 0000000..c54a26b
--- /dev/null
@@ -0,0 +1,75 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.scheduler;
+
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.onap.portalsdk.core.scheduler.CronRegistry;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
+import org.springframework.scheduling.quartz.JobDetailFactoryBean;
+import org.springframework.stereotype.Component;
+
+@Component
+@DependsOn({ "systemProperties" })
+public class LogRegistry extends CronRegistry {
+
+       private static final String groupName = "AppGroup";
+       private static final String jobName = "LogJob";
+       private static final String triggerName = "LogTrigger";
+
+       // @Autowired
+       // private SystemProperties systemProperties;
+
+       // @Bean
+       public JobDetailFactoryBean jobDetailFactoryBean() {
+               Map<String, Object> map = new HashMap<String, Object>();
+               map.put("units", "bytes");
+               return jobDetailFactoryBean(groupName, jobName, LogJob.class, map);
+       }
+
+       // @Bean
+       public CronTriggerFactoryBean cronTriggerFactoryBean() throws ParseException {
+               // "0 * * * * ? *
+               return cronTriggerFactoryBean(groupName, triggerName, SystemProperties.getProperty(SystemProperties.LOG_CRON));
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/Register.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/Register.java
new file mode 100644 (file)
index 0000000..aa3dfe6
--- /dev/null
@@ -0,0 +1,103 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.scheduler;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.scheduler.Registerable;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.quartz.Trigger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.stereotype.Component;
+
+@Component
+@DependsOn({"logRegistry", "sessionMgtRegistry", "systemProperties"})
+public class Register implements Registerable {
+
+       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Register.class);
+
+       private List<Trigger> scheduleTriggers = new ArrayList<Trigger>();
+       Trigger trigger[] = new Trigger[0];
+
+       @Autowired
+       private LogRegistry logRegistry;
+       
+       @Autowired
+       private SessionMgtRegistry sessionMgtRegistry;
+       
+       @Override
+       public Trigger[] getTriggers() {
+               return getScheduleTriggers().toArray(trigger);
+       }
+
+       @Override
+       public void registerTriggers() {
+               // if the property value is not available; the cron will not be added
+               // and can be ignored. its safe to ignore the exceptions
+               try {
+                       if (SystemProperties.getProperty(SystemProperties.LOG_CRON) != null)
+                               getScheduleTriggers().add(logRegistry.getTrigger());
+
+               } catch (IllegalStateException ies) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "registerTriggers log cron failed", ies);
+                       logger.info(EELFLoggerDelegate.debugLogger, ("Log Cron not available"));
+               }
+               
+               try {
+                       if(SystemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON) != null)
+                               getScheduleTriggers().add(sessionMgtRegistry.getTrigger());
+                       
+               } catch(IllegalStateException ies) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "registerTriggers session timeout failed", ies);
+                       logger.info(EELFLoggerDelegate.debugLogger, ("Session Cron not available"));
+               }
+
+       }
+
+       public List<Trigger> getScheduleTriggers() {
+               return scheduleTriggers;
+       }
+
+       public void setScheduleTriggers(List<Trigger> scheduleTriggers) {
+               this.scheduleTriggers = scheduleTriggers;
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/RegistryAdapter.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/RegistryAdapter.java
new file mode 100644 (file)
index 0000000..82120e1
--- /dev/null
@@ -0,0 +1,118 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.scheduler;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.onap.portalsdk.core.scheduler.Registerable;
+import org.onap.portalsdk.workflow.services.WorkflowScheduleService;
+import org.quartz.Trigger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+import org.springframework.stereotype.Component;
+
+/**
+ * TODO REFACTOR moved from org.onap.portalsdk.core.scheduler to
+ * org.openecomp.portalapp.scheduler
+ *
+ */
+@Component
+public class RegistryAdapter {
+
+       @Autowired
+       private Registerable registry;
+
+       @Autowired
+       private WorkflowScheduleService workflowScheduleService;
+
+       private SchedulerFactoryBean schedulerBean;
+
+       Trigger trigger[] = new Trigger[0];
+
+       public Trigger[] getTriggers() {
+
+               registry.registerTriggers();
+
+               List<Trigger> allTriggers = new ArrayList<Trigger>();
+
+               List<Trigger> coreTriggers = addCoreTriggers();
+               final Trigger[] extTriggerArray = registry.getTriggers();
+
+               allTriggers.addAll(Arrays.asList(extTriggerArray));
+               allTriggers.addAll(coreTriggers);
+
+               return allTriggers.toArray(trigger);
+
+       }
+
+       public List<Trigger> addCoreTriggers() {
+               // On startup of the application after crash recovery, invoke workflow
+               // schedule trigger
+               List<Trigger> triggers = getWorkflowScheduleService().triggerWorkflowScheduling();
+               return triggers;
+       }
+
+       public void setSchedulerBean(SchedulerFactoryBean _schedulerBean) {
+               schedulerBean = _schedulerBean;
+
+       }
+
+       public SchedulerFactoryBean getSchedulerBean() {
+               return schedulerBean;
+
+       }
+
+       public Registerable getRegistry() {
+               return registry;
+       }
+
+       public void setRegistry(Registerable registry) {
+               this.registry = registry;
+       }
+
+       public WorkflowScheduleService getWorkflowScheduleService() {
+               return workflowScheduleService;
+       }
+
+       public void setWorkflowScheduleService(WorkflowScheduleService workflowScheduleService) {
+               this.workflowScheduleService = workflowScheduleService;
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/SessionMgtRegistry.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/scheduler/SessionMgtRegistry.java
new file mode 100644 (file)
index 0000000..e263d7e
--- /dev/null
@@ -0,0 +1,105 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.scheduler;
+
+import java.text.ParseException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.onap.portalapp.portal.listener.UserSessionListener;
+import org.onap.portalapp.service.sessionmgt.TimeoutHandler;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.scheduler.CronRegistry;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
+import org.springframework.scheduling.quartz.JobDetailFactoryBean;
+import org.springframework.stereotype.Component;
+
+/**
+ * Extra depends-on annotation tells Spring that the system properties object
+ * will be used in the constructor.
+ */
+@Component
+// @DependsOn({ "manageService", "epAppService", "systemProperties" })
+@DependsOn({ "systemProperties" })
+public class SessionMgtRegistry extends CronRegistry implements ApplicationContextAware {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class);
+       
+       private static final String groupName = "AppGroup";
+       private static final String jobName = "PortalSessionTimeoutFeedJob";
+       private static final String triggerName = "PortalSessionTimeoutFeedTrigger";
+
+       // Not strictly necessary, but preparing for the day
+       // when the getProperty method is not static.
+       @Autowired
+       private SystemProperties systemProperties;
+
+       private ApplicationContext applicationContext;
+
+       public JobDetailFactoryBean jobDetailFactoryBean() {
+               Map<String, Object> map = new HashMap<String, Object>();
+               return jobDetailFactoryBean(groupName, jobName, TimeoutHandler.class, map);
+       }
+
+       @SuppressWarnings("static-access")
+       public CronTriggerFactoryBean cronTriggerFactoryBean() throws ParseException {
+               String property = "* * * * * ? 2099";
+               try {
+                       property = systemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, 
+                                       "Failed to retrieve " + SystemProperties.SESSIONTIMEOUT_FEED_CRON + ", defaulting to " + property,
+                                       e);
+               }
+               return cronTriggerFactoryBean(groupName, triggerName, property);
+       }
+
+       @Override
+       public void setApplicationContext(ApplicationContext _applicationContext) throws BeansException {
+               applicationContext = _applicationContext;
+               TimeoutHandler.setApplicationContext(applicationContext);
+               UserSessionListener.setApplicationContext(_applicationContext);
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..f337705
--- /dev/null
@@ -0,0 +1,114 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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.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;
+
+@Service("remoteWebServiceCallService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl implements RemoteWebServiceCallService {
+
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RemoteWebServiceCallServiceImpl.class);
+       
+       /*
+        * (non-Javadoc)
+        * @see org.openecomp.portalapp.service.sessionmgt.RemoteWebServiceCallService#verifyRESTCredential(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
+        */
+       public boolean verifyRESTCredential(String secretKey, String requestUebKey, String requestAppName,
+                       String requestPassword) throws Exception {
+               EPApp appRecord = findEpApp(requestUebKey);
+               if (appRecord == null) {
+                       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);
+               if (decryptedPwd.equals(requestPassword) && appUserName.equals(requestAppName))
+                       return true;
+               else
+                       return false;
+       }
+       
+       /**
+        * currently this method only validates the application key to fetch the application
+        */
+       public boolean verifyAppKeyCredential(String requestUebKey) throws Exception {
+               String failMessage = "Failed to find application with UEB key " + requestUebKey;
+               if(requestUebKey == null || requestUebKey.equals("")) {
+                       logger.warn(EELFLoggerDelegate.errorLogger, failMessage);
+                       return false;
+               }
+               
+               EPApp appRecord = findEpApp(requestUebKey);
+               if (appRecord == null) {
+                       logger.warn(EELFLoggerDelegate.errorLogger, failMessage);
+                       return false;
+               }
+               
+               return true;
+       }
+
+       /**
+        * Searches the FN_APP table for the specified UEB key.
+        * 
+        * @return EPApp object if the key is found; else null.
+        */
+       public EPApp findEpApp(String uebKey) {
+               List<?> list = null;
+               StringBuffer criteria = new StringBuffer();
+               criteria.append(" where ueb_key = '" + uebKey + "'");
+               list = getDataAccessService().getList(EPApp.class, criteria.toString(), null, null);
+               return (list == null || list.size() == 0) ? null : (EPApp) list.get(0);
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/FunctionalMenuHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/FunctionalMenuHandler.java
new file mode 100644 (file)
index 0000000..6127da6
--- /dev/null
@@ -0,0 +1,136 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.uebhandler;
+
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPAuditLog;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.ueb.UebException;
+import org.onap.portalsdk.core.onboarding.ueb.UebManager;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsg;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import com.google.gson.Gson;
+
+@Component
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPAuditLog
+public class FunctionalMenuHandler {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuHandler.class);
+
+       @Autowired
+       private AdminRolesService adminRolesService;
+
+       @Autowired
+       private FunctionalMenuService functionalMenuService;
+
+       @Autowired
+       private SearchService searchSvc;
+
+       @Async
+       public Boolean getFunctionalMenu(UebMsg requestMsg) {
+               UebMsg returnMsg = new UebMsg();
+
+               if (requestMsg == null) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "handleMenuRequest received null message");
+                       return false;
+               } else if (requestMsg.getSourceTopicName() == null) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "A source topic name is required and not found in this msg:" + requestMsg.toString());
+                       return false;
+               } else if (requestMsg.getUserId() == null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "Error getting functional menu.  A userId is required and not found in this msg: "
+                                                       + requestMsg.toString());
+                       returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
+                       returnMsg.putPayload("Error: A userId is required.  Call msg.putUserId() with an userId");
+               } else {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "Getting functional menu for user = " + requestMsg.getUserId());
+                       EPUser user = searchSvc.searchUserByUserId(requestMsg.getUserId());
+
+                       List<FunctionalMenuItem> menuItems = null;
+                       if (user == null) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "Error getting functional menu.  userId not found in directory or is guest: "
+                                                               + requestMsg.toString());
+                       } else if (adminRolesService.isSuperAdmin(user)) {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
+                               menuItems = functionalMenuService.getFunctionalMenuItems();
+                       } else {
+                               logger.debug(EELFLoggerDelegate.debugLogger,
+                                               "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
+                               menuItems = functionalMenuService.getFunctionalMenuItemsForUser(requestMsg.getUserId());
+                       }
+
+                       if (menuItems != null) {
+                               String functionalMenuJsonString = new Gson().toJson(menuItems);
+                               logger.debug(EELFLoggerDelegate.debugLogger, "returning functional menu : " + functionalMenuJsonString);
+                               returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
+                               returnMsg.putPayload(functionalMenuJsonString);
+                       } else {
+                               returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
+                               returnMsg.putPayload("Error: Not found for userId = " + requestMsg.getUserId());
+                       }
+               }
+
+               try {
+                       UebManager.getInstance().publishReplyEP(returnMsg, requestMsg.getSourceTopicName());
+               } catch (UebException e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "getFunctionalMenu failed to publish reply", e);
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger,
+                                       "getFunctionalMenu failed", e);
+               }
+
+               return true;
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/InitUebHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/InitUebHandler.java
new file mode 100644 (file)
index 0000000..1d3d192
--- /dev/null
@@ -0,0 +1,86 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.uebhandler;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.ueb.UebManager;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsg;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
+
+//
+// Adding this class for the sole purpose of insuring that the MainUebHandler really 
+// honors @Async and kicks off a thread.  For more info google @Async and read about
+// @Async only working if called from different class.
+//
+//@Configuration
+//@EnableAspectJAutoProxy
+//@EPMetricsLog
+public class InitUebHandler {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(InitUebHandler.class);
+
+       // @Autowired
+       private MainUebHandler mainUebHandler;
+
+       public InitUebHandler() {
+
+       }
+
+       // @PostConstruct
+       public void initUeb() {
+               try {
+                       String enableListenerThread = PortalApiProperties.getProperty(PortalApiConstants.UEB_LISTENERS_ENABLE);
+                       if (enableListenerThread.equalsIgnoreCase("true")) {
+                               ConcurrentLinkedQueue<UebMsg> inboxQueue = new ConcurrentLinkedQueue<UebMsg>();
+                               UebManager.getInstance().initListener(inboxQueue);
+                               mainUebHandler.runHandler(inboxQueue);
+                               logger.info(EELFLoggerDelegate.errorLogger, "Returned from initiating mainUebHandler...");
+                       } else {
+                               logger.info(EELFLoggerDelegate.errorLogger,
+                                               "Not starting UEB listening thread because ueb_listeners_enable is not set to true in the properties file.");
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
+                       logger.info(EELFLoggerDelegate.errorLogger,
+                                       "Not starting UEB listening thread because property could not be read "
+                                                       + PortalApiConstants.UEB_LISTENERS_ENABLE + e.getMessage());
+               }
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/MainUebHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/MainUebHandler.java
new file mode 100644 (file)
index 0000000..d522277
--- /dev/null
@@ -0,0 +1,125 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.uebhandler;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import org.onap.portalapp.portal.ueb.EPUebMsgTypes;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsg;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsgTypes;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import com.att.eelf.configuration.Configuration;
+
+//-------------------------------------------------------------------------
+// Listens for received UEB messages and handles the messages
+//
+// Note: To implement a synchronous reply call getMsgId on the request 
+//       and putMsgId on the reply (echoing the request MsgId).
+//       
+//-------------------------------------------------------------------------
+@Component("MainUebHandler")
+public class MainUebHandler {
+       final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MainUebHandler.class);
+
+       private ConcurrentLinkedQueue<UebMsg> inboxQueue = null;
+
+       @Autowired
+       private FunctionalMenuHandler funcMenuHandler;
+
+       @Autowired
+       private WidgetNotificationHandler widgetNotificationHandler;
+
+       @Async
+       public void runHandler(ConcurrentLinkedQueue<UebMsg> queue) {
+               inboxQueue = queue;
+               logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "==> MainUebHandler started");
+               while (true) {
+                       UebMsg msg = null;
+                       while ((msg = inboxQueue.poll()) != null) {
+                               if ((msg.getMsgType() != null)
+                                               && (!msg.getMsgType().equalsIgnoreCase(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK))) {
+                                       // TODO: switch this back to debug
+                                       logger.info(EELFLoggerDelegate.errorLogger,
+                                                       dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
+                                       logger.info(EELFLoggerDelegate.debugLogger,
+                                                       dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
+                                       MDC.put(EPSystemProperties.PARTNER_NAME, msg.getSourceTopicName());
+                                       MDC.put(Configuration.MDC_SERVICE_NAME, msg.getMsgType().toString());
+                                       switch (msg.getMsgType()) {
+                                       case UebMsgTypes.UEB_MSG_TYPE_GET_FUNC_MENU: {
+                                               funcMenuHandler.getFunctionalMenu(msg);
+                                               break;
+                                       }
+                                       case UebMsgTypes.UEB_MSG_TYPE_WIDGET_NOTIFICATION: {
+                                               widgetNotificationHandler.handleWidgetNotification(msg);
+                                               break;
+                                       }
+                                       default: {
+                                               logger.info(EELFLoggerDelegate.debugLogger,
+                                                               dateFormat.format(new Date()) + "Unknown UEB message type " + msg.toString());
+                                               break;
+                                       }
+                                       }
+                               }
+                       }
+
+                       if (Thread.interrupted()) {
+                               logger.info(EELFLoggerDelegate.errorLogger, "==> UebMainHandler exiting");
+                               break;
+                       }
+
+                       try {
+                               Thread.sleep(10);
+                       } catch (InterruptedException e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "runHandler interrupted during sleep", e);
+                       } catch (Exception e) {
+                               logger.error(EELFLoggerDelegate.errorLogger, "runHandler failed", e);
+                       }
+               }
+       }
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/WidgetNotificationHandler.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/uebhandler/WidgetNotificationHandler.java
new file mode 100644 (file)
index 0000000..d8dd98f
--- /dev/null
@@ -0,0 +1,110 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.uebhandler;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.logging.aop.EPMetricsLog;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.SearchService;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.ueb.UebException;
+import org.onap.portalsdk.core.onboarding.ueb.UebManager;
+import org.onap.portalsdk.core.onboarding.ueb.UebMsg;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+@Component
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+@EPMetricsLog
+public class WidgetNotificationHandler {
+       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetNotificationHandler.class);
+
+       final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+       @Autowired
+       EPAppService appSvc;
+
+       @Autowired
+       SearchService searchSvc;
+
+       public WidgetNotificationHandler() {
+       }
+
+       @Async
+       public void handleWidgetNotification(UebMsg requestMsg) {
+               if (requestMsg.getUserId() != null) {
+                       logger.debug(EELFLoggerDelegate.debugLogger,
+                                       "handleWidgetNotification: getting widgets/apps for user = " + requestMsg.getUserId());
+                       EPUser user = searchSvc.searchUserByUserId(requestMsg.getUserId());
+                       if (user != null && (appSvc != null)) {
+                               logger.debug(EELFLoggerDelegate.debugLogger, "Debug mytag: " + appSvc);
+                               List<EPApp> apps = appSvc.getUserApps(user);
+                               for (EPApp app : apps) {
+                                       if (app.getUebTopicName() != null) {
+                                               UebMsg widgetMsg = new UebMsg();
+                                               widgetMsg.putSourceTopicName(app.getUebTopicName());
+                                               logger.debug(EELFLoggerDelegate.debugLogger, "app.getUebTopicName was invoked");
+                                               widgetMsg.putPayload(requestMsg.getPayload());
+                                               try {
+                                                       logger.debug(EELFLoggerDelegate.debugLogger, "Sending widget notification from "
+                                                                       + requestMsg.getSourceTopicName() + " to " + app.getUebTopicName());
+                                                       UebManager.getInstance().publishEP(widgetMsg, app.getUebTopicName());
+                                               } catch (UebException e) {
+                                                       logger.error(EELFLoggerDelegate.errorLogger, "handleWidgetNotification failed", e);
+                                               }
+                                       }
+                               }
+                       } else {
+                               logger.error(EELFLoggerDelegate.errorLogger,
+                                               dateFormat.format(new Date()) + "handleWidgetNotification: user " + requestMsg.getUserId()
+                                                               + " not found" + " source = " + requestMsg.getSourceTopicName()
+                                                               + ". This widget notification cannot be posted to other widgets");
+                       }
+               }
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..edb5ebb
--- /dev/null
@@ -0,0 +1,146 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.util;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.web.support.AppUtils;
+
+public class SessionCookieUtil {
+       
+       //private static final String JSESSIONID = "JSESSIONID";
+       private static final String EP_SERVICE = "EPService";
+       private static final String USER_ID = "UserId";
+       private static Integer cookieMaxAge = -1;
+       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCookieUtil.class);
+       
+       public static void preSetUp(HttpServletRequest request,
+                       HttpServletResponse response) {
+               initateSessionMgtHandler(request);
+               //set up EPService cookie
+               setUpEPServiceCookie(request, response);
+       }
+
+       public static void setUpEPServiceCookie(HttpServletRequest request,
+                       HttpServletResponse response) {
+               String jSessionId = getJessionId(request);
+               Cookie cookie1 = new Cookie(EP_SERVICE, jSessionId);
+               cookie1.setMaxAge(cookieMaxAge);
+               cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
+               cookie1.setPath("/");
+               response.addCookie(cookie1);
+       }
+       
+       public static void setUpUserIdCookie(HttpServletRequest request,
+                       HttpServletResponse response,String userId) throws Exception {
+               logger.info("************** session cookie util set up UserId cookie begins");
+               userId = CipherUtil.encryptPKC(userId,
+                               SystemProperties.getProperty(SystemProperties.Decryption_Key));
+               Cookie cookie1 = new Cookie(USER_ID, userId);
+               cookie1.setMaxAge(cookieMaxAge);
+               cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
+               cookie1.setPath("/");
+               response.addCookie(cookie1);
+               logger.info("************** session cookie util set up EP cookie completed");
+       }
+       
+       public static String getUserIdFromCookie(HttpServletRequest request,
+                       HttpServletResponse response) throws Exception {
+               String userId = "";
+               Cookie[] cookies = request.getCookies();
+               Cookie userIdcookie = null;
+               if (cookies != null)
+                       for (Cookie cookie : cookies)
+                               if (cookie.getName().equals(USER_ID))
+                                       userIdcookie = cookie;
+               if(userIdcookie!=null){
+                       userId = CipherUtil.decryptPKC(userIdcookie.getValue(),
+                                       SystemProperties.getProperty(SystemProperties.Decryption_Key));
+               }
+               
+               logger.info("************** session cookie util set up EP cookie completed");
+               return userId;
+       }
+       
+       public static String getJessionId(HttpServletRequest request){
+               
+               return request.getSession().getId();
+               /*
+               Cookie ep = WebUtils.getCookie(request, JSESSIONID);
+               if(ep==null){
+                       return request.getSession().getId();
+               }
+               return ep.getValue();
+               */
+       }
+       
+       protected static void initateSessionMgtHandler(HttpServletRequest request) {
+               String jSessionId = getJessionId(request);
+               storeMaxInactiveTime(request);
+               PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request));
+       }
+       
+       protected static void storeMaxInactiveTime(HttpServletRequest request) {
+               HttpSession session = AppUtils.getSession(request);
+               if(session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME) == null)
+                       session.setAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME,session.getMaxInactiveInterval());
+       }
+       
+       public static void resetSessionMaxIdleTimeOut(HttpServletRequest request) {
+               try {
+                       HttpSession session = AppUtils.getSession(request);
+                       final Object maxIdleAttribute = session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME);
+                       if(session != null && maxIdleAttribute != null) {
+                               session.setMaxInactiveInterval(Integer.parseInt(maxIdleAttribute.toString()));
+                       }
+               } catch (Exception e) {
+                       logger.error(EELFLoggerDelegate.errorLogger, "resetSessionMaxIdleTimeOut failed", e);
+               }
+               
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/LoginStrategy.java
deleted file mode 100644 (file)
index 6cdcb6b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.authentication;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-public interface LoginStrategy {
-       public boolean login(HttpServletRequest request, HttpServletResponse response)  throws Exception;
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/OpenIdConnectLoginStrategy.java
deleted file mode 100644 (file)
index 02cd340..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.authentication;
-
-import java.util.HashSet;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.mitre.openid.connect.model.UserInfo;
-import org.openecomp.portalapp.command.EPLoginBean;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalapp.util.SessionCookieUtil;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.util.StringUtils;
-import org.springframework.web.servlet.ModelAndView;
-
-public class OpenIdConnectLoginStrategy extends org.openecomp.portalsdk.core.auth.LoginStrategy implements org.openecomp.portalapp.authentication.LoginStrategy {
-       
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(OpenIdConnectLoginStrategy.class);
-       
-       private static final String GLOBAL_LOCATION_KEY = "Location";
-
-       @SuppressWarnings("rawtypes")
-       public boolean login(HttpServletRequest request, HttpServletResponse response){
-               
-               logger.info("Attempting Login");                                                                                                
-               
-               //check both authentication cookie and authentication header
-               UserInfo  userInfo = (UserInfo) request.getAttribute("userInfo");
-                               
-               if (userInfo != null && !StringUtils.isEmpty(userInfo.getPreferredUsername())) {                                                                                                
-                       //package the userid in the login form for processing
-                       EPLoginBean commandBean = new EPLoginBean();
-                       commandBean.setOrgUserId(userInfo.getPreferredUsername());
-
-                       EPUser user = new EPUser();
-                               
-                       user.setOrgUserId(userInfo.getPreferredUsername());
-                       user.setEmail(userInfo.getEmail());
-                       user.setFirstName(userInfo.getName());
-                       user.setLastName(userInfo.getFamilyName());
-                       
-                       //store the currently logged in user's information in the session
-                       EPUserUtils.setUserSession(request, user,  new HashSet(), new HashSet(), SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM),null);
-
-                       logger.info(EELFLoggerDelegate.errorLogger, request.getContextPath());
-                       SessionCookieUtil.preSetUp(request, response);  
-                       return true;
-               } else {
-                       // in case authentication cookie is missing, send 401 UNAUTHORIZED to client and it will redirect to Logon
-                       try {
-                               String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
-                               String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL);
-                               logger.info(EELFLoggerDelegate.errorLogger, "Authentication Mechanism: '" + authentication + "'.");
-                               
-                               if (authentication == null || authentication.equals("") || authentication.trim().equals("OIDC")) {                              
-                                   response.sendRedirect("oid-login");
-                               } else {
-                                       logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
-                                       response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
-                               response.setHeader(GLOBAL_LOCATION_KEY, loginUrl);
-                           }
-                       } catch(Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "login failed", e);
-                       }
-               }
-               return false;
-       }
-
-       @Override
-       public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               String message = "Method not implmented; Cannot be called";
-               logger.error(EELFLoggerDelegate.errorLogger, message);
-               throw new Exception(message);
-       }
-
-       @Override
-       public String getUserId(HttpServletRequest request) throws PortalAPIException {
-               String message = "Method not implmented; Cannot be called";
-               logger.error(EELFLoggerDelegate.errorLogger, message);
-               throw new PortalAPIException(message);
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/authentication/SimpleLoginStrategy.java
deleted file mode 100644 (file)
index b7e1644..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.authentication;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.command.EPLoginBean;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalapp.util.SessionCookieUtil;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.menu.MenuProperties;
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.StringUtils;
-import org.springframework.web.servlet.ModelAndView;
-
-public class SimpleLoginStrategy extends org.openecomp.portalsdk.core.auth.LoginStrategy implements LoginStrategy{
-       
-       @Autowired
-       private EPLoginService loginService;
-
-       @Autowired
-       private EPRoleFunctionService ePRoleFunctionService;
-       
-       private static final String GLOBAL_LOCATION_KEY = "Location";
-       
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SimpleLoginStrategy.class);
-       
-       public boolean login(HttpServletRequest request, HttpServletResponse response) throws Exception{
-               logger.info("Attempting 'Simple' Login");                                                                                               
-               
-               //check both authentication cookie and authentication header
-               String  orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response);
-               
-               if (!StringUtils.isEmpty(orgUserId)) {                                                                                                  
-                       // package the userid in the login form for processing
-                       EPLoginBean commandBean = new EPLoginBean();
-                       commandBean.setOrgUserId(orgUserId);
-                       commandBean = loginService.findUser(commandBean, (String)request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), null);
-
-                        // in case authentication has passed but user is not in the ECOMP data base, return a Guest User to the home page.
-                       if (commandBean.getUser() == null) {
-                       }
-                       else {
-                               // store the currently logged in user's information in the session
-                               EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(), commandBean.getBusinessDirectMenu(), "", ePRoleFunctionService);
-                               logger.info(EELFLoggerDelegate.debugLogger, commandBean.getUser().getOrgUserId() + " exists in the the system.");
-                       }
-                       
-                       logger.info(EELFLoggerDelegate.errorLogger, request.getContextPath());
-                       SessionCookieUtil.preSetUp(request, response);
-                       return true;
-               } else {
-                       // in case authentication cookie is missing, send 401 UNAUTHORIZED to client and it will redirect to Logon
-                       try {
-                               String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
-                               String loginUrl = SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL);
-                               logger.info(EELFLoggerDelegate.errorLogger, "Authentication Mechanism: '" + authentication + "'.");
-                               if (authentication == null || authentication.equals("") || authentication.trim().equals("BOTH")) {
-                               
-                                       logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
-                                   response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
-                           response.setHeader(GLOBAL_LOCATION_KEY, loginUrl); //returnUrl + "/index.htm");
-                       }else {
-                                       logger.info(EELFLoggerDelegate.errorLogger, "No cookies are found, redirecting the request to '" + loginUrl + "'.");
-                                       response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
-                               response.setHeader(GLOBAL_LOCATION_KEY, loginUrl); //returnUrl + "/index.htm");
-                           }
-                       } catch(Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "login failed", e);
-                       }
-               }
-
-               return false;
-
-       }
-
-       @Override
-       public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               String message = "Method not implmented; Cannot be called";
-               logger.error(EELFLoggerDelegate.errorLogger, message);
-               throw new Exception(message);
-       }
-
-       @Override
-       public String getUserId(HttpServletRequest request) throws PortalAPIException {
-               String message = "Method not implmented; Cannot be called";
-               logger.error(EELFLoggerDelegate.errorLogger, message);
-               throw new PortalAPIException(message);
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppConfig.java
deleted file mode 100644 (file)
index 7b44add..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.conf;
-
-import static com.att.eelf.configuration.Configuration.MDC_ALERT_SEVERITY;
-import static com.att.eelf.configuration.Configuration.MDC_INSTANCE_UUID;
-import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
-import static com.att.eelf.configuration.Configuration.MDC_SERVER_IP_ADDRESS;
-import static com.att.eelf.configuration.Configuration.MDC_SERVICE_INSTANCE_ID;
-import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME;
-
-import java.net.InetAddress;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-
-import org.openecomp.portalapp.authentication.LoginStrategy;
-import org.openecomp.portalapp.authentication.OpenIdConnectLoginStrategy;
-import org.openecomp.portalapp.authentication.SimpleLoginStrategy;
-import org.openecomp.portalapp.controller.core.LogoutController;
-import org.openecomp.portalapp.controller.core.SDKLoginController;
-import org.openecomp.portalapp.portal.interceptor.PortalResourceInterceptor;
-import org.openecomp.portalapp.portal.interceptor.SessionTimeoutInterceptor;
-import org.openecomp.portalapp.portal.listener.HealthMonitor;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPLoginServiceImpl;
-import org.openecomp.portalapp.portal.ueb.EPUebHelper;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.scheduler.RegistryAdapter;
-import org.openecomp.portalapp.uebhandler.FunctionalMenuHandler;
-import org.openecomp.portalapp.uebhandler.InitUebHandler;
-import org.openecomp.portalapp.uebhandler.MainUebHandler;
-import org.openecomp.portalapp.uebhandler.WidgetNotificationHandler;
-import org.openecomp.portalsdk.core.conf.AppConfig;
-import org.openecomp.portalsdk.core.conf.Configurable;
-import org.openecomp.portalsdk.core.logging.format.AlarmSeverityEnum;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.objectcache.AbstractCacheManager;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.service.FnMenuService;
-import org.openecomp.portalsdk.core.service.FnMenuServiceImpl;
-import org.openecomp.portalsdk.core.util.CacheManager;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.ComponentScan.Filter;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.FilterType;
-import org.springframework.context.annotation.Profile;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.quartz.SchedulerFactoryBean;
-import org.springframework.web.servlet.ViewResolver;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-
-@Configuration
-@EnableWebMvc
-@ComponentScan(basePackages = { "org.openecomp" }, excludeFilters = {
-               @Filter(value = { LogoutController.class, SDKLoginController.class }, type = FilterType.ASSIGNABLE_TYPE) })
-@Profile("src")
-@EnableAsync
-@EnableScheduling
-public class ExternalAppConfig extends AppConfig implements Configurable {
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppConfig.class);
-
-       private RegistryAdapter schedulerRegistryAdapter;
-
-       public ViewResolver viewResolver() {
-               return super.viewResolver();
-       }
-
-       @Override
-       public void addResourceHandlers(ResourceHandlerRegistry registry) {
-               registry.addResourceHandler("/app/fusion/**").addResourceLocations("/app/fusion/");             
-               registry.addResourceHandler("/static/**").addResourceLocations("/static/");
-               registry.addResourceHandler("/images/**").addResourceLocations("/images/");
-               registry.addResourceHandler("/**").addResourceLocations("/public/");
-       }
-
-       @PostConstruct
-       private void init() {
-               try {
-                       // Loading defaults
-                       MDC.put(MDC_SERVICE_NAME, EPSystemProperties.ECOMP_PORTAL_BE);
-                       MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
-                       MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
-                       MDC.put(MDC_SERVICE_INSTANCE_ID, "");
-                       MDC.put(MDC_ALERT_SEVERITY, AlarmSeverityEnum.INFORMATIONAL.toString());
-                       MDC.put(MDC_INSTANCE_UUID, SystemProperties.getProperty(SystemProperties.INSTANCE_UUID));
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "init failed", e);
-               }
-       }
-
-       /*
-        * /
-        * 
-        * @PostConstruct // file://${catalina.home}/conf/log4j.properties public
-        * void initLog4j() throws FileNotFoundException { try { URL[] classpathurls
-        * = ((URLClassLoader)
-        * (Thread.currentThread().getContextClassLoader())).getURLs(); for (URL url
-        * : classpathurls) { System.out.println(url.getFile().toString()); }
-        * Log4jConfigurer.initLogging(
-        * "file://${catalina.home}/conf/log4j.properties"); } catch
-        * (FileNotFoundException e) { ((URLClassLoader)
-        * (Thread.currentThread().getContextClassLoader())).getURLs();
-        * Log4jConfigurer.initLogging("classpath:../conf/log4j.properties"); } } /
-        **/
-
-       public DataAccessService dataAccessService() {
-               return super.dataAccessService();
-       }
-
-       public String[] tileDefinitions() {
-               return super.tileDefinitions();
-       }
-
-       public List<String> addTileDefinitions() {
-               List<String> definitions = new ArrayList<String>();
-               definitions.add("/WEB-INF/defs/definitions.xml");
-               return definitions;
-       }
-
-       @Bean
-       public AbstractCacheManager cacheManager() {
-               return new CacheManager();
-       }
-
-       @Bean
-       public SessionTimeoutInterceptor sessionTimeoutInterceptor() {
-               return new SessionTimeoutInterceptor();
-       }
-
-       @Bean
-       public PortalResourceInterceptor portalResourceInterceptor() {
-               return new PortalResourceInterceptor();
-       }
-
-       @Bean
-       public EPLoginService eploginService() {
-               return new EPLoginServiceImpl();
-       }
-
-       @Bean
-       public org.openecomp.portalsdk.core.auth.LoginStrategy coreLoginStrategy() {
-               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC"))
-                       return new OpenIdConnectLoginStrategy();
-               else
-                       return new SimpleLoginStrategy();
-       }
-
-       @Bean
-       public LoginStrategy loginStrategy() {
-
-               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC"))
-                       return new OpenIdConnectLoginStrategy();
-               else
-                       return new SimpleLoginStrategy();
-       }
-
-       public FnMenuService fnMenuService() {
-               return new FnMenuServiceImpl();
-       }
-
-       @Override
-       public void addInterceptors(InterceptorRegistry registry) {
-               // registry.addInterceptor(new
-               // StaticResourcesInterceptor()).addPathPatterns("/index.htm",
-               // "/applicationsHome", "/widgetsHome", "/admins", "/users",
-               // "/applications", "/widgets");
-               // Excludes login/logout pages and REST endpoints used by other
-               // application servers.
-
-               registry.addInterceptor(sessionTimeoutInterceptor()).excludePathPatterns("/oid-login", "/portalApi/healthCheck",
-                               "/portalApi/healthCheck/", "/portalApi/healthCheckSuspend", "/portalApi/healthCheckSuspend/",
-                               "/portalApi/healthCheckResume", "/portalApi/healthCheckResume/", "/login_external",
-                               "/login_external.htm*", "login", "/login.htm*","/auxapi/*","/context/*", "/api*",
-                               "/single_signon.htm", "/single_signon", "/dashboard", "/OpenSourceLogin.htm");
-
-               registry.addInterceptor(portalResourceInterceptor());
-
-       }
-
-       /**
-        * Creates and returns a new instance of a {@link SchedulerFactoryBean} and
-        * populates it with triggers.
-        *
-        * @return New instance of {@link SchedulerFactoryBean}
-        */
-
-       @Bean
-       public EPUebHelper epUebHelper() {
-               return new EPUebHelper();
-       }
-
-       @Bean
-       public HealthMonitor healthMonitor() {
-               return new HealthMonitor();
-       }
-
-       /**
-        * Creates and returns a new instance of a {@link MainUebHandler}.
-        * 
-        * @return New instance of {@link MainUebHandler}.
-        */
-       @Bean
-       public MainUebHandler mainUebHandler() {
-               return new MainUebHandler();
-       }
-
-       /**
-        * Creates and returns a new instance of a {@link InitUebHandler}.
-        * 
-        * @return New instance of {@link InitUebHandler}.
-        */
-       @Bean
-       public InitUebHandler initUebHandler() {
-               return new InitUebHandler();
-       }
-
-       /**
-        * Creates and returns a new instance of a {@link WidgetNotificationHandler}
-        * .
-        * 
-        * @return New instance of {@link WidgetNotificationHandler}.
-        */
-       @Bean
-       public WidgetNotificationHandler widgetNotificationHandler() {
-               return new WidgetNotificationHandler();
-       }
-
-       /**
-        * Creates and returns a new instance of a {@link FunctionalMenuHandler} .
-        * 
-        * @return New instance of {@link FunctionalMenuHandler}.
-        */
-       @Bean
-       public FunctionalMenuHandler functionalMenuHandler() {
-               return new FunctionalMenuHandler();
-       }
-
-       /**
-        * Creates and returns a new instance of a {@link SchedulerFactoryBean} and
-        * populates it with triggers.
-        *
-        * @return New instance of {@link SchedulerFactoryBean}
-        * @throws Exception if dataSource fails
-        */
-       // APPLICATIONS REQUIRING QUARTZ SHOULD RESTORE ANNOTATION
-       @Bean // ANNOTATION COMMENTED OUT
-       public SchedulerFactoryBean schedulerFactoryBean() throws Exception {
-               SchedulerFactoryBean scheduler = new SchedulerFactoryBean();
-               scheduler.setConfigLocation(appApplicationContext.getResource("WEB-INF/conf/quartz.properties"));
-               scheduler.setDataSource(dataSource());
-               scheduler.setTriggers(schedulerRegistryAdapter.getTriggers());
-               scheduler.setSchedulerName(getScheduleName());
-               return scheduler;
-       }
-
-       protected String getScheduleName() {
-               final String CRON_SITE_NAME = "cron_site_name";
-               String cronSiteVal = "Default";
-               try {
-                       cronSiteVal = SystemProperties.getProperty(CRON_SITE_NAME);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getScheduleName failed", e);
-                       logger.warn(EELFLoggerDelegate.errorLogger,
-                                       "Cron site name not added in property file, using Default value");
-               }
-
-               String cronSiteName = cronSiteVal != null ? cronSiteVal : "";
-
-               SimpleDateFormat dateFormat = new SimpleDateFormat();
-               dateFormat.applyPattern("YYYYMMdd");
-               String currentDateStr = dateFormat.format(Calendar.getInstance().getTime());
-
-               return "Scheduler" + "_" + currentDateStr + "_" + cronSiteName;
-       }
-
-       /**
-        * Sets the scheduler registry adapter.
-        *
-        * @param schedulerRegistryAdapter
-        *            Scheduler registry adapter
-        */
-       @Autowired
-       public void setSchedulerRegistryAdapter(final RegistryAdapter schedulerRegistryAdapter) {
-               this.schedulerRegistryAdapter = schedulerRegistryAdapter;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/ExternalAppInitializer.java
deleted file mode 100644 (file)
index 121c4be..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.conf;
-
-import java.util.Arrays;
-
-import org.openecomp.portalsdk.core.conf.AppInitializer;
-
-public class ExternalAppInitializer extends  AppInitializer{
-       
-       
-       @Override
-    protected Class<?>[] getRootConfigClasses() {
-       return super.getRootConfigClasses();
-    }
-  
-    @Override
-    protected Class<?>[] getServletConfigClasses() {
-//     Class<?>[] configClasses =  super.getServletConfigClasses();
-//     Class<?>[] additionalConfigClasses  = Arrays.copyOf(configClasses, configClasses.length);
-//     addConfigClass(additionalConfigClasses, ExternalAppConfig.class);
-//     return additionalConfigClasses;
-//     
-       return new Class[] {ExternalAppConfig.class};
-    }
-    
-    static Class<?>[] addConfigClass(Class<?>[] a, Class<?> e) {
-        a  = Arrays.copyOf(a, a.length + 1);
-        a[a.length - 1] = e;
-        return a;
-    }
-  
-    /*
-     * URL request will direct to the Spring dispatcher for processing
-     */
-    @Override
-    protected String[] getServletMappings() {
-       return super.getServletMappings();
-    }
-}
-
-
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/conf/HibernateMappingLocations.java
deleted file mode 100644 (file)
index 7f0e956..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.conf;
-
-import org.openecomp.portalsdk.core.conf.HibernateMappingLocatable;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.stereotype.Component;
-
-@Component
-@Profile("src")
-public class HibernateMappingLocations implements HibernateMappingLocatable {
-
-       public Resource[] getMappingLocations() {
-               return new Resource[] { new ClassPathResource("../fusion/orm/Fusion.hbm.xml"),
-                               new ClassPathResource("../fusion/orm/EP.hbm.xml"),
-                               new ClassPathResource("../fusion/orm/Workflow.hbm.xml") };
-       }
-
-       @Override
-       public String[] getPackagesToScan() {
-               return new String[] { "org.openecomp" };
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ECOMPLogoutController.java
deleted file mode 100644 (file)
index 10ae7b9..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-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.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-import org.springframework.web.servlet.ModelAndView;
-
-@Controller
-@RequestMapping("/")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@Profile("src")
-public class ECOMPLogoutController extends EPUnRestrictedBaseController{
-       
-       private EPUser user;
-       private static final String EP_SERVICE = "EPService";
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ECOMPLogoutController.class);
-
-       @EPAuditLog
-       @RequestMapping(value = {"/logout.htm" }, method = RequestMethod.GET)
-       public ModelAndView logOut(HttpServletRequest request,
-                                                               HttpServletResponse response) throws Exception {
-       
-               ModelAndView modelView = null;
-                               
-               chatRoomLogout(request);
-               logger.debug(EELFLoggerDelegate.debugLogger, "ECOMPLogoutController.handleRequestInternal - Logout request received.");
-               
-               modelView = new ModelAndView("redirect:login.htm");
-               
-               /**
-               if (UserUtils.isClientMobileDevice(request)){
-               modelView.setViewName(modelView.getViewName().concat("?viewType=mobile"));
-               }
-               */
-               String cookieDoamin = EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN);
-               Cookie epCookie = new Cookie(EP_SERVICE, "");
-               epCookie.setMaxAge(0);
-               epCookie.setDomain(cookieDoamin);
-               epCookie.setPath("/");
-               
-               Cookie appHeaderCookie = new Cookie("show_app_header", "");
-               appHeaderCookie.setMaxAge(0);
-               appHeaderCookie.setDomain(cookieDoamin);
-               appHeaderCookie.setPath("/");
-               
-               Cookie appTabCookie = new Cookie("cookieTabs", "");
-               appTabCookie.setMaxAge(0);
-               appTabCookie.setDomain(cookieDoamin);
-               appTabCookie.setPath("/");
-               
-               Cookie appVisInvisTabCookie = new Cookie("visInVisCookieTabs", "");
-               appVisInvisTabCookie.setMaxAge(0);
-               appVisInvisTabCookie.setDomain(cookieDoamin);
-               appVisInvisTabCookie.setPath("/");
-               
-           response.addCookie(epCookie);       
-           response.addCookie(appHeaderCookie);
-           response.addCookie(appTabCookie);
-           response.addCookie(appVisInvisTabCookie);
-               request.getSession().invalidate();
-               
-               logger.debug(EELFLoggerDelegate.debugLogger, "ECOMPLogoutController.handleRequestInternal - Successfully processed the logout request.");
-               
-               return modelView;
-       }
-       
-       @EPMetricsLog
-       public void chatRoomLogout(HttpServletRequest request){
-               request = ((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).getRequest(); 
-               setUser(EPUserUtils.getUserSession(request));
-       }
-       
-       public EPUser getUser() {
-               return user;
-       }
-       
-       public void setUser(EPUser user) {
-               this.user = user;
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginController.java
deleted file mode 100644 (file)
index ce6cc53..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
-
-import java.net.URLDecoder;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.json.JSONObject;
-import org.openecomp.portalapp.command.EPLoginBean;
-import org.openecomp.portalapp.portal.domain.SharedContext;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.SharedContextService;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalapp.util.SessionCookieUtil;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.menu.MenuProperties;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.util.StopWatch;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-import org.springframework.web.util.WebUtils;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Controller
-@RequestMapping("/")
-public class LoginController extends EPUnRestrictedBaseController implements LoginService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LoginController.class);
-
-       public static final String DEFAULT_SUCCESS_VIEW = "applicationsHome";
-       public static final String DEFAULT_FAILURE_VIEW = "login";
-       public static final String ERROR_MESSAGE_KEY = "error";
-       public static final String REDIRECT_URL = "redirectUrl";
-       public static final String REDIRECT_COLON = "redirect:";
-
-       @Autowired
-       private EPLoginService loginService;
-       @Autowired
-       private SharedContextService sharedContextService;
-       @Autowired
-       private EPRoleFunctionService ePRoleFunctionService;
-
-       private String viewName = "login";
-
-       private String welcomeView;
-
-       @RequestMapping(value = { "/login.htm" }, method = RequestMethod.GET)
-       public ModelAndView login(HttpServletRequest request) {
-               Map<String, Object> model = new HashMap<String, Object>();
-               String authentication = SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM);
-               String loginPage;
-               if (authentication == null || "".equals(authentication) || "OICD".equals(authentication.trim()))
-                       loginPage = "openIdLogin";
-               else
-                       loginPage = getViewName();
-               return new ModelAndView(loginPage, "model", model);
-       }
-
-       @SuppressWarnings("rawtypes")
-       @RequestMapping(value = { "/open_source/login" }, method = RequestMethod.POST)
-       @ResponseBody
-       public String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception {
-
-               ObjectMapper mapper = new ObjectMapper();
-               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-               JsonNode root = mapper.readTree(request.getReader());
-
-               EPLoginBean commandBean = new EPLoginBean();
-               String loginId = root.get("loginId").textValue();
-               String password = root.get("password").textValue();
-               commandBean.setLoginId(loginId);
-               commandBean.setLoginPwd(CipherUtil.encrypt(password));
-               HashMap additionalParamsMap = new HashMap();
-               StringBuilder sbAdditionalInfo = new StringBuilder();
-
-               commandBean = getLoginService().findUser(commandBean,
-                               (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY), additionalParamsMap);
-               String fullURL = getFullURL(request);
-               if (commandBean.getUser() == null) {
-                       String loginErrorMessage = (commandBean.getLoginErrorMessage() != null) ? commandBean.getLoginErrorMessage()
-                                       : "login.error.external.invalid";
-                       logger.info(EELFLoggerDelegate.debugLogger, "loginId {} does not exist in the the DB.", loginId);
-                       sbAdditionalInfo.append(String.format("But the Login-Id: %s doesn't exist in the Database. Request-URL: %s",
-                                       loginId, fullURL));
-                       return loginErrorMessage;
-               } else {
-                       // store the currently logged in user's information in the session
-                       EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
-                                       commandBean.getBusinessDirectMenu(),
-                                       SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM), ePRoleFunctionService);
-
-                       try {
-                               logger.info(EELFLoggerDelegate.debugLogger, "loginValidate: store user info into share context begins");
-                               String sessionId = request.getSession().getId();
-                               List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
-                               if (existingSC == null || existingSC.isEmpty()) {
-                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME,
-                                                       commandBean.getUser().getFirstName());
-                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME,
-                                                       commandBean.getUser().getLastName());
-                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL,
-                                                       commandBean.getUser().getEmail());
-                                       getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID,
-                                                       commandBean.getLoginId());
-                               }
-
-                       } catch (Exception e) {
-                               logger.info(EELFLoggerDelegate.errorLogger, "loginValidate: failed the shared context adding process ",
-                                               e);
-                       }
-                       logger.info(EELFLoggerDelegate.debugLogger,
-                                       "loginValidate: PresetUp the EP service cookie and intial sessionManagement");
-
-                       SessionCookieUtil.preSetUp(request, response);
-                       SessionCookieUtil.setUpUserIdCookie(request, response, loginId);
-
-                       JSONObject j = new JSONObject("{success: success}");
-
-                       return j.toString();
-               }
-       }
-
-       /*
-        * Work around a bug in ecompsdkos version 1.1.0 which hard-codes this endpoint.
-        */
-       @RequestMapping(value = { "/process_csp" }, method = RequestMethod.GET)
-       public ModelAndView processCsp(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               return processSingleSignOn(request, response);
-       }
-       /*
-        * Remove this method after epsdk-app-common/.../SingleSignOnController.java is
-        * repaired.
-        */
-
-       @RequestMapping(value = { "/processSingleSignOn" }, method = RequestMethod.GET)
-       public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception {
-
-               Map<Object, Object> model = new HashMap<Object, Object>();
-               HashMap<Object, Object> additionalParamsMap = new HashMap<Object, Object>();
-               EPLoginBean commandBean = new EPLoginBean();
-               MDC.put(MDC_KEY_REQUEST_ID, getRequestId(request));
-               // get userId from cookie
-               String orgUserId = SessionCookieUtil.getUserIdFromCookie(request, response);
-               logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: begins with orgUserId {}", orgUserId);
-
-               StringBuilder sbAdditionalInfo = new StringBuilder();
-               if (orgUserId == null || orgUserId.length() == 0) {
-                       model.put(ERROR_MESSAGE_KEY, SystemProperties.MESSAGE_KEY_LOGIN_ERROR_COOKIE_EMPTY);
-                       if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
-                               return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl="
-                                               + request.getParameter(REDIRECT_URL));
-                       } else {
-                               return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm");
-                       }
-               } else {
-
-                       StopWatch stopWatch = new StopWatch("LoginController.Login");
-                       stopWatch.start();
-
-                       try {
-                               logger.info(EELFLoggerDelegate.debugLogger,
-                                               "Operation findUser is started to locate user {}  in the database.", orgUserId);
-                               commandBean.setLoginId(orgUserId);
-                               commandBean.setOrgUserId(orgUserId);
-                               commandBean = getLoginService().findUser(commandBean,
-                                               (String) request.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY),
-                                               additionalParamsMap);
-
-                               stopWatch.stop();
-                               MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms");
-                               logger.info(EELFLoggerDelegate.debugLogger, "Operation findUser is completed.");
-                       } catch (Exception e) {
-                               stopWatch.stop();
-                               MDC.put(EPSystemProperties.MDC_TIMER, stopWatch.getTotalTimeMillis() + "ms");
-                               logger.info(EELFLoggerDelegate.errorLogger, "processSingleSignOn failed on user " + orgUserId, e);
-                       } finally {
-                               MDC.remove(EPSystemProperties.MDC_TIMER);
-                       }
-
-                       sbAdditionalInfo.append("Login attempt is succeeded. ");
-                       String fullURL = getFullURL(request);
-                       if (commandBean.getUser() == null) {
-                               logger.info(EELFLoggerDelegate.debugLogger,
-                                               "processSingleSignOn: loginId {} does not exist in the the DB.", orgUserId);
-
-                               sbAdditionalInfo.append(String.format(
-                                               "But the Login-Id: %s doesn't exist in the Database. Created a Guest Session. Request-URL: %s",
-                                               orgUserId, fullURL));
-                               if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
-                                       return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm" + "?redirectUrl="
-                                                       + request.getParameter(REDIRECT_URL));
-                               } else {
-                                       return new ModelAndView(REDIRECT_COLON + DEFAULT_FAILURE_VIEW + ".htm");
-                               }
-                       } else {
-
-                               sbAdditionalInfo.append(
-                                               String.format("Login-Id: %s, Login-Method: %s, Request-URL: %s", orgUserId, "", fullURL));
-                               logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: now set up user session for {}",
-                                               orgUserId);
-
-                               EPUserUtils.setUserSession(request, commandBean.getUser(), commandBean.getMenu(),
-                                               commandBean.getBusinessDirectMenu(),
-                                               SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM), ePRoleFunctionService);
-                               logger.info(EELFLoggerDelegate.debugLogger,
-                                               "processSingleSignOn: now set up user session for {} finished", orgUserId);
-
-                               // Store user's information into share context
-                               try {
-                                       logger.info(EELFLoggerDelegate.debugLogger,
-                                                       "processSingleSignOn: store user info into share context begins");
-                                       String sessionId = request.getSession().getId();
-                                       List<SharedContext> existingSC = getSharedContextService().getSharedContexts(sessionId);
-                                       if (existingSC == null || existingSC.isEmpty()) {
-                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_FIRST_NAME,
-                                                               commandBean.getUser().getFirstName());
-                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_LAST_NAME,
-                                                               commandBean.getUser().getLastName());
-                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_EMAIL,
-                                                               commandBean.getUser().getEmail());
-                                               getSharedContextService().addSharedContext(sessionId, EPSystemProperties.USER_ORG_USERID,
-                                                               commandBean.getLoginId());
-                                       }
-                               } catch (Exception e) {
-                                       logger.info(EELFLoggerDelegate.errorLogger,
-                                                       "processSingleSignOn: failed the shared context adding process", e);
-                               }
-
-                               logger.info(EELFLoggerDelegate.debugLogger,
-                                               "processSingleSignOn: PresetUp the EP service cookie and intial sessionManagement");
-                               SessionCookieUtil.preSetUp(request, response);
-                               SessionCookieUtil.setUpUserIdCookie(request, response, orgUserId);
-                               logger.info(EELFLoggerDelegate.debugLogger,
-                                               "processSingleSignOn: PresetUp the EP service cookie and intial sessionManagement completed");
-                               logger.info(EELFLoggerDelegate.debugLogger,
-                                               commandBean.getUser().getOrgUserId() + " exists in the the system.");
-
-                               // get redirectUrl from URL parameter
-                               if (request.getParameter(REDIRECT_URL) != null && request.getParameter(REDIRECT_URL).length() != 0) {
-                                       String forwardUrl = URLDecoder.decode(request.getParameter(REDIRECT_URL), "UTF-8");
-                                       // clean cookie
-                                       Cookie cookie2 = new Cookie(REDIRECT_URL, "");
-                                       // ONAP does not use https
-                                       cookie2.setSecure(false);
-                                       cookie2.setMaxAge(0);
-                                       cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
-                                       cookie2.setPath("/");
-                                       response.addCookie(cookie2);
-                                       return new ModelAndView(REDIRECT_COLON + forwardUrl);
-                               }
-
-                               // first check if redirectUrl exists or not
-                               if (WebUtils.getCookie(request, REDIRECT_URL) != null) {
-                                       String forwardUrl = WebUtils.getCookie(request, REDIRECT_URL).getValue();
-                                       // clean cookie
-                                       Cookie cookie2 = new Cookie(REDIRECT_URL, "");
-                                       // ONAP does not use https
-                                       cookie2.setSecure(false);
-                                       cookie2.setMaxAge(0);
-                                       cookie2.setDomain(EPSystemProperties.getProperty(EPSystemProperties.COOKIE_DOMAIN));
-                                       cookie2.setPath("/");
-                                       response.addCookie(cookie2);
-
-                                       return new ModelAndView(REDIRECT_COLON + forwardUrl);
-                               }
-                       }
-               }
-
-               // if user has been authenticated, now take them to the welcome page.
-               logger.info(EELFLoggerDelegate.debugLogger, "processSingleSignOn: Now return to application home page");
-               return new ModelAndView(REDIRECT_COLON + SystemProperties.getProperty(EPSystemProperties.FE_URL));
-       }
-
-       private String getFullURL(HttpServletRequest request) {
-               if (request != null) {
-                       String requestURL = request.getRequestURL().toString();
-                       String queryString = request.getQueryString();
-                       if (queryString == null) {
-                               return requestURL;
-                       } else {
-                               return requestURL + "?" + queryString;
-                       }
-               }
-               return "";
-       }
-
-       private String getRequestId(HttpServletRequest request) {
-               Enumeration<String> headerNames = request.getHeaderNames();
-               String requestId = "";
-               while (headerNames.hasMoreElements()) {
-                       String headerName = headerNames.nextElement();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "getRequestId: header {} has value {}", headerName,
-                                       request.getHeader(headerName));
-                       if (headerName.equalsIgnoreCase(SystemProperties.ECOMP_REQUEST_ID)) {
-                               requestId = request.getHeader(headerName);
-                               break;
-                       }
-               }
-               return requestId.isEmpty() ? UUID.randomUUID().toString() : requestId;
-       }
-
-       public String getWelcomeView() {
-               return welcomeView;
-       }
-
-       public void setWelcomeView(String welcomeView) {
-               this.welcomeView = welcomeView;
-       }
-
-       @Override
-       public String getViewName() {
-               return viewName;
-       }
-
-       @Override
-       public void setViewName(String viewName) {
-               this.viewName = viewName;
-       }
-
-       public EPLoginService getLoginService() {
-               return loginService;
-       }
-
-       public void setLoginService(EPLoginService loginService) {
-               this.loginService = loginService;
-       }
-
-       public SharedContextService getSharedContextService() {
-               return sharedContextService;
-       }
-
-       public void setSharedContextService(SharedContextService sharedContextService) {
-               this.sharedContextService = sharedContextService;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginService.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/LoginService.java
deleted file mode 100644 (file)
index 4b5a8d9..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-
-public interface LoginService {
-       
-       public ModelAndView login(HttpServletRequest request);
-       
-       public @ResponseBody String loginValidate(HttpServletRequest request, HttpServletResponse response) throws Exception;
-       
-       public ModelAndView processSingleSignOn(HttpServletRequest request, HttpServletResponse response) throws Exception;
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPLoginController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPLoginController.java
deleted file mode 100644 (file)
index 64f38c1..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalsdk.core.auth.LoginStrategy;
-import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
-import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
-import org.openecomp.portalsdk.core.service.LoginService;
-import org.openecomp.portalsdk.core.service.ProfileService;
-import org.openecomp.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.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-
-@Controller
-@RequestMapping("/")
-public class ONAPLoginController extends UnRestrictedBaseController {
-       @Autowired
-       ProfileService service;
-       @Autowired
-       private LoginService loginService;
-       @Autowired
-       private LoginStrategy loginStrategy;
-       String viewName;
-
-       @RequestMapping(value = { "/doLogin" }, method = RequestMethod.GET)
-       public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               return loginStrategy.doLogin(request, response);
-       }
-
-       public String getJessionId(HttpServletRequest request) {
-               return request.getSession().getId();
-       }
-
-       protected void initateSessionMgtHandler(HttpServletRequest request) {
-               String jSessionId = getJessionId(request);
-               PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request));
-       }
-
-       public String getViewName() {
-               return viewName;
-       }
-
-       public void setViewName(String viewName) {
-               this.viewName = viewName;
-       }
-
-       public LoginService getLoginService() {
-               return loginService;
-       }
-
-       public void setLoginService(LoginService loginService) {
-               this.loginService = loginService;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPWelcomeController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/ONAPWelcomeController.java
deleted file mode 100644 (file)
index 917d771..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import java.security.Principal;
-import java.util.Set;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.mitre.openid.connect.client.SubjectIssuerGrantedAuthority;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-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.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-
-@Controller
-@RequestMapping("/")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class ONAPWelcomeController extends EPRestrictedBaseController{
-       String viewName;
-               
-       @RequestMapping(value = "/index.htm", method = RequestMethod.GET)
-    public String getIndexPage(HttpServletRequest request) {
-               return "/index";
-    }
-       
-       @RequestMapping(value = {"/applicationsHome", "/dashboard", "/widgetsHome", "/kpidash*", "/admins", "/users", "/portalAdmins", "/applications", "/widgets", "/functionalMenu", "/contactUs", "/getAccess","/appCatalog", "/widgetOnboarding", "/accountOnboarding"}, method = RequestMethod.GET)
-    public String getEcompSinglePage(HttpServletRequest request, HttpServletResponse response) {
-               return "forward:/index.html";
-    }
-       
-       protected String getViewName() {
-               return viewName;
-       }
-       
-       protected void setViewName(String viewName) {
-               this.viewName = viewName;
-       }
-       
-       
-       @Resource(name = "namedAdmins")
-       private Set<SubjectIssuerGrantedAuthority> admins;
-       
-       @RequestMapping("/user")
-       public String user(Principal p) {
-               return "oid-user";
-       }
-
-       @RequestMapping("/admin")
-       public String admin(Model model, Principal p) {
-
-               model.addAttribute("admins", admins);
-
-               return "oid-admin";
-       }
-       @RequestMapping("/oid-login")
-       public ModelAndView login(Principal p) {                
-               return new ModelAndView("openIdLogin");
-       }       
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/OpenCollaborationController.java
deleted file mode 100644 (file)
index 9e87ae2..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import java.util.HashMap;
-import java.util.Map;
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/controller/PeerBroadcastSocket.java
deleted file mode 100644 (file)
index 9366b1e..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.controller;
-
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Map;
-
-import javax.websocket.OnClose;
-import javax.websocket.OnMessage;
-import javax.websocket.OnOpen;
-import javax.websocket.Session;
-import javax.websocket.server.ServerEndpoint;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@ServerEndpoint("/opencontact")
-public class PeerBroadcastSocket {
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PeerBroadcastSocket.class);
-
-       public static Map<String, Object> channelMap = new Hashtable<String, Object>();
-       public Map<String, String> sessionMap = new Hashtable<String, String>();
-       ObjectMapper mapper = new ObjectMapper();
-
-       @OnMessage
-       public void message(String message, Session session) {
-               try {
-                       // JSONObject jsonObject = new JSONObject(message);
-                       @SuppressWarnings("unchecked")
-                       Map<String, Object> jsonObject = mapper.readValue(message, Map.class);
-                       try {
-                               Object from = jsonObject.get("from");
-                               if (from != null) {
-                                       if(channelMap.get(from.toString()) == null) {
-                                               channelMap.put(from.toString(), session);
-                                               sessionMap.put(session.getId(), from.toString());
-                                       }
-                               }
-                       } catch (Exception je) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to read value" + je.getMessage());
-                       }
-
-                       try {
-                               Object to = jsonObject.get("to");
-                               if (to == null)
-                                       return;
-                               Object toSessionObj = channelMap.get(to);
-                               if (toSessionObj != null) {
-                                       Session toSession = null;
-                                       toSession = (Session) toSessionObj;
-                                       toSession.getBasicRemote().sendText(message);
-                               }
-
-                       } catch (Exception ex) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "Failed to send text" + ex.getMessage());
-                       }
-
-               } catch (Exception ex) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "Failed" + ex.getMessage());
-               }
-
-       }
-
-       @OnOpen
-       public void open(Session session) {
-               logger.info(EELFLoggerDelegate.debugLogger, "Channel opened");
-       }
-
-       @OnClose
-       public void close(Session session) {
-               String channel = sessionMap.get(session.getId());
-               if (channel != null) {
-                       Object sessObj = channelMap.get(channel);
-                       if (sessObj != null) {
-                               try {
-                                       ((Session) sessObj).close();
-                               } catch (IOException e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to close" + e.getMessage());
-                               }
-                       }
-                       channelMap.remove(channel);
-               }
-               logger.info(EELFLoggerDelegate.debugLogger, "Channel closed");
-       }
-
-}
-
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/AppsOSController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/AppsOSController.java
deleted file mode 100644 (file)
index 5cffe8c..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.JSONObject;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppService;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class AppsOSController extends AppsController {
-       
-       static final String FAILURE = "failure";
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsOSController.class);
-
-       @Autowired
-       AdminRolesService adminRolesService;
-       @Autowired
-       EPAppService appService;
-       @Autowired
-       PersUserAppService persUserAppService;
-       @Autowired
-       UserService userService;
-
-       
-       
-       /**
-        * Create new application's contact us details.
-        * 
-        * @param contactUs
-        * @return
-        */
-       @RequestMapping(value = "/portalApi/saveNewUser", method = RequestMethod.POST, produces = "application/json")
-       public PortalRestResponse<String> saveNewUser(HttpServletRequest request,@RequestBody EPUser newUser) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               if (newUser == null)
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE,
-                                       "New User cannot be null or empty");
-               
-               if (!(adminRolesService.isSuperAdmin(user) || adminRolesService.isAccountAdmin(user))){
-                       if(!user.getLoginId().equalsIgnoreCase(newUser.getLoginId()))
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, FAILURE,
-                                               "UnAuthorized");
-               }
-                       
-        String checkDuplicate = request.getParameter("isCheck");
-               String saveNewUser = FAILURE;
-               try {
-                       saveNewUser = userService.saveNewUser(newUser,checkDuplicate);
-               } catch (Exception e) {
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, saveNewUser, e.getMessage());
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, saveNewUser, "");
-       }
-       
-       @RequestMapping(value = { "/portalApi/currentUserProfile/{loginId}" }, method = RequestMethod.GET, produces = "application/json")
-       public String getCurrentUserProfile(HttpServletRequest request, @PathVariable("loginId") String loginId) {
-               
-               Map<String,String> map = new HashMap<String,String>();
-               EPUser user = null;
-               try {
-                        user = (EPUser) userService.getUserByUserId(loginId).get(0);
-                        map.put("firstName", user.getFirstName());
-                    map.put("lastName", user.getLastName());
-                    map.put("email", user.getEmail());
-                        map.put("loginId", user.getLoginId());
-                        map.put("loginPwd",user.getLoginPwd());
-                        map.put("middleInitial",user.getMiddleInitial());
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "Failed to get user info", e);
-               }
-
-               JSONObject j = new JSONObject(map);;
-               return j.toString();
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultController.java
deleted file mode 100644 (file)
index 313ae68..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.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.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/portalApi/search")
-public class DashboardSearchResultController extends EPRestrictedBaseController {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(DashboardSearchResultController.class);
-
-       @Autowired
-       private DashboardSearchService searchService;
-
-       /**
-        * Gets all widgets by type: NEW or RESOURCE
-        * 
-        * @param request
-        * @param resourceType
-        *            Request parameter.
-        * @return Rest response wrapped around a CommonWidgetMeta object.
-        */
-       @RequestMapping(value = "/widgetData", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<CommonWidgetMeta> getWidgetData(HttpServletRequest request,
-                       @RequestParam String resourceType) {
-               return new PortalRestResponse<CommonWidgetMeta>(PortalRestStatusEnum.OK, "success",
-                               searchService.getWidgetData(resourceType));
-       }
-
-       /**
-        * Saves all: news and resources
-        * 
-        * @param commonWidgetMeta
-        *            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")
-       public PortalRestResponse<String> saveWidgetDataBulk(@RequestBody CommonWidgetMeta commonWidgetMeta) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetDataBulk: argument is {}", commonWidgetMeta);
-               if (commonWidgetMeta.getCategory() == null || commonWidgetMeta.getCategory().trim().equals(""))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
-                                       "Category cannot be null or empty");
-               // validate dates
-               for (CommonWidget cw : commonWidgetMeta.getItems()) {
-                       String err = validateCommonWidget(cw);
-                       if (err != null)
-                               return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
-               }
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.saveWidgetDataBulk(commonWidgetMeta));
-       }
-
-       /**
-        * Saves one: news or resource
-        * 
-        * @param commonWidget
-        *            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")
-       public PortalRestResponse<String> saveWidgetData(@RequestBody CommonWidget commonWidget) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "saveWidgetData: argument is {}", commonWidget);
-               if (commonWidget.getCategory() == null || commonWidget.getCategory().trim().equals(""))
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, "ERROR",
-                                       "Cateogry cannot be null or empty");
-               String err = validateCommonWidget(commonWidget);
-               if (err != null)
-                       return new PortalRestResponse<String>(PortalRestStatusEnum.ERROR, err, null);
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.saveWidgetData(commonWidget));
-       }
-
-       /**
-        * Used by the validate function
-        */
-       private final SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd");
-
-       /**
-        * Validates the content of a common widget.
-        * 
-        * @param cw
-        * @return null on success; an error message if validation fails.
-        * @throws Exception
-        */
-       private String validateCommonWidget(CommonWidget cw) {
-               try {
-                       if (cw.getEventDate() != null && cw.getEventDate().trim().length() > 0)
-                               yearMonthDayFormat.parse(cw.getEventDate());
-               } catch (ParseException ex) {
-                       return ex.toString();
-               }
-               return null;
-       }
-
-       /**
-        * Deletes one: news or resource
-        * 
-        * @param commonWidget
-        *            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")
-       public PortalRestResponse<String> deleteWidgetData(@RequestBody CommonWidget commonWidget) {
-               logger.debug(EELFLoggerDelegate.debugLogger, "deleteWidgetData: argument is {}", commonWidget);
-               return new PortalRestResponse<String>(PortalRestStatusEnum.OK, "success",
-                               searchService.deleteWidgetData(commonWidget));
-       }
-
-       /**
-        * Searches all portal for the input string.
-        * 
-        * @param request
-        * @param searchString
-        * @return Rest response wrapped around a Map of String to List of Search
-        *         Result Item.
-        */
-       @RequestMapping(value = "/allPortal", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<Map<String, List<SearchResultItem>>> searchPortal(HttpServletRequest request,
-                       @RequestParam String searchString) {
-
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (user == null) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR,
-                                               "searchPortal: User object is null? - check logs",
-                                               new HashMap<String, List<SearchResultItem>>());
-                       } else if (searchString == null || searchString.trim().length() == 0) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "searchPortal: String string is null",
-                                               new HashMap<String, List<SearchResultItem>>());
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "searchPortal: user {}, search string '{}'",
-                                               user.getLoginId(), searchString);
-                               Map<String, List<SearchResultItem>> results = searchService.searchResults(user.getLoginId(),
-                                               searchString);
-                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success", results);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchPortal failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
-                                       new HashMap<String, List<SearchResultItem>>());
-               }
-       }
-
-       /**
-        * Gets all active users.
-        * 
-        * TODO: should only the superuser be allowed to use this API?
-        * 
-        * @param request
-        * @return Rest response wrapped around a list of String
-        */
-       @RequestMapping(value = "/activeUsers", method = RequestMethod.GET, produces = "application/json")
-       public List<String> getActiveUsers(HttpServletRequest request) {
-               List<String> activeUsers = null;
-               List<String> onlineUsers = new ArrayList<>();
-               try {
-                       EPUser user = EPUserUtils.getUserSession(request);
-                       String userId = user.getOrgUserId();
-
-                       activeUsers = searchService.getRelatedUsers(userId);
-                       HashSet<String> usersSet = CollaborateList.getInstance().getAllUserName();
-                       for (String users : activeUsers) {
-                               if (usersSet.contains(users)) {
-                                       onlineUsers.add(users);
-                               }
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getActiveUsers failed", e);
-               }
-               return onlineUsers;
-       }
-
-       /**
-        * Gets only those users that are 'related' to the currently logged-in user.
-        * 
-        * @param request
-        * @return Rest response wrapped around a List of String
-        */
-       @RequestMapping(value = "/relatedUsers", method = RequestMethod.GET, produces = "application/json")
-       public PortalRestResponse<List<String>> activeUsers(HttpServletRequest request) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               try {
-                       if (user == null) {
-                               return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, "User object is null? - check logs",
-                                               new ArrayList<>());
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "activeUsers: searching for user {}", user.getLoginId());
-                               return new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",
-                                               searchService.getRelatedUsers(user.getLoginId()));
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "activeUsers failed", e);
-                       return new PortalRestResponse<>(PortalRestStatusEnum.ERROR, e.getMessage() + " - check logs.",
-                                       new ArrayList<>());
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulController.java
deleted file mode 100644 (file)
index 9562366..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedRESTfulBaseController;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.portal.utils.PortalConstants;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-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.RestController;
-
-@RestController
-@RequestMapping(PortalConstants.REST_AUX_API)
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class ExternalAppsRestfulController extends EPRestrictedRESTfulBaseController {
-       
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExternalAppsRestfulController.class);
-       
-       @Autowired
-       FunctionalMenuService functionalMenuService;
-       
-       @Autowired
-       EPLoginService epLoginService;
-       
-       @Autowired
-       AdminRolesService adminRolesService;
-       
-       @RequestMapping(value={"/getFavorites"}, method = RequestMethod.GET,produces = "application/json")
-       public List<FavoritesFunctionalMenuItemJson> getFavoritesForUser(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               String loginId                  = "";
-               String userAgent                = "";
-               List<FavoritesFunctionalMenuItemJson> favorites = null;
-               
-               loginId                 = request.getHeader(EPSystemProperties.MDC_LOGIN_ID);
-               userAgent               = MDC.get(EPSystemProperties.PARTNER_NAME);
-                               
-               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
-               logger.info(EELFLoggerDelegate.errorLogger, "getFavorites request was received from " + userAgent + " for the user " + loginId + ".");
-               if (epUser==null || epUser.getId()==null) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "No User record found for the LoginId '" + loginId + "' in the database.");
-                       throw new Exception("Received null for Login-Id.");
-               } else {
-                       favorites = functionalMenuService.getFavoriteItems(epUser.getId());
-                       FieldsValidator fieldsValidator = new FieldsValidator();
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-                       
-                       EcompPortalUtils.logAndSerializeObject("/auxapi/getFavorites", "result = ", favorites);
-               }
-               
-               return favorites;
-       }
-       
-       @RequestMapping(value={"/functionalMenuItemsForUser"}, method = RequestMethod.GET,produces = "application/json")
-       public List<FunctionalMenuItem> getFunctionalMenuItemsForUser(HttpServletRequest request, HttpServletResponse response) throws Exception {
-               String loginId                  = "";
-               String userAgent                = "";
-               List<FunctionalMenuItem> fnMenuItems = null;
-               
-               loginId                 = request.getHeader("LoginId");
-               userAgent               = MDC.get(EPSystemProperties.PARTNER_NAME);
-
-               EPUser epUser = epLoginService.findUserWithoutPwd(loginId);
-               logger.info(EELFLoggerDelegate.errorLogger, "getFunctionalMenuItemsForUser request was received from " + userAgent + " for the user " + loginId + ".");
-               if (epUser==null || epUser.getId()==null) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "No User record found for the LoginId '" + loginId + "' in the database.");
-                       throw new Exception("Received null for Login-Id.");
-               } else if (adminRolesService.isSuperAdmin(epUser)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
-                       fnMenuItems = functionalMenuService.getFunctionalMenuItems();
-               }
-               else {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
-                       fnMenuItems = functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId());
-               }
-               
-               FieldsValidator fieldsValidator = new FieldsValidator();
-               response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               
-               EcompPortalUtils.logAndSerializeObject("/auxapi/functionalMenuItemsForUser", "result = ", fnMenuItems);
-               
-               return fnMenuItems;
-       }
-       
-       @ExceptionHandler(Exception.class)
-       protected void handleBadRequests(Exception e, HttpServletResponse response) throws IOException {
-               logger.warn(EELFLoggerDelegate.errorLogger, "Handling bad request", e);
-               response.sendError(HttpStatus.BAD_REQUEST.value(), e.getMessage());
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/controller/PortalAdminController.java
deleted file mode 100644 (file)
index d2585ab..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.controller.EPRestrictedBaseController;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.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.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class PortalAdminController extends EPRestrictedBaseController {
-       @Autowired
-       PortalAdminService portalAdminService;
-       @Autowired
-       AdminRolesService adminRolesService;
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PortalAdminController.class);
-
-       @RequestMapping(value = { "/portalApi/portalAdmins" }, method = RequestMethod.GET, produces = "application/json")
-       public List<PortalAdmin> getPortalAdmins(HttpServletRequest request, HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<PortalAdmin> portalAdmins = null;
-               if (user == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, null user");
-                       EcompPortalUtils.setBadPermissions(user, response, "getPortalAdmins");
-               } else if (!adminRolesService.isSuperAdmin(user)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.getPortalAdmins, bad permissions");
-                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
-               } else {
-                       // return the list of portal admins
-                       portalAdmins = portalAdminService.getPortalAdmins();
-                       logger.debug(EELFLoggerDelegate.debugLogger, "portalAdmins: called getPortalAdmins()");
-                       EcompPortalUtils.logAndSerializeObject("/portalApi/getPortalAdmins", "result =", portalAdmins);
-               }
-
-               return portalAdmins;
-       }
-
-       /**
-        * RESTful service method to create a new portal admin. Requirement: you
-        * must be the Ecomp portal super admin user.
-        */
-
-       @RequestMapping(value = { "/portalApi/portalAdmin" }, method = RequestMethod.POST)
-       public FieldsValidator createPortalAdmin(HttpServletRequest request, @RequestBody String userid,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               if (user == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin, null user");
-                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
-               } else if (!adminRolesService.isSuperAdmin(user)) {
-                       logger.debug(EELFLoggerDelegate.debugLogger, "PortalAdminController.createPortalAdmin bad permissions");
-                       EcompPortalUtils.setBadPermissions(user, response, "createPortalAdmin");
-               } else {
-                       fieldsValidator = portalAdminService.createPortalAdmin(userid);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               }
-               EcompPortalUtils.logAndSerializeObject("/portalAdmin", "POST result =", response.getStatus());
-
-               return fieldsValidator;
-       }
-
-       @RequestMapping(value = { "/portalApi/portalAdmin/{orgUserId}" }, method = RequestMethod.DELETE)
-       public FieldsValidator deletePortalAdmin(HttpServletRequest request, @PathVariable("orgUserId") Long orgUserId,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               FieldsValidator fieldsValidator = null;
-               if (!adminRolesService.isSuperAdmin(user)) {
-                       EcompPortalUtils.setBadPermissions(user, response, "deletePortalAdmin");
-               } else {
-                       fieldsValidator = portalAdminService.deletePortalAdmin(orgUserId);
-                       response.setStatus(fieldsValidator.httpStatusCode.intValue());
-               }
-               EcompPortalUtils.logAndSerializeObject("/portalAdmin", "DELETE result =", response.getStatus());
-
-               return fieldsValidator;
-       }
-       
-       @RequestMapping(value = { "/portalApi/adminAppsRoles/{appId}" }, method = RequestMethod.GET, produces = "application/json")
-       public List<EPRole> getRolesByApp(HttpServletRequest request, @PathVariable("appId") Long appId,
-                       HttpServletResponse response) {
-               EPUser user = EPUserUtils.getUserSession(request);
-               List<EPRole> rolesByApp = null;
-
-               try {
-                       if (user == null) {
-                               EcompPortalUtils.setBadPermissions(user, response, "getUserApps");
-                       } else {
-                               rolesByApp = adminRolesService.getRolesByApp(user, appId);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "getRolesByApp failed", e);
-               }
-
-               return rolesByApp;
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/interceptor/SessionTimeoutInterceptor.java
deleted file mode 100644 (file)
index 61b98e4..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.interceptor;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.authentication.LoginStrategy;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalapp.util.SessionCookieUtil;
-import org.openecomp.portalsdk.core.controller.FusionBaseController;
-import org.openecomp.portalsdk.core.domain.support.CollaborateList;
-import org.openecomp.portalsdk.core.exception.SessionExpiredException;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
-
-public class SessionTimeoutInterceptor extends HandlerInterceptorAdapter {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionTimeoutInterceptor.class);
-
-       @Autowired
-       private LoginStrategy loginStrategy;
-
-       public SessionTimeoutInterceptor() {
-       }
-
-       public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
-                       throws Exception {
-
-               if (!isHandlerMethod(handler))
-                       return false;
-
-               HandlerMethod method = (HandlerMethod) handler;
-
-               if (!isFusionController(method.getBean()))
-                       return false;
-
-               if (method.getBean() instanceof FusionBaseController) {
-                       FusionBaseController controller = (FusionBaseController) method.getBean();
-
-                       if (!controller.isAccessible()) {
-                               try {
-                                       EPUser user = EPUserUtils.getUserSession(request);
-
-                                       if (request.getRequestURI().indexOf("logout.htm") > -1) {
-                                               CollaborateList.delUserName(user.getOrgUserId());
-                                               throw new SessionExpiredException();
-                                       } else {
-                                               resetSessionMaxIdleTimeOut(request);
-                                               CollaborateList.addUserName(user.getOrgUserId());
-                                       }
-                               } catch (Exception e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "preHandle failed", e);
-                                       return false;
-                               }
-
-                       }
-
-               }
-
-               return true;
-       }
-
-       private void resetSessionMaxIdleTimeOut(HttpServletRequest request) {
-               SessionCookieUtil.resetSessionMaxIdleTimeOut(request);
-
-       }
-
-       private boolean isFusionController(Object controller) {
-               if (controller instanceof FusionBaseController)
-                       return true;
-               return false;
-       }
-
-       private boolean isHandlerMethod(Object controller) {
-               if (controller instanceof HandlerMethod)
-                       return true;
-               return false;
-       }
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/logging/aop/EPEELFLoggerAspect.java
deleted file mode 100644 (file)
index 0970ec4..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.logging.aop;
-
-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.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum;
-import org.springframework.beans.factory.annotation.Autowired;
-
-@Aspect
-@org.springframework.context.annotation.Configuration
-public class EPEELFLoggerAspect {
-       
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPEELFLoggerAspect.class);
-
-       @Autowired
-       EPEELFLoggerAdvice epAdvice;
-       
-       /*
-        * Point-cut expression to handle all INCOMING_REST_MESSAGES
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.portal.controller.*.*(..))")
-       public void incomingAuditMessages() {}
-       
-       /*
-        * Handles all INCOMING_REST_MESSAGES from kpiDashboard
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.kpidash.controller.*.*(..))")
-       public void kpiDashboardAuditMessages() {}
-
-       /*
-        * Point-cut expression to handle all session management INCOMING_REST_MESSAGES
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.controller.sessionmgt.*.*(..))")
-       public void sessionMgtIncomingAuditMessages() {}
-       
-       /*
-        * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.controller.core.UserProfileController.*(..))")
-       public void userProfileIncomingAuditMessages() {}
-       
-       /*
-        * Point-cut expression to handle UserProfileController INCOMING_REST_MESSAGES
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.controller.ONAPWelcomeController.*(..))")
-       public void welcomeIncomingAuditMessages() {}
-       
-       /*
-        * Point-cut expression to handle INCOMING Logout Rest Messages
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.controller.ECOMPLogoutController.*(..))")
-       public void logoutAuditMessages() {}
-
-       
-       /*
-        * Point-cut expression which handles all the OUTGOING_REST_MESSAGES.
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.portal.service.ApplicationsRestClientServiceImpl.*(..))")
-       public void outgoingAuditMessages() {}
-       
-       /*
-        * Point-cut expression to handle all the session management OUTGOING_REST_MESSAGES.
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.service.sessionmgt.SessionCommunication.*(..))")
-       public void sessionMgtOutgoingAuditMessages() {}
-       
-       /*
-        * Point-cut expression which handles all the LDAP_PHONEBOOK_USER_SEARCH calls.
-        */
-       @Pointcut("execution(public * org.openecomp.portalapp.portal.service.EPLdapServiceImpl.*(..))")
-       public void phoneBookSearchAuditMessages() {}
-       
-       /*
-        * Handles Audit, Metrics & Debug logging for the point-cut
-        * expression defined at class-level
-        */
-       @Around("(incomingAuditMessages() || kpiDashboardAuditMessages() || sessionMgtIncomingAuditMessages() || "
-                       + "userProfileIncomingAuditMessages() || welcomeIncomingAuditMessages()) && @within(epAuditLog)")
-       public Object incomingAuditMessagesAroundClass(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
-       }
-       
-       /*
-        * Handles Audit, Metrics & Debug logging for the point-cut
-        * expression defined at class-level
-        */
-       @Around("(outgoingAuditMessages() || sessionMgtOutgoingAuditMessages()) && @within(epAuditLog)")
-       public Object outgoingAuditMessagesAroundClass(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.OUTGOING_REST_MESSAGE);
-       }
-       
-       
-       /*
-        * Handles Audit, Metrics & Debug logging for the point-cut
-        * expression defined at method-level
-        */
-       @Around("(outgoingAuditMessages() || sessionMgtOutgoingAuditMessages()) && @annotation(epAuditLog)")
-       public Object outgoingAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.OUTGOING_REST_MESSAGE);
-       }
-       
-       /*
-        * Handles Audit, Metrics & Debug logging for the point-cut
-        * expression defined at method-level
-        */
-       @Around("(incomingAuditMessages() || kpiDashboardAuditMessages() || sessionMgtIncomingAuditMessages() ||"
-                       + "userProfileIncomingAuditMessages() || welcomeIncomingAuditMessages()) && @annotation(epAuditLog)")
-       public Object incomingAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
-       }
-       
-       @Around("@annotation(epAuditLog)")
-       public Object loginAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.FE_LOGIN_ATTEMPT);
-       }
-       
-       @Around("logoutAuditMessages() && @annotation(epAuditLog)")
-       public Object logoutAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.FE_LOGOUT);
-       }
-       
-       @Around("phoneBookSearchAuditMessages() && @annotation(epAuditLog)")
-       public Object phonebookSearchAuditMessagesAroundMethod(ProceedingJoinPoint joinPoint, EPAuditLog epAuditLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, SecurityEventTypeEnum.LDAP_PHONEBOOK_USER_SEARCH);
-       }
-       
-       private Object logAroundMethod(ProceedingJoinPoint joinPoint, SecurityEventTypeEnum securityEventType) throws Throwable {
-               //Before
-               Object[] passOnArgs = new Object[] {joinPoint.getSignature().getDeclaringType().getName(), joinPoint.getSignature().getName()};
-               Object[] returnArgs = epAdvice.before(securityEventType, joinPoint.getArgs(), passOnArgs);
-               
-               //Call the actual method
-               Object result = null;
-               String statusCode = "COMPLETE";
-               String responseCode = "200";
-               try {
-                       result = joinPoint.proceed();
-               } catch(Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "logAroundMethod failed", e);
-                       statusCode = "ERROR";
-                       responseCode = "500"; //Internal server error
-               }
-               
-               //Check the result
-               if (securityEventType!=null) {
-                       if (result==null) {
-                               statusCode = "ERROR";
-                               //Check if there is an internal response code
-                               //and use it if the caller function has configured it.
-                               responseCode = epAdvice.getInternalResponseCode();
-                               if (responseCode==null||responseCode=="") {
-                                       responseCode = "500"; //Internal server error
-                               }
-                       } else if (result instanceof FieldsValidator) {
-                               FieldsValidator fieldsValidator = (FieldsValidator) result;
-                               if (fieldsValidator!=null && fieldsValidator.httpStatusCode!=null) {
-                                       responseCode = fieldsValidator.httpStatusCode.toString();
-                               }
-                       }
-               }
-               
-               //After
-               epAdvice.after(securityEventType, statusCode, responseCode, joinPoint.getArgs(), returnArgs, passOnArgs);
-               
-               return result;
-       }
-       
-       //Metrics Logging
-       @Pointcut("execution(* *(..))")
-    public void performMetricsLogging() {}
-       
-       @Around("performMetricsLogging() && @within(epMetricsLog)")
-       public Object metricsLoggingAroundClass(ProceedingJoinPoint joinPoint, EPMetricsLog epMetricsLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, null);
-       }
-       
-       @Around("performMetricsLogging() && @annotation(epMetricsLog)")
-       public Object metricsLoggingAroundMethod(ProceedingJoinPoint joinPoint, EPMetricsLog epMetricsLog) throws Throwable {
-               return this.logAroundMethod(joinPoint, null);
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheService.java
deleted file mode 100644 (file)
index 20f4d59..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-
-public interface AppsCacheService {
-       
-       /**
-        * returns an app by id from the cache
-        * @param appId
-        * @return corresponding App
-        */
-       EPApp getApp(Long appId);
-       
-       /**
-        * returns the corresponding application endpoint
-        * @param appId
-        * @return if appId exists in cache, then return corresponding application endpoint, null otherwise.
-        */
-       String getAppEndpoint(Long appId);
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/AppsCacheServiceImple.java
deleted file mode 100644 (file)
index 09a78e8..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("appsCacheService")
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class AppsCacheServiceImple implements AppsCacheService {
-       @Autowired
-       EPAppService appsService;
-       
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AppsCacheServiceImple.class);
-       
-       private static long updateTime = 0;
-       private static final int cacheUpdateIntervalInSeconds = 10;
-       
-       private static volatile Map<Long, EPApp> appsMap;
-       
-       @PostConstruct
-       public void init() {
-               this.refreshAppsMap();
-       }
-
-       private Map<Long, EPApp> refreshAppsMap() {
-               long now = System.currentTimeMillis();
-               
-               if(noNeedToUpdate(now))
-                       return null;
-               
-               synchronized (this) {
-                       if(noNeedToUpdate(now))
-                               return null;
-                       List<EPApp> allApps = appsService.getAppsFullList();
-                       Map<Long, EPApp> newAppsMap = new HashMap<Long, EPApp>();
-                       for (EPApp app : allApps) {
-                               newAppsMap.put(app.getId(), app);
-                       }
-                       // Switch cache with the new one.
-                       appsMap = newAppsMap;
-                       updateTime = now;
-               }
-               
-               return appsMap;
-       }
-
-       private boolean noNeedToUpdate(long now) {
-               long secondsPassed = (now - updateTime)/1000;
-               if(secondsPassed < cacheUpdateIntervalInSeconds){
-                       logger.debug(EELFLoggerDelegate.debugLogger, "no need to refresh yet, seconds since last refresh: " + secondsPassed + ", refresh interval (sec) = " + cacheUpdateIntervalInSeconds);
-                       return true; // no need to update cache
-               }
-               return false; // its time to update
-       }
-
-       @Override
-       public String getAppEndpoint(Long appId) {
-               refreshAppsMap();
-               EPApp app = appsMap.get(appId);
-               if(app != null)
-                       return app.getAppRestEndpoint();
-               return null;
-       }
-       
-       @Override
-       public EPApp getApp(Long appId) {
-               refreshAppsMap();
-               EPApp app = appsMap.get(appId);
-               if(app != null)
-                       return app;
-               return null;            
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/EPAppServiceImpl.java
deleted file mode 100644 (file)
index ea92ca5..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.net.MalformedURLException;
-import java.security.GeneralSecurityException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.TreeSet;
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.OnboardingApp;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.att.nsa.cambria.client.CambriaClientFactory;
-import com.att.nsa.cambria.client.CambriaTopicManager;
-
-@Service("epAppService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class EPAppServiceImpl extends EPAppCommonServiceImpl implements EPAppService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPAppServiceImpl.class);
-
-       private static Object syncRests = new Object();
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       @Override
-       public List<EPApp> getUserRemoteApps(String id) {
-               StringBuilder query = new StringBuilder();
-               query.append("SELECT * FROM FN_APP join FN_USER_ROLE ON FN_USER_ROLE.APP_ID = FN_APP.APP_ID where ");
-               query.append("FN_USER_ROLE.USER_ID = " + id + " AND FN_USER_ROLE.ROLE_ID != " + SUPER_ADMIN_ROLE_ID);
-               query.append(" AND FN_APP.ENABLED = 'Y'");
-               TreeSet<EPApp> distinctApps = new TreeSet<EPApp>();
-               @SuppressWarnings("unchecked")
-               List<EPApp> adminApps = dataAccessService.executeSQLQuery(query.toString(), EPApp.class, null);
-               for (EPApp app : adminApps) {
-                       distinctApps.add(app);
-               }
-               List<EPApp> userApps = new ArrayList<EPApp>();
-               userApps.addAll(distinctApps);
-               return userApps;
-       }
-
-       @Override
-       protected void updateRestrictedApp(Long appId, OnboardingApp onboardingApp, FieldsValidator fieldsValidator,
-                       EPUser user) {
-               synchronized (syncRests) {
-                       boolean result = false;
-                       Session localSession = null;
-                       Transaction transaction = null;
-                       try {
-                               localSession = sessionFactory.openSession();
-                               transaction = localSession.beginTransaction();
-                               EPApp app;
-                               if (appId == null) {
-                                       app = new EPApp();
-                                       /*
-                                        * In the parent class, the UEB code is responsible for generating the
-                                        * keys/secret/mailbox but UEB Messaging is not actually being used currently;
-                                        * may be used in future at which point we can just remove this method and
-                                        * depend on parent class's method So, using UUID generator to generate the
-                                        * unique key instead.
-                                        */
-                                       String uuidStr = UUID.randomUUID().toString();
-                                       String appKey = uuidStr;
-                                       String appSecret = uuidStr;
-                                       String appMailboxName = "ECOMP-PORTAL-OUTBOX";
-                                       onboardingApp.setUebTopicName(appMailboxName);
-                                       onboardingApp.setUebKey(appKey);
-                                       onboardingApp.setUebSecret(appSecret);
-                               } else {
-                                       app = (EPApp) localSession.get(EPApp.class, appId);
-                                       if (app == null || app.getId() == null) {
-                                               // App is already deleted!
-                                               transaction.commit();
-                                               localSession.close();
-                                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_NOT_FOUND);
-                                               return;
-                                       }
-                               }
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "updateRestrictedApp: about to call createAppFromOnboarding");
-                               createAppFromOnboarding(app, onboardingApp, localSession);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "updateRestrictedApp: finished calling createAppFromOnboarding");
-                               localSession.saveOrUpdate(app);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "updateRestrictedApp: finished calling localSession.saveOrUpdate");
-                               // Enable or disable all menu items associated with this app
-                               setFunctionalMenuItemsEnabled(localSession, onboardingApp.isEnabled, appId);
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "updateRestrictedApp: finished calling setFunctionalMenuItemsEnabled");
-                               transaction.commit();
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "updateRestrictedApp: finished calling transaction.commit");
-                               result = true;
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "updateRestrictedApp failed", e);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeUebRegisterOnboardingAppError, e);
-                               EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeDaoSystemError, e);
-                               EcompPortalUtils.rollbackTransaction(transaction,
-                                               "updateRestrictedApp rollback, exception = " + e.toString());
-                       } finally {
-                               EcompPortalUtils.closeLocalSession(localSession, "updateRestrictedApp");
-                       }
-                       if (!result) {
-                               fieldsValidator.httpStatusCode = new Long(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                       }
-               }
-
-       }
-
-       @Override
-       public CambriaTopicManager getTopicManager(List<String> urlList, String key, String secret)
-                       throws MalformedURLException, GeneralSecurityException {
-               return CambriaClientFactory.createTopicManager(null, urlList, key, secret);
-       }
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchService.java
deleted file mode 100644 (file)
index 07dc8cc..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-
-public interface SearchService {
-
-       public String searchUsersInPhoneBook(String searchString);
-       
-       public String searchUsersInFnTable(String searchString);
-
-       public List<UserWithNameSurnameTitle> searchUsersByName(EPUser attrUser);
-       
-       public List<UserWithNameSurnameTitle> searchUsersByUserId(EPUser attrUser);
-       
-       public EPUser searchUserByUserId(String orgUserId);
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/SearchServiceImpl.java
deleted file mode 100644 (file)
index 0929c48..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Service("searchService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class SearchServiceImpl implements SearchService {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SearchServiceImpl.class);
-       
-       // TODO: the values below should be defined in other place
-       private static final int maxSizeOfSearchResult = 100;
-
-       @Autowired
-       UserService userService;
-
-       @Override
-       public String searchUsersInPhoneBook(String searchString) {
-               return searchUsersInFnTable(searchString);
-       }
-       
-       @Override
-       public String searchUsersInFnTable(String searchString) {
-               String orgUserId = null;
-               List<String> tokens = EcompPortalUtils.parsingByRegularExpression(searchString, " ");
-               for (int i = 0; i < tokens.size(); i++) { // find userid if possible and remove it from tokens
-                       if (tokens.get(i).matches(".*\\d+.*")) {
-                               orgUserId = tokens.get(i);
-                               tokens.remove(i);
-                       }
-               }
-               while (tokens.size() > 2) { // we use no more then first 2 tokens (userId is removed, see above)
-                       tokens.remove(tokens.size() - 1);
-               }
-               EPUser attrUser = new EPUser();
-               attrUser.setOrgUserId(orgUserId);
-               List<UserWithNameSurnameTitle> resultOfSearch = new ArrayList<UserWithNameSurnameTitle>(), resultOfAdditionalSearch = null;
-               if (tokens.size() == 2) {
-                       attrUser.setFirstName(tokens.get(0));
-                       attrUser.setLastName(tokens.get(1));
-                       resultOfSearch = this.searchUsersByName(attrUser);
-                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
-                       resultOfSearch = this.removeWrongLastNames(resultOfSearch, tokens.get(1));
-                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
-                               attrUser.setFirstName(tokens.get(1));
-                               attrUser.setLastName(tokens.get(0));
-                               resultOfAdditionalSearch = this.searchUsersByName(attrUser);
-                               resultOfAdditionalSearch = this.removeWrongFirstNames(resultOfAdditionalSearch, tokens.get(1));
-                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
-                       }
-               } else if (tokens.size() == 1) {
-                       attrUser.setFirstName(tokens.get(0));
-                       resultOfSearch = this.searchUsersByName(attrUser);
-                       resultOfSearch = this.removeWrongFirstNames(resultOfSearch, tokens.get(0));
-                       if (resultOfSearch.size() < maxSizeOfSearchResult) {
-                               attrUser.setFirstName(null);
-                               attrUser.setLastName(tokens.get(0));
-                               resultOfAdditionalSearch = this.searchUsersByName(attrUser);
-                               resultOfAdditionalSearch = this.removeWrongLastNames(resultOfAdditionalSearch, tokens.get(0));
-                       }
-               } else if (orgUserId != null) {
-                       resultOfSearch = this.searchUsersByUserId(attrUser);
-               }
-               if (resultOfAdditionalSearch != null) {
-                       resultOfSearch.addAll(resultOfAdditionalSearch);
-               }
-               resultOfSearch = this.cutSearchResultToMaximumSize(resultOfSearch);
-               ObjectMapper mapper = new ObjectMapper();
-               String result = "[]";
-               try {
-                       result = mapper.writeValueAsString(resultOfSearch);
-               } catch (JsonProcessingException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersInFnTable failed", e);
-               }
-               return result;
-       }
-
-       
-       @SuppressWarnings("rawtypes")
-       public List<UserWithNameSurnameTitle> searchUsersByUserId(EPUser attrUser) {
-               List<UserWithNameSurnameTitle> foundUsers = new ArrayList<UserWithNameSurnameTitle>();
-               try {
-                       List searchResult = this.userService.getUserByUserId(attrUser.getOrgUserId());
-                       for (Object obj : searchResult) {
-                               EPUser user = (EPUser) obj;
-                               UserWithNameSurnameTitle foundUser = new UserWithNameSurnameTitle(user.getOrgUserId(), user.getFirstName(), user.getLastName(), user.getJobTitle());
-                               foundUsers.add(foundUser);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByUserId failed", e);
-               }
-               return foundUsers;
-       }
-       
-       @SuppressWarnings("rawtypes")
-       public List<UserWithNameSurnameTitle> searchUsersByName(EPUser attrUser) {
-               List<UserWithNameSurnameTitle> foundUsers = new ArrayList<UserWithNameSurnameTitle>();
-               try {
-                       List searchResult = this.userService.getUserByFirstLastName(attrUser.getFirstName(),attrUser.getLastName());
-                       for (Object obj : searchResult) {
-                               EPUser user = (EPUser) obj;
-                               UserWithNameSurnameTitle foundUser = new UserWithNameSurnameTitle(user.getOrgUserId(), user.getFirstName(), user.getLastName(), user.getJobTitle());
-                               foundUsers.add(foundUser);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUsersByName failed", e);
-               }
-               return foundUsers;
-       }
-
-       private List<UserWithNameSurnameTitle> removeWrongFirstNames(List<UserWithNameSurnameTitle> resultOfSearch, String firstName) {
-               firstName = firstName.toUpperCase();
-               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
-                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
-                       if ((user.firstName == null) || !user.firstName.toUpperCase().startsWith(firstName)) {
-                               resultOfSearch.remove(i);
-                       }
-               }
-               return resultOfSearch;
-       }
-
-       private List<UserWithNameSurnameTitle> removeWrongLastNames(List<UserWithNameSurnameTitle> resultOfSearch, String lastName) {
-               lastName = lastName.toUpperCase();
-               for (int i = resultOfSearch.size() - 1; i >= 0; i--) {
-                       UserWithNameSurnameTitle user = resultOfSearch.get(i);
-                       if ((user.lastName == null) || !user.lastName.toUpperCase().startsWith(lastName)) {
-                               resultOfSearch.remove(i);
-                       }
-               }
-               return resultOfSearch;
-       }
-
-       private List<UserWithNameSurnameTitle> cutSearchResultToMaximumSize(List<UserWithNameSurnameTitle> resultOfSearch) {
-               for (int i = resultOfSearch.size() - 1; i >= maxSizeOfSearchResult; i--) {
-                       resultOfSearch.remove(i);
-               }
-               return resultOfSearch;
-       }
-
-
-       @SuppressWarnings("rawtypes")
-       @Override
-       public EPUser searchUserByUserId(String orgUserId) {
-               List<EPUser> foundUsers = new ArrayList<EPUser>();
-               try {
-                       List searchResult = this.userService.getUserByUserId(orgUserId);
-                       for (Object obj : searchResult) {
-                               EPUser user = (EPUser) obj;
-                               foundUsers.add(user);
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "searchUserByUserId failed", e);
-                       return null;
-               }
-               return foundUsers.get(0);
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/TicketEventServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/TicketEventServiceImpl.java
deleted file mode 100644 (file)
index 446bb60..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.stereotype.Service;
-
-import com.fasterxml.jackson.databind.JsonNode;
-
-@Service("ticketService")
-public class TicketEventServiceImpl implements TicketEventService{
-
-       @Override
-       public String getNotificationHyperLink(JsonNode application, String ticket, String eventSource) {
-               String hyperlink = SystemProperties.getProperty(EPCommonSystemProperties.EXTERNAL_SYSTEM_NOTIFICATION_URL)+ticket;
-               return hyperlink;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserRolesServiceImpl.java
deleted file mode 100644 (file)
index 41b320c..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.apache.cxf.transport.http.HTTPException;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.domain.EPUserApp;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Service("userRolesService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class UserRolesServiceImpl extends UserRolesCommonServiceImpl implements UserRolesService {
-
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserRolesServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-       
-       private EPUser getUserFromRemoteApp(String orgUserId, EPApp app,
-                       ApplicationsRestClientService applicationsRestClientService) throws HTTPException {
-               EPUser user = applicationsRestClientService.get(EPUser.class, app.getId(),
-                               String.format("/user/%s", orgUserId));
-               return user;
-       }
-
-       private static void createNewUserOnRemoteApp(String orgUserId, EPApp app,
-                       ApplicationsRestClientService applicationsRestClientService, SearchService searchService,
-                       ObjectMapper mapper) throws Exception {
-               EPUser client = searchService.searchUserByUserId(orgUserId);
-               if (client == null) {
-                       String msg = "cannot create user " + orgUserId + ", because he/she cannot be found in phonebook.";
-                       logger.error(EELFLoggerDelegate.errorLogger, msg);
-                       throw new Exception(msg);
-               }
-               client.setLoginId(orgUserId);
-               client.setActive(true);
-               // The remote doesn't care about other apps, and this has caused
-               // serialization problems - infinite recursion.
-               client.getEPUserApps().clear();
-               mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
-               String userAsString = mapper.writeValueAsString(client);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               "about to post new client to remote application, users json = " + userAsString);
-               applicationsRestClientService.post(EPUser.class, app.getId(), userAsString, String.format("/user", orgUserId));
-       }
-
-       public static void persistExternalRoleInEcompDb(EPRole externalAppRole, Long appId, EPRoleService roleService) {
-               externalAppRole.setAppId(appId);
-               externalAppRole.setAppRoleId(externalAppRole.getId());
-               externalAppRole.setId(null); // We will persist a new role, with ecomp
-                                                                               // role id which will be different than
-                                                                               // external app role id.
-
-               roleService.saveRole(externalAppRole);
-               logger.debug(EELFLoggerDelegate.debugLogger,
-                               String.format("ECOMP persists role from app:%d, app roleId: %d, roleName: %s", appId,
-                                               externalAppRole.getAppRoleId(), externalAppRole.getName()));
-       }
-
-       @Override
-       public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId) {
-               // Find the records for this user-app combo, if any
-               String filter = " where user_id = " + Long.toString(userId) + " and app_id = " + Long.toString(appId);
-               @SuppressWarnings("unchecked")
-               List<EPUserApp> roleList = dataAccessService.getList(EPUserApp.class, filter, null, null);
-               logger.debug(EELFLoggerDelegate.debugLogger, "getCachedAppRolesForUser: list size is {}", roleList.size());
-               return roleList;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserService.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserService.java
deleted file mode 100644 (file)
index 69ea652..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public interface UserService {
-       
-       List getUserByUserId(String orgUserId);
-       
-       List getUserByFirstLastName(String firstName, String lastName);
-       
-       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception;
-       
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/UserServiceImpl.java
deleted file mode 100644 (file)
index 9cc9746..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalsdk.core.FusionObject.Utilities;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service("userService")
-@Transactional
-public class UserServiceImpl implements UserService {
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(UserServiceImpl.class);
-
-       @Autowired
-       private DataAccessService dataAccessService;
-
-       public DataAccessService getDataAccessService() {
-               return dataAccessService;
-       }
-
-       public void setDataAccessService(DataAccessService dataAccessService) {
-               this.dataAccessService = dataAccessService;
-       }
-
-       @SuppressWarnings("rawtypes")
-       @Override
-       public List getUserByUserId(String userId) {
-
-               if (SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
-                       List<EPUser> users = new ArrayList<EPUser>();
-                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
-                       BufferedReader in = null;
-                       HttpURLConnection con = null;
-                       try {
-                               String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
-                               URL obj = new URL(url);
-
-                               con = (HttpURLConnection) obj.openConnection();
-
-                               // optional default is GET
-                               con.setRequestMethod("GET");
-                               con.setConnectTimeout(3000);
-                               con.setReadTimeout(8000);
-
-                               StringBuffer response = new StringBuffer();
-
-                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
-                               String inputLine;
-                               while ((inputLine = in.readLine()) != null)
-                                       response.append(inputLine);
-                               JSONObject jObject = new JSONObject(response.toString()); // json
-                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
-                               for (int i = 0; i < jsonUsers.length(); i++) {
-                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
-                                       EPUser eachUser = new EPUser();
-                                       eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
-                                       eachUser.setFirstName(eachObject.get("givenName").toString());
-                                       eachUser.setLastName(eachObject.get("familyName").toString());
-                                       eachUser.setEmail(eachObject.get("email").toString());
-                                       users.add(eachUser);
-                               }
-
-                               for (int i = 0; i < users.size(); i++) {
-
-                                       if (Utilities.nvl(userId).length() > 0) {
-                                               if (!userId.equalsIgnoreCase(users.get(i).getOrgUserId())) {
-                                                       continue;
-                                               }
-                                       }
-                                       filterdUsers.add(users.get(i));
-
-                               }
-
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId failed", e);
-                       } finally {
-                               try {
-                                       in.close();
-                                       con.disconnect();
-                               } catch (IOException e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByUserId 2 failed", e);
-                               }
-                       }
-
-                       return filterdUsers;
-
-               } else {
-
-                       List list = null;
-                       StringBuffer criteria = new StringBuffer();
-                       criteria.append(" where org_user_id = '").append(userId).append("'");
-                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
-                       return (list == null || list.size() == 0) ? null : list;
-
-               }
-
-       }
-
-       @SuppressWarnings("rawtypes")
-       @Override
-       public List getUserByFirstLastName(String firstName, String lastName) {
-
-               if (!SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM).trim().equalsIgnoreCase("OIDC")) {
-
-                       List list = null;
-                       StringBuffer criteria = new StringBuffer();
-                       if (firstName != null)
-                               criteria.append(" where first_name = '").append(firstName).append("'");
-                       if (lastName != null)
-                               criteria.append(" where last_name = '").append(lastName).append("'");
-                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
-                       return (list == null || list.size() == 0) ? null : list;
-
-               } else {
-
-                       List<EPUser> users = new ArrayList<EPUser>();
-                       List<EPUser> filterdUsers = new ArrayList<EPUser>();
-                       BufferedReader in = null;
-                       HttpURLConnection con = null;
-                       try {
-                               String url = EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER);
-                               URL obj = new URL(url);
-
-                               con = (HttpURLConnection) obj.openConnection();
-
-                               // optional default is GET
-                               con.setRequestMethod("GET");
-                               con.setConnectTimeout(3000);
-                               con.setReadTimeout(8000);
-
-                               StringBuffer response = new StringBuffer();
-
-                               in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
-                               String inputLine;
-                               while ((inputLine = in.readLine()) != null)
-                                       response.append(inputLine);
-                               JSONObject jObject = new JSONObject(response.toString()); // json
-                               JSONArray jsonUsers = jObject.getJSONArray("response"); // get data object
-                               for (int i = 0; i < jsonUsers.length(); i++) {
-                                       JSONObject eachObject = jsonUsers.getJSONObject(i);
-                                       EPUser eachUser = new EPUser();
-                                       eachUser.setOrgUserId(eachObject.get("id").toString());// getString("id"));
-                                       eachUser.setFirstName(eachObject.get("givenName").toString());
-                                       eachUser.setLastName(eachObject.get("familyName").toString());
-                                       eachUser.setEmail(eachObject.get("email").toString());
-                                       users.add(eachUser);
-                               }
-
-                               for (int i = 0; i < users.size(); i++) {
-
-                                       if (Utilities.nvl(firstName).length() > 0) {
-                                               if (!firstName.equalsIgnoreCase(users.get(i).getFirstName())) {
-                                                       continue;
-                                               }
-                                       }
-                                       if (Utilities.nvl(lastName).length() > 0) {
-                                               if (!lastName.equalsIgnoreCase(users.get(i).getLastName())) {
-                                                       continue;
-                                               }
-                                       }
-
-                                       filterdUsers.add(users.get(i));
-
-                               }
-
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName failed", e);
-                       } finally {
-                               try {
-                                       in.close();
-                                       con.disconnect();
-                               } catch (IOException e) {
-                                       logger.error(EELFLoggerDelegate.errorLogger, "getUserByFirstLastName 2 failed", e);
-                               }
-                       }
-
-                       return filterdUsers;
-               }
-
-       }
-
-       public String saveNewUser(EPUser newUser, String checkDuplicate) throws Exception {
-               try {
-                       List list = null;
-                       StringBuffer criteria = new StringBuffer();
-                       criteria.append(" where org_user_id = '").append(newUser.getLoginId()).append("'");
-                       list = getDataAccessService().getList(EPUser.class, criteria.toString(), null, null);
-                       if (list == null || list.size() == 0) {
-                               newUser.setActive(true);
-                               newUser.setOrgUserId(newUser.getLoginId());
-                               newUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
-                               getDataAccessService().saveDomainObject(newUser, null);
-                       } else {
-                               if (checkDuplicate.equals("Yes")) {
-                                       // userId already exist in database
-                                       return "Record already exist";
-                               } else {
-
-                                       EPUser oldUser = (EPUser) list.get(0);
-                                       oldUser.setFirstName(newUser.getFirstName());
-                                       oldUser.setLastName(newUser.getLastName());
-                                       oldUser.setMiddleInitial(newUser.getMiddleInitial());
-                                       if (!oldUser.getLoginPwd().equals(newUser.getLoginPwd()))
-                                               oldUser.setLoginPwd(CipherUtil.encrypt(newUser.getLoginPwd()));
-                                       else
-                                               oldUser.setLoginPwd(newUser.getLoginPwd());
-                                       getDataAccessService().saveDomainObject(oldUser, null);
-
-                               }
-
-                       }
-
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "saveNewUser failed", e);
-                       throw new Exception(e);
-               }
-               return "success";
-       };
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java
deleted file mode 100644 (file)
index 4a156a1..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.transport;
-
-public class OnboardingApp {
-
-       public Long id;
-
-       public String name;
-
-       public String imageUrl;
-       
-       public String imageLink;
-
-       public String description;
-
-       public String notes;
-
-       public String url;
-
-       public String alternateUrl;
-
-       public String restUrl;
-
-       public Boolean isOpen;
-
-       public Boolean isEnabled;
-
-       public String username;
-
-       public String appPassword;
-
-       public String thumbnail;
-       
-       public String uebTopicName;
-       
-       public String uebKey;
-       
-       public String uebSecret;
-       
-       public Boolean restrictedApp;
-       
-       public Boolean isCentralAuth;
-       
-       public String nameSpace;
-
-       public void normalize() {
-               this.name = (this.name == null) ? "" : this.name.trim();
-               this.username = (this.username == null) ? "" : this.username.trim();
-               this.appPassword = (this.appPassword == null) ? "" : this.appPassword.trim();
-       }
-
-       public void setUebTopicName(String topicName) {
-               this.uebTopicName = topicName;
-       }
-
-       public void setUebKey(String key) {
-               this.uebKey = key;
-       }
-       
-       public void setUebSecret(String secret) {
-               this.uebSecret = secret;
-       }
-       
-       // 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 setRestrictedApp(Boolean restrictedApp) {
-               this.restrictedApp = restrictedApp;
-       }
-}
-
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebHelper.java
deleted file mode 100644 (file)
index 81b1c49..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ueb;
-
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EcompApp;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.logging.format.EPAppMessagesEnum;
-import org.openecomp.portalapp.portal.logging.logic.EPLogUtil;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.Helper;
-import org.openecomp.portalsdk.core.onboarding.ueb.Publisher;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-
-@Component
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class EPUebHelper {
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(EPUebHelper.class);
-
-       @Autowired
-       EPAppService appsService;
-
-       @Autowired
-       private SessionFactory sessionFactory;
-
-       @SuppressWarnings("unused")
-       private Publisher epPublisher;
-
-       public EPUebHelper() {
-
-       }
-
-       //
-       // This should only be called by the ECOMP Portal App, other Apps have just one
-       // publisher and use appPublisher
-       //
-       @SuppressWarnings("unused")
-       @EPMetricsLog
-       public void refreshPublisherList() {
-               Session localSession = null;
-               boolean addedPublisher = false;
-
-               try {
-                       localSession = sessionFactory.openSession();
-
-                       List<EcompApp> apps = appsService.getEcompAppAppsFullList();
-                       for (int i = 0; i < apps.size(); i++) {
-                               if ((apps.get(i).isEnabled()) && (apps.get(i).getUebTopicName() != null)
-                                               && !(apps.get(i).getUebTopicName().toUpperCase().contains("ECOMP-PORTAL-INBOX"))) {
-                                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                                       "UEBManager adding publisher for " + apps.get(i).getUebTopicName());
-                                       UebManager.getInstance().addPublisher(apps.get(i).getUebTopicName());
-                                       addedPublisher = true;
-                               } else if ((apps.get(i).getId() != 1) && // App may have been disabled, remove the publisher
-                                               !(apps.get(i).isEnabled())) {
-                                       if (apps.get(i).getUebTopicName() != null) {
-                                               UebManager.getInstance().removePublisher(apps.get(i).getUebTopicName());
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebSystemError, "add/remove Publisher");
-                       logger.error(EELFLoggerDelegate.errorLogger, "refreshPublisherList failed", e);
-               }
-
-               // publisherList.print();
-
-               if (addedPublisher == true) // Give publishers time to initialize
-               {
-                       Helper.sleep(400);
-               }
-       }
-
-       // @PostConstruct
-       // @EPMetricsLog
-       public void initUeb() {
-               try {
-                       epPublisher = new Publisher(PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_KEY),
-                                       PortalApiProperties.getProperty(PortalApiConstants.UEB_APP_SECRET),
-                                       PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, e.getMessage());
-                       logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
-               }
-
-               Thread thread = new Thread("EPUebManager: postConstructMethod - refreshPublisherList") {
-                       public void run() {
-                               refreshPublisherList();
-                       }
-               };
-               if (thread != null) {
-                       thread.start();
-               }
-       }
-
-       @EPMetricsLog
-       public void addPublisher(EPApp app) {
-               // TODO Auto-generated method stub
-               try {
-                       UebManager.getInstance().addPublisher(app.getUebTopicName());
-               } catch (UebException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "addPublisher failed", e);
-               }
-       }
-
-       public boolean checkAvailability() {
-
-               //
-               // Test existence of topic at UEB url
-               //
-               //
-               //
-               boolean available = true;
-               LinkedList<String> urlList = Helper.uebUrlList();
-               if (!urlList.isEmpty()) {
-                       String url = "http://" + urlList.getFirst() + ":3904/topics/"
-                                       + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME);
-                       if (!url.isEmpty()) {
-                               try {
-                                       URL siteURL = new URL(url);
-                                       HttpURLConnection connection = (HttpURLConnection) siteURL.openConnection();
-                                       connection.setRequestMethod("GET");
-                                       connection.connect();
-
-                                       int code = connection.getResponseCode();
-                                       if (code == 200) {
-                                               available = true;
-                                       } else {
-                                               EPLogUtil.logEcompError(EPAppMessagesEnum.BeUebConnectionError, url);
-                                               available = false;
-                                               logger.warn(EELFLoggerDelegate.errorLogger,
-                                                               "Warning! UEB topic existence check failed, topic = " + url);
-                                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                                               "Warning! UEB topic existence check failed, topic = " + url);
-                                       }
-                               } catch (Exception e) {
-                                       available = false;
-                                       logger.error(EELFLoggerDelegate.errorLogger, "checkAvailability failed", e);
-                               }
-                       }
-               }
-               return available;
-       }
-
-       public boolean MessageCanBeSentToTopic() {
-
-               boolean sentMsgSuccessfully = false;
-
-               UebMsg msg = new UebMsg();
-               msg.putSourceTopicName(PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME));
-               msg.putPayload("Pinging topic for health check");
-               msg.putMsgType(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK);
-
-               try {
-                       // epPublisher.send(msg);
-                       sentMsgSuccessfully = true;
-               } catch (Exception e) {
-                       EPLogUtil.logEcompError(EPAppMessagesEnum.BeHealthCheckUebClusterError);
-                       sentMsgSuccessfully = false;
-                       logger.warn(EELFLoggerDelegate.errorLogger, "Warning! could not successfully publish a UEB msg to "
-                                       + PortalApiProperties.getProperty(PortalApiConstants.ECOMP_PORTAL_INBOX_NAME), e);
-               }
-
-               return sentMsgSuccessfully;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/ueb/EPUebMsgTypes.java
deleted file mode 100644 (file)
index 720e061..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.ueb;
-
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsgTypes;
-
-public interface EPUebMsgTypes extends UebMsgTypes {
-
-       public static final String UEB_MSG_TYPE_HEALTH_CHECK = "uebHealthCheckPing";
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/utils/EPSystemProperties.java
deleted file mode 100644 (file)
index e877267..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.context.annotation.PropertySources;
-
-@Configuration
-@PropertySources({ 
-       @PropertySource ("/WEB-INF/conf/system.properties"),
-       @PropertySource ("/WEB-INF/conf/sql.properties"),
-    @PropertySource ("/WEB-INF/fusion/conf/fusion.properties"),
-       @PropertySource (value = "file:${catalina.home}/conf/system.properties", ignoreResourceNotFound = true),
-       @PropertySource (value = "file:${catalina.home}/conf/fusion.properties", ignoreResourceNotFound = true)
-       })
-
-/**
- * Contains properties specific to the ONAP version of the ECOMP Portal.
- */
-public class EPSystemProperties extends EPCommonSystemProperties {
-       public static final String CONTACT_US_URL = "contact_us_link";
-       public static final String ECOMP_CONTEXT_ROOT = "context_root";
-
-}
\ No newline at end of file
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogJob.java
deleted file mode 100644 (file)
index 63b4402..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.scheduler;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.quartz.DisallowConcurrentExecution;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
-import org.quartz.PersistJobDataAfterExecution;
-import org.springframework.scheduling.quartz.QuartzJobBean;
-
-@PersistJobDataAfterExecution
-@DisallowConcurrentExecution
-public class LogJob extends QuartzJobBean {
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(LogJob.class);
-
-       @Override
-       protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {
-               // JobDataMap dataMap = ctx.getJobDetail().getJobDataMap();
-               // int cnt = dataMap.getInt("");
-               // JobKey jobKey = ctx.getJobDetail().getKey();
-               logger.info(EELFLoggerDelegate.debugLogger,
-                               (Runtime.getRuntime().maxMemory() + " " + Runtime.getRuntime().maxMemory()));
-
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/LogRegistry.java
deleted file mode 100644 (file)
index f502a56..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.scheduler;
-
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.openecomp.portalsdk.core.scheduler.CronRegistry;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.context.annotation.DependsOn;
-import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
-import org.springframework.scheduling.quartz.JobDetailFactoryBean;
-import org.springframework.stereotype.Component;
-
-@Component
-@DependsOn({ "systemProperties" })
-public class LogRegistry extends CronRegistry {
-
-       private static final String groupName = "AppGroup";
-       private static final String jobName = "LogJob";
-       private static final String triggerName = "LogTrigger";
-
-       // @Autowired
-       // private SystemProperties systemProperties;
-
-       // @Bean
-       public JobDetailFactoryBean jobDetailFactoryBean() {
-               Map<String, Object> map = new HashMap<String, Object>();
-               map.put("units", "bytes");
-               return jobDetailFactoryBean(groupName, jobName, LogJob.class, map);
-       }
-
-       // @Bean
-       public CronTriggerFactoryBean cronTriggerFactoryBean() throws ParseException {
-               // "0 * * * * ? *
-               return cronTriggerFactoryBean(groupName, triggerName, SystemProperties.getProperty(SystemProperties.LOG_CRON));
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/Register.java
deleted file mode 100644 (file)
index 00eb7b6..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.scheduler;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.scheduler.Registerable;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.quartz.Trigger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.DependsOn;
-import org.springframework.stereotype.Component;
-
-@Component
-@DependsOn({"logRegistry", "sessionMgtRegistry", "systemProperties"})
-public class Register implements Registerable {
-
-       EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(Register.class);
-
-       private List<Trigger> scheduleTriggers = new ArrayList<Trigger>();
-       Trigger trigger[] = new Trigger[0];
-
-       @Autowired
-       private LogRegistry logRegistry;
-       
-       @Autowired
-       private SessionMgtRegistry sessionMgtRegistry;
-       
-       @Override
-       public Trigger[] getTriggers() {
-               return getScheduleTriggers().toArray(trigger);
-       }
-
-       @Override
-       public void registerTriggers() {
-               // if the property value is not available; the cron will not be added
-               // and can be ignored. its safe to ignore the exceptions
-               try {
-                       if (SystemProperties.getProperty(SystemProperties.LOG_CRON) != null)
-                               getScheduleTriggers().add(logRegistry.getTrigger());
-
-               } catch (IllegalStateException ies) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "registerTriggers log cron failed", ies);
-                       logger.info(EELFLoggerDelegate.debugLogger, ("Log Cron not available"));
-               }
-               
-               try {
-                       if(SystemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON) != null)
-                               getScheduleTriggers().add(sessionMgtRegistry.getTrigger());
-                       
-               } catch(IllegalStateException ies) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "registerTriggers session timeout failed", ies);
-                       logger.info(EELFLoggerDelegate.debugLogger, ("Session Cron not available"));
-               }
-
-       }
-
-       public List<Trigger> getScheduleTriggers() {
-               return scheduleTriggers;
-       }
-
-       public void setScheduleTriggers(List<Trigger> scheduleTriggers) {
-               this.scheduleTriggers = scheduleTriggers;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/RegistryAdapter.java
deleted file mode 100644 (file)
index 542b0d8..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.scheduler;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.openecomp.portalsdk.core.scheduler.Registerable;
-import org.openecomp.portalsdk.workflow.services.WorkflowScheduleService;
-import org.quartz.Trigger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.quartz.SchedulerFactoryBean;
-import org.springframework.stereotype.Component;
-
-/**
- * TODO REFACTOR moved from org.openecomp.portalsdk.core.scheduler to
- * org.openecomp.portalapp.scheduler
- *
- */
-@Component
-public class RegistryAdapter {
-
-       @Autowired
-       private Registerable registry;
-
-       @Autowired
-       private WorkflowScheduleService workflowScheduleService;
-
-       private SchedulerFactoryBean schedulerBean;
-
-       Trigger trigger[] = new Trigger[0];
-
-       public Trigger[] getTriggers() {
-
-               registry.registerTriggers();
-
-               List<Trigger> allTriggers = new ArrayList<Trigger>();
-
-               List<Trigger> coreTriggers = addCoreTriggers();
-               final Trigger[] extTriggerArray = registry.getTriggers();
-
-               allTriggers.addAll(Arrays.asList(extTriggerArray));
-               allTriggers.addAll(coreTriggers);
-
-               return allTriggers.toArray(trigger);
-
-       }
-
-       public List<Trigger> addCoreTriggers() {
-               // On startup of the application after crash recovery, invoke workflow
-               // schedule trigger
-               List<Trigger> triggers = getWorkflowScheduleService().triggerWorkflowScheduling();
-               return triggers;
-       }
-
-       public void setSchedulerBean(SchedulerFactoryBean _schedulerBean) {
-               schedulerBean = _schedulerBean;
-
-       }
-
-       public SchedulerFactoryBean getSchedulerBean() {
-               return schedulerBean;
-
-       }
-
-       public Registerable getRegistry() {
-               return registry;
-       }
-
-       public void setRegistry(Registerable registry) {
-               this.registry = registry;
-       }
-
-       public WorkflowScheduleService getWorkflowScheduleService() {
-               return workflowScheduleService;
-       }
-
-       public void setWorkflowScheduleService(WorkflowScheduleService workflowScheduleService) {
-               this.workflowScheduleService = workflowScheduleService;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/scheduler/SessionMgtRegistry.java
deleted file mode 100644 (file)
index c18b4b3..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.scheduler;
-
-import java.text.ParseException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.openecomp.portalapp.portal.listener.UserSessionListener;
-import org.openecomp.portalapp.service.sessionmgt.TimeoutHandler;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.scheduler.CronRegistry;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.annotation.DependsOn;
-import org.springframework.scheduling.quartz.CronTriggerFactoryBean;
-import org.springframework.scheduling.quartz.JobDetailFactoryBean;
-import org.springframework.stereotype.Component;
-
-/**
- * Extra depends-on annotation tells Spring that the system properties object
- * will be used in the constructor.
- */
-@Component
-// @DependsOn({ "manageService", "epAppService", "systemProperties" })
-@DependsOn({ "systemProperties" })
-public class SessionMgtRegistry extends CronRegistry implements ApplicationContextAware {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionMgtRegistry.class);
-       
-       private static final String groupName = "AppGroup";
-       private static final String jobName = "PortalSessionTimeoutFeedJob";
-       private static final String triggerName = "PortalSessionTimeoutFeedTrigger";
-
-       // Not strictly necessary, but preparing for the day
-       // when the getProperty method is not static.
-       @Autowired
-       private SystemProperties systemProperties;
-
-       private ApplicationContext applicationContext;
-
-       public JobDetailFactoryBean jobDetailFactoryBean() {
-               Map<String, Object> map = new HashMap<String, Object>();
-               return jobDetailFactoryBean(groupName, jobName, TimeoutHandler.class, map);
-       }
-
-       @SuppressWarnings("static-access")
-       public CronTriggerFactoryBean cronTriggerFactoryBean() throws ParseException {
-               String property = "* * * * * ? 2099";
-               try {
-                       property = systemProperties.getProperty(SystemProperties.SESSIONTIMEOUT_FEED_CRON);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, 
-                                       "Failed to retrieve " + SystemProperties.SESSIONTIMEOUT_FEED_CRON + ", defaulting to " + property,
-                                       e);
-               }
-               return cronTriggerFactoryBean(groupName, triggerName, property);
-       }
-
-       @Override
-       public void setApplicationContext(ApplicationContext _applicationContext) throws BeansException {
-               applicationContext = _applicationContext;
-               TimeoutHandler.setApplicationContext(applicationContext);
-               UserSessionListener.setApplicationContext(_applicationContext);
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/service/RemoteWebServiceCallServiceImpl.java
deleted file mode 100644 (file)
index 0b10caf..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.service.WebServiceCallServiceImpl;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service("remoteWebServiceCallService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl implements RemoteWebServiceCallService {
-
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RemoteWebServiceCallServiceImpl.class);
-       
-       /*
-        * (non-Javadoc)
-        * @see org.openecomp.portalapp.service.sessionmgt.RemoteWebServiceCallService#verifyRESTCredential(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
-        */
-       public boolean verifyRESTCredential(String secretKey, String requestUebKey, String requestAppName,
-                       String requestPassword) throws Exception {
-               EPApp appRecord = findEpApp(requestUebKey);
-               if (appRecord == null) {
-                       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.decrypt(encryptedPwdDB,
-                               secretKey == null ? SystemProperties.getProperty(SystemProperties.Decryption_Key) : secretKey);
-               if (decryptedPwd.equals(requestPassword) && appUserName.equals(requestAppName))
-                       return true;
-               else
-                       return false;
-       }
-       
-       /**
-        * currently this method only validates the application key to fetch the application
-        */
-       public boolean verifyAppKeyCredential(String requestUebKey) throws Exception {
-               String failMessage = "Failed to find application with UEB key " + requestUebKey;
-               if(requestUebKey == null || requestUebKey.equals("")) {
-                       logger.warn(EELFLoggerDelegate.errorLogger, failMessage);
-                       return false;
-               }
-               
-               EPApp appRecord = findEpApp(requestUebKey);
-               if (appRecord == null) {
-                       logger.warn(EELFLoggerDelegate.errorLogger, failMessage);
-                       return false;
-               }
-               
-               return true;
-       }
-
-       /**
-        * Searches the FN_APP table for the specified UEB key.
-        * 
-        * @return EPApp object if the key is found; else null.
-        */
-       public EPApp findEpApp(String uebKey) {
-               List<?> list = null;
-               StringBuffer criteria = new StringBuffer();
-               criteria.append(" where ueb_key = '" + uebKey + "'");
-               list = getDataAccessService().getList(EPApp.class, criteria.toString(), null, null);
-               return (list == null || list.size() == 0) ? null : (EPApp) list.get(0);
-       }
-
-       public static void main(String args[]) throws Exception {
-               String decryptedPwd = CipherUtil.decrypt("okYTaDrhzibcbGVq5mjkVQ==", "AGLDdG4D04BKm2IxIWEr8o==");
-               System.out.print(decryptedPwd);
-       }
-       
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/FunctionalMenuHandler.java
deleted file mode 100644 (file)
index 8fd70a2..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.uebhandler;
-
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPAuditLog;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
-
-import com.google.gson.Gson;
-
-@Component
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPAuditLog
-public class FunctionalMenuHandler {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FunctionalMenuHandler.class);
-
-       @Autowired
-       private AdminRolesService adminRolesService;
-
-       @Autowired
-       private FunctionalMenuService functionalMenuService;
-
-       @Autowired
-       private SearchService searchSvc;
-
-       @Async
-       public Boolean getFunctionalMenu(UebMsg requestMsg) {
-               UebMsg returnMsg = new UebMsg();
-
-               if (requestMsg == null) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "handleMenuRequest received null message");
-                       return false;
-               } else if (requestMsg.getSourceTopicName() == null) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "A source topic name is required and not found in this msg:" + requestMsg.toString());
-                       return false;
-               } else if (requestMsg.getUserId() == null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "Error getting functional menu.  A userId is required and not found in this msg: "
-                                                       + requestMsg.toString());
-                       returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
-                       returnMsg.putPayload("Error: A userId is required.  Call msg.putUserId() with an userId");
-               } else {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "Getting functional menu for user = " + requestMsg.getUserId());
-                       EPUser user = searchSvc.searchUserByUserId(requestMsg.getUserId());
-
-                       List<FunctionalMenuItem> menuItems = null;
-                       if (user == null) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "Error getting functional menu.  userId not found in directory or is guest: "
-                                                               + requestMsg.toString());
-                       } else if (adminRolesService.isSuperAdmin(user)) {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "FunctionalMenuHandler: SuperUser, about to call getFunctionalMenuItems()");
-                               menuItems = functionalMenuService.getFunctionalMenuItems();
-                       } else {
-                               logger.debug(EELFLoggerDelegate.debugLogger,
-                                               "getMenuItemsForAuthUser: about to call getFunctionalMenuItemsForUser()");
-                               menuItems = functionalMenuService.getFunctionalMenuItemsForUser(requestMsg.getUserId());
-                       }
-
-                       if (menuItems != null) {
-                               String functionalMenuJsonString = new Gson().toJson(menuItems);
-                               logger.debug(EELFLoggerDelegate.debugLogger, "returning functional menu : " + functionalMenuJsonString);
-                               returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
-                               returnMsg.putPayload(functionalMenuJsonString);
-                       } else {
-                               returnMsg.putMsgId(requestMsg.getMsgId()); // echo tells requester this is a response
-                               returnMsg.putPayload("Error: Not found for userId = " + requestMsg.getUserId());
-                       }
-               }
-
-               try {
-                       UebManager.getInstance().publishReplyEP(returnMsg, requestMsg.getSourceTopicName());
-               } catch (UebException e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "getFunctionalMenu failed to publish reply", e);
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger,
-                                       "getFunctionalMenu failed", e);
-               }
-
-               return true;
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/InitUebHandler.java
deleted file mode 100644 (file)
index db60c89..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.uebhandler;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiProperties;
-
-//
-// Adding this class for the sole purpose of insuring that the MainUebHandler really 
-// honors @Async and kicks off a thread.  For more info google @Async and read about
-// @Async only working if called from different class.
-//
-//@Configuration
-//@EnableAspectJAutoProxy
-//@EPMetricsLog
-public class InitUebHandler {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(InitUebHandler.class);
-
-       // @Autowired
-       private MainUebHandler mainUebHandler;
-
-       public InitUebHandler() {
-
-       }
-
-       // @PostConstruct
-       public void initUeb() {
-               try {
-                       String enableListenerThread = PortalApiProperties.getProperty(PortalApiConstants.UEB_LISTENERS_ENABLE);
-                       if (enableListenerThread.equalsIgnoreCase("true")) {
-                               ConcurrentLinkedQueue<UebMsg> inboxQueue = new ConcurrentLinkedQueue<UebMsg>();
-                               UebManager.getInstance().initListener(inboxQueue);
-                               mainUebHandler.runHandler(inboxQueue);
-                               logger.info(EELFLoggerDelegate.errorLogger, "Returned from initiating mainUebHandler...");
-                       } else {
-                               logger.info(EELFLoggerDelegate.errorLogger,
-                                               "Not starting UEB listening thread because ueb_listeners_enable is not set to true in the properties file.");
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "initUeb failed", e);
-                       logger.info(EELFLoggerDelegate.errorLogger,
-                                       "Not starting UEB listening thread because property could not be read "
-                                                       + PortalApiConstants.UEB_LISTENERS_ENABLE + e.getMessage());
-               }
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/MainUebHandler.java
deleted file mode 100644 (file)
index 9e2bfff..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.uebhandler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.openecomp.portalapp.portal.ueb.EPUebMsgTypes;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsgTypes;
-import org.slf4j.MDC;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
-
-import com.att.eelf.configuration.Configuration;
-
-//-------------------------------------------------------------------------
-// Listens for received UEB messages and handles the messages
-//
-// Note: To implement a synchronous reply call getMsgId on the request 
-//       and putMsgId on the reply (echoing the request MsgId).
-//       
-//-------------------------------------------------------------------------
-@Component("MainUebHandler")
-public class MainUebHandler {
-       final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MainUebHandler.class);
-
-       private ConcurrentLinkedQueue<UebMsg> inboxQueue = null;
-
-       @Autowired
-       private FunctionalMenuHandler funcMenuHandler;
-
-       @Autowired
-       private WidgetNotificationHandler widgetNotificationHandler;
-
-       @Async
-       public void runHandler(ConcurrentLinkedQueue<UebMsg> queue) {
-               inboxQueue = queue;
-               logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "==> MainUebHandler started");
-               while (true) {
-                       UebMsg msg = null;
-                       while ((msg = inboxQueue.poll()) != null) {
-                               if ((msg.getMsgType() != null)
-                                               && (!msg.getMsgType().equalsIgnoreCase(EPUebMsgTypes.UEB_MSG_TYPE_HEALTH_CHECK))) {
-                                       // TODO: switch this back to debug
-                                       logger.info(EELFLoggerDelegate.errorLogger,
-                                                       dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
-                                       logger.info(EELFLoggerDelegate.debugLogger,
-                                                       dateFormat.format(new Date()) + "<== Received UEB message : " + msg.toString());
-                                       MDC.put(EPSystemProperties.PARTNER_NAME, msg.getSourceTopicName());
-                                       MDC.put(Configuration.MDC_SERVICE_NAME, msg.getMsgType().toString());
-                                       switch (msg.getMsgType()) {
-                                       case UebMsgTypes.UEB_MSG_TYPE_GET_FUNC_MENU: {
-                                               funcMenuHandler.getFunctionalMenu(msg);
-                                               break;
-                                       }
-                                       case UebMsgTypes.UEB_MSG_TYPE_WIDGET_NOTIFICATION: {
-                                               widgetNotificationHandler.handleWidgetNotification(msg);
-                                               break;
-                                       }
-                                       default: {
-                                               logger.info(EELFLoggerDelegate.debugLogger,
-                                                               dateFormat.format(new Date()) + "Unknown UEB message type " + msg.toString());
-                                               break;
-                                       }
-                                       }
-                               }
-                       }
-
-                       if (Thread.interrupted()) {
-                               logger.info(EELFLoggerDelegate.errorLogger, "==> UebMainHandler exiting");
-                               break;
-                       }
-
-                       try {
-                               Thread.sleep(10);
-                       } catch (InterruptedException e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "runHandler interrupted during sleep", e);
-                       } catch (Exception e) {
-                               logger.error(EELFLoggerDelegate.errorLogger, "runHandler failed", e);
-                       }
-               }
-       }
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/uebhandler/WidgetNotificationHandler.java
deleted file mode 100644 (file)
index 1f96443..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.uebhandler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.logging.aop.EPMetricsLog;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.SearchService;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebException;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebManager;
-import org.openecomp.portalsdk.core.onboarding.ueb.UebMsg;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
-
-@Component
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-@EPMetricsLog
-public class WidgetNotificationHandler {
-       private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WidgetNotificationHandler.class);
-
-       final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-       @Autowired
-       EPAppService appSvc;
-
-       @Autowired
-       SearchService searchSvc;
-
-       public WidgetNotificationHandler() {
-       }
-
-       @Async
-       public void handleWidgetNotification(UebMsg requestMsg) {
-               if (requestMsg.getUserId() != null) {
-                       logger.debug(EELFLoggerDelegate.debugLogger,
-                                       "handleWidgetNotification: getting widgets/apps for user = " + requestMsg.getUserId());
-                       EPUser user = searchSvc.searchUserByUserId(requestMsg.getUserId());
-                       if (user != null && (appSvc != null)) {
-                               logger.debug(EELFLoggerDelegate.debugLogger, "Debug mytag: " + appSvc);
-                               List<EPApp> apps = appSvc.getUserApps(user);
-                               for (EPApp app : apps) {
-                                       if (app.getUebTopicName() != null) {
-                                               UebMsg widgetMsg = new UebMsg();
-                                               widgetMsg.putSourceTopicName(app.getUebTopicName());
-                                               logger.debug(EELFLoggerDelegate.debugLogger, "app.getUebTopicName was invoked");
-                                               widgetMsg.putPayload(requestMsg.getPayload());
-                                               try {
-                                                       logger.debug(EELFLoggerDelegate.debugLogger, "Sending widget notification from "
-                                                                       + requestMsg.getSourceTopicName() + " to " + app.getUebTopicName());
-                                                       UebManager.getInstance().publishEP(widgetMsg, app.getUebTopicName());
-                                               } catch (UebException e) {
-                                                       logger.error(EELFLoggerDelegate.errorLogger, "handleWidgetNotification failed", e);
-                                               }
-                                       }
-                               }
-                       } else {
-                               logger.error(EELFLoggerDelegate.errorLogger,
-                                               dateFormat.format(new Date()) + "handleWidgetNotification: user " + requestMsg.getUserId()
-                                                               + " not found" + " source = " + requestMsg.getSourceTopicName()
-                                                               + ". This widget notification cannot be posted to other widgets");
-                       }
-               }
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/util/SessionCookieUtil.java
deleted file mode 100644 (file)
index 7ae34ae..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.util;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.onboarding.util.PortalApiConstants;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.web.support.AppUtils;
-
-public class SessionCookieUtil {
-       
-       //private static final String JSESSIONID = "JSESSIONID";
-       private static final String EP_SERVICE = "EPService";
-       private static final String USER_ID = "UserId";
-       private static Integer cookieMaxAge = -1;
-       private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SessionCookieUtil.class);
-       
-       public static void preSetUp(HttpServletRequest request,
-                       HttpServletResponse response) {
-               initateSessionMgtHandler(request);
-               //set up EPService cookie
-               setUpEPServiceCookie(request, response);
-       }
-
-       public static void setUpEPServiceCookie(HttpServletRequest request,
-                       HttpServletResponse response) {
-               String jSessionId = getJessionId(request);
-               Cookie cookie1 = new Cookie(EP_SERVICE, jSessionId);
-               cookie1.setMaxAge(cookieMaxAge);
-               cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
-               cookie1.setPath("/");
-               response.addCookie(cookie1);
-       }
-       
-       public static void setUpUserIdCookie(HttpServletRequest request,
-                       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));
-               Cookie cookie1 = new Cookie(USER_ID, userId);
-               cookie1.setMaxAge(cookieMaxAge);
-               cookie1.setDomain(EPCommonSystemProperties.getProperty(EPCommonSystemProperties.COOKIE_DOMAIN));
-               cookie1.setPath("/");
-               response.addCookie(cookie1);
-               logger.info("************** session cookie util set up EP cookie completed");
-       }
-       
-       public static String getUserIdFromCookie(HttpServletRequest request,
-                       HttpServletResponse response) throws Exception {
-               String userId = "";
-               Cookie[] cookies = request.getCookies();
-               Cookie userIdcookie = null;
-               if (cookies != null)
-                       for (Cookie cookie : cookies)
-                               if (cookie.getName().equals(USER_ID))
-                                       userIdcookie = cookie;
-               if(userIdcookie!=null){
-                       userId = CipherUtil.decrypt(userIdcookie.getValue(),
-                                       SystemProperties.getProperty(SystemProperties.Decryption_Key));
-               }
-               
-               logger.info("************** session cookie util set up EP cookie completed");
-               return userId;
-       }
-       
-       public static String getJessionId(HttpServletRequest request){
-               
-               return request.getSession().getId();
-               /*
-               Cookie ep = WebUtils.getCookie(request, JSESSIONID);
-               if(ep==null){
-                       return request.getSession().getId();
-               }
-               return ep.getValue();
-               */
-       }
-       
-       protected static void initateSessionMgtHandler(HttpServletRequest request) {
-               String jSessionId = getJessionId(request);
-               storeMaxInactiveTime(request);
-               PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request));
-       }
-       
-       protected static void storeMaxInactiveTime(HttpServletRequest request) {
-               HttpSession session = AppUtils.getSession(request);
-               if(session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME) == null)
-                       session.setAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME,session.getMaxInactiveInterval());
-       }
-       
-       public static void resetSessionMaxIdleTimeOut(HttpServletRequest request) {
-               try {
-                       HttpSession session = AppUtils.getSession(request);
-                       final Object maxIdleAttribute = session.getAttribute(PortalApiConstants.GLOBAL_SESSION_MAX_IDLE_TIME);
-                       if(session != null && maxIdleAttribute != null) {
-                               session.setMaxInactiveInterval(Integer.parseInt(maxIdleAttribute.toString()));
-                       }
-               } catch (Exception e) {
-                       logger.error(EELFLoggerDelegate.errorLogger, "resetSessionMaxIdleTimeOut failed", e);
-               }
-               
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/main/resources/key.properties b/ecomp-portal-BE-os/src/main/resources/key.properties
new file mode 100644 (file)
index 0000000..b9dad85
--- /dev/null
@@ -0,0 +1,3 @@
+# Encrypted Properties 
+
+cipher.enc.key = AGLDdG4D04BKm2IxIWEr8o==!
\ No newline at end of file
index 8afa5af..d1efbe2 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index cafd0fd..3c77149 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index 37e2484..c858480 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -35,7 +35,7 @@
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 ###
 #
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 ###
-portal.api.impl.class = org.openecomp.portalsdk.core.onboarding.client.OnBoardingApiServiceImpl
+portal.api.impl.class = org.onap.portalsdk.core.onboarding.client.OnBoardingApiServiceImpl
 portal.api.prefix = /api
 max.idle.time = 5
 user.attribute.name = user_attribute
 portal.api.prefix = /api
 max.idle.time = 5
 user.attribute.name = user_attribute
@@ -45,7 +45,7 @@ ecomp_redirect_url = https://localhost:8080/ecompportal/login.htm
 
 testing=testing
 
 
 testing=testing
 
-# URL of the ECOMP Portal REST API
+# URL of the ONAP Portal REST API
 ecomp_rest_url = http://localhost:8080/ecompportal/auxapi
 
 ueb_listeners_enable = true
 ecomp_rest_url = http://localhost:8080/ecompportal/auxapi
 
 ueb_listeners_enable = true
index 10b5112..8728af6 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index 3335db1..27d8c55 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index 26a0501..688e807 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index 03dbcab..ceb8849 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index 484f205..247042c 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
diff --git a/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/scheduler.properties b/ecomp-portal-BE-os/src/main/webapp/WEB-INF/conf/scheduler.properties
new file mode 100644 (file)
index 0000000..65e845e
--- /dev/null
@@ -0,0 +1,61 @@
+###
+# ============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============================================
+#
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+###
+
+
+##scheduler authentication credentials
+scheduler.user.name=test1
+scheduler.password=test2
+#scheduler properties
+scheduler.server.url=http://mtanjv9sdlg10.aic.cip.onap.com:8989/scheduler
+scheduler.create.new.vnf.change.instance=/v1/ChangeManagement/schedules/
+scheduler.get.time.slots=/v1/ChangeManagement/schedules/
+scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals
+vid.truststore.filename=C:\\Temp\\vid_keystore.jks
+vid.truststore.passwd.x=OBF:1wgg1wfq1uus1uui1x131x0r1x1v1x1j1uvo1uve1wg81wfi
+
+#scheduler-policy properties
+policy.server.url=https://policypdp-conexus-e2e.ecomp.cci.onap.com:8081/pdp
+policy.get.config=/api/getConfig
+policy.ClientAuth=UHlQRFBTZXJ2ZXI6dGVzdA==
+policy.client.mechId=m06814@controller.dcae.ecomp.onap.com
+policy.client.password=OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0
+policy.username=testpdp
+policy.password=OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt
+policy.Authorization=dGVzdHBkcDphbHBoYTEyMw==
+policy.environment=TEST
+
index 0c2cfda..a2911fb 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index fe2d7db..5e8aa1a 100644 (file)
@@ -2,11 +2,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -19,7 +19,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
 ###
 
 db.driver = org.mariadb.jdbc.Driver
 ###
 
 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/ecomp_portal
+#db.userName = XXXX
+#db.password = XXXX
+db.connectionURL = jdbc:mariadb:failover://demeter.homer.att.com:3306/ecomp_portal_1710_os
+db.userName = portal
+db.password = P0rt@l
 # is the db.password property encrypted?
 db.encrypt_flag = false
 
 # is the db.password property encrypted?
 db.encrypt_flag = false
 
+
 db.hib.dialect = org.hibernate.dialect.MySQLDialect
 db.min_pool_size = 5
 db.max_pool_size = 10
 db.hib.dialect = org.hibernate.dialect.MySQLDialect
 db.min_pool_size = 5
 db.max_pool_size = 10
@@ -76,7 +80,7 @@ cache_switch                  = 1
 cache_load_on_startup         = false
 
 user_name                                        = fullName
 cache_load_on_startup         = false
 
 user_name                                        = fullName
-decryption_key                           = AGLDdG4D04BKm2lxlWEr8o==
+decryption_key                           = AGLDdG4D04BKm2IxIWEr8o==
 
 
 #Cron Schedules
 
 
 #Cron Schedules
@@ -138,22 +142,12 @@ window_width_threshold_right_menu = 1350
 #External system notification URL
 external_system_notification_url= https://jira.onap.org/browse/
 
 #External system notification URL
 external_system_notification_url= https://jira.onap.org/browse/
 
-#scheduler properties
-scheduler.server.url=http://mtanjv9sdlg10.aic.cip.onap.com:8989/scheduler
-scheduler.create.new.vnf.change.instance=/v1/ChangeManagement/schedules/
-scheduler.get.time.slots=/v1/ChangeManagement/schedules/
-scheduler.submit.new.vnf.change=/v1/ChangeManagement/schedules/{scheduleId}/approvals
-vid.truststore.filename=C:\\Temp\\vid_keystore.jks
-vid.truststore.passwd.x=OBF:1wgg1wfq1uus1uui1x131x0r1x1v1x1j1uvo1uve1wg81wfi
-
-#scheduler-policy properties
-policy.server.url=https://policypdp-conexus-e2e.ecomp.cci.onap.com:8081/pdp
-policy.get.config=/api/getConfig
-policy.ClientAuth=UHlQRFBTZXJ2ZXI6dGVzdA==
-policy.client.mechId=m06814@controller.dcae.ecomp.onap.com
-policy.client.password=OBF:1ffu1qvu1t2z1l161fuk1i801nz91ro41xf71xfv1rqi1nx51i7y1fuq1kxw1t371qxw1fh0
-policy.username=testpdp
-policy.password=OBF:1igd1kft1l1a1sw61svs1kxs1kcl1idt
-policy.Authorization=dGVzdHBkcDphbHBoYTEyMw==
-policy.environment=TEST
+# 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_domain = @csp.onap.org
+
+# External Central Auth system access
+remote_centralized_system_access = false
 
 
index f8207a1..34995ae 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index c609ffa..c986cbf 100644 (file)
@@ -3,11 +3,11 @@
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
 # ============LICENSE_START==========================================
 # ONAP Portal
 # ===================================================================
-# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+# 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”);
+# 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
 #
 # you may not use this software except in compliance with the License.
 # You may obtain a copy of the License at
 #
@@ -20,7 +20,7 @@
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
 # limitations under the License.
 #
 # Unless otherwise specified, all documentation contained herein is licensed
-# under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+# 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
 #
 # you may not use this documentation except in compliance with the License.
 # You may obtain a copy of the License at
 #
index ed3f0b9..ec93202 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 318ce4e..5cd8060 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index e6370be..c0ca151 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -38,8 +38,8 @@
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
 <%@ taglib prefix="c"      uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fmt"    uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
 <%@ taglib prefix="c"      uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="fmt"    uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %>
-<%@ page import="org.openecomp.portalapp.portal.utils.EPSystemProperties" %>
+<%@ page import="org.onap.portalsdk.core.util.SystemProperties" %>
+<%@ page import="org.onap.portalapp.portal.utils.EPSystemProperties" %>
 <c:set var="title" value="Login" />
 <c:set var="isMobileEnabled"
        value="<%=(SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE)!= null && SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE).trim().equals(\"true\"))%>" />
 <c:set var="title" value="Login" />
 <c:set var="isMobileEnabled"
        value="<%=(SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE)!= null && SystemProperties.getProperty(SystemProperties.MOBILE_ENABLE).trim().equals(\"true\"))%>" />
@@ -188,22 +188,6 @@ app.controller("externalLoginController", function ($scope) {
         });
 
     };
         });
 
     };
-       /**
-       $scope.loginExternal = function() {
-
-        
-                 var redirectUrl = "login_external/login";
-          var form = $('<form action="' + redirectUrl + '" method="post">' +
-                  '<input type="hidden" name="loginId" value='+$scope.loginId+' />' +
-                  '<input type="hidden" name="password" value='+$scope.password+' />' +
-                  '</form>');
-                  
-                  $('body').append(form);
-                  $(form).submit();
-         
-
-    };
-    */ 
 });
 </script>
        
 });
 </script>
        
index 03d04b8..2bd2181 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 9d14359..92c88b1 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 47ef249..9989f33 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index e244032..38262ae 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 3eed49a..119f9e5 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
        xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
        xmlns:util="http://www.springframework.org/schema/util"
        xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd
        xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
        xmlns:util="http://www.springframework.org/schema/util"
        xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2-2.0.xsd
-               http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
-               http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
-               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
-               http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.1.xsd
-               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd
-               http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd">
+               http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
+               http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
+               http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
+               http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd
+               http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
+               http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd">
 
        <!-- DispatcherServlet Context: defines this servlet's request-processing 
                infrastructure -->
 
        <!-- DispatcherServlet Context: defines this servlet's request-processing 
                infrastructure -->
@@ -95,7 +95,7 @@
        </security:http>
 
        <bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
        </security:http>
 
        <bean id="authenticationEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
-               <property name="loginFormUrl" value="/openid_connect_login" />
+               <constructor-arg name="loginFormUrl" value="/openid_connect_login" />
        </bean>
 
        <security:authentication-manager alias="authenticationManager">
        </bean>
 
        <security:authentication-manager alias="authenticationManager">
index 1480a51..ee60d32 100644 (file)
@@ -3,11 +3,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -20,7 +20,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -54,7 +54,7 @@
        <!-- The Portal app can function on a HA cluster -->
        <distributable/>
        
        <!-- The Portal app can function on a HA cluster -->
        <distributable/>
        
-       <context-param>
+       <!-- <context-param>
        <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/oid-context.xml</param-value>
        </context-param>
        <param-name>contextConfigLocation</param-name>
                <param-value>/WEB-INF/oid-context.xml</param-value>
        </context-param>
           <listener-class>
                org.springframework.web.context.ContextLoaderListener
           </listener-class>
           <listener-class>
                org.springframework.web.context.ContextLoaderListener
           </listener-class>
-       </listener> 
+       </listener>  -->
 
 
        <listener>
 
 
        <listener>
-       <listener-class>org.openecomp.portalapp.portal.listener.UserSessionListener</listener-class>
+       <listener-class>org.onap.portalapp.portal.listener.UserSessionListener</listener-class>
        </listener>
                
        <filter>
        </listener>
                
        <filter>
       <url-pattern>/*</url-pattern>
     </filter-mapping>
     
       <url-pattern>/*</url-pattern>
     </filter-mapping>
     
-       <filter>
-           <filter-name>springSecurityFilterChain</filter-name>
-           <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
-            <!-- <init-param>
-               <param-name>contextAttribute</param-name>
-               <param-value>org.springframework.web.servlet.FrameworkServlet.CONTEXT.appServlet</param-value>
-           </init-param> -->
+       <filter>
+           <filter-name>SecurityXssFilter</filter-name>
+           <filter-class>org.onap.portalapp.filter.SecurityXssFilter</filter-class>
        </filter>
        </filter>
-
+       
        <filter-mapping>
        <filter-mapping>
-           <filter-name>springSecurityFilterChain</filter-name>
+           <filter-name>SecurityXssFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
-        
 </web-app>
 </web-app>
index 0bbd8a3..150124b 100644 (file)
@@ -37,6 +37,7 @@
 .icon-people-oneperson-stalker:before, .icon-controls-pointer:before,
 .icon-arrows-replay-restart:before, .icon-content-star:before,
 .icon-misc-trash:before, .icon-arrows-upload:before,
 .icon-people-oneperson-stalker:before, .icon-controls-pointer:before,
 .icon-arrows-replay-restart:before, .icon-content-star:before,
 .icon-misc-trash:before, .icon-arrows-upload:before,
+.icon-controls-moreapplications:before,
 .icon-controls-upPRIMARY, .ion-navicon                                                                         
 {
     display: inline-block;
 .icon-controls-upPRIMARY, .ion-navicon                                                                         
 {
     display: inline-block;
 .icon-controls-upPRIMARY:before { content: "\f3d8";  }
 
 .ion-navicon:before { content: "\f20e"; }
 .icon-controls-upPRIMARY:before { content: "\f3d8";  }
 
 .ion-navicon:before { content: "\f20e"; }
+
+.icon-controls-moreapplications:before { content: "\f20b"; }
index f63bfa1..8b543da 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java
new file mode 100644 (file)
index 0000000..58e596a
--- /dev/null
@@ -0,0 +1,155 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.authentication;
+
+import static org.junit.Assert.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.authentication.OpenIdConnectLoginStrategy;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalapp.util.SessionCookieUtil;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.util.SystemProperties;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mitre.openid.connect.model.DefaultUserInfo;
+import org.mitre.openid.connect.model.UserInfo;
+import org.mockito.InjectMocks;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.springframework.util.StringUtils;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({StringUtils.class, EPUserUtils.class , SessionCookieUtil.class,SystemProperties.class})
+public class OpenIdConnectLoginStrategyTest {
+       
+       @InjectMocks
+       OpenIdConnectLoginStrategy OpenIdConnectLoginStrategy = new OpenIdConnectLoginStrategy();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+               
+       @Test
+       public void loginTest() throws Exception
+       {
+               PowerMockito.mockStatic(StringUtils.class);
+               PowerMockito.mockStatic(EPUserUtils.class);
+               PowerMockito.mockStatic(SessionCookieUtil.class);
+               
+               UserInfo  userInfo = new DefaultUserInfo();
+               userInfo.setPreferredUsername("Test");
+               userInfo.setEmail("test@gmail.com");
+               userInfo.setName("first_name");
+               userInfo.setFamilyName("last_name");
+               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
+               assertTrue(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void loginIfUserNullTest() throws Exception
+       {               
+               PowerMockito.mockStatic(SystemProperties.class);
+               UserInfo  userInfo = null;
+               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
+//             Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenReturn("auth");
+               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void loginIfUserIfAuthIsOIDCTest() throws Exception
+       {               
+               PowerMockito.mockStatic(SystemProperties.class);
+               UserInfo  userInfo = null;
+               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
+               Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenReturn("OIDC");
+               Mockito.when(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL)).thenReturn("login_url");
+               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void loginIfUserIfAuthNotNullTest() throws Exception
+       {               
+               PowerMockito.mockStatic(SystemProperties.class);
+               UserInfo  userInfo = null;
+               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
+               Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenReturn("test");
+               Mockito.when(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL)).thenReturn("login_url");
+               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void loginIfUserExceptionest() throws Exception
+       {               
+               PowerMockito.mockStatic(SystemProperties.class);
+               UserInfo  userInfo = null;
+               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
+               Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenThrow(nullPointerException);
+               Mockito.when(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL)).thenReturn("login_url");
+               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+       @Test(expected =  Exception.class)
+       public void doLoginTest() throws Exception
+       {
+               OpenIdConnectLoginStrategy.doLogin(mockedRequest, mockedResponse);
+       }
+       
+       @Test(expected =  PortalAPIException.class)
+       public void getUserIdTest() throws Exception
+       {
+               OpenIdConnectLoginStrategy.getUserId(mockedRequest);
+       }
+       
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java
new file mode 100644 (file)
index 0000000..11b54bf
--- /dev/null
@@ -0,0 +1,92 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.authentication;
+
+import static org.junit.Assert.assertFalse;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.authentication.LoginStrategy;
+import org.onap.portalapp.authentication.SimpleLoginStrategy;
+import org.onap.portalapp.controller.EPFusionBaseController;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.interceptor.SessionTimeoutInterceptor;
+import org.springframework.web.method.HandlerMethod;
+
+public class SessionTimeoutInterceptorTest {
+
+       
+       @Mock
+       LoginStrategy loginStrategy = new SimpleLoginStrategy();
+       
+       @Mock
+       EPFusionBaseController ePFusionBaseController = new EPFusionBaseController() {
+       };
+       
+       @Mock
+       HandlerMethod handlerMethod;
+       
+       @InjectMocks
+       SessionTimeoutInterceptor  sessionTimeoutInterceptor = new  SessionTimeoutInterceptor();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       
+       @Test
+       public void preHandleTest() throws Exception{
+               assertFalse(sessionTimeoutInterceptor.preHandle(mockedRequest, mockedResponse, ePFusionBaseController));
+       }
+       
+       @Test
+       public void preHandleTestIfMethodIsinstanceOfHandlerMethod() throws Exception{
+               assertFalse(sessionTimeoutInterceptor.preHandle(mockedRequest, mockedResponse, handlerMethod));
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SimpleLoginStrategyTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/authentication/SimpleLoginStrategyTest.java
new file mode 100644 (file)
index 0000000..1a3972f
--- /dev/null
@@ -0,0 +1,171 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.authentication;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.authentication.SimpleLoginStrategy;
+import org.onap.portalapp.command.EPLoginBean;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalapp.portal.service.EPRoleService;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalapp.util.SessionCookieUtil;
+import org.onap.portalsdk.core.menu.MenuProperties;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+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.util.StringUtils;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ StringUtils.class, EPUserUtils.class, SessionCookieUtil.class, SystemProperties.class,
+               SessionCookieUtil.class, MenuProperties.class })
+public class SimpleLoginStrategyTest {
+
+       @InjectMocks
+       SimpleLoginStrategy simpleLoginStrategy = new SimpleLoginStrategy();
+
+       @Mock
+       EPLoginService loginService;
+       @Mock
+       EPRoleService roleService;
+       @Mock
+    EPRoleFunctionService ePRoleFunctionService;
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Test(expected = Exception.class)
+       public void loginTest() throws Exception {
+               PowerMockito.mockStatic(MenuProperties.class);
+               PowerMockito.mockStatic(SessionCookieUtil.class);
+               PowerMockito.mockStatic(StringUtils.class);
+               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
+               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(false);
+               EPLoginBean commandBean = new EPLoginBean();
+               EPUser user = new EPUser();
+               commandBean.setUser(user);
+               commandBean.setOrgUserId("guestT");
+               Mockito.when(mockedRequest.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY))
+                               .thenReturn("menu_properties_filename");
+               Mockito.when(loginService.findUser(commandBean, "menu_properties_filename", null)).thenReturn(commandBean);
+               assertTrue(simpleLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void loginIfUserEmptyTest() throws Exception {
+               PowerMockito.mockStatic(MenuProperties.class);
+               PowerMockito.mockStatic(SessionCookieUtil.class);
+               PowerMockito.mockStatic(StringUtils.class);
+               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
+               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
+               EPLoginBean commandBean = new EPLoginBean();
+               EPUser user = new EPUser();
+               commandBean.setUser(user);
+               commandBean.setOrgUserId("guestT");
+               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void loginIfAuthIsBothTest() throws Exception {
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(SessionCookieUtil.class);
+               PowerMockito.mockStatic(StringUtils.class);
+               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
+               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("BOTH");
+               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void loginIfAuthIsNotNullTest() throws Exception {
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(SessionCookieUtil.class);
+               PowerMockito.mockStatic(StringUtils.class);
+               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
+               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("Test");
+               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+
+       @Test
+       public void loginExceptionTest() throws Exception {
+               PowerMockito.mockStatic(SystemProperties.class);
+               PowerMockito.mockStatic(SessionCookieUtil.class);
+               PowerMockito.mockStatic(StringUtils.class);
+               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
+               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM))
+                               .thenThrow(nullPointerException);
+               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
+       }
+
+       @Test(expected = Exception.class)
+       public void doLoginTest() throws Exception {
+               simpleLoginStrategy.doLogin(mockedRequest, mockedResponse);
+       }
+
+       @Test(expected = PortalAPIException.class)
+       public void getUserIdTest() throws Exception {
+               simpleLoginStrategy.getUserId(mockedRequest);
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/AppsOSControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/AppsOSControllerTest.java
new file mode 100644 (file)
index 0000000..565bfdb
--- /dev/null
@@ -0,0 +1,189 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+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.Ignore;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.AppsOSController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPAppService;
+import org.onap.portalapp.portal.service.PersUserAppService;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.util.EPUserUtils;
+
+public class AppsOSControllerTest {
+
+       @Mock
+       AdminRolesService adminRolesService;
+
+       @Mock
+       EPAppService appService;
+
+       @Mock
+       PersUserAppService persUserAppService;
+
+       @Mock
+       UserService userService;
+
+       @Mock
+       EPUserUtils ePUserUtils;
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @InjectMocks
+       AppsOSController appsOSController = new AppsOSController();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void saveNewUserIfUserISNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("failure");
+               expectedportalRestResponse.setResponse("New User cannot be null or empty");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, null);
+               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       @Ignore
+       public void saveNewUserIfUserNOtNullTest() {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("failure");
+               expectedportalRestResponse.setResponse("UnAuthorized");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               EPUser user1 = mockUser.mockEPUser();
+               user1.setLoginId("guest");
+               user.setLoginId("guestT");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user1);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, user);
+               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveNewUserAndLoggedInUserIdSameTest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("Success");
+               expectedportalRestResponse.setResponse("");
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
+               EPUser user = mockUser.mockEPUser();
+               user.setLoginId("guestT");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               Mockito.when(mockedRequest.getParameter("isCheck")).thenReturn("test");
+               Mockito.when(userService.saveNewUser(user, "test")).thenReturn("Success");
+               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, user);
+               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveNewUserexceptionest() throws Exception {
+               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
+               expectedportalRestResponse.setMessage("failure");
+               expectedportalRestResponse.setResponse(null);
+               PortalRestStatusEnum portalRestStatusEnum = null;
+               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
+               EPUser user = mockUser.mockEPUser();
+               user.setLoginId("guestT");
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
+               Mockito.when(mockedRequest.getParameter("isCheck")).thenReturn("test");
+               Mockito.when(userService.saveNewUser(user, "test")).thenThrow(nullPointerException);
+               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, user);
+               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void getCurrentUserProfileTest() {
+               String loginId = "guestT";
+               EPUser user = mockUser.mockEPUser();
+               List<EPUser> expectedList = new ArrayList<EPUser>();
+               expectedList.add(user);
+               Mockito.when(userService.getUserByUserId(loginId)).thenReturn(expectedList);
+               String expectedString = appsOSController.getCurrentUserProfile(mockedRequest, loginId);
+               assertEquals("{\"firstName\":\"test\",\"lastName\":\"test\"}", expectedString);
+       }
+
+       @Test
+       public void getCurrentUserProfileExceptionTest() {
+               String loginId = "guestT";
+               EPUser user = mockUser.mockEPUser();
+               List<EPUser> expectedList = new ArrayList<EPUser>();
+               expectedList.add(user);
+               Mockito.when(userService.getUserByUserId(loginId)).thenThrow(nullPointerException);
+               String expectedString = appsOSController.getCurrentUserProfile(mockedRequest, loginId);
+               assertEquals("{}", expectedString);
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/DashboardSearchResultControllerTest.java
new file mode 100644 (file)
index 0000000..d2a0c4e
--- /dev/null
@@ -0,0 +1,360 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.DashboardSearchResultController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.ecomp.model.PortalRestResponse;
+import org.onap.portalapp.portal.ecomp.model.PortalRestStatusEnum;
+import org.onap.portalapp.portal.ecomp.model.SearchResultItem;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.transport.CommonWidget;
+import org.onap.portalapp.portal.transport.CommonWidgetMeta;
+import org.onap.portalapp.util.EPUserUtils;
+
+public class DashboardSearchResultControllerTest {
+
+       @Mock
+       DashboardSearchService searchService;
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       @InjectMocks
+       DashboardSearchResultController dashboardSearchResultController = new DashboardSearchResultController();
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+
+       @Test
+       public void getWidgetDataTest() {
+               PortalRestResponse<CommonWidgetMeta> ecpectedPortalRestResponse = new PortalRestResponse<CommonWidgetMeta>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(new CommonWidgetMeta());
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+               Mockito.when(searchService.getWidgetData("test")).thenReturn(commonWidgetMeta);
+               PortalRestResponse<CommonWidgetMeta> actualPortalRestResponse = dashboardSearchResultController
+                               .getWidgetData(mockedRequest, "test");
+               assertEquals(ecpectedPortalRestResponse.getStatus(), actualPortalRestResponse.getStatus());
+       }
+
+       @Test
+       public void saveWidgetDataBulkIfCatrgoryNullTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("ERROR");
+               ecpectedPortalRestResponse.setResponse("Category cannot be null or empty");
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+               commonWidgetMeta.setCategory(null);
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataBulkTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+               commonWidgetMeta.setCategory("test");
+               List<CommonWidget> items = new ArrayList<>();
+
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setEventDate("2017-06-06");
+               items.add(commonWidget);
+               commonWidgetMeta.setItems(items);
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataBulkExceptionTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"date\"");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
+               commonWidgetMeta.setCategory("test");
+               List<CommonWidget> items = new ArrayList<>();
+
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setId((long) 1);
+               commonWidget.setEventDate("date");
+               items.add(commonWidget);
+               commonWidgetMeta.setItems(items);
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetDataBulk(commonWidgetMeta);
+               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataIfCatagoryNullTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("ERROR");
+               ecpectedPortalRestResponse.setResponse("Cateogry cannot be null or empty");
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setCategory(null);
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetData(commonWidget);
+               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setCategory("test");
+               commonWidget.setId((long) 1);
+               commonWidget.setEventDate("2017-06-06");
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetData(commonWidget);
+               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
+       }
+
+       @Test
+       public void saveWidgetDataExceptionTest() {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"date\"");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
+               CommonWidget commonWidget = new CommonWidget();
+               commonWidget.setCategory("test");
+               commonWidget.setId((long) 1);
+               commonWidget.setEventDate("date");
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .saveWidgetData(commonWidget);
+               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
+       }
+       
+       @Test
+       public void deleteWidgetDataTest()
+       {
+               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
+               ecpectedPortalRestResponse.setMessage("success");
+               ecpectedPortalRestResponse.setResponse(null);
+               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
+               CommonWidget commonWidget = new CommonWidget();
+               Mockito.when(searchService.deleteWidgetData(commonWidget)).thenReturn("test");
+               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
+                               .deleteWidgetData(commonWidget);
+               assertEquals(ecpectedPortalRestResponse.getStatus(), actualPortalRestResponse.getStatus());
+       }
+       
+       @Test
+       public void searchPortalIfUserIsTest()
+       {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = "test";
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("searchPortal: User object is null? - check logs");
+               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               System.out.println(actualResult);
+
+               assertEquals(expectedResult, actualResult);
+       }
+       
+       
+       @Test
+       public void getActiveUsersTest() {
+               List<String> expectedActiveUsers = new ArrayList<String>();
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String userId = user.getOrgUserId();
+               Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(expectedActiveUsers);
+               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
+               assertEquals(expectedActiveUsers, actualOnlineUsers);
+
+       }
+
+       @Test
+       public void getActiveUsersExceptionTest() {
+               List<String> expectedActiveUsers = new ArrayList<String>();
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String userId = user.getOrgUserId();
+               Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
+               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
+               assertEquals(expectedActiveUsers, actualOnlineUsers);
+
+       }
+
+       @Test
+       public void activeUsersTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
+               expectedResult.setMessage("success");
+               expectedResult.setResponse(new ArrayList<>());
+               expectedResult.setStatus(PortalRestStatusEnum.OK);
+               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
+
+               assertEquals(actualResult, expectedResult);
+
+       }
+
+       @Test
+       public void activeUsersIfUserNullTest() {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
+               expectedResult.setMessage("User object is null? - check logs");
+               expectedResult.setResponse(new ArrayList<>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
+               assertEquals(actualResult, expectedResult);
+
+       }
+
+       @Test
+       public void activeUsersExceptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
+               expectedResult.setMessage("null - check logs.");
+               expectedResult.setResponse(new ArrayList<>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+               Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
+               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
+               assertEquals(actualResult, expectedResult);
+
+       }
+       
+       @Test
+       public void searchPortalIfSearchStringNullTest() {
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = null;
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("searchPortal: String string is null");
+               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+       }
+
+       @Test
+       public void searchPortalIfSearchTest() {
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = "test";
+               List<SearchResultItem> searchResultItemList = new ArrayList<SearchResultItem>();
+               SearchResultItem searchResultItem = new SearchResultItem();
+
+               searchResultItem.setId((long) 1);
+               searchResultItem.setCategory("test");
+               searchResultItem.setName("test_name");
+               searchResultItem.setTarget("test_target");
+               searchResultItem.setUuid("test_UUId");
+               searchResultItemList.add(searchResultItem);
+               Map<String, List<SearchResultItem>> expectedResultMap = new HashMap<String, List<SearchResultItem>>();
+               expectedResultMap.put(searchString, searchResultItemList);
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("success");
+               expectedResult.setResponse(expectedResultMap);
+               expectedResult.setStatus(PortalRestStatusEnum.OK);
+
+               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenReturn(expectedResultMap);
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+
+       }
+
+       @Test
+       public void searchPortalIfSearchExcptionTest() {
+               EPUser user = mockUser.mockEPUser();
+               ;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               String searchString = "test";
+
+               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
+               expectedResult.setMessage("null - check logs.");
+               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
+               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
+
+               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenThrow(nullPointerException);
+               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
+                               .searchPortal(mockedRequest, searchString);
+               assertEquals(expectedResult, actualResult);
+       }
+
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ECOMPLogoutControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ECOMPLogoutControllerTest.java
new file mode 100644 (file)
index 0000000..20f3fe7
--- /dev/null
@@ -0,0 +1,114 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import javax.servlet.ServletRequestWrapper;
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.stubbing.OngoingStubbing;
+import org.onap.portalapp.controller.ECOMPLogoutController;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.DashboardSearchService;
+import org.onap.portalapp.portal.service.DashboardSearchServiceImpl;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.util.EPUserUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.springframework.core.NamedThreadLocal;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+import org.springframework.web.servlet.ModelAndView;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({EPUserUtils.class, EPCommonSystemProperties.class,RequestContextHolder.class,RequestAttributes.class})
+public class ECOMPLogoutControllerTest {
+
+       @Mock
+       DashboardSearchService searchService = new DashboardSearchServiceImpl();
+       
+       @InjectMocks
+       ECOMPLogoutController ecompLogoutController = new ECOMPLogoutController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       MockEPUser mockUser = new MockEPUser();
+       
+       @Mock
+       RequestContextHolder requestContextHolder;
+       
+       @Mock
+       RequestAttributes requestAttributes;
+       
+       @Test
+       public void logOutTest() throws Exception{
+               ModelAndView actualData = new ModelAndView("redirect:login.htm");
+               ModelAndView expedtedData = null;
+               ThreadLocal<RequestAttributes> requestAttributesHolder =
+                               new NamedThreadLocal<RequestAttributes>("Request attributes");
+               RequestAttributes requestAttributes = new ServletRequestAttributes(mockedRequest);
+               PowerMockito.mockStatic(RequestContextHolder.class);
+               PowerMockito.mockStatic(RequestAttributes.class);
+           Mockito.when((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).thenReturn((ServletRequestAttributes) requestAttributes);
+               expedtedData = ecompLogoutController.logOut(mockedRequest, mockedResponse);
+               assertEquals(actualData.getViewName(),expedtedData.getViewName());
+       }
+       
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java
new file mode 100644 (file)
index 0000000..e881112
--- /dev/null
@@ -0,0 +1,199 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.ExternalAppsRestfulController;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.FunctionalMenuService;
+import org.onap.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
+import org.onap.portalapp.portal.transport.FunctionalMenuItem;
+import org.onap.portalapp.portal.utils.EPCommonSystemProperties;
+import org.onap.portalapp.portal.utils.EPSystemProperties;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+import org.slf4j.MDC;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ MDC.class, EPSystemProperties.class , EcompPortalUtils.class})
+public class ExternalAppsRestfulControllerOSTest {
+
+       
+       @InjectMocks
+       ExternalAppsRestfulController externalAppsRestfulController = new ExternalAppsRestfulController();
+       @Mock
+       FunctionalMenuService functionalMenuService;
+       
+       @Mock
+       EPLoginService epLoginService;
+       
+       @Mock
+       AdminRolesService adminRolesService;
+       
+       
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       MockEPUser mockUser = new MockEPUser();
+       
+       @Test
+       public void getFavoritesForUserTest() throws Exception
+       {
+               PowerMockito.mockStatic(EPSystemProperties.class);
+               PowerMockito.mockStatic(MDC.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               EPUser epUser = mockUser.mockEPUser();
+               epUser.setId((long) 1);
+               epUser.setLoginId("guestT");
+               String loginId = "guestT";
+               Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
+               FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
+               favorites.add(favoritesFunctionalMenuItemJson);
+               Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
+               Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               Mockito.when(epLoginService.findUserWithoutPwd("Login_URL")).thenReturn(epUser);
+               Mockito.when(functionalMenuService.getFavoriteItems(epUser.getId())).thenReturn(favorites);
+               List<FavoritesFunctionalMenuItemJson> actaulFavorites = externalAppsRestfulController
+                               .getFavoritesForUser(mockedRequest, mockedResponse);
+               assertEquals(actaulFavorites.size(), 1);
+       }
+       
+       @Test
+       public void getFunctionalMenuItemsForUserIfSuperAdminTest() throws Exception {
+               PowerMockito.mockStatic(EPSystemProperties.class);
+               PowerMockito.mockStatic(MDC.class);
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               EPUser epUser = mockUser.mockEPUser();
+               epUser.setId((long) 1);
+               epUser.setLoginId("guestT");
+               String loginId = "guestT";
+               Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+               Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+               List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
+               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+               expectedList.add(functionalMenuItem);
+               Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
+               Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(true);
+               Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(expectedList);
+               List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+                               mockedResponse);
+               assertNull(actualList.get(0).menuId);
+       }
+
+        @Test(expected = Exception.class)
+        public void getFunctionalMenuItemsForUserIfUSerNullTest() throws
+        Exception
+        {
+        PowerMockito.mockStatic(EPSystemProperties.class);
+        PowerMockito.mockStatic(EcompPortalUtils.class);
+        PowerMockito.mockStatic(MDC.class);
+        EPUser epUser = null;
+        String loginId = "guestT";
+        Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+        Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+        externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+        mockedResponse);
+        }
+        
+           @Test
+               public void getFunctionalMenuItemsForUserTest() throws Exception {
+                       PowerMockito.mockStatic(EPSystemProperties.class);
+                       PowerMockito.mockStatic(MDC.class);
+                       EPUser epUser = mockUser.mockEPUser();
+                       epUser.setId((long) 1);
+                       epUser.setLoginId("guestT");
+                       String loginId = "guestT";
+                       Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+                       Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
+                       List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
+                       FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
+                       expectedList.add(functionalMenuItem);
+                       Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
+                       Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(false);
+                       Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId()))
+                                       .thenReturn(expectedList);
+                       List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
+                                       mockedResponse);
+                       assertNull(actualList.get(0).menuId);
+               }
+
+           @Test(expected = Exception.class)
+               public void getFavoritesForUserIfUserNullTest() throws Exception {
+                       List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
+                       FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
+                       favorites.add(favoritesFunctionalMenuItemJson);
+                       PowerMockito.mockStatic(EPSystemProperties.class);
+                       PowerMockito.mockStatic(MDC.class);
+                       Mockito.when(mockedRequest.getHeader(EPSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
+                       Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
+                       EPUser epUser = null;
+                       externalAppsRestfulController.getFavoritesForUser(mockedRequest, mockedResponse);
+               }
+
+               
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/LoginControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/LoginControllerTest.java
new file mode 100644 (file)
index 0000000..983584e
--- /dev/null
@@ -0,0 +1,121 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.LoginController;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.EPLoginService;
+import org.onap.portalapp.portal.service.EPRoleFunctionService;
+import org.onap.portalapp.portal.service.EPRoleService;
+import org.onap.portalapp.portal.service.SharedContextService;
+import org.onap.portalapp.service.EPProfileService;
+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.web.servlet.ModelAndView;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(SystemProperties.class)
+public class LoginControllerTest {
+
+       @Mock
+       EPProfileService service;
+       @Mock
+    EPLoginService loginService;
+       @Mock
+        SharedContextService sharedContextService;
+       @Mock
+        EPRoleService roleService;
+       @Mock
+        EPRoleFunctionService ePRoleFunctionService;
+       
+       @InjectMocks
+       LoginController loginController = new LoginController();
+       
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       @Test
+       public void loginIfAuthNullTest()
+       {
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn(null);
+               ModelAndView result = loginController.login(mockedRequest);
+               assertEquals(result.getViewName(),"openIdLogin") ;
+       }
+       
+       @Test
+       public void loginIfAuthOIDCTest()
+       {
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("OIDC");
+               ModelAndView result = loginController.login(mockedRequest);
+               assertEquals(result.getViewName(),"login") ;
+       }
+       
+       @Test
+       public void loginTest()
+       {
+               PowerMockito.mockStatic(SystemProperties.class);
+               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("Test");
+               ModelAndView result = loginController.login(mockedRequest);
+               assertEquals(result.getViewName(),"login") ;
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPLoginControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPLoginControllerTest.java
new file mode 100644 (file)
index 0000000..ab01a0c
--- /dev/null
@@ -0,0 +1,128 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.ONAPLoginController;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalsdk.core.auth.LoginStrategy;
+import org.onap.portalsdk.core.service.LoginService;
+import org.onap.portalsdk.core.service.ProfileService;
+import org.onap.portalsdk.core.service.ProfileServiceImpl;
+import org.springframework.web.servlet.ModelAndView;
+
+public class ONAPLoginControllerTest { 
+       
+       @Mock
+       ProfileService ProfileService = new ProfileServiceImpl();
+       
+       @Mock
+       LoginService mockLoginService;
+       
+       @Mock
+       LoginStrategy loginStrategy ;
+       
+       @InjectMocks
+       ONAPLoginController oNAPLoginController = new ONAPLoginController();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       MockEPUser mockUser = new MockEPUser();
+       
+       
+       @Test
+       public void doLogin() throws Exception
+       {
+               ModelAndView expectedModelandView = null;
+               ModelAndView actualModelandView = null;
+               Mockito.when(loginStrategy.doLogin(mockedRequest, mockedResponse)).thenReturn(expectedModelandView);
+               actualModelandView= oNAPLoginController.doLogin(mockedRequest, mockedResponse);
+               oNAPLoginController.setViewName("test");
+               assertEquals("test", oNAPLoginController.getViewName());        
+               assertEquals(actualModelandView,expectedModelandView);
+       }
+       
+       
+       @Test
+       public void ViewTest() throws Exception
+       {
+               ModelAndView expectedModelandView = new ModelAndView();
+               expectedModelandView.setViewName("testView");
+               ModelAndView actualModelandView = null;
+               Mockito.when(loginStrategy.doLogin(mockedRequest, mockedResponse)).thenReturn(expectedModelandView);
+               actualModelandView= oNAPLoginController.doLogin(mockedRequest, mockedResponse);
+               assertEquals(actualModelandView.getViewName(),expectedModelandView.getViewName());
+       }
+       @Test
+       public void getJessionIdTest() throws Exception
+       {
+        assertNull(oNAPLoginController.getJessionId(mockedRequest));
+       }
+       
+       @Test
+       public void getLoginServiceTest() throws Exception
+       {
+               LoginService expectedLoginService =     oNAPLoginController.getLoginService();
+               assertEquals(mockLoginService,expectedLoginService);
+       }
+       
+       
+       
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPWelcomeControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/ONAPWelcomeControllerTest.java
new file mode 100644 (file)
index 0000000..c9c18b7
--- /dev/null
@@ -0,0 +1,101 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.controller;
+
+import static org.junit.Assert.*;
+
+import java.security.Principal;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.controller.ONAPWelcomeController;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.springframework.ui.Model;
+import org.springframework.web.servlet.ModelAndView;
+
+public class ONAPWelcomeControllerTest {
+
+       @InjectMocks
+       ONAPWelcomeController oNAPWelcomeController = new ONAPWelcomeController();
+       
+       @Mock
+       Principal p;
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       @Test
+       public void getIndexPageTest()
+       {
+               assertEquals(oNAPWelcomeController.getIndexPage(mockedRequest), "/index");
+       }
+       
+       @Test
+       public void getEcompSinglePageTest()
+       {
+               assertEquals(oNAPWelcomeController.getEcompSinglePage(mockedRequest, mockedResponse), "forward:/index.html");
+       }
+       
+       @Test
+       public void userTest()
+       {
+               assertEquals(oNAPWelcomeController.user(null), "oid-user");
+       }
+       
+       @Test
+       public void loginTest()
+       {
+               ModelAndView expectedView = new ModelAndView();
+               expectedView.setViewName("openIdLogin");
+               ModelAndView md = oNAPWelcomeController.login(p);
+               System.out.println(md.getViewName());
+               assertEquals(md.getViewName(), expectedView.getViewName());
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerOSTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/controller/PortalAdminControllerOSTest.java
new file mode 100644 (file)
index 0000000..a8d8e49
--- /dev/null
@@ -0,0 +1,242 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+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.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.controller.PortalAdminController;
+import org.onap.portalapp.portal.domain.EPRole;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AdminRolesService;
+import org.onap.portalapp.portal.service.AdminRolesServiceImpl;
+import org.onap.portalapp.portal.service.PortalAdminService;
+import org.onap.portalapp.portal.service.PortalAdminServiceImpl;
+import org.onap.portalapp.portal.transport.FieldsValidator;
+import org.onap.portalapp.portal.transport.PortalAdmin;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.util.EPUserUtils;
+import org.onap.portalsdk.core.service.AuditService;
+import org.onap.portalsdk.core.service.AuditServiceImpl;
+
+public class PortalAdminControllerOSTest {
+
+       @InjectMocks
+       PortalAdminController portalAdminController = new PortalAdminController();
+
+       @Mock
+       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
+       
+       @Mock
+       PortalAdminService portalAdminService = new PortalAdminServiceImpl();
+
+       @Mock
+       AuditService auditService = new AuditServiceImpl();
+
+        
+       @Mock
+       EcompPortalUtils ecompPortalUtils = new EcompPortalUtils();
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+       NullPointerException nullPointerException = new NullPointerException();
+
+       @Mock
+       EPUserUtils ePUserUtils = new EPUserUtils();
+
+       MockEPUser mockUser = new MockEPUser();
+       
+       @Test
+       public void deletePortalAdminIfUserIsSuperAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Long userInfo = (long) 12;
+               assertNull(portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse));
+
+       }
+       
+       @Test
+       public void deletePortalAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+       
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Long userInfo = (long) 12;
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(portalAdminService.deletePortalAdmin((long) 12)).thenReturn(expectedFieldValidator);
+               actualFieldValidator = portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse);
+        assertEquals(actualFieldValidator,expectedFieldValidator);
+
+       }
+       
+       @Test
+       public void deletePortalAdminWithNoUserInfoTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               Long userInfo = null;
+               assertNull(portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse));
+       }
+       
+       @Test
+       public void getRolesByAppExceptionTest()
+       {
+               EPUser user = mockUser.mockEPUser();;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPRole> expectedRoleList = new ArrayList<EPRole>();        
+               EPRole ePRole = new EPRole();
+               expectedRoleList.add(ePRole);
+               Long appId = (long) 1;
+               Mockito.when(adminRolesService.getRolesByApp(user, appId)).thenThrow(nullPointerException);
+               assertNull(portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse));
+       }
+       
+       @Test
+       public void getRolesByAppIfUserNullTest()
+       {
+               EPUser user = null;
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Long appId = (long) 1;
+               assertNull(portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse));
+       }
+       
+       @Test
+       public void getRolesByAppTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<EPRole> expectedRoleList = new ArrayList<EPRole>();        
+               EPRole ePRole = new EPRole();
+               expectedRoleList.add(ePRole);
+               Long appId = (long) 1;
+               Mockito.when(adminRolesService.getRolesByApp(user, appId)).thenReturn(expectedRoleList);
+               List<EPRole> actualRoleList =   portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse);
+               assertEquals(actualRoleList,expectedRoleList);
+       }
+       
+       @Test
+       public void createPortalAdminIfUserNullTest()
+       {
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+               assertNull(portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse));
+       }
+       
+       
+       @Test
+       public void createPortalAdminIfUserIsSuperAdminTest()
+       {
+
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               FieldsValidator expectedFieldValidator = new FieldsValidator();
+               expectedFieldValidator.setHttpStatusCode((long) 200);
+               expectedFieldValidator.setFields(null);
+               expectedFieldValidator.setErrorCode(null);
+               FieldsValidator actualFieldValidator = new FieldsValidator();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(portalAdminService.createPortalAdmin("guestT")).thenReturn(expectedFieldValidator);
+               actualFieldValidator = portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse);
+        assertEquals(actualFieldValidator,expectedFieldValidator);
+       }
+       
+       @Test
+       public void createPortalAdminIfUserIsNotSuperAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               assertNull(portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse));
+       }
+               
+       @Test
+       public void getPortalAdminsIfUserNullTest()
+       {
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
+               assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
+       }
+       
+       @Test
+       public void getPortalAdminsIfUserAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               List<PortalAdmin> portalAdmins = new ArrayList<>();
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
+               Mockito.when(portalAdminService.getPortalAdmins()).thenReturn(portalAdmins);
+               List<PortalAdmin> actualortalAdmins = portalAdminController.getPortalAdmins(mockedRequest, mockedResponse);
+        assertEquals(actualortalAdmins,portalAdmins);
+       }
+       
+       @Test
+       public void getPortalAdminIfUserIsNotSuperAdminTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
+               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
+               assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockEPUser.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockEPUser.java
new file mode 100644 (file)
index 0000000..99c9654
--- /dev/null
@@ -0,0 +1,102 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.framework;
+
+import java.util.Date;
+
+import org.onap.portalapp.portal.domain.EPUser;
+
+public class MockEPUser {
+
+       public EPUser mockEPUser() {
+
+               EPUser ePUser = new EPUser();
+               ePUser.setOrgId(null);
+               ePUser.setManagerId(null);
+               ePUser.setFirstName("test");
+               ePUser.setLastName("test");
+               ePUser.setMiddleInitial(null);
+               ePUser.setPhone(null);
+               ePUser.setFax(null);
+               ePUser.setCellular(null);
+               ePUser.setEmail(null);
+               ePUser.setAddressId(null);
+               ePUser.setAlertMethodCd(null);
+               ePUser.setHrid(null);
+               ePUser.setOrgUserId("guestT");
+               ePUser.setOrgCode(null);
+               ePUser.setAddress1(null);
+               ePUser.setAddress2(null);
+               ePUser.setCity(null);
+               ePUser.setState(null);
+               ePUser.setZipCode(null);
+               ePUser.setCountry(null);
+               ePUser.setOrgManagerUserId(null);
+               ePUser.setLocationClli(null);
+               ePUser.setBusinessCountryCode(null);
+               ePUser.setBusinessCountryName(null);
+               ePUser.setBusinessUnit(null);
+               ePUser.setBusinessUnitName(null);
+               ePUser.setDepartment(null);
+               ePUser.setDepartmentName(null);
+               ePUser.setCompanyCode(null);
+               ePUser.setCompany(null);
+               ePUser.setZipCodeSuffix(null);
+               ePUser.setJobTitle(null);
+               ePUser.setCommandChain(null);
+               ePUser.setSiloStatus(null);
+               ePUser.setCostCenter(null);
+               ePUser.setFinancialLocCode(null);
+
+               ePUser.setLoginId(null);
+               ePUser.setLoginPwd(null);
+               Date date = new Date();
+               ePUser.setLastLoginDate(date);
+               ePUser.setActive(true);
+               ePUser.setInternal(false);
+               ePUser.setSelectedProfileId(null);
+               ePUser.setTimeZoneId(null);
+               ePUser.setOnline(true);
+               ePUser.setChatId(null);
+               ePUser.setUserApps(null);
+               ePUser.setPseudoRoles(null);
+
+               ePUser.setId((long) -1);
+               return ePUser;
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/framework/MockitoTestSuite.java
new file mode 100644 (file)
index 0000000..219bc86
--- /dev/null
@@ -0,0 +1,93 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.framework;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class MockitoTestSuite {
+
+
+       public MockHttpServletRequestWrapper mockedRequest = new MockHttpServletRequestWrapper(
+                       Mockito.mock(HttpServletRequest.class));
+       public HttpServletResponse mockedResponse = Mockito.mock(HttpServletResponse.class);
+
+       public MockHttpServletRequestWrapper getMockedRequest() {
+               return mockedRequest;
+       }
+
+       public HttpServletResponse getMockedResponse() {
+               return mockedResponse;
+       }
+
+       public class MockHttpServletRequestWrapper extends HttpServletRequestWrapper {
+
+               HttpSession session = Mockito.mock(HttpSession.class);
+
+               public MockHttpServletRequestWrapper(HttpServletRequest request) {
+                       super(request);
+
+               }
+
+               @Override
+               public HttpSession getSession() {
+
+                       return session;
+               }
+
+               @Override
+               public HttpSession getSession(boolean create) {
+
+                       return session;
+               }
+
+       }
+       @Test
+       public void test()
+       {
+               assert(true);
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/listener/HealthMonitorTest.java
new file mode 100644 (file)
index 0000000..929c8e3
--- /dev/null
@@ -0,0 +1,55 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.listener;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.listener.HealthMonitor;
+
+public class HealthMonitorTest {
+
+       @Test
+       public void initialFlagsTest() {
+               assertEquals(false, HealthMonitor.isBackEndUp());
+               assertEquals(false, HealthMonitor.isFrontEndUp());
+               assertEquals(false, HealthMonitor.isDatabaseUp());
+               assertEquals(false, HealthMonitor.isUebUp());
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..ad208f3
--- /dev/null
@@ -0,0 +1,186 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalsdk.core.util.SystemProperties;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.domain.EPApp;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.AppsCacheService;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.onap.portalapp.service.RemoteWebServiceCallServiceImpl;
+import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.service.DataAccessService;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ CipherUtil.class , SystemProperties.class})
+public class RemoteWebServiceCallServiceImplTest {
+       
+
+       @InjectMocks
+       RemoteWebServiceCallServiceImpl remoteWebServiceCallServiceImpl = new RemoteWebServiceCallServiceImpl();
+
+       @Mock
+       AppsCacheService appCacheService;
+       
+       @Mock
+       DataAccessService dataAccessService;
+       
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       
+       @Test
+       public void verifyRESTCredentialTest() throws Exception
+       {
+               PowerMockito.mockStatic(CipherUtil.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               String criteria= " where ueb_key = 'requestUebKey'";
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = new EPApp();
+               app.setAppPassword("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");
+               assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","requestPassword"));
+       }
+       
+       @Test
+       public void verifyRESTCredentialExceptionTest() throws Exception
+       {
+               PowerMockito.mockStatic(CipherUtil.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               String criteria= " where ueb_key = 'requestUebKey'";
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = new EPApp();
+               app.setAppPassword("password");
+               app.setUsername("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");
+               assertTrue(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd"));
+       }
+       
+       @Test
+       public void verifyRESTCredentialIfAppNullTest() throws Exception
+       {
+               PowerMockito.mockStatic(CipherUtil.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               String criteria= " where ueb_key = 'requestUebKey'";
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = new EPApp();
+               app.setAppPassword("password");
+               app.setUsername("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");
+               assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd"));
+       }
+       
+       @Test
+       public void verifyAppKeyCredentialIfKeyIsNullTest() throws Exception
+       {
+               assertFalse(remoteWebServiceCallServiceImpl.verifyAppKeyCredential(null));
+       }
+       
+       @Test
+       public void verifyAppKeyCredentialTest() throws Exception
+       {
+               PowerMockito.mockStatic(CipherUtil.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               StringBuffer criteria = new  StringBuffer("where ueb_key = 'requestUebKey'");
+//             String criteria= " where ueb_key = 'requestUebKey'";
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = new EPApp();
+               app.setAppPassword("password");
+               app.setUsername("requestAppName");
+               appList.add(app);
+               Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null);
+               assertFalse(remoteWebServiceCallServiceImpl.verifyAppKeyCredential("test"));
+       }
+       
+       @Test
+       public void verifyAppKeyCredentialSuccessTest() throws Exception
+       {
+               PowerMockito.mockStatic(CipherUtil.class);
+               PowerMockito.mockStatic(SystemProperties.class);
+               String criteria= " where ueb_key = 'test'";
+               List<EPApp> appList = new ArrayList<>();
+               EPApp app = new EPApp();
+               app.setAppPassword("password");
+               app.setUsername("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/portal/service/SearchServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/SearchServiceImplTest.java
new file mode 100644 (file)
index 0000000..339f4eb
--- /dev/null
@@ -0,0 +1,228 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+
+import static org.junit.Assert.*;
+
+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.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.onap.portalapp.portal.domain.EPUser;
+import org.onap.portalapp.portal.framework.MockEPUser;
+import org.onap.portalapp.portal.framework.MockitoTestSuite;
+import org.onap.portalapp.portal.service.SearchServiceImpl;
+import org.onap.portalapp.portal.service.UserService;
+import org.onap.portalapp.portal.transport.UserWithNameSurnameTitle;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ EcompPortalUtils.class})
+public class SearchServiceImplTest {
+       
+       @InjectMocks
+       SearchServiceImpl searchServiceImpl = new SearchServiceImpl();
+
+       @Mock
+       UserService userService;
+       
+
+       @Before
+       public void setup() {
+               MockitoAnnotations.initMocks(this);
+       }
+
+       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+
+       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+
+       NullPointerException nullPointerException = new NullPointerException();
+       MockEPUser mockUser = new MockEPUser();
+       
+       @Test
+       public void searchUsersInPhoneBookTest()
+       {
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+               List<String> list = new ArrayList<>();
+               String str = "Test";
+               list.add(str);
+               Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list);
+               assertEquals(searchServiceImpl.searchUsersInPhoneBook("Test"), "[]");
+       }
+       
+       @Test
+       public void searchUsersInFnTableToFindUserIdTest()
+       {
+       PowerMockito.mockStatic(EcompPortalUtils.class);
+       List<String> list = new ArrayList<>();
+       String str = "Test";
+       String str2 = "Test new";
+       String str1 = "Test new1";
+       list.add(str);
+       list.add(str1);
+       list.add(str2);
+       Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list);
+       List<EPUser> userList = new ArrayList();
+       EPUser user = mockUser.mockEPUser();
+       user.setLastName("Test new");
+       userList.add(user);
+       Mockito.when( this.userService.getUserByFirstLastName("Test","Test new")).thenReturn(userList);
+       String result = searchServiceImpl.searchUsersInPhoneBook("Test");
+       assertEquals("[{\"orgUserId\":\"guestT\",\"firstName\":\"test\",\"lastName\":\"Test new\",\"jobTitle\":null}]" , result);
+       }
+       
+       
+       
+       @Test
+       public void searchUsersInFnTableFirstNameTest()
+       {
+       PowerMockito.mockStatic(EcompPortalUtils.class);
+       List<String> list = new ArrayList<>();
+       String str = "TestTT";
+       String str2 = "Test new1";
+       String str1 = "Test new";
+       String str3 = "Test new2";
+       list.add(str);
+       list.add(str1);
+       list.add(str2);
+       list.add(str3);
+       Mockito.when(EcompPortalUtils.parsingByRegularExpression("TestTT", " ")).thenReturn(list);
+       List<EPUser> userList = new ArrayList();
+       EPUser user = mockUser.mockEPUser();
+       user.setLastName("Test new");
+       user.setFirstName(null);
+       userList.add(user);
+       Mockito.when( this.userService.getUserByFirstLastName("TestTT","Test new")).thenReturn(userList);
+       assertEquals(searchServiceImpl.searchUsersInPhoneBook("TestTT"), "[]"); }
+
+       
+       @Test
+       public void searchUsersInFnTableLastNameTest()
+       {
+               PowerMockito.mockStatic(EcompPortalUtils.class);
+           List<String> list = new ArrayList<>();
+               String str = "Test";
+               String str2 = "Test new";
+               String str1 = "Test new1";
+               list.add(str);
+               list.add(str1);
+               list.add(str2);
+               Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list);
+               List<EPUser> userList = new ArrayList();
+               EPUser user = mockUser.mockEPUser();
+               user.setLastName(null);
+               userList.add(user);
+               Mockito.when( this.userService.getUserByFirstLastName("Test","Test new")).thenReturn(userList);
+               assertEquals(searchServiceImpl.searchUsersInPhoneBook("Test"), "[]");   }
+               
+       
+
+       @Test
+       public void searchUserByUserIdTest()
+       {
+               List<EPUser> userList = new ArrayList();
+               EPUser user = mockUser.mockEPUser();
+               user.setLastName("Test new");
+               userList.add(user);
+               List<EPUser> foundUsers = new ArrayList<EPUser>();
+               Mockito.when(this.userService.getUserByUserId("guestT")).thenReturn(userList);
+               
+               EPUser expectedUser = searchServiceImpl.searchUserByUserId("guestT");
+               assertEquals(user, expectedUser);
+       }
+       
+       @Test
+       public void searchUserByUserIdExceptionTest()
+       {
+               Mockito.when(this.userService.getUserByUserId("guestT")).thenThrow(nullPointerException);
+               assertNull(searchServiceImpl.searchUserByUserId("guestT"));
+               
+       }
+       
+       @Test
+       public void searchUsersByUserIdTest()
+       {
+               
+               List<EPUser> userList = new ArrayList();
+               EPUser user = mockUser.mockEPUser();
+               user.setLastName("Test new");
+               userList.add(user);
+               Mockito.when(this.userService.getUserByUserId("guestT")).thenReturn(userList);
+               List<UserWithNameSurnameTitle> foundUsers = searchServiceImpl.searchUsersByUserId(user);
+               assertEquals(foundUsers.size(), 1);
+               
+       }
+       
+       @Test
+       public void searchUsersByUserIdExceptionTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               user.setLastName("Test new");
+               Mockito.when(this.userService.getUserByUserId("guestT")).thenThrow(nullPointerException);
+               List<UserWithNameSurnameTitle> foundUsers =  searchServiceImpl.searchUsersByUserId(user);
+               assertEquals(foundUsers.size(), 0);
+               
+       }
+       
+       @Test
+       public void searchUsersByNameExceptionTest()
+       {
+               EPUser user = mockUser.mockEPUser();
+               user.setLastName("test");
+               user.setFirstName("test");
+
+               Mockito.when(this.userService.getUserByFirstLastName("test","test")).thenThrow(nullPointerException);
+               List<UserWithNameSurnameTitle> foundUsers =     searchServiceImpl.searchUsersByName(user);
+               assertEquals(foundUsers.size(), 0);
+               
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/UserServiceImplTest.java
new file mode 100644 (file)
index 0000000..f4afb0f
--- /dev/null
@@ -0,0 +1,101 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.service;
+//package org.openecomp.portalapp.portal.service;
+//
+//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.Mock;
+//import org.mockito.Mockito;
+//import org.mockito.MockitoAnnotations;
+//import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
+//import org.openecomp.portalapp.portal.utils.EPSystemProperties;
+//import org.openecomp.portalsdk.core.service.DataAccessService;
+//import org.openecomp.portalsdk.core.util.SystemProperties;
+//import org.powermock.api.mockito.PowerMockito;
+//
+//import java.io.BufferedReader;
+//import java.io.IOException;
+//import java.io.InputStreamReader;
+//import java.io.UnsupportedEncodingException;
+//import java.net.HttpURLConnection;
+//import org.powermock.core.classloader.annotations.PrepareForTest;
+//import org.powermock.modules.junit4.PowerMockRunner;
+//
+//
+//@RunWith(PowerMockRunner.class)
+//@PrepareForTest({ SystemProperties.class , EPSystemProperties.class , SystemProperties.class})
+//public class UserServiceImplTest {
+//
+//     
+//     @InjectMocks
+//     UserServiceImpl userServiceImpl = new UserServiceImpl();
+//
+//     @Mock
+//     DataAccessService dataAccessService;
+//     
+//     @Mock
+//     HttpURLConnection con;
+//     
+//     @Before
+//     public void setup() {
+//             MockitoAnnotations.initMocks(this);
+//     }
+//
+//     MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
+//
+//     HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
+//     HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
+//     
+//     @Test
+//     public void getUserByUserIdTest() throws UnsupportedEncodingException, IOException
+//     {
+//              BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
+//             PowerMockito.mockStatic(SystemProperties.class);
+//             PowerMockito.mockStatic(EPSystemProperties.class);
+//             Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("OIDC");
+//             Mockito.when(EPSystemProperties.getProperty(EPSystemProperties.AUTH_USER_SERVER)).thenReturn("http://www.google.com");
+//             Mockito.when(new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"))).thenReturn(reader).thenReturn(reader);
+//             userServiceImpl.getUserByUserId("guestT");
+//     }
+//}
diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/utils/EcompPortalUtilsTest.java
new file mode 100644 (file)
index 0000000..532c720
--- /dev/null
@@ -0,0 +1,52 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+package org.onap.portalapp.portal.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.onap.portalapp.portal.utils.EcompPortalUtils;
+
+public class EcompPortalUtilsTest {
+
+       
+       @Test
+       public void legitimateUserIdFailureTest() {
+               assertEquals(false, EcompPortalUtils.legitimateUserId("1#@23456"));
+       }
+}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/OpenIdConnectLoginStrategyTest.java
deleted file mode 100644 (file)
index 2d0f795..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.authentication;
-
-import static org.junit.Assert.*;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mitre.openid.connect.model.DefaultUserInfo;
-import org.mitre.openid.connect.model.UserInfo;
-import org.mockito.InjectMocks;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.authentication.OpenIdConnectLoginStrategy;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalapp.util.SessionCookieUtil;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.util.StringUtils;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({StringUtils.class, EPUserUtils.class , SessionCookieUtil.class,SystemProperties.class})
-public class OpenIdConnectLoginStrategyTest {
-       
-       @InjectMocks
-       OpenIdConnectLoginStrategy OpenIdConnectLoginStrategy = new OpenIdConnectLoginStrategy();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-               
-       @Test
-       public void loginTest()
-       {
-               PowerMockito.mockStatic(StringUtils.class);
-               PowerMockito.mockStatic(EPUserUtils.class);
-               PowerMockito.mockStatic(SessionCookieUtil.class);
-               
-               UserInfo  userInfo = new DefaultUserInfo();
-               userInfo.setPreferredUsername("Test");
-               userInfo.setEmail("test@gmail.com");
-               userInfo.setName("first_name");
-               userInfo.setFamilyName("last_name");
-               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
-               assertTrue(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void loginIfUserNullTest()
-       {               
-               PowerMockito.mockStatic(SystemProperties.class);
-               UserInfo  userInfo = null;
-               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
-//             Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenReturn("auth");
-               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void loginIfUserIfAuthIsOIDCTest()
-       {               
-               PowerMockito.mockStatic(SystemProperties.class);
-               UserInfo  userInfo = null;
-               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
-               Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenReturn("OIDC");
-               Mockito.when(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL)).thenReturn("login_url");
-               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void loginIfUserIfAuthNotNullTest()
-       {               
-               PowerMockito.mockStatic(SystemProperties.class);
-               UserInfo  userInfo = null;
-               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
-               Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenReturn("test");
-               Mockito.when(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL)).thenReturn("login_url");
-               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void loginIfUserExceptionest()
-       {               
-               PowerMockito.mockStatic(SystemProperties.class);
-               UserInfo  userInfo = null;
-               Mockito.when(mockedRequest.getAttribute("userInfo")).thenReturn(userInfo);
-               Mockito.when(SystemProperties.getProperty("authentication_mechanism")).thenThrow(nullPointerException);
-               Mockito.when(SystemProperties.getProperty(EPSystemProperties.LOGIN_URL_NO_RET_VAL)).thenReturn("login_url");
-               assertFalse(OpenIdConnectLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-       @Test(expected =  Exception.class)
-       public void doLoginTest() throws Exception
-       {
-               OpenIdConnectLoginStrategy.doLogin(mockedRequest, mockedResponse);
-       }
-       
-       @Test(expected =  PortalAPIException.class)
-       public void getUserIdTest() throws Exception
-       {
-               OpenIdConnectLoginStrategy.getUserId(mockedRequest);
-       }
-       
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SessionTimeoutInterceptorTest.java
deleted file mode 100644 (file)
index c4946c6..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.authentication;
-
-import static org.junit.Assert.assertFalse;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.authentication.LoginStrategy;
-import org.openecomp.portalapp.authentication.SimpleLoginStrategy;
-import org.openecomp.portalapp.controller.EPFusionBaseController;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.interceptor.SessionTimeoutInterceptor;
-import org.springframework.web.method.HandlerMethod;
-
-public class SessionTimeoutInterceptorTest {
-
-       
-       @Mock
-       LoginStrategy loginStrategy = new SimpleLoginStrategy();
-       
-       @Mock
-       EPFusionBaseController ePFusionBaseController = new EPFusionBaseController() {
-       };
-       
-       @Mock
-       HandlerMethod handlerMethod;
-       
-       @InjectMocks
-       SessionTimeoutInterceptor  sessionTimeoutInterceptor = new  SessionTimeoutInterceptor();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       
-       @Test
-       public void preHandleTest() throws Exception{
-               assertFalse(sessionTimeoutInterceptor.preHandle(mockedRequest, mockedResponse, ePFusionBaseController));
-       }
-       
-       @Test
-       public void preHandleTestIfMethodIsinstanceOfHandlerMethod() throws Exception{
-               assertFalse(sessionTimeoutInterceptor.preHandle(mockedRequest, mockedResponse, handlerMethod));
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SimpleLoginStrategyTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/authentication/SimpleLoginStrategyTest.java
deleted file mode 100644 (file)
index 588bd89..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.authentication;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.authentication.SimpleLoginStrategy;
-import org.openecomp.portalapp.command.EPLoginBean;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.EPRoleService;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalapp.util.SessionCookieUtil;
-import org.openecomp.portalsdk.core.menu.MenuProperties;
-import org.openecomp.portalsdk.core.onboarding.exception.PortalAPIException;
-import org.openecomp.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.util.StringUtils;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ StringUtils.class, EPUserUtils.class, SessionCookieUtil.class, SystemProperties.class,
-               SessionCookieUtil.class, MenuProperties.class })
-public class SimpleLoginStrategyTest {
-
-       @InjectMocks
-       SimpleLoginStrategy simpleLoginStrategy = new SimpleLoginStrategy();
-
-       @Mock
-       EPLoginService loginService;
-       @Mock
-       EPRoleService roleService;
-       @Mock
-    EPRoleFunctionService ePRoleFunctionService;
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Test(expected = Exception.class)
-       public void loginTest() throws Exception {
-               PowerMockito.mockStatic(MenuProperties.class);
-               PowerMockito.mockStatic(SessionCookieUtil.class);
-               PowerMockito.mockStatic(StringUtils.class);
-               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
-               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(false);
-               EPLoginBean commandBean = new EPLoginBean();
-               EPUser user = new EPUser();
-               commandBean.setUser(user);
-               commandBean.setOrgUserId("guestT");
-               Mockito.when(mockedRequest.getAttribute(MenuProperties.MENU_PROPERTIES_FILENAME_KEY))
-                               .thenReturn("menu_properties_filename");
-               Mockito.when(loginService.findUser(commandBean, "menu_properties_filename", null)).thenReturn(commandBean);
-               assertTrue(simpleLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void loginIfUserEmptyTest() throws Exception {
-               PowerMockito.mockStatic(MenuProperties.class);
-               PowerMockito.mockStatic(SessionCookieUtil.class);
-               PowerMockito.mockStatic(StringUtils.class);
-               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
-               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
-               EPLoginBean commandBean = new EPLoginBean();
-               EPUser user = new EPUser();
-               commandBean.setUser(user);
-               commandBean.setOrgUserId("guestT");
-               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void loginIfAuthIsBothTest() throws Exception {
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(SessionCookieUtil.class);
-               PowerMockito.mockStatic(StringUtils.class);
-               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
-               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("BOTH");
-               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void loginIfAuthIsNotNullTest() throws Exception {
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(SessionCookieUtil.class);
-               PowerMockito.mockStatic(StringUtils.class);
-               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
-               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("Test");
-               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-
-       @Test
-       public void loginExceptionTest() throws Exception {
-               PowerMockito.mockStatic(SystemProperties.class);
-               PowerMockito.mockStatic(SessionCookieUtil.class);
-               PowerMockito.mockStatic(StringUtils.class);
-               Mockito.when(SessionCookieUtil.getUserIdFromCookie(mockedRequest, mockedResponse)).thenReturn("guestT");
-               Mockito.when(StringUtils.isEmpty("guestT")).thenReturn(true);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM))
-                               .thenThrow(nullPointerException);
-               assertFalse(simpleLoginStrategy.login(mockedRequest, mockedResponse));
-       }
-
-       @Test(expected = Exception.class)
-       public void doLoginTest() throws Exception {
-               simpleLoginStrategy.doLogin(mockedRequest, mockedResponse);
-       }
-
-       @Test(expected = PortalAPIException.class)
-       public void getUserIdTest() throws Exception {
-               simpleLoginStrategy.getUserId(mockedRequest);
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/AppsOSControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/AppsOSControllerTest.java
deleted file mode 100644 (file)
index eb2ea32..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPAppService;
-import org.openecomp.portalapp.portal.service.PersUserAppService;
-import org.openecomp.portalapp.portal.service.UserService;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class AppsOSControllerTest {
-
-       @Mock
-       AdminRolesService adminRolesService;
-
-       @Mock
-       EPAppService appService;
-
-       @Mock
-       PersUserAppService persUserAppService;
-
-       @Mock
-       UserService userService;
-
-       @Mock
-       EPUserUtils ePUserUtils;
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @InjectMocks
-       AppsOSController appsOSController = new AppsOSController();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void saveNewUserIfUserISNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("failure");
-               expectedportalRestResponse.setResponse("New User cannot be null or empty");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, null);
-               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveNewUserIfUserNOtNullTest() {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("failure");
-               expectedportalRestResponse.setResponse("UnAuthorized");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               EPUser user1 = mockUser.mockEPUser();
-               user1.setLoginId("guest");
-               user.setLoginId("guestT");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user1);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, user);
-               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveNewUserAndLoggedInUserIdSameTest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("Success");
-               expectedportalRestResponse.setResponse("");
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.OK);
-               EPUser user = mockUser.mockEPUser();
-               user.setLoginId("guestT");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               Mockito.when(mockedRequest.getParameter("isCheck")).thenReturn("test");
-               Mockito.when(userService.saveNewUser(user, "test")).thenReturn("Success");
-               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, user);
-               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveNewUserexceptionest() throws Exception {
-               PortalRestResponse<String> expectedportalRestResponse = new PortalRestResponse<String>();
-               expectedportalRestResponse.setMessage("failure");
-               expectedportalRestResponse.setResponse(null);
-               PortalRestStatusEnum portalRestStatusEnum = null;
-               expectedportalRestResponse.setStatus(portalRestStatusEnum.ERROR);
-               EPUser user = mockUser.mockEPUser();
-               user.setLoginId("guestT");
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Mockito.when(adminRolesService.isAccountAdmin(user)).thenReturn(false);
-               Mockito.when(mockedRequest.getParameter("isCheck")).thenReturn("test");
-               Mockito.when(userService.saveNewUser(user, "test")).thenThrow(nullPointerException);
-               PortalRestResponse<String> actualPortalRestResponse = appsOSController.saveNewUser(mockedRequest, user);
-               assertEquals(expectedportalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void getCurrentUserProfileTest() {
-               String loginId = "guestT";
-               EPUser user = mockUser.mockEPUser();
-               List<EPUser> expectedList = new ArrayList<EPUser>();
-               expectedList.add(user);
-               Mockito.when(userService.getUserByUserId(loginId)).thenReturn(expectedList);
-               String expectedString = appsOSController.getCurrentUserProfile(mockedRequest, loginId);
-               assertEquals("{\"firstName\":\"test\",\"lastName\":\"test\"}", expectedString);
-       }
-
-       @Test
-       public void getCurrentUserProfileExceptionTest() {
-               String loginId = "guestT";
-               EPUser user = mockUser.mockEPUser();
-               List<EPUser> expectedList = new ArrayList<EPUser>();
-               expectedList.add(user);
-               Mockito.when(userService.getUserByUserId(loginId)).thenThrow(nullPointerException);
-               String expectedString = appsOSController.getCurrentUserProfile(mockedRequest, loginId);
-               assertEquals("{}", expectedString);
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/DashboardSearchResultControllerTest.java
deleted file mode 100644 (file)
index b2a6c43..0000000
+++ /dev/null
@@ -1,359 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestResponse;
-import org.openecomp.portalapp.portal.ecomp.model.PortalRestStatusEnum;
-import org.openecomp.portalapp.portal.ecomp.model.SearchResultItem;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.transport.CommonWidget;
-import org.openecomp.portalapp.portal.transport.CommonWidgetMeta;
-import org.openecomp.portalapp.util.EPUserUtils;
-
-public class DashboardSearchResultControllerTest {
-
-       @Mock
-       DashboardSearchService searchService;
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       @InjectMocks
-       DashboardSearchResultController dashboardSearchResultController = new DashboardSearchResultController();
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-
-       @Test
-       public void getWidgetDataTest() {
-               PortalRestResponse<CommonWidgetMeta> ecpectedPortalRestResponse = new PortalRestResponse<CommonWidgetMeta>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(new CommonWidgetMeta());
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
-               Mockito.when(searchService.getWidgetData("test")).thenReturn(commonWidgetMeta);
-               PortalRestResponse<CommonWidgetMeta> actualPortalRestResponse = dashboardSearchResultController
-                               .getWidgetData(mockedRequest, "test");
-               assertEquals(ecpectedPortalRestResponse.getStatus(), actualPortalRestResponse.getStatus());
-       }
-
-       @Test
-       public void saveWidgetDataBulkIfCatrgoryNullTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("ERROR");
-               ecpectedPortalRestResponse.setResponse("Category cannot be null or empty");
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
-               commonWidgetMeta.setCategory(null);
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataBulkTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
-               commonWidgetMeta.setCategory("test");
-               List<CommonWidget> items = new ArrayList<>();
-
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setEventDate("2017-06-06");
-               items.add(commonWidget);
-               commonWidgetMeta.setItems(items);
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataBulkExceptionTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"date\"");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               CommonWidgetMeta commonWidgetMeta = new CommonWidgetMeta();
-               commonWidgetMeta.setCategory("test");
-               List<CommonWidget> items = new ArrayList<>();
-
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setId((long) 1);
-               commonWidget.setEventDate("date");
-               items.add(commonWidget);
-               commonWidgetMeta.setItems(items);
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetDataBulk(commonWidgetMeta);
-               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataIfCatagoryNullTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("ERROR");
-               ecpectedPortalRestResponse.setResponse("Cateogry cannot be null or empty");
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setCategory(null);
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetData(commonWidget);
-               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setCategory("test");
-               commonWidget.setId((long) 1);
-               commonWidget.setEventDate("2017-06-06");
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetData(commonWidget);
-               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
-       }
-
-       @Test
-       public void saveWidgetDataExceptionTest() {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("java.text.ParseException: Unparseable date: \"date\"");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.ERROR);
-               CommonWidget commonWidget = new CommonWidget();
-               commonWidget.setCategory("test");
-               commonWidget.setId((long) 1);
-               commonWidget.setEventDate("date");
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .saveWidgetData(commonWidget);
-               assertEquals(ecpectedPortalRestResponse, actualPortalRestResponse);
-       }
-       
-       @Test
-       public void deleteWidgetDataTest()
-       {
-               PortalRestResponse<String> ecpectedPortalRestResponse = new PortalRestResponse<String>();
-               ecpectedPortalRestResponse.setMessage("success");
-               ecpectedPortalRestResponse.setResponse(null);
-               ecpectedPortalRestResponse.setStatus(PortalRestStatusEnum.OK);
-               CommonWidget commonWidget = new CommonWidget();
-               Mockito.when(searchService.deleteWidgetData(commonWidget)).thenReturn("test");
-               PortalRestResponse<String> actualPortalRestResponse = dashboardSearchResultController
-                               .deleteWidgetData(commonWidget);
-               assertEquals(ecpectedPortalRestResponse.getStatus(), actualPortalRestResponse.getStatus());
-       }
-       
-       @Test
-       public void searchPortalIfUserIsTest()
-       {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = "test";
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("searchPortal: User object is null? - check logs");
-               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               System.out.println(actualResult);
-
-               assertEquals(expectedResult, actualResult);
-       }
-       
-       
-       @Test
-       public void getActiveUsersTest() {
-               List<String> expectedActiveUsers = new ArrayList<String>();
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String userId = user.getOrgUserId();
-               Mockito.when(searchService.getRelatedUsers(userId)).thenReturn(expectedActiveUsers);
-               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
-               assertEquals(expectedActiveUsers, actualOnlineUsers);
-
-       }
-
-       @Test
-       public void getActiveUsersExceptionTest() {
-               List<String> expectedActiveUsers = new ArrayList<String>();
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String userId = user.getOrgUserId();
-               Mockito.when(searchService.getRelatedUsers(userId)).thenThrow(nullPointerException);
-               List<String> actualOnlineUsers = dashboardSearchResultController.getActiveUsers(mockedRequest);
-               assertEquals(expectedActiveUsers, actualOnlineUsers);
-
-       }
-
-       @Test
-       public void activeUsersTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
-               expectedResult.setMessage("success");
-               expectedResult.setResponse(new ArrayList<>());
-               expectedResult.setStatus(PortalRestStatusEnum.OK);
-               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
-
-               assertEquals(actualResult, expectedResult);
-
-       }
-
-       @Test
-       public void activeUsersIfUserNullTest() {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
-               expectedResult.setMessage("User object is null? - check logs");
-               expectedResult.setResponse(new ArrayList<>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
-               assertEquals(actualResult, expectedResult);
-
-       }
-
-       @Test
-       public void activeUsersExceptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               PortalRestResponse<List<String>> expectedResult = new PortalRestResponse<List<String>>();
-               expectedResult.setMessage("null - check logs.");
-               expectedResult.setResponse(new ArrayList<>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-               Mockito.when(searchService.getRelatedUsers(user.getLoginId())).thenThrow(nullPointerException);
-               PortalRestResponse<List<String>> actualResult = dashboardSearchResultController.activeUsers(mockedRequest);
-               assertEquals(actualResult, expectedResult);
-
-       }
-       
-       @Test
-       public void searchPortalIfSearchStringNullTest() {
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = null;
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("searchPortal: String string is null");
-               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-       }
-
-       @Test
-       public void searchPortalIfSearchTest() {
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = "test";
-               List<SearchResultItem> searchResultItemList = new ArrayList<SearchResultItem>();
-               SearchResultItem searchResultItem = new SearchResultItem();
-
-               searchResultItem.setId((long) 1);
-               searchResultItem.setCategory("test");
-               searchResultItem.setName("test_name");
-               searchResultItem.setTarget("test_target");
-               searchResultItem.setUuid("test_UUId");
-               searchResultItemList.add(searchResultItem);
-               Map<String, List<SearchResultItem>> expectedResultMap = new HashMap<String, List<SearchResultItem>>();
-               expectedResultMap.put(searchString, searchResultItemList);
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("success");
-               expectedResult.setResponse(expectedResultMap);
-               expectedResult.setStatus(PortalRestStatusEnum.OK);
-
-               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenReturn(expectedResultMap);
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-
-       }
-
-       @Test
-       public void searchPortalIfSearchExcptionTest() {
-               EPUser user = mockUser.mockEPUser();
-               ;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               String searchString = "test";
-
-               PortalRestResponse<Map<String, List<SearchResultItem>>> expectedResult = new PortalRestResponse<Map<String, List<SearchResultItem>>>();
-               expectedResult.setMessage("null - check logs.");
-               expectedResult.setResponse(new HashMap<String, List<SearchResultItem>>());
-               expectedResult.setStatus(PortalRestStatusEnum.ERROR);
-
-               Mockito.when(searchService.searchResults(user.getLoginId(), searchString)).thenThrow(nullPointerException);
-               PortalRestResponse<Map<String, List<SearchResultItem>>> actualResult = dashboardSearchResultController
-                               .searchPortal(mockedRequest, searchString);
-               assertEquals(expectedResult, actualResult);
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ECOMPLogoutControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ECOMPLogoutControllerTest.java
deleted file mode 100644 (file)
index 954ff0c..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.ECOMPLogoutController;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.DashboardSearchService;
-import org.openecomp.portalapp.portal.service.DashboardSearchServiceImpl;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.springframework.core.NamedThreadLocal;
-import org.springframework.web.context.request.RequestAttributes;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-import org.springframework.web.servlet.ModelAndView;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({EPUserUtils.class, EPCommonSystemProperties.class,RequestContextHolder.class,RequestAttributes.class})
-public class ECOMPLogoutControllerTest {
-
-       @Mock
-       DashboardSearchService searchService = new DashboardSearchServiceImpl();
-       
-       @InjectMocks
-       ECOMPLogoutController ecompLogoutController = new ECOMPLogoutController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       MockEPUser mockUser = new MockEPUser();
-       
-       @Mock
-       RequestContextHolder requestContextHolder;
-       
-       @Mock
-       RequestAttributes requestAttributes;
-       
-       @Test
-       public void logOutTest() throws Exception{
-               ModelAndView actualData = new ModelAndView("redirect:login.htm");
-               ModelAndView expedtedData = null;
-               ThreadLocal<RequestAttributes> requestAttributesHolder =
-                               new NamedThreadLocal<RequestAttributes>("Request attributes");
-               RequestAttributes requestAttributes = new ServletRequestAttributes(mockedRequest);
-               PowerMockito.mockStatic(RequestContextHolder.class);
-               PowerMockito.mockStatic(RequestAttributes.class);
-           Mockito.when((ServletRequestAttributes)RequestContextHolder.currentRequestAttributes()).thenReturn((ServletRequestAttributes) requestAttributes);
-               expedtedData = ecompLogoutController.logOut(mockedRequest, mockedResponse);
-               assertEquals(actualData.getViewName(),expedtedData.getViewName());
-       }
-       
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ExternalAppsRestfulControllerOSTest.java
deleted file mode 100644 (file)
index 0f92bb3..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.*;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.FunctionalMenuService;
-import org.openecomp.portalapp.portal.transport.FavoritesFunctionalMenuItemJson;
-import org.openecomp.portalapp.portal.transport.FunctionalMenuItem;
-import org.openecomp.portalapp.portal.utils.EPCommonSystemProperties;
-import org.openecomp.portalapp.portal.utils.EPSystemProperties;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-import org.slf4j.MDC;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ MDC.class, EPSystemProperties.class , EcompPortalUtils.class})
-public class ExternalAppsRestfulControllerOSTest {
-
-       
-       @InjectMocks
-       ExternalAppsRestfulController externalAppsRestfulController = new ExternalAppsRestfulController();
-       @Mock
-       FunctionalMenuService functionalMenuService;
-       
-       @Mock
-       EPLoginService epLoginService;
-       
-       @Mock
-       AdminRolesService adminRolesService;
-       
-       
-       
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       MockEPUser mockUser = new MockEPUser();
-       
-       @Test
-       public void getFavoritesForUserTest() throws Exception
-       {
-               PowerMockito.mockStatic(EPSystemProperties.class);
-               PowerMockito.mockStatic(MDC.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               EPUser epUser = mockUser.mockEPUser();
-               epUser.setId((long) 1);
-               epUser.setLoginId("guestT");
-               String loginId = "guestT";
-               Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
-               FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
-               favorites.add(favoritesFunctionalMenuItemJson);
-               Mockito.when(mockedRequest.getHeader(EPCommonSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
-               Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               Mockito.when(epLoginService.findUserWithoutPwd("Login_URL")).thenReturn(epUser);
-               Mockito.when(functionalMenuService.getFavoriteItems(epUser.getId())).thenReturn(favorites);
-               List<FavoritesFunctionalMenuItemJson> actaulFavorites = externalAppsRestfulController
-                               .getFavoritesForUser(mockedRequest, mockedResponse);
-               assertEquals(actaulFavorites.size(), 1);
-       }
-       
-       @Test
-       public void getFunctionalMenuItemsForUserIfSuperAdminTest() throws Exception {
-               PowerMockito.mockStatic(EPSystemProperties.class);
-               PowerMockito.mockStatic(MDC.class);
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               EPUser epUser = mockUser.mockEPUser();
-               epUser.setId((long) 1);
-               epUser.setLoginId("guestT");
-               String loginId = "guestT";
-               Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
-               Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
-               List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
-               FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
-               expectedList.add(functionalMenuItem);
-               Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
-               Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(true);
-               Mockito.when(functionalMenuService.getFunctionalMenuItems()).thenReturn(expectedList);
-               List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
-                               mockedResponse);
-               assertNull(actualList.get(0).menuId);
-       }
-
-        @Test(expected = Exception.class)
-        public void getFunctionalMenuItemsForUserIfUSerNullTest() throws
-        Exception
-        {
-        PowerMockito.mockStatic(EPSystemProperties.class);
-        PowerMockito.mockStatic(EcompPortalUtils.class);
-        PowerMockito.mockStatic(MDC.class);
-        EPUser epUser = null;
-        String loginId = "guestT";
-        Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
-        Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
-        externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
-        mockedResponse);
-        }
-        
-           @Test
-               public void getFunctionalMenuItemsForUserTest() throws Exception {
-                       PowerMockito.mockStatic(EPSystemProperties.class);
-                       PowerMockito.mockStatic(MDC.class);
-                       EPUser epUser = mockUser.mockEPUser();
-                       epUser.setId((long) 1);
-                       epUser.setLoginId("guestT");
-                       String loginId = "guestT";
-                       Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
-                       Mockito.when(epLoginService.findUserWithoutPwd(loginId)).thenReturn(epUser);
-                       List<FunctionalMenuItem> expectedList = new ArrayList<FunctionalMenuItem>();
-                       FunctionalMenuItem functionalMenuItem = new FunctionalMenuItem();
-                       expectedList.add(functionalMenuItem);
-                       Mockito.when(mockedRequest.getHeader("LoginId")).thenReturn("guestT");
-                       Mockito.when(adminRolesService.isSuperAdmin(epUser)).thenReturn(false);
-                       Mockito.when(functionalMenuService.getFunctionalMenuItemsForUser(epUser.getOrgUserId()))
-                                       .thenReturn(expectedList);
-                       List<FunctionalMenuItem> actualList = externalAppsRestfulController.getFunctionalMenuItemsForUser(mockedRequest,
-                                       mockedResponse);
-                       assertNull(actualList.get(0).menuId);
-               }
-
-           @Test(expected = Exception.class)
-               public void getFavoritesForUserIfUserNullTest() throws Exception {
-                       List<FavoritesFunctionalMenuItemJson> favorites = new ArrayList<FavoritesFunctionalMenuItemJson>();
-                       FavoritesFunctionalMenuItemJson favoritesFunctionalMenuItemJson = new FavoritesFunctionalMenuItemJson();
-                       favorites.add(favoritesFunctionalMenuItemJson);
-                       PowerMockito.mockStatic(EPSystemProperties.class);
-                       PowerMockito.mockStatic(MDC.class);
-                       Mockito.when(mockedRequest.getHeader(EPSystemProperties.MDC_LOGIN_ID)).thenReturn("Login_URL");
-                       Mockito.when(MDC.get(EPSystemProperties.PARTNER_NAME)).thenReturn("Test");
-                       EPUser epUser = null;
-                       externalAppsRestfulController.getFavoritesForUser(mockedRequest, mockedResponse);
-               }
-
-               
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/LoginControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/LoginControllerTest.java
deleted file mode 100644 (file)
index a02e1b2..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.*;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.LoginController;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.EPLoginService;
-import org.openecomp.portalapp.portal.service.EPRoleFunctionService;
-import org.openecomp.portalapp.portal.service.EPRoleService;
-import org.openecomp.portalapp.portal.service.SharedContextService;
-import org.openecomp.portalapp.service.EPProfileService;
-import org.openecomp.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.web.servlet.ModelAndView;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest(SystemProperties.class)
-public class LoginControllerTest {
-
-       @Mock
-       EPProfileService service;
-       @Mock
-    EPLoginService loginService;
-       @Mock
-        SharedContextService sharedContextService;
-       @Mock
-        EPRoleService roleService;
-       @Mock
-        EPRoleFunctionService ePRoleFunctionService;
-       
-       @InjectMocks
-       LoginController loginController = new LoginController();
-       
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       @Test
-       public void loginIfAuthNullTest()
-       {
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn(null);
-               ModelAndView result = loginController.login(mockedRequest);
-               assertEquals(result.getViewName(),"openIdLogin") ;
-       }
-       
-       @Test
-       public void loginIfAuthOIDCTest()
-       {
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("OIDC");
-               ModelAndView result = loginController.login(mockedRequest);
-               assertEquals(result.getViewName(),"login") ;
-       }
-       
-       @Test
-       public void loginTest()
-       {
-               PowerMockito.mockStatic(SystemProperties.class);
-               Mockito.when(SystemProperties.getProperty(SystemProperties.AUTHENTICATION_MECHANISM)).thenReturn("Test");
-               ModelAndView result = loginController.login(mockedRequest);
-               assertEquals(result.getViewName(),"login") ;
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPLoginControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPLoginControllerTest.java
deleted file mode 100644 (file)
index 4621830..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.ONAPLoginController;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalsdk.core.auth.LoginStrategy;
-import org.openecomp.portalsdk.core.service.LoginService;
-import org.openecomp.portalsdk.core.service.ProfileService;
-import org.openecomp.portalsdk.core.service.ProfileServiceImpl;
-import org.springframework.web.servlet.ModelAndView;
-
-public class ONAPLoginControllerTest { 
-       
-       @Mock
-       ProfileService ProfileService = new ProfileServiceImpl();
-       
-       @Mock
-       LoginService mockLoginService;
-       
-       @Mock
-       LoginStrategy loginStrategy ;
-       
-       @InjectMocks
-       ONAPLoginController oNAPLoginController = new ONAPLoginController();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       MockEPUser mockUser = new MockEPUser();
-       
-       
-       @Test
-       public void doLogin() throws Exception
-       {
-               ModelAndView expectedModelandView = null;
-               ModelAndView actualModelandView = null;
-               Mockito.when(loginStrategy.doLogin(mockedRequest, mockedResponse)).thenReturn(expectedModelandView);
-               actualModelandView= oNAPLoginController.doLogin(mockedRequest, mockedResponse);
-               oNAPLoginController.setViewName("test");
-               assertEquals("test", oNAPLoginController.getViewName());        
-               assertEquals(actualModelandView,expectedModelandView);
-       }
-       
-       
-       @Test
-       public void ViewTest() throws Exception
-       {
-               ModelAndView expectedModelandView = new ModelAndView();
-               expectedModelandView.setViewName("testView");
-               ModelAndView actualModelandView = null;
-               Mockito.when(loginStrategy.doLogin(mockedRequest, mockedResponse)).thenReturn(expectedModelandView);
-               actualModelandView= oNAPLoginController.doLogin(mockedRequest, mockedResponse);
-               assertEquals(actualModelandView.getViewName(),expectedModelandView.getViewName());
-       }
-       @Test
-       public void getJessionIdTest() throws Exception
-       {
-        assertNull(oNAPLoginController.getJessionId(mockedRequest));
-       }
-       
-       @Test
-       public void getLoginServiceTest() throws Exception
-       {
-               LoginService expectedLoginService =     oNAPLoginController.getLoginService();
-               assertEquals(mockLoginService,expectedLoginService);
-       }
-       
-       
-       
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPWelcomeControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/ONAPWelcomeControllerTest.java
deleted file mode 100644 (file)
index b7399fb..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import static org.junit.Assert.assertEquals;
-
-import java.security.Principal;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.controller.ONAPWelcomeController;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.springframework.web.servlet.ModelAndView;
-
-public class ONAPWelcomeControllerTest {
-
-       @InjectMocks
-       ONAPWelcomeController oNAPWelcomeController = new ONAPWelcomeController();
-       
-       @Mock
-       Principal p;
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       @Test
-       public void getIndexPageTest()
-       {
-               assertEquals(oNAPWelcomeController.getIndexPage(mockedRequest), "/index");
-       }
-       
-       @Test
-       public void getEcompSinglePageTest()
-       {
-               assertEquals(oNAPWelcomeController.getEcompSinglePage(mockedRequest, mockedResponse), "forward:/index.html");
-       }
-       
-       @Test
-       public void userTest()
-       {
-               assertEquals(oNAPWelcomeController.user(null), "oid-user");
-       }
-       
-       @Test
-       public void loginTest()
-       {
-               ModelAndView expectedView = new ModelAndView();
-               expectedView.setViewName("openIdLogin");
-               ModelAndView md = oNAPWelcomeController.login(p);
-               System.out.println(md.getViewName());
-               assertEquals(md.getViewName(), expectedView.getViewName());
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerOSTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/PortalAdminControllerOSTest.java
deleted file mode 100644 (file)
index aa7cb46..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPRole;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.service.AdminRolesService;
-import org.openecomp.portalapp.portal.service.AdminRolesServiceImpl;
-import org.openecomp.portalapp.portal.service.PortalAdminService;
-import org.openecomp.portalapp.portal.service.PortalAdminServiceImpl;
-import org.openecomp.portalapp.portal.transport.FieldsValidator;
-import org.openecomp.portalapp.portal.transport.PortalAdmin;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.openecomp.portalapp.util.EPUserUtils;
-import org.openecomp.portalsdk.core.service.AuditService;
-import org.openecomp.portalsdk.core.service.AuditServiceImpl;
-
-public class PortalAdminControllerOSTest {
-
-       @InjectMocks
-       PortalAdminController portalAdminController = new PortalAdminController();
-
-       @Mock
-       AdminRolesService adminRolesService = new AdminRolesServiceImpl();
-       
-       @Mock
-       PortalAdminService portalAdminService = new PortalAdminServiceImpl();
-
-       @Mock
-       AuditService auditService = new AuditServiceImpl();
-
-        
-       @Mock
-       EcompPortalUtils ecompPortalUtils = new EcompPortalUtils();
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-       NullPointerException nullPointerException = new NullPointerException();
-
-       @Mock
-       EPUserUtils ePUserUtils = new EPUserUtils();
-
-       MockEPUser mockUser = new MockEPUser();
-       
-       @Test
-       public void deletePortalAdminIfUserIsSuperAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Long userInfo = (long) 12;
-               assertNull(portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse));
-
-       }
-       
-       @Test
-       public void deletePortalAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-       
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Long userInfo = (long) 12;
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(portalAdminService.deletePortalAdmin((long) 12)).thenReturn(expectedFieldValidator);
-               actualFieldValidator = portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse);
-        assertEquals(actualFieldValidator,expectedFieldValidator);
-
-       }
-       
-       @Test
-       public void deletePortalAdminWithNoUserInfoTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               Long userInfo = null;
-               assertNull(portalAdminController.deletePortalAdmin(mockedRequest, userInfo, mockedResponse));
-       }
-       
-       @Test
-       public void getRolesByAppExceptionTest()
-       {
-               EPUser user = mockUser.mockEPUser();;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPRole> expectedRoleList = new ArrayList<EPRole>();        
-               EPRole ePRole = new EPRole();
-               expectedRoleList.add(ePRole);
-               Long appId = (long) 1;
-               Mockito.when(adminRolesService.getRolesByApp(user, appId)).thenThrow(nullPointerException);
-               assertNull(portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse));
-       }
-       
-       @Test
-       public void getRolesByAppIfUserNullTest()
-       {
-               EPUser user = null;
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Long appId = (long) 1;
-               assertNull(portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse));
-       }
-       
-       @Test
-       public void getRolesByAppTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<EPRole> expectedRoleList = new ArrayList<EPRole>();        
-               EPRole ePRole = new EPRole();
-               expectedRoleList.add(ePRole);
-               Long appId = (long) 1;
-               Mockito.when(adminRolesService.getRolesByApp(user, appId)).thenReturn(expectedRoleList);
-               List<EPRole> actualRoleList =   portalAdminController.getRolesByApp(mockedRequest, appId, mockedResponse);
-               assertEquals(actualRoleList,expectedRoleList);
-       }
-       
-       @Test
-       public void createPortalAdminIfUserNullTest()
-       {
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
-               assertNull(portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse));
-       }
-       
-       
-       @Test
-       public void createPortalAdminIfUserIsSuperAdminTest()
-       {
-
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               FieldsValidator expectedFieldValidator = new FieldsValidator();
-               expectedFieldValidator.setHttpStatusCode((long) 200);
-               expectedFieldValidator.setFields(null);
-               expectedFieldValidator.setErrorCode(null);
-               FieldsValidator actualFieldValidator = new FieldsValidator();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(portalAdminService.createPortalAdmin("guestT")).thenReturn(expectedFieldValidator);
-               actualFieldValidator = portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse);
-        assertEquals(actualFieldValidator,expectedFieldValidator);
-       }
-       
-       @Test
-       public void createPortalAdminIfUserIsNotSuperAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               assertNull(portalAdminController.createPortalAdmin(mockedRequest, "guestT", mockedResponse));
-       }
-               
-       @Test
-       public void getPortalAdminsIfUserNullTest()
-       {
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(null);
-               assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
-       }
-       
-       @Test
-       public void getPortalAdminsIfUserAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               List<PortalAdmin> portalAdmins = new ArrayList<>();
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(true);
-               Mockito.when(portalAdminService.getPortalAdmins()).thenReturn(portalAdmins);
-               List<PortalAdmin> actualortalAdmins = portalAdminController.getPortalAdmins(mockedRequest, mockedResponse);
-        assertEquals(actualortalAdmins,portalAdmins);
-       }
-       
-       @Test
-       public void getPortalAdminIfUserIsNotSuperAdminTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               Mockito.when(EPUserUtils.getUserSession(mockedRequest)).thenReturn(user);
-               Mockito.when(adminRolesService.isSuperAdmin(user)).thenReturn(false);
-               assertNull(portalAdminController.getPortalAdmins(mockedRequest, mockedResponse));
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestClient.java
deleted file mode 100644 (file)
index f4196db..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.net.URI;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.SSLContext;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.http.Consts;
-import org.apache.http.HttpEntity;
-import org.apache.http.client.methods.CloseableHttpResponse;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPost;
-import org.apache.http.client.utils.URIBuilder;
-import org.apache.http.conn.ssl.NoopHostnameVerifier;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.entity.ContentType;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.ssl.SSLContexts;
-import org.apache.http.ssl.TrustStrategy;
-import org.apache.http.util.EntityUtils;
-/**
- * Provides reusable features for test cases to get or post from an REST
- * endpoint, allowing use of HTTPS connections to servers that use self-signed
- * certificates.
- */
-public class SharedContextRestClient {
-
-       private static final Log logger = LogFactory.getLog(SharedContextRestClient.class);
-
-       /**
-        * Convenience method that builds and sends a GET request using properties
-        * to build the URI and populate header with credentials.
-        * 
-        * @param task
-        *            last component(s) of REST endpoint name; e.g., "get".
-        * @param contextId
-        * @param contextKey
-        * @return JSON string fetched
-        * @throws Exception
-        *             if the HTTP response code is anything other than OK.
-        */
-       public static String getJson(final SharedContextTestProperties properties, final String task,
-                       final String contextId, final String contextKey) throws Exception {
-               String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) //
-                               + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) //
-                               + '/' + task;
-               return getJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), //
-                               properties.getProperty(SharedContextTestProperties.PORT, -1), //
-                               properties.getProperty(SharedContextTestProperties.SECURE, true), //
-                               properties.getProperty(SharedContextTestProperties.UEBKEY), //
-                               properties.getProperty(SharedContextTestProperties.USERNAME), //
-                               properties.getProperty(SharedContextTestProperties.PASSWORD), requestPath, //
-                               contextId, //
-                               contextKey);
-       }
-
-       /**
-        * Constructs and sends a GET request using the specified values.
-        * 
-        * @param hostname
-        * @param port
-        *            ignored if negative
-        * @param secure
-        *            If true, uses https; else http.
-        * @param headerUebkey
-        * @param headerUsername
-        * @param headerPassword
-        * @param requestPath
-        *            full path of the REST endpoint
-        * @param contextId
-        * @param contextKey
-        * Ignored if null
-        * @return JSON result
-        */
-       public static String getJson(final String hostname, final int port, boolean secure, final String headerUebkey,
-                       final String headerUsername, final String headerPassword, final String requestPath, final String contextId,
-                       final String contextKey) throws Exception {
-
-               URIBuilder uriBuilder = new URIBuilder();
-               if (secure)
-                       uriBuilder.setScheme("https");
-               else
-                       uriBuilder.setScheme("http");
-               uriBuilder.setHost(hostname);
-               if (port > 0)
-                       uriBuilder.setPort(port);
-               uriBuilder.setPath(requestPath);
-               uriBuilder.addParameter("context_id", contextId);
-               if (contextKey != null)
-                       uriBuilder.addParameter("ckey", contextKey);
-               final URI uri = uriBuilder.build();
-
-               CloseableHttpClient httpClient;
-               if (secure) {
-                       // Tell HttpClient to accept any server certificate for HTTPS.
-                       // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error
-                       SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
-                               @Override
-                               public boolean isTrusted(final X509Certificate[] chain, final String authType)
-                                               throws CertificateException {
-                                       return true;
-                               }
-                       }).build();
-                       SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,
-                                       NoopHostnameVerifier.INSTANCE);
-                       httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
-               } else {
-                       httpClient = HttpClients.createDefault();
-               }
-
-               HttpGet httpGet = new HttpGet(uri);
-               httpGet.setHeader("uebkey", headerUebkey);
-               httpGet.setHeader("username", headerUsername);
-               httpGet.setHeader("password", headerPassword);
-
-               String json = null;
-               CloseableHttpResponse response = null;
-               try {
-                       logger.debug("GET from " + uri);
-                       response = httpClient.execute(httpGet);
-                       logger.info("Status is " + response.getStatusLine());
-                       if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK)
-                               throw new Exception("Status is " + response.getStatusLine().toString());
-                       HttpEntity entity = response.getEntity();
-                       if (entity == null) {
-                               logger.warn("Entity is null!");
-                       } else {
-                               // entity content length is never set.
-                               // this naively tries to read everything.
-                               json = EntityUtils.toString(entity);
-                               EntityUtils.consume(entity);
-                       }
-               } finally {
-                       if (response != null)
-                               response.close();
-               }
-               return json;
-       }
-
-       /**
-        * Convenience method that builds and sends a POST request using properties
-        * to build the URI and populate header with credentials.
-        * 
-        * @param path
-        *            last component(s) of REST endpoint name; e.g., "users" or
-        *            "user/{userid}/roles".
-        * @return JSON string fetched
-        * @throws Exception
-        *             if the HTTP response code is anything other than OK.
-        */
-       public static String postJson(final SharedContextTestProperties properties, final String path, final String json)
-                       throws Exception {
-               String requestPath = '/' + properties.getProperty(SharedContextTestProperties.APPNAME) //
-                               + '/' + properties.getProperty(SharedContextTestProperties.RESTPATH) //
-                               + '/' + path;
-               return postJson(properties.getProperty(SharedContextTestProperties.HOSTNAME), //
-                               properties.getProperty(SharedContextTestProperties.PORT, -1), //
-                               properties.getProperty(SharedContextTestProperties.SECURE, true), //
-                               properties.getProperty(SharedContextTestProperties.UEBKEY), //
-                               properties.getProperty(SharedContextTestProperties.USERNAME), //
-                               properties.getProperty(SharedContextTestProperties.PASSWORD), //
-                               requestPath, //
-                               json);
-       }
-
-       /**
-        * Constructs and sends a POST request using the specified values.
-        * 
-        * @param hostname
-        * @param port
-        * @param secure
-        *            If true, uses https; else http.
-        * @param requestPath
-        *            full path of the REST endpoint
-        * @param headerUebkey
-        * @param headerUsername
-        * @param headerPassword
-        * @param json
-        *            Content to post
-        * @return JSON result
-        * @throws Exception
-        */
-       public static String postJson(final String hostname, final int port, boolean secure, final String headerUebkey,
-                       final String headerUsername, final String headerPassword, final String requestPath, final String json)
-                       throws Exception {
-
-               URIBuilder builder = new URIBuilder();
-               if (secure)
-                       builder.setScheme("https");
-               else
-                       builder.setScheme("http");
-               builder.setHost(hostname);
-               if (port > 0)
-                       builder.setPort(port);
-               builder.setPath(requestPath);
-               final URI uri = builder.build();
-
-               CloseableHttpClient httpClient;
-               if (secure) {
-                       // Tell HttpClient to accept any server certificate for HTTPS.
-                       // http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error
-                       SSLContext sslContext = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
-                               @Override
-                               public boolean isTrusted(final X509Certificate[] chain, final String authType)
-                                               throws CertificateException {
-                                       return true;
-                               }
-                       }).build();
-                       SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext,
-                                       NoopHostnameVerifier.INSTANCE);
-                       httpClient = HttpClientBuilder.create().setSSLSocketFactory(sslsf).build();
-               } else {
-                       httpClient = HttpClients.createDefault();
-               }
-               HttpPost httpPost = new HttpPost(uri);
-               httpPost.setHeader("uebkey", headerUebkey);
-               httpPost.setHeader("username", headerUsername);
-               httpPost.setHeader("password", headerPassword);
-
-               StringEntity postEntity = new StringEntity(json, ContentType.create("application/json", Consts.UTF_8));
-               httpPost.setEntity(postEntity);
-
-               String responseJson = null;
-               CloseableHttpResponse response = null;
-               try {
-                       logger.debug("POST to " + uri);
-                       response = httpClient.execute(httpPost);
-                       logger.info("Status is " + response.getStatusLine());
-                       if (response.getStatusLine().getStatusCode() != HttpServletResponse.SC_OK)
-                               throw new Exception("Status is " + response.getStatusLine().toString());
-
-                       HttpEntity entity = response.getEntity();
-                       if (entity == null) {
-                               logger.warn("Entity is null!");
-                       } else {
-                               long len = entity.getContentLength();
-                               if (len < 0)
-                                       logger.warn("Content length is -1");
-                               if (len < 2048) {
-                                       responseJson = EntityUtils.toString(entity);
-                                       logger.debug(responseJson);
-                               } else {
-                                       logger.warn("Not implemented - stream content");
-                               }
-                               EntityUtils.consume(entity);
-                       }
-               } finally {
-                       if (response != null)
-                               response.close();
-               }
-               return responseJson;
-       }
-
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextRestControllerTest.java
deleted file mode 100644 (file)
index e406178..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Assert;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * Tests the endpoints exposed by the Shared Context REST controller in Portal
- * Core.
- * 
- * @author clott
- */
-public class SharedContextRestControllerTest {
-
-       private final Log logger = LogFactory.getLog(getClass());
-
-       private final SharedContextTestProperties properties;
-
-       private final String ckey = "ckey";
-       private final String cvalue = "cvalue";
-       
-       // Supposed to be a Portal session ID
-       private final String cxid = UUID.randomUUID().toString();
-
-       private final String key = "key123";
-       private final String value1 = "first value";
-       private final String value2 = "second value";
-
-       public SharedContextRestControllerTest() throws IOException {
-               properties = new SharedContextTestProperties();
-       }
-
-       @SuppressWarnings("unchecked")
-       //@Test
-       public void test() throws Exception {
-               String response = null, val = null;
-               ObjectMapper mapper = new ObjectMapper();
-               Map<String, Object> responseMap, jsonMap;
-
-               logger.info("Get on empty context");
-               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
-               // Should not exist - just generated the UUID
-               Map<String, Object> responseMap1 = mapper.readValue(response, Map.class);
-               response = (String) responseMap1.get("response");
-               Assert.assertNull(response);
-
-               logger.info("Set a new context");
-               response = setContext(cxid, key, value1);
-               Assert.assertNotNull(response);
-               responseMap = mapper.readValue(response, Map.class);
-               String responseValue = (String) responseMap.get("response");
-               Assert.assertNotNull(responseValue);
-               Assert.assertEquals("added", responseValue);
-
-               logger.info("Get existing context");
-               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
-               responseMap = mapper.readValue(response, Map.class);
-               jsonMap = (Map<String,Object>) responseMap.get("response");
-               Assert.assertNotNull(jsonMap);
-               val = (String) jsonMap.get(cvalue);
-               Assert.assertEquals(val, value1);
-
-               logger.info("Overwrite exiting context");
-               response = setContext(cxid, key, value2);
-               Assert.assertNotNull(response);
-               responseMap = mapper.readValue(response, Map.class);
-               response = (String) responseMap.get("response");
-               Assert.assertNotNull(responseValue);
-               // Assert.assertEquals("replaced", responseValue);
-
-               logger.info("Get existing context to verify overwrite");
-               response = SharedContextRestClient.getJson(properties, "get", cxid, key);
-               responseMap = mapper.readValue(response, Map.class);
-               jsonMap = (Map<String,Object>) responseMap.get("response");
-               Assert.assertNotNull(jsonMap);
-               val = (String) jsonMap.get(cvalue);
-               Assert.assertEquals(val, value2);
-
-               logger.info("Delete one context");
-               response = SharedContextRestClient.getJson(properties, "remove", cxid, key);
-               responseMap = mapper.readValue(response, Map.class);
-               response = (String) responseMap.get("response");
-               Assert.assertEquals(response, "removed");
-
-               logger.info("Clear the context");
-               response = SharedContextRestClient.getJson(properties, "clear", cxid, null);
-               Assert.assertEquals("", response);
-       }
-
-       private String setContext(String context, String id, String value) throws Exception {
-               ObjectMapper mapper = new ObjectMapper();
-               HashMap<String,String> stringMap = new HashMap<String,String>();
-               stringMap.put("context_id", cxid);
-               stringMap.put(ckey, key);
-               stringMap.put(cvalue, value2);
-               String json = mapper.writeValueAsString(stringMap);
-               String response = SharedContextRestClient.postJson(properties, "set", json);
-               return response;
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/SharedContextTestProperties.java
deleted file mode 100644 (file)
index 1c84942..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.controller;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * Trivial extension of Properties that populates itself from a known source.
- */
-public class SharedContextTestProperties extends Properties {
-
-       private static final long serialVersionUID = -4064100267979036550L;
-
-       // property names
-       public static final String HOSTNAME = "hostname";
-       public static final String PORT = "port";
-       public static final String SECURE = "secure";
-       public static final String APPNAME = "appname";
-       public static final String RESTPATH = "restpath";
-       public static final String UEBKEY = "uebkey";
-       public static final String USERNAME = "username";
-       public static final String PASSWORD = "password";
-
-       /**
-        * Expected on the classpath
-        */
-       private static final String propertiesFileName = "shared-context-test.properties";
-
-       /**
-        * Constructor populates itself from properties file found in same package.
-        * 
-        * @throws Exception
-        */
-       public SharedContextTestProperties() throws IOException {
-               InputStream inStream = getClass().getResourceAsStream(propertiesFileName);
-               if (inStream == null)
-                       throw new IOException("Failed to find file on classpath: " + propertiesFileName);
-               super.load(inStream);
-               inStream.close();
-       }
-
-       public int getProperty(final String name, final int defVal) throws NumberFormatException {
-               String prop = getProperty(name);
-               if (prop == null)
-                       return defVal;
-               return Integer.parseInt(prop);
-       }
-       
-       public boolean getProperty(final String name, final boolean defVal) {
-               String prop = getProperty(name);
-               if (prop == null)
-                       return false;
-               return Boolean.parseBoolean(prop);
-       }
-       
-       // Test this class
-       public static void main(String[] args) throws Exception {
-               SharedContextTestProperties p = new SharedContextTestProperties();
-               System.out.println("Property " + SharedContextTestProperties.HOSTNAME + " = "
-                               + p.getProperty(SharedContextTestProperties.HOSTNAME));
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/controller/shared-context-test.properties
deleted file mode 100644 (file)
index 75e6f83..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-###
-# ============LICENSE_START==========================================
-# ONAP Portal
-# ===================================================================
-# Copyright © 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============================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-###
-
-hostname= localhost
-# port = 80
-secure = true
-appname = ecompportal
-restpath = context
-uebkey = xgnLrmNmkfCRnIwa
-username = Default
-password = AppPassword!1
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockEPUser.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockEPUser.java
deleted file mode 100644 (file)
index d38b21a..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.framework;
-
-import java.util.Date;
-
-import org.openecomp.portalapp.portal.domain.EPUser;
-
-public class MockEPUser {
-
-       public EPUser mockEPUser() {
-
-               EPUser ePUser = new EPUser();
-               ePUser.setOrgId(null);
-               ePUser.setManagerId(null);
-               ePUser.setFirstName("test");
-               ePUser.setLastName("test");
-               ePUser.setMiddleInitial(null);
-               ePUser.setPhone(null);
-               ePUser.setFax(null);
-               ePUser.setCellular(null);
-               ePUser.setEmail(null);
-               ePUser.setAddressId(null);
-               ePUser.setAlertMethodCd(null);
-               ePUser.setHrid(null);
-               ePUser.setOrgUserId("guestT");
-               ePUser.setOrgCode(null);
-               ePUser.setAddress1(null);
-               ePUser.setAddress2(null);
-               ePUser.setCity(null);
-               ePUser.setState(null);
-               ePUser.setZipCode(null);
-               ePUser.setCountry(null);
-               ePUser.setOrgManagerUserId(null);
-               ePUser.setLocationClli(null);
-               ePUser.setBusinessCountryCode(null);
-               ePUser.setBusinessCountryName(null);
-               ePUser.setBusinessUnit(null);
-               ePUser.setBusinessUnitName(null);
-               ePUser.setDepartment(null);
-               ePUser.setDepartmentName(null);
-               ePUser.setCompanyCode(null);
-               ePUser.setCompany(null);
-               ePUser.setZipCodeSuffix(null);
-               ePUser.setJobTitle(null);
-               ePUser.setCommandChain(null);
-               ePUser.setSiloStatus(null);
-               ePUser.setCostCenter(null);
-               ePUser.setFinancialLocCode(null);
-
-               ePUser.setLoginId(null);
-               ePUser.setLoginPwd(null);
-               Date date = new Date();
-               ePUser.setLastLoginDate(date);
-               ePUser.setActive(true);
-               ePUser.setInternal(false);
-               ePUser.setSelectedProfileId(null);
-               ePUser.setTimeZoneId(null);
-               ePUser.setOnline(true);
-               ePUser.setChatId(null);
-               ePUser.setUserApps(null);
-               ePUser.setPseudoRoles(null);
-
-               ePUser.setId((long) -1);
-               return ePUser;
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/framework/MockitoTestSuite.java
deleted file mode 100644 (file)
index 529dd5a..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.framework;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
-
-@RunWith(MockitoJUnitRunner.class)
-public class MockitoTestSuite {
-
-
-       public MockHttpServletRequestWrapper mockedRequest = new MockHttpServletRequestWrapper(
-                       Mockito.mock(HttpServletRequest.class));
-       public HttpServletResponse mockedResponse = Mockito.mock(HttpServletResponse.class);
-
-       public MockHttpServletRequestWrapper getMockedRequest() {
-               return mockedRequest;
-       }
-
-       public HttpServletResponse getMockedResponse() {
-               return mockedResponse;
-       }
-
-       public class MockHttpServletRequestWrapper extends HttpServletRequestWrapper {
-
-               HttpSession session = Mockito.mock(HttpSession.class);
-
-               public MockHttpServletRequestWrapper(HttpServletRequest request) {
-                       super(request);
-
-               }
-
-               @Override
-               public HttpSession getSession() {
-
-                       return session;
-               }
-
-               @Override
-               public HttpSession getSession(boolean create) {
-
-                       return session;
-               }
-
-       }
-       @Test
-       public void test()
-       {
-               assert(true);
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/listener/HealthMonitorTest.java
deleted file mode 100644 (file)
index 651f7f6..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.listener;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class HealthMonitorTest {
-
-       @Test
-       public void initialFlagsTest() {
-               assertEquals(false, HealthMonitor.isBackEndUp());
-               assertEquals(false, HealthMonitor.isFrontEndUp());
-               assertEquals(false, HealthMonitor.isDatabaseUp());
-               assertEquals(false, HealthMonitor.isUebUp());
-       }
-       
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java
deleted file mode 100644 (file)
index f3218a7..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPApp;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.service.RemoteWebServiceCallServiceImpl;
-import org.openecomp.portalsdk.core.onboarding.util.CipherUtil;
-import org.openecomp.portalsdk.core.service.DataAccessService;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ CipherUtil.class , SystemProperties.class})
-public class RemoteWebServiceCallServiceImplTest {
-       
-
-       @InjectMocks
-       RemoteWebServiceCallServiceImpl remoteWebServiceCallServiceImpl = new RemoteWebServiceCallServiceImpl();
-
-       @Mock
-       AppsCacheService appCacheService;
-       
-       @Mock
-       DataAccessService dataAccessService;
-       
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       
-       @Test
-       public void verifyRESTCredentialTest() throws Exception
-       {
-               PowerMockito.mockStatic(CipherUtil.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               String criteria= " where ueb_key = 'requestUebKey'";
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = new EPApp();
-               app.setAppPassword("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.decrypt("password",
-                               secretKey == null ? null : secretKey)).thenReturn("pwd");
-               assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","requestPassword"));
-       }
-       
-       @Test
-       public void verifyRESTCredentialExceptionTest() throws Exception
-       {
-               PowerMockito.mockStatic(CipherUtil.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               String criteria= " where ueb_key = 'requestUebKey'";
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = new EPApp();
-               app.setAppPassword("password");
-               app.setUsername("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.decrypt("password",
-                               secretKey == null ? null : secretKey)).thenReturn("pwd");
-               assertTrue(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd"));
-       }
-       
-       @Test
-       public void verifyRESTCredentialIfAppNullTest() throws Exception
-       {
-               PowerMockito.mockStatic(CipherUtil.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               String criteria= " where ueb_key = 'requestUebKey'";
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = new EPApp();
-               app.setAppPassword("password");
-               app.setUsername("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.decrypt("password",
-                               secretKey == null ? null : secretKey)).thenReturn("pwd");
-               assertFalse(remoteWebServiceCallServiceImpl.verifyRESTCredential(secretKey,"requestUebKey","requestAppName","pwd"));
-       }
-       
-       @Test
-       public void verifyAppKeyCredentialIfKeyIsNullTest() throws Exception
-       {
-               assertFalse(remoteWebServiceCallServiceImpl.verifyAppKeyCredential(null));
-       }
-       
-       @Test
-       public void verifyAppKeyCredentialTest() throws Exception
-       {
-               PowerMockito.mockStatic(CipherUtil.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               StringBuffer criteria = new  StringBuffer("where ueb_key = 'requestUebKey'");
-//             String criteria= " where ueb_key = 'requestUebKey'";
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = new EPApp();
-               app.setAppPassword("password");
-               app.setUsername("requestAppName");
-               appList.add(app);
-               Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null);
-               assertFalse(remoteWebServiceCallServiceImpl.verifyAppKeyCredential("test"));
-       }
-       
-       @Test
-       public void verifyAppKeyCredentialSuccessTest() throws Exception
-       {
-               PowerMockito.mockStatic(CipherUtil.class);
-               PowerMockito.mockStatic(SystemProperties.class);
-               String criteria= " where ueb_key = 'test'";
-               List<EPApp> appList = new ArrayList<>();
-               EPApp app = new EPApp();
-               app.setAppPassword("password");
-               app.setUsername("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/openecomp/portalapp/portal/service/SearchServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/service/SearchServiceImplTest.java
deleted file mode 100644 (file)
index 71671da..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.service;
-
-import static org.junit.Assert.*;
-
-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.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.openecomp.portalapp.portal.domain.EPUser;
-import org.openecomp.portalapp.portal.framework.MockEPUser;
-import org.openecomp.portalapp.portal.framework.MockitoTestSuite;
-import org.openecomp.portalapp.portal.transport.UserWithNameSurnameTitle;
-import org.openecomp.portalapp.portal.utils.EcompPortalUtils;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
-
-
-@RunWith(PowerMockRunner.class)
-@PrepareForTest({ EcompPortalUtils.class})
-public class SearchServiceImplTest {
-       
-       @InjectMocks
-       SearchServiceImpl searchServiceImpl = new SearchServiceImpl();
-
-       @Mock
-       UserService userService;
-       
-
-       @Before
-       public void setup() {
-               MockitoAnnotations.initMocks(this);
-       }
-
-       MockitoTestSuite mockitoTestSuite = new MockitoTestSuite();
-
-       HttpServletRequest mockedRequest = mockitoTestSuite.getMockedRequest();
-       HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
-
-       NullPointerException nullPointerException = new NullPointerException();
-       MockEPUser mockUser = new MockEPUser();
-       
-       @Test
-       public void searchUsersInPhoneBookTest()
-       {
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-               List<String> list = new ArrayList<>();
-               String str = "Test";
-               list.add(str);
-               Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list);
-               assertEquals(searchServiceImpl.searchUsersInPhoneBook("Test"), "[]");
-       }
-       
-       @Test
-       public void searchUsersInFnTableToFindUserIdTest()
-       {
-       PowerMockito.mockStatic(EcompPortalUtils.class);
-       List<String> list = new ArrayList<>();
-       String str = "Test";
-       String str2 = "Test new";
-       String str1 = "Test new1";
-       list.add(str);
-       list.add(str1);
-       list.add(str2);
-       Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list);
-       List<EPUser> userList = new ArrayList();
-       EPUser user = mockUser.mockEPUser();
-       user.setLastName("Test new");
-       userList.add(user);
-       Mockito.when( this.userService.getUserByFirstLastName("Test","Test new")).thenReturn(userList);
-       String result = searchServiceImpl.searchUsersInPhoneBook("Test");
-       assertEquals("[{\"orgUserId\":\"guestT\",\"firstName\":\"test\",\"lastName\":\"Test new\",\"jobTitle\":null}]" , result);
-       }
-       
-       
-       
-       @Test
-       public void searchUsersInFnTableFirstNameTest()
-       {
-       PowerMockito.mockStatic(EcompPortalUtils.class);
-       List<String> list = new ArrayList<>();
-       String str = "TestTT";
-       String str2 = "Test new1";
-       String str1 = "Test new";
-       String str3 = "Test new2";
-       list.add(str);
-       list.add(str1);
-       list.add(str2);
-       list.add(str3);
-       Mockito.when(EcompPortalUtils.parsingByRegularExpression("TestTT", " ")).thenReturn(list);
-       List<EPUser> userList = new ArrayList();
-       EPUser user = mockUser.mockEPUser();
-       user.setLastName("Test new");
-       user.setFirstName(null);
-       userList.add(user);
-       Mockito.when( this.userService.getUserByFirstLastName("TestTT","Test new")).thenReturn(userList);
-       assertEquals(searchServiceImpl.searchUsersInPhoneBook("TestTT"), "[]"); }
-
-       
-       @Test
-       public void searchUsersInFnTableLastNameTest()
-       {
-               PowerMockito.mockStatic(EcompPortalUtils.class);
-           List<String> list = new ArrayList<>();
-               String str = "Test";
-               String str2 = "Test new";
-               String str1 = "Test new1";
-               list.add(str);
-               list.add(str1);
-               list.add(str2);
-               Mockito.when(EcompPortalUtils.parsingByRegularExpression("Test", " ")).thenReturn(list);
-               List<EPUser> userList = new ArrayList();
-               EPUser user = mockUser.mockEPUser();
-               user.setLastName(null);
-               userList.add(user);
-               Mockito.when( this.userService.getUserByFirstLastName("Test","Test new")).thenReturn(userList);
-               assertEquals(searchServiceImpl.searchUsersInPhoneBook("Test"), "[]");   }
-               
-       
-
-       @Test
-       public void searchUserByUserIdTest()
-       {
-               List<EPUser> userList = new ArrayList();
-               EPUser user = mockUser.mockEPUser();
-               user.setLastName("Test new");
-               userList.add(user);
-               List<EPUser> foundUsers = new ArrayList<EPUser>();
-               Mockito.when(this.userService.getUserByUserId("guestT")).thenReturn(userList);
-               
-               EPUser expectedUser = searchServiceImpl.searchUserByUserId("guestT");
-               assertEquals(user, expectedUser);
-       }
-       
-       @Test
-       public void searchUserByUserIdExceptionTest()
-       {
-               Mockito.when(this.userService.getUserByUserId("guestT")).thenThrow(nullPointerException);
-               assertNull(searchServiceImpl.searchUserByUserId("guestT"));
-               
-       }
-       
-       @Test
-       public void searchUsersByUserIdTest()
-       {
-               
-               List<EPUser> userList = new ArrayList();
-               EPUser user = mockUser.mockEPUser();
-               user.setLastName("Test new");
-               userList.add(user);
-               Mockito.when(this.userService.getUserByUserId("guestT")).thenReturn(userList);
-               List<UserWithNameSurnameTitle> foundUsers = searchServiceImpl.searchUsersByUserId(user);
-               assertEquals(foundUsers.size(), 1);
-               
-       }
-       
-       @Test
-       public void searchUsersByUserIdExceptionTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               user.setLastName("Test new");
-               Mockito.when(this.userService.getUserByUserId("guestT")).thenThrow(nullPointerException);
-               List<UserWithNameSurnameTitle> foundUsers =  searchServiceImpl.searchUsersByUserId(user);
-               assertEquals(foundUsers.size(), 0);
-               
-       }
-       
-       @Test
-       public void searchUsersByNameExceptionTest()
-       {
-               EPUser user = mockUser.mockEPUser();
-               user.setLastName("test");
-               user.setFirstName("test");
-
-               Mockito.when(this.userService.getUserByFirstLastName("test","test")).thenThrow(nullPointerException);
-               List<UserWithNameSurnameTitle> foundUsers =     searchServiceImpl.searchUsersByName(user);
-               assertEquals(foundUsers.size(), 0);
-               
-       }
-}
diff --git a/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java b/ecomp-portal-BE-os/src/test/java/org/openecomp/portalapp/portal/utils/EcompPortalUtilsTest.java
deleted file mode 100644 (file)
index d9a5436..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.portal.utils;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class EcompPortalUtilsTest {
-
-       
-       @Test
-       public void legitimateUserIdFailureTest() {
-               assertEquals(false, EcompPortalUtils.legitimateUserId("1#@23456"));
-       }
-}
diff --git a/ecomp-portal-DB-common/EcompPortalDDLMySql_1707_Common.sql b/ecomp-portal-DB-common/EcompPortalDDLMySql_1707_Common.sql
deleted file mode 100644 (file)
index 902fecc..0000000
+++ /dev/null
@@ -1,1735 +0,0 @@
--- ---------------------------------------------------------------------------------------------------------------
--- This is the 1707 Open Source Version of Ecomp Portal database called portal
--- based on 1610.2 Open Source Version and 1702 Version of Ecomp Portal database called portal from 
--- Branchfeature/1610.2_OpenSource/ecomp_portal_core ecomp-portal-BE ecomp-portal-resources sql scripts
--- includes new additions for the 1707 release
--- Integrated Notifications. Web Analytics, Basic Authentication and Widgets
-
--- 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. 
---                          MySql/MariaDB Version compatibility information
--- bash-4.2$ mysql --version  – cluster version
--- mysql  Ver 15.1 Distrib 10.1.17-MariaDB, for Linux (x86_64) using readline 5.1
-
--- All versions newer or older than these DO NOT necessarily mean they are compatible.
--- -----------------------------------------------------------------------------------------------------------------
-
-
-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(50) 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),
-    constraint fk_fn_menu_ref_223_fn_funct foreign key (function_cd) references fn_function(function_cd)
-);
---
--- 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
-);
-
--- ------------------ 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
-   );
-
- -- ----------------------------------------------------------
- -- 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) NOT 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
-
--- ----------------------------------------------------------
--- 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_menu_function_cd; type: index
---
-create index fn_menu_function_cd using btree on fn_menu (function_cd);
---
--- 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/EcompPortalDDLMySql_1710_Common.sql b/ecomp-portal-DB-common/EcompPortalDDLMySql_1710_Common.sql
deleted file mode 100644 (file)
index 1ff699f..0000000
+++ /dev/null
@@ -1,1766 +0,0 @@
--- ---------------------------------------------------------------------------------------------------------------
--- This is the 1710 Open Source Version of Ecomp Portal database called portal
--- based on 1707 Open Source Version and  Ecomp 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. 
---                          MySql/MariaDB Version compatibility information
--- bash-4.2$ mysql --version  – cluster version
--- mysql  Ver 15.1 Distrib 10.1.17-MariaDB, for Linux (x86_64) using readline 5.1
-
--- All versions newer or older than these DO NOT necessarily mean they are compatible.
--- -----------------------------------------------------------------------------------------------------------------
-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),
-    constraint fk_fn_menu_ref_223_fn_funct foreign key (function_cd) references fn_function(function_cd)
-);
---
--- 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) 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) NOT 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(50) 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,
-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_menu_function_cd; type: index
---
-create index fn_menu_function_cd using btree on fn_menu (function_cd);
---
--- 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/EcompPortalDMLMySql_1707_Common.sql b/ecomp-portal-DB-common/EcompPortalDMLMySql_1707_Common.sql
deleted file mode 100644 (file)
index 66d4858..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-       -- --------------------------------------------------------------------------------------------
--- This is the common default data for 1707 Open Source Version of Ecomp Portal database called 
--- portal based on 1610.2 Open Source Version and 1702 
--- Version of Ecomp Portal database called portal from 
--- Branchfeature/1610.2_OpenSource/ecomp_portal_core ecomp-portal-BE ecomp-portal-resources sql scripts
-
-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-apps-marketplace');
-
-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-apps-marketplace');
-
-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-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_admin','Y','APP','N','icon-user');
-
-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_admin','Y','APP','N','icon-user');
-
-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-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_admin','Y','APP','N','icon-add-widget');
-
-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-add-widget');
-
-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-edit');
-
-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-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-add-widget');
-Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC)
-                                                               values(14,'Web Analytics',1,120,'root.webAnalytics','menu_web_analytics','Y','APP','N','icon-misc-piechart');
-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-add-widget');                               
-Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC)
-                                                               values(16,'Web Analytics Onboarding',1,140,'root.webAnlayticsSource','menu_admin','Y','APP','N','icon-misc-piechart');                                          
--- 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/EcompPortalDMLMySql_1710_Common.sql b/ecomp-portal-DB-common/EcompPortalDMLMySql_1710_Common.sql
deleted file mode 100644 (file)
index 581f2c6..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-       -- --------------------------------------------------------------------------------------------
--- This is the common default data for 1710 Open Source Version of Ecomp Portal database called 
--- portal based on 1707 Open Source Version and 1707
--- Version of Ecomp 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-apps-marketplace');
-
-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-apps-marketplace');
-
-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-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_admin','Y','APP','N','icon-user');
-
-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_admin','Y','APP','N','icon-user');
-
-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-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_admin','Y','APP','N','icon-add-widget');
-
-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-add-widget');
-
-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-edit');
-
-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-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-add-widget');
-Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC)
-                                                               values(14,'Web Analytics',1,120,'root.webAnalytics','menu_web_analytics','Y','APP','N','icon-misc-piechart');
-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-add-widget');                               
-Insert into fn_menu(MENU_ID,LABEL,PARENT_ID,SORT_ORDER,ACTION,FUNCTION_CD,ACTIVE_YN,MENU_SET_CD,SEPARATOR_YN,IMAGE_SRC)
-                                                               values(16,'Web Analytics Onboarding',1,140,'root.webAnlayticsSource','menu_admin','Y','APP','N','icon-misc-piechart');
--- 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/PortalDDLMySql_2_1_Common.sql b/ecomp-portal-DB-common/PortalDDLMySql_2_1_Common.sql
new file mode 100644 (file)
index 0000000..fd3828a
--- /dev/null
@@ -0,0 +1,1758 @@
+-- ---------------------------------------------------------------------------------------------------------------
+-- 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) 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) 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) NOT 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(50) 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/PortalDMLMySql_2_1_Common.sql b/ecomp-portal-DB-common/PortalDMLMySql_2_1_Common.sql
new file mode 100644 (file)
index 0000000..6c60c50
--- /dev/null
@@ -0,0 +1,276 @@
+-- --------------------------------------------------------------------------------------------
+-- 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
index b47e15d..dd45f07 100644 (file)
@@ -1,6 +1,4 @@
-This directory holds the common database scripts for the ONAP/ECOMP Portal.
-
-Previously database scripts were in ecomp-portal-BE/ecomp-portal-resources/sql scripts/
+This directory holds the common database scripts for the ONAP/Portal.
 
 This Readme file contains a description of all the database scripts
   
 
 This Readme file contains a description of all the database scripts
   
@@ -10,12 +8,10 @@ Directions:
 
 DDL
 
 
 DDL
 
-EcompPortalDDLMySql_1707_Common.sql  - this is the DDL entries that both Opensource and AT&T have in common
-EcompPortalDDLMySql_1710_Common.sql  - this is the DDL entries that both Opensource and AT&T have in common
+PortalDDLMySql_2_1_Common.sql  - this is the DDL entries for use inside the company and in the ONAP community
 
 DML
 
 
 DML
 
-EcompPortalDMLMySql_1707_Common.sql  - this is the DML entries that both Opensource and AT&T have in common
-EcompPortalDMLMySql_1710_Common.sql  - this is the DML entries that both Opensource and AT&T have in common
+PortalDMLMySql_2_1_Common.sql  - this is the DML entries for use inside the company and in the ONAP community
 
 ***************************************************************************************************************************************
 
 ***************************************************************************************************************************************
diff --git a/ecomp-portal-DB-os/EcompPortalDDLMySql_1707_OS.sql b/ecomp-portal-DB-os/EcompPortalDDLMySql_1707_OS.sql
deleted file mode 100644 (file)
index 494b6c3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
--- ---------------------------------------------------------------------------------------------------------------
--- This script adds tables for the 1707 OPEN-SOURCE version of the ECOMP Portal database.
--- The DDL 1707 COMMON 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/EcompPortalDDLMySql_1710_OS.sql b/ecomp-portal-DB-os/EcompPortalDDLMySql_1710_OS.sql
deleted file mode 100644 (file)
index caa022b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
--- ---------------------------------------------------------------------------------------------------------------
--- This script adds tables for the 1710 OPEN-SOURCE version of the ECOMP Portal database.
--- The DDL 1710 COMMON 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/EcompPortalDMLMySql_1707_OS.sql b/ecomp-portal-DB-os/EcompPortalDMLMySql_1707_OS.sql
deleted file mode 100644 (file)
index ace9d45..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
--- ---------------------------------------------------------------------------------------------------------------
--- This is the default data for the 1707 Version of ECOMP 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; 
-
--- 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','95LidzVz7nSpsTsRUrDNVA==','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_app
-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) values (1,'Default','assets/images/tmp/portal1.png','Some Default Description','Some Default Note','http://localhost','http://localhost','http://localhost:8080/ecompportal','EcompPortal','',NULL,'','N','N',NULL,NULL,NULL,NULL,NULL,1);
-
--- 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);
-
--- change to inactive for following menu
-update fn_menu set active_yn='N' where menu_id=14; /* web analytics */
-update fn_menu set active_yn='N' where menu_id=16; /* web analytics onboarding*/
-
-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) &gt;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 &gt; 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 &lt;= 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 &gt; 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 &lt;&gt; 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 &gt; 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) &gt;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) &gt;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) &gt;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 &gt; 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 &lt;= 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 &gt; 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 &lt;&gt; 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 &gt; 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) &gt;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) &gt;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'
-       );
-commit;    
\ No newline at end of file
diff --git a/ecomp-portal-DB-os/EcompPortalDMLMySql_1710_OS.sql b/ecomp-portal-DB-os/EcompPortalDMLMySql_1710_OS.sql
deleted file mode 100644 (file)
index b566219..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
--- ---------------------------------------------------------------------------------------------------------------
--- This is the default data for the 1710 Version of ECOMP 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; 
-
--- 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@onap.org',NULL,NULL,NULL,'demo',NULL,'demo','95LidzVz7nSpsTsRUrDNVA==','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_app
-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,'okYTaDrhzibcbGVq5mjkVQ==','N','N',NULL,'portal','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) &gt;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 &gt; 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 &lt;= 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 &gt; 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 &lt;&gt; 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 &gt; 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) &gt;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) &gt;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) &gt;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 &gt; 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 &lt;= 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 &gt; 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 &lt;&gt; 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 &gt; 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) &gt;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) &gt;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'
-       );
-commit;    
diff --git a/ecomp-portal-DB-os/PortalDDLMySql_2_1_OS.sql b/ecomp-portal-DB-os/PortalDDLMySql_2_1_OS.sql
new file mode 100644 (file)
index 0000000..8099aad
--- /dev/null
@@ -0,0 +1,12 @@
+-- ---------------------------------------------------------------------------------------------------------------
+-- 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
new file mode 100644 (file)
index 0000000..d6e15a1
--- /dev/null
@@ -0,0 +1,113 @@
+-- ---------------------------------------------------------------------------------------------------------------
+-- 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; 
+
+-- 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','95LidzVz7nSpsTsRUrDNVA==','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,'okYTaDrhzibcbGVq5mjkVQ==','N','N',NULL,'portal','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) &gt;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 &gt; 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 &lt;= 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 &gt; 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 &lt;&gt; 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 &gt; 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) &gt;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) &gt;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) &gt;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 &gt; 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 &lt;= 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 &gt; 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 &lt;&gt; 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 &gt; 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) &gt;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) &gt;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 Acc Menu');
+
+
+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|edit_notification|*', null),
+(12, 1, 999, 'url|getAdminNotifications|*', null),
+(13, 1, 999, 'menu|menu_admin|*', 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);
+commit;    
\ No newline at end of file
index 0f4422c..563676a 100644 (file)
@@ -1,6 +1,4 @@
-This directory holds the Opensource database scripts for the ONAP ECOMP Portal.
-
-Previously database scripts were in ecomp-portal-BE/ecomp-portal-resources/sql scripts/
+This directory holds the Opensource database scripts for the ONAP Portal.
 
 This Readme file contains a description of all the database scripts
   
 
 This Readme file contains a description of all the database scripts
   
@@ -12,19 +10,15 @@ DDL
 
 For an Opensource instance run only 
 
 
 For an Opensource instance run only 
 
-1707: script EcompPortalDDLMySql_1707_Common.sql.
-1710: script EcompPortalDDLMySql_1710_Common.sql.
+2_1: script PortalDDLMySql_2_1_Common.sql.
 
 
-1707: EcompPortalDDLMySql_1707_OS.sql is only a placeholder at this time.
-1710: EcompPortalDDLMySql_1710_OS.sql is only a placeholder at this time.
+2_1: PortalDDLMySql_2_1_OS.sql is only a placeholder at this time.
 
 DML
 
 For an Opensource instance run  
 
 
 DML
 
 For an Opensource instance run  
 
-1707: script EcompPortalDMLMySql_1707_Common.sql and script EcompPortalDMLMySql_1707_OS.sql.
-1710: script EcompPortalDMLMySql_1710_Common.sql and script EcompPortalDMLMySql_1710_OS.sql.
+2_1: script PortalDMLMySql_2_1_Common.sql and script PortalDMLMySql_2_1_OS.sql.
 
 
-1707: EcompPortalDMLMySql_1707_OS.sql - this is the specific DML entries that only Opensource needs
-1710: EcompPortalDMLMySql_1710_OS.sql - this is the specific DML entries that only Opensource needs
+2_1: PortalDMLMySql_2_1_OS.sql - this is the specific DML entries that only Opensource needs
 ***************************************************************************************************************************************
 ***************************************************************************************************************************************
index 7396411..550474b 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 
  */
 
 
index b60ffb2..e7156bf 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 (function () {
        /*
  */
 (function () {
        /*
index c6e2d6d..3b57a69 100644 (file)
@@ -1,4 +1,41 @@
-.b2b-nav-menu .b2b-subnav-container li{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .b2b-nav-menu .b2b-subnav-container li{
        background-color:white;
        z-index:10;
 }
\ No newline at end of file
        background-color:white;
        z-index:10;
 }
\ No newline at end of file
index ff818ce..44b0a9e 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index bab1fce..49e8872 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by Rui Lu on 12/12/16.
  */
 /**
  * Created by Rui Lu on 12/12/16.
index e031ed0..8005d7d 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 'use strict';
  */
 
 'use strict';
index e481f4b..7607271 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 1/28/16.
  */
 /**
  * Created by nnaffar on 1/28/16.
index ced37d6..24d134e 100644 (file)
@@ -1,5 +1,39 @@
-/**
- * Created by nnaffar on 1/28/16.
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 @sidebar-width: 200px;
 @transition-duration: 0.25s;
  */
 @sidebar-width: 200px;
 @transition-duration: 0.25s;
index 80b3bc9..a4d13b1 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index f73793b..c9e5d17 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/21/15.+
  */
 /**
  * Created by nnaffar on 12/21/15.+
index 6aa2ac5..91a98fd 100644 (file)
@@ -1,4 +1,41 @@
-.multiple-select{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .multiple-select{
   position: relative;
   width: 100%;
 
   position: relative;
   width: 100%;
 
        left: 0;
     top: 0;
   }
        left: 0;
     top: 0;
   }
+  
+  .checkbox .checkBoxText{     
+       width: 87%;
+  }
 }
\ No newline at end of file
 }
\ No newline at end of file
index 5f9ac21..2db7590 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -47,7 +47,7 @@
         <div ng-repeat="item in ngModel" id="{{item[nameAttr].split(' ').join('-')}}-checkbox-div">
             <label id="{{item[nameAttr].split(' ').join('-')}}-checkbox-label"  class="checkbox">
                 <input type="checkbox" id="{{item[nameAttr].split(' ').join('-')}}-checkbox" ng-model="item[valueAttr]" ng-change="onCheckboxClicked()">
         <div ng-repeat="item in ngModel" id="{{item[nameAttr].split(' ').join('-')}}-checkbox-div">
             <label id="{{item[nameAttr].split(' ').join('-')}}-checkbox-label"  class="checkbox">
                 <input type="checkbox" id="{{item[nameAttr].split(' ').join('-')}}-checkbox" ng-model="item[valueAttr]" ng-change="onCheckboxClicked()">
-                <i class="skin"></i><span>{{item[nameAttr]}}</span>              
+                <i class="skin"></i><span class="checkBoxText">{{item[nameAttr]}}</span>              
             </label>
         </div>
     </div>
             </label>
         </div>
     </div>
index f49848c..c0b3945 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/21/15.+
  */
 /**
  * Created by nnaffar on 12/21/15.+
index 00d295a..47d816d 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index b31d00e..6e16164 100644 (file)
@@ -1,4 +1,41 @@
-.multiple-select2{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .multiple-select2{
   position: relative;
   width: 100%;
 
   position: relative;
   width: 100%;
 
index ff33932..f2e120d 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 angular.module('ecompApp').directive( 'contextMenu', function($compile){
  */
 'use strict';
 angular.module('ecompApp').directive( 'contextMenu', function($compile){
index d6bf3d6..0e6ed3c 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 angular.module('ecompApp').
     directive('ngRightClick', function($parse) {
  */
 angular.module('ecompApp').
     directive('ngRightClick', function($parse) {
index d067257..d343760 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 angular.module('ecompApp')
  */
 
 angular.module('ecompApp')
index 6fd402c..d38e6ed 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 5cdac0b..9cc598b 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 //'use strict';
  */
 
 //'use strict';
index e297c7f..7bd7072 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 angular.module('ecompApp')
  */
 
 angular.module('ecompApp')
index 310649b..41c9f75 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index a9dc783..d7cb47e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 describe('Filter: elipsis', function () {
     'use strict';
  */
 describe('Filter: elipsis', function () {
     'use strict';
index 1bf3398..1825ec9 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index a6e70d6..96c33aa 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 angular.module('ecompApp')
  */
 
 angular.module('ecompApp')
index 7a3d3a7..84eaf24 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 60a99f5..0774f8c 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 11/22/2015.
  */
 /**
  * Created by nnaffar on 11/22/2015.
index d723a27..9d90fba 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
             this.utilsService = utilsService
         }
         
             this.utilsService = utilsService
         }
         
+        getSingleAppInfo(appName) {
+            let deferred = this.$q.defer();
+            var _this12 = this;
+            this.$http.get(this.conf.api.singleAppInfo,
+                {
+                    cache: false,
+                    params:{'appParam':appName},
+                    headers: {
+                        'X-ECOMP-RequestID':this.uuid.generate()
+                    }
+                })
+                .then( res => {
+                    // If response comes back as a redirected HTML page which IS NOT a success
+                       // But don't declare an empty list to be an error.
+                    if (res == null || res.data == null || _this12.utilsService.isValidJSON(res.data) == false) {
+                        deferred.reject("ApplicationsService::getSingleAppInfo Failed");
+                    } else {
+                        deferred.resolve(res.data);
+                    }
+                })
+                .catch( status => {
+                    deferred.reject(status);
+                });
+            return deferred.promise;
+        }
+        
+        getSingleAppInfoById(appId) {
+            let deferred = this.$q.defer();
+            var _this14 = this;
+            this.$http.get(this.conf.api.singleAppInfoById,
+                {
+                    cache: false,
+                    params:{'appParam':appId},
+                    headers: {
+                        'X-ECOMP-RequestID':this.uuid.generate()
+                    }
+                })
+                .then( res => {
+                    // If response comes back as a redirected HTML page which IS NOT a success
+                       // But don't declare an empty list to be an error.
+                    if (res == null || res.data == null || _this14.utilsService.isValidJSON(res.data) == false) {
+                        deferred.reject("ApplicationsService::getSingleAppInfoById Failed");
+                    } else {
+                        deferred.resolve(res.data);
+                    }
+                })
+                .catch( status => {
+                    deferred.reject(status);
+                });
+            return deferred.promise;
+        }
+        
         getPersUserApps() {
             let deferred = this.$q.defer();
             var _this0 = this;
         getPersUserApps() {
             let deferred = this.$q.defer();
             var _this0 = this;
                 });
             return deferred.promise;
         }
                 });
             return deferred.promise;
         }
+        
+        syncRolesEcompFromExtAuthSystem(appId){
+                let deferred = this.$q.defer();
+                let url = this.conf.api.syncRolesFromExternalAuthSystem;
+             var _this13 = this; 
+                this.$http({
+                method: "POST",
+                url: url,
+                cache: false,
+                data:appId,
+                headers: {
+                    'X-ECOMP-RequestID':this.uuid.generate()
+                }
+              }).then( res => {
+                     // If response comes back as a redirected HTML page which IS NOT a success
+                       // But don't declare an empty list to be an error.
+                     if (res == null || res.data == null || _this13.utilsService.isValidJSON(res.data) == false) {
+                         deferred.reject("ApplicationsService::syncRolesEcompFromExtAuthSystem Failed");
+                     } else {
+                         deferred.resolve(res);
+                     }
+                 })
+                 .catch( status => {
+                     deferred.reject(status);
+                 });
+             return deferred.promise;
+        }
+        
+       syncFunctionsFromExternalAuthSystem(appId){
+                let deferred = this.$q.defer();
+                let url = this.conf.api.syncFunctionsFromExternalAuthSystem;
+               var _this13 = this; 
+                  this.$http({
+                  method: "POST",
+                  url: url,
+                  cache: false,
+                  data:appId,
+                  headers: {
+                      'X-ECOMP-RequestID':this.uuid.generate()
+                  }
+                }).then( res => {
+                       // If response comes back as a redirected HTML page which IS NOT a success
+                       // But don't declare an empty list to be an error.
+                       if (res == null || res.data == null || _this13.utilsService.isValidJSON(res.data) == false) {
+                           deferred.reject("ApplicationsService::syncFunctionsFromExternalAuthSystem Failed");
+                       } else {
+                           deferred.resolve(res);
+                       }
+                   })
+                   .catch( status => {
+                       deferred.reject(status);
+                   });
+               return deferred.promise;
+          }
 
         getTopMenuData(selectedApp) {
             let deferred = this.$q.defer();
 
         getTopMenuData(selectedApp) {
             let deferred = this.$q.defer();
index af48fd6..c55d726 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by robertlo on 11/18/2016.
  */
 /**
  * Created by robertlo on 11/18/2016.
index dccc5b2..b08211f 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Author: Rui Lu
  */
 /**
  * Author: Rui Lu
index a95e0c0..3efb0d0 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 'use strict';
 
 (function () {
 'use strict';
 
 (function () {
index 8e30aa2..ff58092 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 11/22/2015.
  */
 /**
  * Created by nnaffar on 11/22/2015.
index 6b89341..e808b5a 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 2cebf0c..3d7954d 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 1/18/16.
  */
 /**
  * Created by nnaffar on 1/18/16.
index 6158498..9b45186 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by robertlo on 10/10/2016.
  */
 /**
  * Created by robertlo on 10/10/2016.
index 9e5e69b..e3f252e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by robertlo on 09/26/2016.
  */
 /**
  * Created by robertlo on 09/26/2016.
index a19f509..9cef649 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 let errorMessageByCode = {1201: 'Value already exists'};
  */
 'use strict';
 let errorMessageByCode = {1201: 'Value already exists'};
index 3be977b..8c03613 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 742b984..c78cb9a 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 0bfbe53..5f52d56 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 1/21/16.
  */
 /**
  * Created by nnaffar on 1/21/16.
index 89709a8..9b84e39 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by mlittle on 9/9/2016.
  */
 /**
  * Created by mlittle on 9/9/2016.
index 957cb6d..f947248 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 393e7cc..3c81945 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 0eea70c..fdd4521 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 'use strict';
  */
 
 'use strict';
index 12518ce..251c60d 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index ee2cd53..a84afdf 100644 (file)
@@ -1,26 +1,45 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 app.factory('RoleService', function ($http, $q, conf,uuid4) {
  */
 app.factory('RoleService', function ($http, $q, conf,uuid4) {
+       var manageRoleDetails = {};
        return {
        return {
-               getRoles: function() {
-                       return $http.get(conf.api.getRoles,{
+               getRoles(appId) {
+                       return $http.get(conf.api.getRoles.replace(':appId', appId),{
                 cache: false,
                 headers: {
                     'X-ECOMP-RequestID':uuid4.generate()
                 cache: false,
                 headers: {
                     'X-ECOMP-RequestID':uuid4.generate()
@@ -39,8 +58,8 @@ app.factory('RoleService', function ($http, $q, conf,uuid4) {
                        });
                },
                
                        });
                },
                
-               saveRoleFunction: function() {
-                       return $http.post(conf.api.saveRoleFuncion)
+               saveRoleFunction(appId) {
+                       return $http.post(conf.api.saveRoleFuncion.replace(':appId', appId))
                        .then(function(response) {
                                if (typeof response.data === 'object') {
                                        return response.data;
                        .then(function(response) {
                                if (typeof response.data === 'object') {
                                        return response.data;
@@ -54,8 +73,8 @@ app.factory('RoleService', function ($http, $q, conf,uuid4) {
                        });
                },
                
                        });
                },
                
-               getRoleFunctionList: function() {
-                       return $http.get(conf.api.getRoleFunctions,{
+               getRoleFunctionList(appId) {
+                       return $http.get(conf.api.getRoleFunctions.replace(':appId', appId),{
                 cache: false,
                 headers: {
                     'X-ECOMP-RequestID':uuid4.generate()
                 cache: false,
                 headers: {
                     'X-ECOMP-RequestID':uuid4.generate()
@@ -166,9 +185,9 @@ app.factory('RoleService', function ($http, $q, conf,uuid4) {
                        });
                },
                
                        });
                },
                
-               getRole: function(roleId) {
+               getRole: function(appId, roleId) {
                        
                        
-                       return $http.get(conf.api.getRole + '?role_id=' + roleId,{
+                       return $http.get(conf.api.getRole + '/' + appId + '/' + roleId,{    
                 cache: false,
                 headers: {
                     'X-ECOMP-RequestID':uuid4.generate()
                 cache: false,
                 headers: {
                     'X-ECOMP-RequestID':uuid4.generate()
@@ -185,6 +204,53 @@ app.factory('RoleService', function ($http, $q, conf,uuid4) {
                                // something went wrong
                                return $q.reject(response.data);
                        });
                                // something went wrong
                                return $q.reject(response.data);
                        });
+               },
+               
+               saveRole(appId) {
+                       return $http.post(conf.api.saveRole.replace(':appId', appId))
+                       .then(function(response) {
+                               if (typeof response.data === 'object') {
+                                       return response.data;
+                               } else {
+                                       return $q.reject(response.data);
+                               }
+
+                       }, function(response) {
+                               // something went wrong
+                               return $q.reject(response.data);
+                       });
+               },
+               
+               getCentralizedApps: function(userId) {
+                       
+                       return $http.get(conf.api.centralizedApps + '?userId=' + userId,{
+                cache: false,
+                headers: {
+                    'X-ECOMP-RequestID':uuid4.generate()
+                }
+            })
+                       .then(function(response) {
+                               if (typeof response.data === 'object') {
+                                       return response.data;
+                               } else {
+                                       return $q.reject(response.data);
+                               }
+       
+                       }, function(response) {
+                               // something went wrong
+                               return $q.reject(response.data);
+                       });
+               },
+               
+               setManageRoleDetails:function(apps, id){
+                       manageRoleDetails = {
+                                       apps: apps,
+                                       id: id
+                       }
+               },
+               
+               getManageRoleDetails: function(){
+                       return manageRoleDetails;
                }
        };
 });
                }
        };
 });
diff --git a/ecomp-portal-FE-common/client/app/services/scheduler/scheduler.service.js b/ecomp-portal-FE-common/client/app/services/scheduler/scheduler.service.js
new file mode 100644 (file)
index 0000000..8d7d5c6
--- /dev/null
@@ -0,0 +1,217 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+'use strict';
+
+(function () {
+       class SchedulerService {
+               constructor($q, $log, $http, conf, uuid, utilsService,$modal) {
+                       this.$q = $q;
+                       this.$log = $log;
+                       this.$http = $http;
+                       this.conf = conf;
+                       this.uuid = uuid;
+                       this.utilsService = utilsService;
+                       this.$modal = $modal;
+                       this.widgetInfo={
+                                       id:'',
+                                       data:'',
+                                       param:''
+                       }
+               }
+
+               /** get scheduler uuID **/
+               getStatusSchedulerId(schedulerInfo) {
+                       let deferred = this.$q.defer();
+                       var url = this.conf.api.getSchedulerId
+                       this.$http({
+                               url: url+'?r='+ Math.random(),
+                               method: 'POST',
+                               cache: false,
+                               timeout: 60000,
+                               data:schedulerInfo,
+                               headers: {
+                                       'X-ECOMP-RequestID':this.uuid.generate()
+                               }
+                       }).then(res => {
+                               if (res == null || res.data == null || this.utilsService.isValidJSON(res.data)== false) {
+                                       deferred.reject('SchedulerService::getStatusSchedulerId Failed');
+                               } else {
+                                       deferred.resolve(res.data);
+                               }
+                       }).catch(status => {
+                               deferred.reject(status);
+                       });
+                       return deferred.promise;
+               }
+
+               /** get time slots for Range scheduler **/
+               getTimeslotsForScheduler(schedulerID) {
+                       let deferred = this.$q.defer();
+                       var url = this.conf.api.getTimeslotsForScheduler + '/' + schedulerID + '?r=' + Math.random();
+                       this.$http({
+                               url: url,
+                               method: 'GET',
+                               timeout: 60000,
+                               cache: false,
+                               headers: {
+                                       'X-ECOMP-RequestID':this.uuid.generate()
+                               },
+                       }).then(res => {
+                               this.$log.debug('SchedulerService:: this.conf.api.portalAdmin: ' + JSON.stringify(res));
+                               if (res == null || res.data == null || this.utilsService.isValidJSON(res.data)== false) {
+                                       deferred.reject('SchedulerService::getTimeslotsForScheduler Failed');
+                               } else {
+                                       deferred.resolve(res.data);
+                               }
+                       }).catch(errRes => {
+                               deferred.reject(errRes);
+                       });
+                       return deferred.promise;
+               }
+
+               
+               postSubmitForApprovedTimeslots(approvedTimeSlotsObj) {
+                       let deferred = this.$q.defer();
+                       let url = this.conf.api.postSubmitForApprovedTimeslots + '?r='+ Math.random();
+                       this.$http({
+                               url: url,
+                               method: 'POST',
+                               timeout: 60000,
+                               cache: false,
+                               data: approvedTimeSlotsObj, 
+                               headers: {
+                                       'X-ECOMP-RequestID':this.uuid.generate()
+                               }
+                       }).then(res => {
+                               if (res == null || res.data == null || this.utilsService.isValidJSON(res.data)== false) {
+                                       deferred.reject('SchedulerService::postSubmitForapprovedTimeslots');
+                               } else {
+                                       deferred.resolve(res.data);
+                               }
+                       }).catch(errRes => {
+                               deferred.reject(errRes);
+                       });
+
+                       return deferred.promise;
+               }
+
+               /** Get policy information from BE **/
+               getPolicyInfo() {
+                       let deferred = this.$q.defer();
+                       let url =  this.conf.api.getPolicy + '?r=' + Math.random();
+                       this.$http({
+                               url: url,
+                               method: 'GET',
+                               timeout: 60000,
+                               cache: false,
+                               headers: {
+                                       'X-ECOMP-RequestID':this.uuid.generate()
+                               }
+                       }).then(res => {
+                               if (res == null || res.data == null || this.utilsService.isValidJSON(res.data)== false) {
+                                       deferred.reject('SchedulerService::getPolicyInfo');
+                               } else {
+                                       deferred.resolve(res.data);
+                               }
+                       }).catch(errRes => {
+                               deferred.reject(errRes);
+                       });
+
+                       return deferred.promise;
+               }
+
+               /** get Scheduler UI constants from BE **/
+               getSchedulerConstants() {
+                       let deferred = this.$q.defer();
+                       let url =  this.conf.api.getSchedulerConstants;       
+                       this.$http({
+                               url: url,
+                               method: 'GET',
+                               timeout: 60000,
+                               cache: false,
+                               headers: {
+                                       'X-ECOMP-RequestID':this.uuid.generate()
+                               }
+                       }).then(res => {
+                               if (res == null || res.data == null || this.utilsService.isValidJSON(res.data)== false) {
+                                       deferred.reject('SchedulerService::getSchedulerConstant');
+                               } else {
+                                       deferred.resolve(res.data);
+                               }
+                       }).catch(errRes => {
+                               deferred.reject(errRes);
+                       });
+                       return deferred.promise;
+               }
+
+               
+               /**Opens up the popup for Scheduler UI**/
+               showWidget(widgetId,widgetData,widgetParam) {
+                       let deferred = this.$q.defer();
+                       this.widgetInfo.id = widgetId;
+                       this.widgetInfo.data = widgetData;
+                       this.widgetInfo.param = widgetParam;    
+                       var modalInstance = this.$modal.open({
+                               templateUrl: 'app/views/scheduler/scheduler.tpl.html',
+                               controller: 'SchedulerCtrl',
+                               sizeClass:'modal-large',
+                               windowClass:"modal-docked",
+                               resolve: {
+                                       message: function message() {
+                                               var message = {
+                                                               id: widgetId,
+                                                               data: widgetData,
+                                                               param: widgetParam
+                                               };
+                                               return message;
+                                       }
+                               }
+                       });
+                       modalInstance.result.then(function () {
+                               deferred.resolve();
+                       });  
+                       return deferred.promise;
+               };
+
+               getWidgetData(){
+                       return this.widgetInfo;
+               }
+       }
+       SchedulerService.$inject = ['$q', '$log', '$http', 'conf', 'uuid4', 'utilsService', '$modal'];
+       angular.module('ecompApp').service('schedulerService', SchedulerService)
+})();
index 4b2ac50..efcace2 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 70899f2..a801eaa 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 808a663..eaafc77 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by doritrieur on 12/8/15.
  */
 /**
  * Created by doritrieur on 12/8/15.
index 2b12188..eaedb56 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index c3b57e3..9cb8557 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 601c9ff..5642cbf 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by doritrieur on 12/3/15.
  */
 /**
  * Created by doritrieur on 12/3/15.
index 4e626f9..32255c9 100644 (file)
@@ -1,4 +1,41 @@
-.b2b-modal-header{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .b2b-modal-header{
        font-size: 22px;
 }
 
        font-size: 22px;
 }
 
index dd11101..7cefc45 100644 (file)
@@ -1,4 +1,41 @@
-.ecomp-btn {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .ecomp-btn {
     .white14m;
     border-style: solid;
     border-width: 1px;
     .white14m;
     border-style: solid;
     border-width: 1px;
index 79003c0..748749d 100644 (file)
@@ -1,4 +1,41 @@
-.w-ecomp-main-view-title {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .w-ecomp-main-view-title {
     //.a24r;
     .blackText24m;
     //margin-left: @table-margin-left;
     //.a24r;
     .blackText24m;
     //margin-left: @table-margin-left;
index 0caaf48..6418ab2 100644 (file)
@@ -1,4 +1,41 @@
-.form {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .form {
     input, textarea, label , .multiple {
         .blue14r;
     }
     input, textarea, label , .multiple {
         .blue14r;
     }
index 9c598c0..171db97 100644 (file)
@@ -1,4 +1,41 @@
-/*------------------------------- Backgrounds -------------------------------*/
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ /*------------------------------- Backgrounds -------------------------------*/
 //.bg_a  {background-color:  @a;}
 //.bg_b  {background-color:  @b;}
 //.bg_c  {background-color:  @c;}
 //.bg_a  {background-color:  @a;}
 //.bg_b  {background-color:  @b;}
 //.bg_c  {background-color:  @c;}
index d5ecff6..aab1673 100644 (file)
@@ -1,4 +1,41 @@
-.ngdialog.ngdialog-theme-default.ng-scope {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .ngdialog.ngdialog-theme-default.ng-scope {
 .ngdialog-content {
         background-color: @portalWhite;
         padding: 0;
 .ngdialog-content {
         background-color: @portalWhite;
         padding: 0;
index 2c5fbd5..66a37ef 100644 (file)
@@ -1,4 +1,41 @@
-html, body, div, span, applet, object, iframe,
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ html, body, div, span, applet, object, iframe,
 h1, h2, h3, h4, h5, h6, p, blockquote, pre,
 a, abbr, acronym, address, big, cite, code,
 del, dfn, em, img, ins, kbd, q, s, samp,
 h1, h2, h3, h4, h5, h6, p, blockquote, pre,
 a, abbr, acronym, address, big, cite, code,
 del, dfn, em, img, ins, kbd, q, s, samp,
index 835b336..1474e2e 100644 (file)
@@ -1,4 +1,41 @@
-.select2-drop {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .select2-drop {
     //position: absolute;
     border-radius: 0 0 2px 2px;
 
     //position: absolute;
     border-radius: 0 0 2px 2px;
 
index b1bf6a1..205169c 100644 (file)
@@ -1,4 +1,41 @@
-.ecomp-spinner{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .ecomp-spinner{
   background: url('../assets/images/spinner.gif') top left no-repeat;
   @height: 32px;
   @width: 32px;
   background: url('../assets/images/spinner.gif') top left no-repeat;
   @height: 32px;
   @width: 32px;
index a241851..7a89ae7 100644 (file)
@@ -1,4 +1,41 @@
-.sprite-base {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .sprite-base {
   background: url('../assets/images/sprite.png') top left no-repeat;
 }
 
   background: url('../assets/images/sprite.png') top left no-repeat;
 }
 
index 7a0a75e..51ad10f 100644 (file)
@@ -1,4 +1,41 @@
-/*----------------------------------    General    ----------------------------------------------------------------*/
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ /*----------------------------------    General    ----------------------------------------------------------------*/
 @font-omnes-regular: Omnes-ECOMP-W02,Arial;
 @font-omnes-medium: Omnes-ECOMP-W02-Medium,Arial;
 @font-omnes-light: Omnes-ECOMP-W02-Light,Arial;
 @font-omnes-regular: Omnes-ECOMP-W02,Arial;
 @font-omnes-medium: Omnes-ECOMP-W02-Medium,Arial;
 @font-omnes-light: Omnes-ECOMP-W02-Light,Arial;
index 798b4db..43ddd10 100644 (file)
@@ -1,4 +1,41 @@
-<style>
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+  <style>
 
 .checkbox .skin {
     left: 0px;
 
 .checkbox .skin {
     left: 0px;
@@ -41,7 +78,7 @@ padding-top:10px;
                                <div class="account-properties-main"
                        scroll-top="accountAddDetails.scrollApi">
                        <form id="accounts-details-form" name="serviceForm" novalidate
                                <div class="account-properties-main"
                        scroll-top="accountAddDetails.scrollApi">
                        <form id="accounts-details-form" name="serviceForm" novalidate
-                               autocomplete="off">
+                               autocomplete="off" method="post">
                                <div class="item required">
                                        <div class="item-label">Account Name</div>
                                        <input id="account-details-input-name"
                                <div class="item required">
                                        <div class="item-label">Account Name</div>
                                        <input id="account-details-input-name"
@@ -110,7 +147,7 @@ padding-top:10px;
                                <div class="add-endpoint-item">
                                        <div class="item-label add-label-left">Add Endpoint</div>
                                        <div class="icon-add add-label-right" id="accountAddDetails-button-accordion"
                                <div class="add-endpoint-item">
                                        <div class="item-label add-label-left">Add Endpoint</div>
                                        <div class="icon-add add-label-right" id="accountAddDetails-button-accordion"
-                                               ng-click="accountAddDetails.addEndpoint()"></div>
+                                               ng-click="accountAddDetails.addEndpoint()"><span class="icon-primary-accordion-plus"></span></div>
                                </div>
                                <div class="item">
                                        <div class="item-label"
                                </div>
                                <div class="item">
                                        <div class="item-label"
@@ -128,7 +165,7 @@ padding-top:10px;
                                                </div>
 
                                                <div class="icon-circle-action-remove endpoint-item-middle"
                                                </div>
 
                                                <div class="icon-circle-action-remove endpoint-item-middle"
-                                                       ng-click="accountAddDetails.removeEndpointItem(endpoint)"></div>
+                                                       ng-click="accountAddDetails.removeEndpointItem(endpoint)"><span class="icon-primary-accordion-minus"></span></div>
                                                        
                                                <div class="error-container endpoint-item-right"
                                                                ng-show="endpoint.valid == false">
                                                        
                                                <div class="error-container endpoint-item-right"
                                                                ng-show="endpoint.valid == false">
@@ -157,7 +194,7 @@ padding-top:10px;
                        <div class="b2b-modal-footer">
                                <div class="cta-button-group cta-modal-footer-flex">            
                                        <div class="item">
                        <div class="b2b-modal-footer">
                                <div class="cta-button-group cta-modal-footer-flex">            
                                        <div class="item">
-                                               <div id="account-details-next-button" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Close</div>
+                                               <div id="account-details-next-button" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')">Cancel</div>
                                                <div id="account-details-next-button" class="btn btn-alt btn-small" ng-click="accountAddDetails.saveChanges()">Save</div>
                                        </div>
                                </div>
                                                <div id="account-details-next-button" class="btn btn-alt btn-small" ng-click="accountAddDetails.saveChanges()">Save</div>
                                        </div>
                                </div>
index 97e4b70..3d728b6 100644 (file)
@@ -1,7 +1,44 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 'use strict';
 (function () {
     class AccountAddDetailsCtrl {
 'use strict';
 (function () {
     class AccountAddDetailsCtrl {
-        constructor($scope, $log, $interval, basicAuthAccountService, errorMessageByCode, ECOMP_URL_REGEX, $window, confirmBoxService, $cookies,items) {
+        constructor($scope, $log, $interval, basicAuthAccountService, $modalInstance, errorMessageByCode, ECOMP_URL_REGEX, $window, confirmBoxService, $cookies,items) {
          
            this.addEndpoint = () => {
                  this.account.endpointList.push({
          
            this.addEndpoint = () => {
                  this.account.endpointList.push({
                        confirmBoxService.editItem(message).then(isConfirmed => {
                                if(isConfirmed){
                                        basicAuthAccountService.updateAccount(this.account.id, newAccount).then(() => {
                        confirmBoxService.editItem(message).then(isConfirmed => {
                                if(isConfirmed){
                                        basicAuthAccountService.updateAccount(this.account.id, newAccount).then(() => {
-                                $scope.$dismiss('cancel');
-                                $window.location.reload();
-
+                                               $modalInstance.close("confirmed");
                                        });
                                        }
                        });
                }else{
                        basicAuthAccountService.createAccount(newAccount).then(() => {
                                        });
                                        }
                        });
                }else{
                        basicAuthAccountService.createAccount(newAccount).then(() => {
-                        $scope.$dismiss('cancel');
-                        $window.location.reload();
-
+                                $modalInstance.close("confirmed");
                        });
                }
             }
                        });
                }
             }
             });
         }
     }
             });
         }
     }
-    AccountAddDetailsCtrl.$inject = ['$scope', '$log', '$interval', 'basicAuthAccountService', 'errorMessageByCode', 'ECOMP_URL_REGEX', '$window', 'confirmBoxService', '$cookies','items'];
+    AccountAddDetailsCtrl.$inject = ['$scope', '$log', '$interval', 'basicAuthAccountService', '$modalInstance', 'errorMessageByCode', 'ECOMP_URL_REGEX', '$window', 'confirmBoxService', '$cookies','items'];
     angular.module('ecompApp').controller('AccountAddDetailsCtrl', AccountAddDetailsCtrl);
 })(); 
\ No newline at end of file
     angular.module('ecompApp').controller('AccountAddDetailsCtrl', AccountAddDetailsCtrl);
 })(); 
\ No newline at end of file
index a18be84..edbf33e 100644 (file)
@@ -1,4 +1,41 @@
-.account-add-details-modal{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .account-add-details-modal{
        height: 550px;
        
        overflow-y: auto;
        height: 550px;
        
        overflow-y: auto;
index 38c2bb1..b33dd8e 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 'use strict';
 (function () {
     class AccountOnboardingCtrl {
 'use strict';
 (function () {
     class AccountOnboardingCtrl {
                 })
                 
                 modalInstance.result.then(function (needUpdate) {
                 })
                 
                 modalInstance.result.then(function (needUpdate) {
-                       if(needUpdate.value === true){
-                               if(needUpdate.value === true){
+                               if(needUpdate == 'confirmed'){
                                         getOnboardingAccounts();
                        }
                                         getOnboardingAccounts();
                        }
-                  }
                });
             };
             
                });
             };
             
index 7c01a5a..c06fc6a 100644 (file)
@@ -1,4 +1,41 @@
-.account-onboarding{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .account-onboarding{
   .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
     position: @page-main-position;
   .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
     position: @page-main-position;
index d5a3c24..3e19f30 100644 (file)
@@ -1,8 +1,46 @@
-<div class="w-ecomp-main">
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+  <div class="w-ecomp-main">
        <div class="w-ecomp-main-container">
                <div class="account-onboarding" id="page-content">
        <div class="w-ecomp-main-container">
                <div class="account-onboarding" id="page-content">
-                       <div id="account-onboarding-title" class="w-ecomp-main-view-title">Account
-                               Onboarding</div>
+                       <div id="account-onboarding-title" class="w-ecomp-main-view-title">
+                               <h1 class="heading-page" >App Account Management</h1>
+                       </div>
                        <div class="account-table">
                                <div class="table-control">
 
                        <div class="account-table">
                                <div class="table-control">
 
@@ -24,7 +62,7 @@
                                                                total-page="accountOnboarding.totalPageIgnored">
                                                                <thead b2b-table-row type="header">
                                                                        <tr>
                                                                total-page="accountOnboarding.totalPageIgnored">
                                                                <thead b2b-table-row type="header">
                                                                        <tr>
-                                                                               <th id="account-catalog-th-header-name"
+                                                                               <th id="account-catalog-th-header-name-{{header.value}}"
                                                                                        ng-repeat="header in accountOnboarding.accoutTableHeaders"
                                                                                        b2b-table-header key="{{header.value}}"
                                                                                        sortable="{{header.isSortable}}">{{header.name}}</th>
                                                                                        ng-repeat="header in accountOnboarding.accoutTableHeaders"
                                                                                        b2b-table-header key="{{header.value}}"
                                                                                        sortable="{{header.isSortable}}">{{header.name}}</th>
index a5ba021..00b134f 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 'use strict';
  */
 
 'use strict';
                     app.isAdmin = true;
                     this.appsOrder.push(app.id);
                 }
                     app.isAdmin = true;
                     this.appsOrder.push(app.id);
                 }
-                this.selectedNewApp = null;
                 //this.showNewAdminAppDropdown = false;
             });
                 //this.showNewAdminAppDropdown = false;
             });
+            this.selectedNewApp = null;
 
             $scope.$on('$stateChangeStart', e => {
                 //Disable navigation when modal is opened
 
             $scope.$on('$stateChangeStart', e => {
                 //Disable navigation when modal is opened
index c6011d1..4beb481 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/8/15.
  */
 /**
  * Created by nnaffar on 12/8/15.
index a392f94..70134b4 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -93,7 +93,7 @@
                                        <span class="left">Administrates:</span>
                                        <!--<span class="right" ng-click="newAdmin.addAdministratedApp()">+Add</span>-->
                                </div>
                                        <span class="left">Administrates:</span>
                                        <!--<span class="right" ng-click="newAdmin.addAdministratedApp()">+Add</span>-->
                                </div>
-                               <div class="adminAppsRoles_dropdown">
+                               <div class="adminAppsRoles_dropdown" id="sort-by-{{newAdmin.selectedNewApp.value}}">
                                        <select id="dropdown1" name="dropdown1" b2b-dropdown
                                                placeholder-text="Select application"
                                                ng-model="newAdmin.selectedNewApp.value">
                                        <select id="dropdown1" name="dropdown1" b2b-dropdown
                                                placeholder-text="Select application"
                                                ng-model="newAdmin.selectedNewApp.value">
index 1ac5963..40ce6ac 100644 (file)
@@ -1,4 +1,41 @@
-.new-admin-modal {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .new-admin-modal {
   height: 430px;
   margin-left: 20px;
   height: 350px;
   height: 430px;
   margin-left: 20px;
   height: 350px;
index 28144ed..93c1465 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 38760ca..2abb5fe 100644 (file)
@@ -1,4 +1,41 @@
-.w-ecomp-admins-page-main {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .w-ecomp-admins-page-main {
 
     .bg_portalWhite;//white for 1702
     position: @page-main-position;
 
     .bg_portalWhite;//white for 1702
     position: @page-main-position;
index 344cfe3..3c3b700 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index c580ac6..54af7c7 100644 (file)
@@ -1,4 +1,41 @@
-.application-details-modal {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .application-details-modal {
  // height: 700px;
 
   .title {
  // height: 700px;
 
   .title {
@@ -8,12 +45,9 @@
 
   }
   .app-properties-main{
 
   }
   .app-properties-main{
-    padding-left: 16px;
+    padding-left: 40px;
     padding-top: 16px;
     padding-bottom: 16px;
     padding-top: 16px;
     padding-bottom: 16px;
-    height: 630px;
-    overflow-y: auto;
-
 
     .left-container{
       display: inline-block;
 
     .left-container{
       display: inline-block;
index 60b9d81..bef4852 100644 (file)
@@ -1,4 +1,41 @@
-.applications-page-main{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .applications-page-main{
  .bg_portalWhite;//white for 1702
     position: @page-main-position;
     top: @page-main-top;
  .bg_portalWhite;//white for 1702
     position: @page-main-position;
     top: @page-main-top;
index 39eb8ab..78ae64d 100644 (file)
@@ -1,4 +1,41 @@
-.new-catalog-modal {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .new-catalog-modal {
   height: 430px;
 
   .user-catalog-roles{
   height: 430px;
 
   .user-catalog-roles{
index 1685c13..6a593e8 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index bbff851..2479a0b 100644 (file)
@@ -1,4 +1,41 @@
-.w-ecomp-app-catalog {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .w-ecomp-app-catalog {
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
   top: @page-main-top;
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
   top: @page-main-top;
index e64ba05..f6f0eac 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 83438e9..bffcfeb 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 'use strict';
  */
 
 'use strict';
index 9820982..0bc8a95 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index ed383fb..6d2d8c5 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index ef553e2..74cd646 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 1/18/16.
  */
 /**
  * Created by nnaffar on 1/18/16.
index 8beee1d..c7c6856 100644 (file)
@@ -1,4 +1,41 @@
-.confirmation-box-container {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .confirmation-box-container {
   .confirmation-message-wrap {
     display: table;
     height: 60px;
   .confirmation-message-wrap {
     display: table;
     height: 60px;
index 1dc1bb2..52bb45d 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index fe60706..6074937 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index d2a1736..27f13cd 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
                        <button type="button" class="close" aria-label="Close" id="div-information-close-button" ng-click="$dismiss('cancel')"></button>
                </div>
        </div>
                        <button type="button" class="close" aria-label="Close" id="div-information-close-button" ng-click="$dismiss('cancel')"></button>
                </div>
        </div>
-       <div class="b2b-modal-body" tabindex="0" role="region" aria-label="Modal header text content"   style="height: 60px;">
-               {{message.content}}
+       <div class="b2b-modal-body" tabindex="0" role="region" aria-label="Modal header text content">
+               <p class="information-message-body">{{message.content}}</p>
        </div>
        <div class="b2b-modal-footer ng-scope ng-isolate-scope in">
                <div class="cta-button-group in">
        </div>
        <div class="b2b-modal-footer ng-scope ng-isolate-scope in">
                <div class="cta-button-group in">
-                       <button class="btn btn-alt btn-small" type="button"     id="information-cancel-button" ng-click="$dismiss('cancel')">OK</button>
+                       <button class="btn btn-alt btn-small" type="button"     id="div-confirm-ok-button" ng-click="ok(true)">OK</button>
                </div>
        </div>
 </div>
                </div>
        </div>
 </div>
index 7842a7d..27e4a42 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 0197e9d..984666e 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index fbe255a..efb814a 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 10ccb9b..5cba449 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 76521f9..66c518f 100644 (file)
@@ -1,4 +1,41 @@
-.manage-widget-parameters-title{
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .manage-widget-parameters-title{
        color: #067ab4;
     font-family: "Omnes-ECOMP-W02", Arial;;
     font-size: 24px;
        color: #067ab4;
     font-family: "Omnes-ECOMP-W02", Arial;;
     font-size: 24px;
index 7767cdb..0c5fb2e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
                                return;
                        }
                        
                                return;
                        }
                        
-                       dashboardService.saveCommonWidgetData($scope.widgetObject)
-                       .then(function(res){
-                               if (res.status == 'OK') {
-                               dashboardService.getCommonWidgetData(message.type)
-                               .then(function(res){
-                                       $scope.widgetData = res.response.items;
-                               $scope.modflag = false;
-                                       $scope.cancelEdit(index);
-                                       });
-                               }
-                               else {
-                                       // Save failed
-                                       confirmBoxService.showInformation("Save failed").then(isConfirmed => {return;});
-                                       return;
-                               }
-                       });   
+                       dashboardService.saveCommonWidgetData($scope.widgetObject)
+                       .then(function(res){
+                               if (res.status == 'OK') {
+                                       dashboardService.getCommonWidgetData(message.type)
+                                       .then(function(res){
+                                               $scope.widgetData = res.response.items;
+                                               $scope.modflag = false;
+                                               $scope.cancelEdit(index);
+                                       });
+                               }
+                               else {
+                                       // Save failed
+                                       confirmBoxService.showInformation("Save failed. " +res.message).then(isConfirmed => {return;});
+                                       return;
+                               }
+                       });   
 
                };      
                
 
                };      
                
index b4cb010..3835d84 100644 (file)
@@ -1,4 +1,41 @@
-.searchLiHeader {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .searchLiHeader {
 font-weight: bold; 
 color: #0574ac; 
 font-size: 16px;
 font-weight: bold; 
 color: #0574ac; 
 font-size: 16px;
index 4c5ee2c..cb914ff 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
@@ -494,7 +512,7 @@ function _classCallCheck(instance, Constructor) {
                     id: new Date(),
                     title: item.headerText,
                     url: appUrl,
                     id: new Date(),
                     title: item.headerText,
                     url: appUrl,
-                    appId: item.appId
+                    appId: item.appid
                 };
                 $cookies.putObject('addTab', tabContent);
             }
                 };
                 $cookies.putObject('addTab', tabContent);
             }
index 0c05a81..1c374d3 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 02cd960..8cd1761 100644 (file)
@@ -1,4 +1,41 @@
-.w-ecomp-dashboard-home {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .w-ecomp-dashboard-home {
  .bg_portalWhite;//white for 1702
    position: @page-main-position;
   top: @page-main-top;
  .bg_portalWhite;//white for 1702
    position: @page-main-position;
   top: @page-main-top;
@@ -749,7 +786,7 @@ display: block!important;
 margin-left: 735px;
 }
 
 margin-left: 735px;
 }
 
-#dashboard-dropdown
+.dashboard-dropdown
 {
 position: absolute;
 margin-top: -37px;
 {
 position: absolute;
 margin-top: -37px;
@@ -935,7 +972,11 @@ cursor:move;
        cursor:move;
   }
   .widgetHeaderBtns-span {
        cursor:move;
   }
   .widgetHeaderBtns-span {
-       color: #888;
+    color: #888;
+    margin-left: 1px;
+    top: -3px;
+    position: relative;
+    font-size: 20px;
   }
   .widgetHeaderBtns-img {
        margin-bottom: 3px; 
   }
   .widgetHeaderBtns-img {
        margin-bottom: 3px; 
index a48fbce..db9b1ab 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -47,7 +47,7 @@
                                        <span class="simulateGridHeaderTitle">Applications <span
                                                class="dashboardSortHeader">Sort by:</span>
                                                
                                        <span class="simulateGridHeaderTitle">Applications <span
                                                class="dashboardSortHeader">Sort by:</span>
                                                
-                                               <div id="dashboard-dropdown">
+                                               <div class="dashboard-dropdown" id="sort-by-dropdownid-{{selectedSortType.value}}">
                                                <select id="sort-by-{{selectedSortType.value}}" name="dropdown1" b2b-dropdown  ng-model="selectedSortType.value" ng-change="selectedSortTypeChanged(selectedSortType.value)">  
                                        <option b2b-dropdown-list option-repeat="d in sort_options" value="{{d.value}}">{{d.title}}</option>
                                                </select>
                                                <select id="sort-by-{{selectedSortType.value}}" name="dropdown1" b2b-dropdown  ng-model="selectedSortType.value" ng-change="selectedSortTypeChanged(selectedSortType.value)">  
                                        <option b2b-dropdown-list option-repeat="d in sort_options" value="{{d.value}}">{{d.title}}</option>
                                                </select>
@@ -61,9 +61,7 @@
                                                        <div class="app-error-block">
                                                                <i class="icon-information full-linear-icon-information"
                                                                        class="icon-info"></i> <br>
                                                        <div class="app-error-block">
                                                                <i class="icon-information full-linear-icon-information"
                                                                        class="icon-info"></i> <br>
-                                                               <div class="activity-error-msg1">
-                                                                       You do not have access to any application or function in ECOMP
-                                                                       Portal.
+                                                               <div class="activity-error-msg1">                                                                       
                                                                        <div ng-include src="'app/views/dashboard/dashboard-extension.tpl.html'"></div>
                                                                </div>
                                                        </div>
                                                                        <div ng-include src="'app/views/dashboard/dashboard-extension.tpl.html'"></div>
                                                                </div>
                                                        </div>
                                                                <h3>{{ widget.headerText}}</h3>
                                                                <div class="box-header-btns pull-right"
                                                                        ng-if="isAdminPortalAdmin == true" class="ng-scope">
                                                                <h3>{{ widget.headerText}}</h3>
                                                                <div class="box-header-btns pull-right"
                                                                        ng-if="isAdminPortalAdmin == true" class="ng-scope">
-                                                                               <a id="widgetHeaderBtns"
+                                                                               <span id="widgetHeaderBtns-{{widget.headerText.split(' ').join('-')}}"
                                                                                        class="widgetHeaderBtn widgetHeaderBtnPosition singleBtnBorder"
                                                                                        ng-class="singleBtnBorder" alt="Settings"
                                                                                        ng-mousedown="showImpResOption=!showImpResOption"
                                                                                        ng-mouseleave="showImpResOption=false" title="Settings"
                                                                                        ddh-accessibility-click="13,32" tabindex="0"><span
                                                                                        class="widgetHeaderBtn widgetHeaderBtnPosition singleBtnBorder"
                                                                                        ng-class="singleBtnBorder" alt="Settings"
                                                                                        ng-mousedown="showImpResOption=!showImpResOption"
                                                                                        ng-mouseleave="showImpResOption=false" title="Settings"
                                                                                        ddh-accessibility-click="13,32" tabindex="0"><span
-                                                                                       class="widgetHeaderBtns-span"><img
-                                                                                       ng-src="assets/images/generic.png"
-                                                                                       class="widgetHeaderBtns-img" alt="..."
-                                                                                       aria-label="Tap or Click to move"
-                                                                                       src="assets/images/generic.png"></span></a>
+                                                                                       class="widgetHeaderBtns-span"><span class="icon-controls-moreapplications"></span></span></span>
 
                                                                                <ul class="optionsMenu widget-menu-options"                                                                                     
                                                                                        ng-show="showImpResOption"
 
                                                                                <ul class="optionsMenu widget-menu-options"                                                                                     
                                                                                        ng-show="showImpResOption"
index 0efbaac..afb12c5 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 5f4f410..887f0f5 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 'use strict';
 (function () {
     class ErrorCtrl {
 'use strict';
 (function () {
     class ErrorCtrl {
index c0476c6..344d9fe 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 764399a..9f4e9cb 100644 (file)
@@ -1,10 +1,44 @@
-/**
- * Created by nnaffar on 12/20/15.
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
     class MenuDetailsModalCtrl {
  */
 'use strict';
 (function () {
     class MenuDetailsModalCtrl {
-        constructor($scope, $log, functionalMenuService, errorMessageByCode, ECOMP_URL_REGEX,$rootScope,confirmBoxService,items) {
+        constructor($scope, $log, functionalMenuService, errorMessageByCode, $modalInstance, ECOMP_URL_REGEX,$rootScope,confirmBoxService,items) {
                $scope.ngDialogData=items;
                $scope.isAllApplications = false;
             let newMenuModel = {
                $scope.ngDialogData=items;
                $scope.isAllApplications = false;
             let newMenuModel = {
@@ -15,7 +49,6 @@
             };
 
             let getAvailableRoles = (appid) => {
             };
 
             let getAvailableRoles = (appid) => {
-                this.isSaving = true;
                 if (appid != null) {
                     $log.debug("MenuDetailsModalCtrl::getAvailableRoles: About to call getManagedRolesMenu");
                     functionalMenuService.getManagedRolesMenu(appid).then(rolesObj => {
                 if (appid != null) {
                     $log.debug("MenuDetailsModalCtrl::getAvailableRoles: About to call getManagedRolesMenu");
                     functionalMenuService.getManagedRolesMenu(appid).then(rolesObj => {
@@ -46,7 +79,6 @@
                         }
                         
                         $rootScope.$broadcast('availableRolesReady');
                         }
                         
                         $rootScope.$broadcast('availableRolesReady');
-                        this.isSaving = false;
                         for(var i=0; i<rolesObj.length;i++){
                                this.availableRoles[i].isApplied = false;
                                for(var j=0;j<this.preSelectedRoles.roles.length;j++){
                         for(var i=0; i<rolesObj.length;i++){
                                this.availableRoles[i].isApplied = false;
                                for(var j=0;j<this.preSelectedRoles.roles.length;j++){
                                break;
                        }
                 }
                                break;
                        }
                 }
-                debugger;
                 $log.debug('MenuDetailsModalCtrl::updateSelectedApp: drop down app item = ' + JSON.stringify(appItem.index));
                 $log.debug("MenuDetailsModalCtrl::updateSelectedApp: appItem in updateSelectedApp: ");
                 $log.debug('MenuDetailsModalCtrl::updateSelectedApp: ',appItem);
                 $log.debug('MenuDetailsModalCtrl::updateSelectedApp: drop down app item = ' + JSON.stringify(appItem.index));
                 $log.debug("MenuDetailsModalCtrl::updateSelectedApp: appItem in updateSelectedApp: ");
                 $log.debug('MenuDetailsModalCtrl::updateSelectedApp: ',appItem);
-                this.selectedApp.isDisabled = ! appobj.enabled;
+                if (appItem !== "Select Application"){
+                               this.selectedApp.isDisabled = ! appobj.enabled;
+                }
                 this.selectedApp.index=appobj.index;
                  $log.debug("MenuDetailsModalCtrl::updateSelectedApp: isDisabled: "+this.selectedApp.isDisabled);
                 getAvailableRoles(appobj.index);
                 this.selectedApp.index=appobj.index;
                  $log.debug("MenuDetailsModalCtrl::updateSelectedApp: isDisabled: "+this.selectedApp.isDisabled);
                 getAvailableRoles(appobj.index);
                         .then(() => {
                             $log.debug('MenuDetailsModalCtrl::saveChanges:  Menu Item saved');
                            // $scope.closeThisDialog(true);
                         .then(() => {
                             $log.debug('MenuDetailsModalCtrl::saveChanges:  Menu Item saved');
                            // $scope.closeThisDialog(true);
-                            $scope.$dismiss('cancel');
+                            $modalInstance.close("confirmed");
                         }).catch(err => {
                         if(err.status === 409){//Conflict
                             handleConflictErrors(err);
                         }).catch(err => {
                         if(err.status === 409){//Conflict
                             handleConflictErrors(err);
             });
         }
     }
             });
         }
     }
-    MenuDetailsModalCtrl.$inject = ['$scope', '$log', 'functionalMenuService', 'errorMessageByCode', 'ECOMP_URL_REGEX','$rootScope','confirmBoxService','items'];
+    MenuDetailsModalCtrl.$inject = ['$scope', '$log', 'functionalMenuService', 'errorMessageByCode', '$modalInstance', 'ECOMP_URL_REGEX','$rootScope','confirmBoxService','items'];
     angular.module('ecompApp').controller('MenuDetailsModalCtrl', MenuDetailsModalCtrl);
 
   })();
\ No newline at end of file
     angular.module('ecompApp').controller('MenuDetailsModalCtrl', MenuDetailsModalCtrl);
 
   })();
\ No newline at end of file
index e80a026..9a507a9 100644 (file)
@@ -1,4 +1,41 @@
-<div class="functionalMenu-details-modal">
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+  <div class="functionalMenu-details-modal">
     <div id="title" class="title">Delete Menu Item</div>
 
     <div id="functionalMenu-main" class="functionalMenu-properties-main" scroll-top="functionalMenuDetails.scrollApi">
     <div id="title" class="title">Delete Menu Item</div>
 
     <div id="functionalMenu-main" class="functionalMenu-properties-main" scroll-top="functionalMenuDetails.scrollApi">
index bae0e77..508db70 100644 (file)
@@ -1,4 +1,41 @@
-<div class="functionalMenu-details-modal">
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+  <div class="functionalMenu-details-modal">
 
                <div class="b2b-modal-header">
                        <h2 class="titles" id="microservice-add-details-title">{{ngDialogData.title}}</h2>
 
                <div class="b2b-modal-header">
                        <h2 class="titles" id="microservice-add-details-title">{{ngDialogData.title}}</h2>
index c63a63e..81b2184 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .functionalMenu-details-modal {
   //height: 520px;
   
 .functionalMenu-details-modal {
   //height: 520px;
   
index 8554fad..8c1a39f 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .functional-menu-main{
  .bg_portalWhite;//white for 1702
    position: @page-main-position;
 .functional-menu-main{
  .bg_portalWhite;//white for 1702
    position: @page-main-position;
index f0a3117..fae8948 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
                  $scope.lastName = res.lastName;
                  $scope.loginSnippetEmail = res.email;
                  $scope.loginSnippetUserid = res.userId;
                  $scope.lastName = res.lastName;
                  $scope.loginSnippetEmail = res.email;
                  $scope.loginSnippetUserid = res.userId;
-                 $scope.lastLogin = res.last_login;
+                 $scope.lastLogin = Date.parse(res.last_login);
                 }).catch(err=> {
                  $log.error('HeaderCtrl::LoginSnippetCtrl: failed in getFunctionalMenuStaticInfo: ' + err);
                 });
                 }).catch(err=> {
                  $log.error('HeaderCtrl::LoginSnippetCtrl: failed in getFunctionalMenuStaticInfo: ' + err);
                 });
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index eb0f14a..c3ffd9e 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .header-section {
   position: relative;
   z-index: 999;
 .header-section {
   position: relative;
   z-index: 999;
 .third-level-menu{
 column-count: 4;
     line-height: 12px;
 .third-level-menu{
 column-count: 4;
     line-height: 12px;
-    max-height: 500px;
     overflow-x: hidden;
     overflow-y: hidden;
     column-gap: 13px;
     overflow-x: hidden;
     overflow-y: hidden;
     column-gap: 13px;
@@ -456,7 +492,6 @@ column-count: 4;
 }
 
 .b2b-header-tabs .third-level-menu li{
 }
 
 .b2b-header-tabs .third-level-menu li{
-    display: inline-block;
     width:100%;
     border-bottom: 1px solid #d2d2d2;
 }
     width:100%;
     border-bottom: 1px solid #d2d2d2;
 }
@@ -573,3 +608,7 @@ column-count: 4;
   .recommendation-bulb-txt {
        font-size: 22px;
   }
   .recommendation-bulb-txt {
        font-size: 22px;
   }
+  .business-card-app-role{
+       font-size: 18px;
+       font-family: Omnes-ECOMP-W02, Arial;
+  }
\ No newline at end of file
index 37f0ad3..5103038 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
                                                                                <li><div class="reg-userLastLogin-label"><span class="reg-userLastLogin-label-spn reg-common-label-spn-txt">
                                                                Last login<span class="visuallyhidden">:</span></span></div></li>
                                                                                <li><div class="reg-userLastLogin-value"><span class="reg-userLastLogin-value-spn">
                                                                                <li><div class="reg-userLastLogin-label"><span class="reg-userLastLogin-label-spn reg-common-label-spn-txt">
                                                                Last login<span class="visuallyhidden">:</span></span></div></li>
                                                                                <li><div class="reg-userLastLogin-value"><span class="reg-userLastLogin-value-spn">
-                                                               {{lastLogin}}<span class="visuallyhidden"></span></span></div></li>
+                                                               {{ lastLogin | date : 'medium' }}<span class="visuallyhidden"></span></span></div></li>
                                                                <li>&nbsp;</li>
                                                                                <li>
                                                                        <div class="display-userAppRoles-label">
                                                                <li>&nbsp;</li>
                                                                                <li>
                                                                        <div class="display-userAppRoles-label">
-                                                                               <a href="javascript:void(0);"  ng-click="getUserApplicationRoles()"  class="icon-primary-accordion-plus" ng-class="{true: 'icon-primary-accordion-plus', false: 'icon-primary-accordion-minus'}[ !displayUserAppRoles]" >Applications and Roles</a>
+                                                                               <a href="javascript:void(0);"  ng-click="getUserApplicationRoles()"  class="icon-primary-accordion-plus" ng-class="{true: 'icon-primary-accordion-plus', false: 'icon-primary-accordion-minus'}[ !displayUserAppRoles]" ><span class="business-card-app-role">Applications and Roles</span></a>
                                                                        </div>
                                                                        <br>
                                                                <div class="display-userAppRoles-label display-userAppRoles-label-txt" ng-show="displayUserAppRoles">
                                                                        </div>
                                                                        <br>
                                                                <div class="display-userAppRoles-label display-userAppRoles-label-txt" ng-show="displayUserAppRoles">
index 06e205a..e5a3e8d 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -49,7 +49,7 @@
 <div class="microservice-add-details-model">
 
                <div class="b2b-modal-header">
 <div class="microservice-add-details-model">
 
                <div class="b2b-modal-header">
-                       <h2 class="title" id="microservice-add-details-title">Microservice Details</h2>
+                       <h2  id="microservice-add-details-title">Microservice Details</h2>
 
                        <div class="corner-button in">
                                <button type="button" class="close" aria-label="Close" id="microservicedetails-button-cancel"
 
                        <div class="corner-button in">
                                <button type="button" class="close" aria-label="Close" id="microservicedetails-button-cancel"
@@ -62,7 +62,7 @@
                <div class="microservice-properties-main"
                        scroll-top="microserviceAddDetails.scrollApi">
                        <form id="microservices-details-form" name="serviceForm" novalidate
                <div class="microservice-properties-main"
                        scroll-top="microserviceAddDetails.scrollApi">
                        <form id="microservices-details-form" name="serviceForm" novalidate
-                               autocomplete="off">
+                               autocomplete="off" method="post">
                                <div class="item required">
                                        <div class="item-label">Microservice Name</div>
                                        <input id="microservice-details-input-name" class="table-search-field"
                                <div class="item required">
                                        <div class="item-label">Microservice Name</div>
                                        <input id="microservice-details-input-name" class="table-search-field"
@@ -95,7 +95,7 @@
                                        <div class="item-label">Microservice Description</div>
                                        <textarea b2b-reset b2b-reset-textarea id="widgets-details-input-desc"
                                                name="desc" ng-model="microserviceAddDetails.service.desc"
                                        <div class="item-label">Microservice Description</div>
                                        <textarea b2b-reset b2b-reset-textarea id="widgets-details-input-desc"
                                                name="desc" ng-model="microserviceAddDetails.service.desc"
-                                               ng-change="microserviceAddDetails.updateDesc()"></textarea>
+                                               ng-change="microserviceAddDetails.updateDesc()"  class="textAreaDesc"></textarea>
                                        <div class="error-container"
                                                ng-show="(microserviceAddDetails.emptyServiceDesc 
                                        || (serviceForm.desc.$dirty && microserviceAddDetails.service.desc == ''))">
                                        <div class="error-container"
                                                ng-show="(microserviceAddDetails.emptyServiceDesc 
                                        || (serviceForm.desc.$dirty && microserviceAddDetails.service.desc == ''))">
                        <div class="b2b-modal-footer">
                                <div class="cta-button-group cta-modal-footer-flex">            
                                        <button class="btn btn-alt btn-small" id="microservice-details-save-button" ng-click="microserviceAddDetails.saveChanges()">Save</button>                               
                        <div class="b2b-modal-footer">
                                <div class="cta-button-group cta-modal-footer-flex">            
                                        <button class="btn btn-alt btn-small" id="microservice-details-save-button" ng-click="microserviceAddDetails.saveChanges()">Save</button>                               
-                                       <button class="btn btn-alt btn-small" id="microservice-details-close-button" ng-click="$dismiss('cancel')">Close</button>       
+                                       <button class="btn btn-alt btn-small" id="microservice-details-close-button" ng-click="$dismiss('cancel')">Cancel</button>      
                                </div>
                        </div>
                        
                                </div>
                        </div>
                        
index dff938a..04469a0 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index e817803..166d600 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .microservice-add-details-model{
        //height: 550px;
        //overflow-y: auto;
 .microservice-add-details-model{
        //height: 550px;
        //overflow-y: auto;
@@ -13,6 +50,9 @@
            padding-top:30px;
            margin-left: 25px;
        }
            padding-top:30px;
            margin-left: 25px;
        }
+       .textAreaDesc{
+               padding:10px;
+       }
        .microservice-properties-main {
            padding-top: 20px;
            padding-left: 20px;
        .microservice-properties-main {
            padding-top: 20px;
            padding-left: 20px;
 }
 #microservice-scroll-end{
        height: 20px;
 }
 #microservice-scroll-end{
        height: 20px;
-} 
\ No newline at end of file
+} 
+
+#microservice-details-input-endpoint-url{
+       width:400px !important;
+}
\ No newline at end of file
index dfb424f..727204d 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 'use strict';
 (function () {
     class MicroserviceOnboardingCtrl {
 'use strict';
 (function () {
     class MicroserviceOnboardingCtrl {
index 74b1b6a..7a84d0b 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .microservice-onboarding{
    .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
 .microservice-onboarding{
    .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
index 3d665c5..ebbebd9 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -38,8 +38,9 @@
 <div class="w-ecomp-main">
        <div class="w-ecomp-main-container">
                <div class="microservice-onboarding" id="page-content">
 <div class="w-ecomp-main">
        <div class="w-ecomp-main-container">
                <div class="microservice-onboarding" id="page-content">
-                       <div id="microservice-onboarding-title"
-                               class="w-ecomp-main-view-title">Microservice Onboarding</div>
+                       <div id="microservice-onboarding-title" class="w-ecomp-main-view-title">
+                               <h1 class="heading-page" >Microservice Onboarding</h1>
+                       </div>
                        <div class="microservices-table">
                                <div class="table-control">
                        <div class="table-control-buttons">
                        <div class="microservices-table">
                                <div class="table-control">
                        <div class="table-control-buttons">
@@ -56,7 +57,7 @@
                                                                total-page="microserviceOnboarding.totalPageIgnored">
                                                                <thead b2b-table-row type="header">
                                                                        <tr>
                                                                total-page="microserviceOnboarding.totalPageIgnored">
                                                                <thead b2b-table-row type="header">
                                                                        <tr>
-                                                                               <th id="microservice-catalog-th-header-name"
+                                                                               <th id="microservice-catalog-th-{{header.value}}"
                                                                                        ng-repeat="header in microserviceOnboarding.serviceTableHeaders"
                                                                                        b2b-table-header key="{{header.value}}"
                                                                                        sortable="{{header.isSortable}}">{{header.name}}</th>
                                                                                        ng-repeat="header in microserviceOnboarding.serviceTableHeaders"
                                                                                        b2b-table-header key="{{header.value}}"
                                                                                        sortable="{{header.isSortable}}">{{header.name}}</th>
index de28a8b..f2abcc8 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 7120eb5..6322b98 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-user-notification-history {
       .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
 .w-ecomp-user-notification-history {
       .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
index 7b0c037..2ab9d7c 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 49605e5..ed61112 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/8/15.
  */
 /**
  * Created by nnaffar on 12/8/15.
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 9a003ce..6aa76e1 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 7c8e5ff..0ed4786 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .new-portal-admin-modal {
   height: 430px;
 
 .new-portal-admin-modal {
   height: 430px;
 
index de1557a..4b770f0 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index d3a0b56..d12b1bd 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 0471aee..a2c0bdd 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .portal-admins-page-main {
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
 .portal-admins-page-main {
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
diff --git a/ecomp-portal-FE-common/client/app/views/role/popup_createedit_role.html b/ecomp-portal-FE-common/client/app/views/role/popup_createedit_role.html
new file mode 100644 (file)
index 0000000..dc4e00d
--- /dev/null
@@ -0,0 +1,137 @@
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+  <style>
+  .checkbox .skin {
+    left: 112px;
+    top: -8px;
+}
+.checkbox input {
+    margin: 0px;
+    left: 105px;
+    height: 20px;
+    top: -4px;
+    }
+.checkbox span {
+    display: inline-block;
+    margin-left: 1px;
+    margin-top: 0;
+    position: relative;
+    top: -3px;
+}
+.property-label {
+       margin-right: 40px;
+}
+.dialog-control {
+    bottom: 170px;
+    position: fixed;
+    right: 588px;
+}
+.header-txt{
+       font-size: 30px;
+}
+  </style>
+               <div class="b2b-modal-header">  
+                       <div id="title" class="w-ecomp-main-view-title">
+                       <h1 id="role" class="header-txt" >Role</h1>
+                        </div>
+                       <div class="corner-button in">
+                               <button type="button" class="close" aria-label="Close" id="button-cancel-role"
+                                       ng-click="$dismiss('cancel')"></button>
+                       </div>
+               </div>
+               
+               <div class="b2b-modal-body">
+                           <p class="p-info">Please <span ng-if="roleId != ''">edit</span> <span ng-if="roleId == ''">add</span> the role details below:&nbsp;</p><br>
+                           
+                              <div ng-show ="isGlobalRole" class="property-label checkbox-label"> 
+                                       <label for="checkbox-app-is-restricted" class="checkbox"> 
+                               <input type="checkbox" ng-model="isGlobalRoleChecked.isChecked" id="checkbox-app-is-restricted"  ng-checked="isGlobalRoleChecked.isChecked" /> 
+                               <i id="checkbox-app-is-restricted" class="skin"></i> 
+                               <span>Global Roles: </span> 
+                           </label> 
+                               </div>
+                            
+                               <div id="role-text" >
+                                       <label id="role-text-name-label" >*Name:</label>
+                                       <input id="input-name"  class="input-field" maxlength="300"  type="text" data-ng-model="role.name" ng-disabled = "isGlobalRoleChecked.isChecked && appId != 1">                                  
+                                       <br>
+                                       <label id="role-text-priority-label">Priority:</label>
+                                       <input id="input-priority" class="input-field" maxlength="30"  type="text" data-ng-model="role.priority" ng-disabled = "isGlobalRoleChecked.isChecked && appId != 1">                                           
+                               </div>
+                               <br/>
+                               <div class="scrolling-table">
+                                       <div ng-if="roleFunctions.length">
+                                               <div id="page-title"  class="pageTitle">
+                                                       <label>Role Functions</label>
+                                               </div>                                  
+                                               <div b2b-table table-data="availableRoleFunctions" class="b2b-table-div">
+                                               <span class="ecomp-spinner" ng-show="isLoadingRoleFunctions"></span>
+                                                       <table>
+                                                               <thead b2b-table-row type="header">
+                                                                       <tr>
+                                                                               <th b2b-table-header key="firstName" sortable="true" id="col1"></th>
+                                                                               <th b2b-table-header key="name" sortable="true" id="col2">Name</th>
+                                                                       </tr>
+                                                               </thead>
+                                                               <tbody b2b-table-row type="body"
+                                                                       row-repeat="rowData in availableRoleFunctions">
+                                                                       <tr>
+                                                                               <td b2b-table-body id="rowheader_t1_{{$index}}" headers="col1">
+                                                                                       <label class="btn-switch-label" tabindex="0" role="option">
+                                                                                               <input id="row-input-{{$index}}" type="checkbox" b2b-switches
+                                                                                               ng-model="rowData.selected"
+                                                                                               ng-click="toggleRoleFunction(rowData.selected,rowData);">
+                                                                               </label>
+                                                                               </td>
+                                                                               <td b2b-table-body headers="rowheader_t1_{{$index}} col2"
+                                                                                       ng-bind="rowData.name"></td>            
+                                                                       </tr>
+                                                               </tbody>
+                                                       </table>
+                                               </div>                                                                          
+                                       </div>
+                       </div>
+        </div>
+        
+        <div class="b2b-modal-footer">
+               <div class="cta-button-group in">       
+                       <button id="button-app-save" class="btn btn-alt btn-small" size="small" ng-click="saveRole(role, editRoleFunction);" href="javascript:void(0)">Save</button>
+                                               
+                       <button id="button-app-cancel" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')" role="button" tabindex="0" href="javascript:void(0)">Cancel</button>
+               </div>
+        </div>   
\ No newline at end of file
index da8a5b3..5322dc6 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
  
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
  
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
-  <style>
-  .dialog-control {
-    position: relative;
-    bottom: -13px;
-    right: 0px;
-}
-  </style>
 <style>
 <style>
-  .dialog-control {
-    position: relative;
-    bottom: -13px;
-    right: 0px;
+.dialog-control {
+       position: relative;
+       bottom: -13px;
+       right: 0px;
 }
 }
-  </style>
+</style>
 
 <!-- <link rel="stylesheet" href="role.css">
 
 <!-- <link rel="stylesheet" href="role.css">
- --><div class="new-admin-modal">
-               <div class="b2b-modal-header">
-                       
+ -->
+<div class="new-admin-modal" style="height: 600px;">
+       <div class="b2b-modal-header">
 
 
-                       <div class="corner-button in">
-                               <button type="button" class="close" aria-label="Close" id="button-cancel-role"
-                                       ng-click="$dismiss('cancel')"></button>
-                       </div>
+
+               <div class="corner-button in">
+                       <button type="button" class="close" aria-label="Close"
+                               id="button-cancel-role" ng-click="$dismiss('cancel')"></button>
                </div>
                </div>
+       </div>
 
 
-               <div class="b2b-modal-body">
+       <div class="b2b-modal-body">
                <form id="admin-details-form" name="adminForm" novalidate>
                <form id="admin-details-form" name="adminForm" novalidate>
-               <div class="title" ng-bind="label" class="adminForm-title"></div>
-<br>
-               <div >
-                                       <div class="item-label"> <span ID="required" style="color: Red;"
-                                               visible="false"> *</span>Name:</div>
-                                       <input id="name-property-input"
-                                               class="adminForm-name-property-input" ng-model="editRoleFunction.name"
-                                               type="text" maxlength="30"
-                                                />
+                       <div class="title" ng-bind="label" class="adminForm-title"></div>
+                       <br>
+                       <div>
+                               <div class="item-label">
+                                       <span ID="required" style="color: Red;" visible="false"> *</span>Type:
+                                       <fieldset style="height: 75px;" role="radiogroup"
+                                               b2b-radio-group-accessibility aria-labelledby="radiolabel2">
+                                               <div class="form-row" role="radio"
+                                                       ng-repeat="radioObj in ngRepeatDemo">
+                                                       <label style="margin-top: 10px;" for="{{radioObj.id}}"
+                                                               class="radio"> <input type="radio"
+                                                               ng-model="selectedvalueradioButtonGroup.type"
+                                                               id="{{radioObj.id}}" ng-disabled="disableCd"
+                                                               name="nameradioButton" value="{{radioObj.value}}"> <i
+                                                               style="margin-top: 10px;" class="skin"></i> <span
+                                                               style="margin-top: 10px;">{{radioObj.labelvalue}}</span>
+                                                       </label>
+                                               </div>
+                                       </fieldset>
+                                       <br> <input
+                                               ng-show="selectedvalueradioButtonGroup.type === 'other'"
+                                               id="type-property-input" class="adminForm-name-property-input"
+                                               ng-model="editRoleFunction.type" ng-disabled="disableCd"
+                                               type="text" maxlength="30" />
+                               </div>
+                               <div class="error-container"
+                                       ng-show="selectedvalueradioButtonGroup.type === 'other'&&(!editRoleFunction.type||editRoleFunction.type.length==0)">
+                                       <small id="microservices-details-input-url-required"
+                                               class="err-message">Type is Required</small>
+                               </div>
+                       </div>
+                       <br>
+                       <div>
+                               <div class="item-label">
+                                       <span ID="required" style="color: Red;" visible="false"> *</span>Instance:
+                               </div>
+                               <input id="code-property-input"
+                                       class="adminForm-code-property-input"
+                                       ng-model="editRoleFunction.code" ng-disabled="disableCd"
+                                       type="text" maxlength="250" />
 
 
-                                       <div class="error-container"
-                                               ng-show="!editRoleFunction.name||editRoleFunction.name.length==0">
-                                               <small id="microservices-details-input-url-required"
-                                                       class="err-message">Name is Required</small>
-                                       </div>
+                               <div class="error-container"
+                                       ng-show="!editRoleFunction.code||editRoleFunction.code.length==0">
+                                       <small id="code-property-required" class="err-message">Instance
+                                               is Required</small>
+                               </div>
+                       </div>
+                       <br>
+                       <div>
+                               <div class="item-label">
+                                       <span ID="required" style="color: Red;" visible="false"> *</span>Action:
+                               </div>
+                               <input id="action-property-input"
+                                       class="adminForm-name-property-input"
+                                       ng-model="editRoleFunction.action" ng-disabled="disableCd"
+                                       type="text" maxlength="30" />
+                               <div class="error-container"
+                                       ng-show="!editRoleFunction.action||editRoleFunction.action.length==0">
+                                       <small id="microservices-details-input-url-required"
+                                               class="err-message">Action is Required</small>
                                </div>
                                </div>
-                       <br>    
-                               <div >
-                                       <div class="item-label"> <span ID="required" style="color: Red;"
-                                               visible="false"> *</span>Code:</div>
-                                       <input id="code-property-input"
-                                               class="adminForm-code-property-input" ng-model="editRoleFunction.code" ng-disabled="disableCd"
-                                               type="text" maxlength="30"
-                                                />
+                       </div>
+                       <br>
+                       <div>
+                               <div class="item-label">
+                                       <span ID="required" style="color: Red;" visible="false"> *</span>Name:
+                               </div>
+                               <input id="name-property-input"
+                                       class="adminForm-name-property-input"
+                                       ng-model="editRoleFunction.name" type="text" maxlength="50" />
 
 
-                                       <div class="error-container"
-                                               ng-show="!editRoleFunction.code||editRoleFunction.code.length==0">
-                                               <small id="code-property-required"
-                                                       class="err-message">Code is Required</small>
-                                       </div>
+                               <div class="error-container"
+                                       ng-show="!editRoleFunction.name||editRoleFunction.name.length==0">
+                                       <small id="microservices-details-input-url-required"
+                                               class="err-message">Name is Required</small>
                                </div>
                                </div>
-               
+                       </div>
+                       <br>
+                       <div class="item-label">
+                               <span style="color: #0568ae; font-size: 20px;"
+                                       class="icon-numslets-flat-info"></span> Code: <span
+                                       ng-show="selectedvalueradioButtonGroup.type !== 'other'">{{selectedvalueradioButtonGroup.type}}|{{editRoleFunction.code}}|{{editRoleFunction.action}}</span>
+                               <span ng-show="selectedvalueradioButtonGroup.type === 'other'">{{editRoleFunction.type}}|{{editRoleFunction.code}}|{{editRoleFunction.action}}</span>
+                       </div>
                </form>
        </div>
                </form>
        </div>
-               
-                       <div class="b2b-modal-footer">
-                               <div class="dialog-control">
-                               
-<button id="button-app-save" class="btn btn-alt btn-small" size="small" ng-disabled="(!editRoleFunction.name||editRoleFunction.name.length==0)||(!editRoleFunction.code||editRoleFunction.code.length==0 )" ng-click="!saveRoleFunction(editRoleFunction)";herf="javascript:void(0)">Save</button>
-                                               
-                                               <div id="button-app-cancel" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')" role="button" tabindex="0" herf="javascript:void(0)">Cancel</div>
-               </div>
-               
-               <!-- <div class="dialog-control">
 
 
-<button id="button-app-save" class="btn btn-alt btn-small" size="small" ng-disabled="(!editRoleFunction.name||editRoleFunction.name.length==0)||(!editRoleFunction.code||editRoleFunction.code.length==0 )" ng-click="!saveRoleFunction(editRoleFunction)";herf="javascript:void(0)">Save</button>
+       <div class="b2b-modal-footer">
+               <div class="dialog-control">
+
+                       <button id="button-app-save" class="btn btn-alt btn-small"
+                               size="small"
+                               ng-disabled="(!editRoleFunction.name||editRoleFunction.name.length==0)||(!editRoleFunction.code||editRoleFunction.code.length==0 )||(!editRoleFunction.action||editRoleFunction.action.length==0)
+                       ||(!selectedvalueradioButtonGroup.type||selectedvalueradioButtonGroup.type.length==0)||(selectedvalueradioButtonGroup.type ==='other'&&(!editRoleFunction.type||editRoleFunction.type.length==0))"
+                               ng-click="!saveRoleFunction(editRoleFunction,selectedvalueradioButtonGroup.type)"
+                               herf="javascript:void(0)">Save</button>
+
+                       <div id="button-app-cancel" class="btn btn-alt btn-small"
+                               ng-click="$dismiss('cancel')" role="button" tabindex="0"
+                               herf="javascript:void(0)">Cancel</div>
+               </div>
+       </div>
 
 
-<div id="button-app-cancel" class="btn btn-alt btn-small" ng-click="closeThisDialog()" role="button" tabindex="0" herf="javascript:void(0)">Cancel</div>
-</div> -->
-                       </div>
-                       
 </div>
 
 <script>
 </div>
 
 <script>
-$(document).ready(function(){
-    $(".ngdialog-close").attr('id','dialog-close');
-});
-</script>
-
+       $(document).ready(function() {
+               $(".ngdialog-close").attr('id', 'dialog-close');
+       });
+</script>
\ No newline at end of file
index 22b28e9..2d6f84d 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 
  */
 
 
@@ -43,7 +61,7 @@ app.controller('roleController', function ($scope, $http, confirmBoxService, ngD
                                $scope.routeRoleId = $stateParams.roleId;
                                $scope.ociavailableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions);
                                $scope.isGlobalRoleChecked=($scope.role.name.indexOf('global_')==-1)?false:true;
                                $scope.routeRoleId = $stateParams.roleId;
                                $scope.ociavailableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions);
                                $scope.isGlobalRoleChecked=($scope.role.name.indexOf('global_')==-1)?false:true;
-
+                               
                                $scope.availableRoleFunctions=[];
 
                                if($scope.ociavailableRoleFunctions)
                                $scope.availableRoleFunctions=[];
 
                                if($scope.ociavailableRoleFunctions)
@@ -105,6 +123,11 @@ app.controller('roleController', function ($scope, $http, confirmBoxService, ngD
                                        }else{
                                                $scope.role.name=$scope.role.name.replace('global_','');
                                        }
                                        }else{
                                                $scope.role.name=$scope.role.name.replace('global_','');
                                        }
+                                       for(let key in $scope.role.roleFunctions){
+                                               if($scope.role.roleFunctions[key].hasOwnProperty('selected')){
+                                                       delete $scope.role.roleFunctions[key].selected;
+                                               }
+                                       }
                                        var postData = {
                                                        role: $scope.role, 
                                                        childRoles: $scope.role.childRoles,
                                        var postData = {
                                                        role: $scope.role, 
                                                        childRoles: $scope.role.childRoles,
@@ -154,11 +177,6 @@ app.controller('roleController', function ($scope, $http, confirmBoxService, ngD
         });
        
        modalInstance.result.finally(function () {
         });
        
        modalInstance.result.finally(function () {
-               if($stateParams.roleId === '0'){
-                               return $scope.role;
-                       }else{
-                               $scope.fetchRoles();
-                       }
            });
        };
                
            });
        };
                
@@ -195,22 +213,11 @@ app.controller('roleController', function ($scope, $http, confirmBoxService, ngD
                $scope.removeRoleFunction = function(roleFunction) {
                        confirmBoxService.confirm("You are about to remove the role function "+roleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?").then(
                                function(confirmed){
                $scope.removeRoleFunction = function(roleFunction) {
                        confirmBoxService.confirm("You are about to remove the role function "+roleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?").then(
                                function(confirmed){
-                                               var uuu = conf.api.toggleRoleRoleFunction + "?role_id=" + $stateParams.roleId;
-                                                 var postData={roleFunction:roleFunction};
                                                        if(confirmed) { 
                                                        if(confirmed) { 
-                                                               $http.post(uuu, postData).then(
-                                                                               function(response) {
-                                                                                       $scope.role= response.data.role;
-                                                                                       $.each($scope.availableRoleFunctions, function(k, c){ 
-                                                                                       if(c.code === roleFunction.code) {
-                                                                                               c.selected = false;
-                                                                                       }
-                                                                                   });
-                                                                               }, 
-                                                                               function(response) {
-                                                                                       confirmBoxService.showInformation("Error while saving.");
-                                                                               }
-                                                               );                                                                      
+                                                               var index = $scope.role.roleFunctions.indexOf(roleFunction);
+                                                               if(index>=0)
+                                                                       $scope.role.roleFunctions.splice(index, 1);
+                                                               return;
                                                                }
                                
                });
                                                                }
                                
                });
diff --git a/ecomp-portal-FE-common/client/app/views/role/role-create-edit-popup-controller.js b/ecomp-portal-FE-common/client/app/views/role/role-create-edit-popup-controller.js
new file mode 100644 (file)
index 0000000..6475a83
--- /dev/null
@@ -0,0 +1,149 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+app.controller('roleCreateEditController',function($scope, conf, $http, $modalInstance, confirmBoxService, message, RoleService) {
+       $scope.isGlobalRole = false; 
+       $scope.availableRoles = message.availableRoles;
+       $scope.roleFunctions = message.availableRoleFunctions;
+       $scope.appId = message.appId;
+       if($scope.appId == 1){
+               $scope.isGlobalRole = true;
+       }
+       $scope.role = message.role;
+       $scope.isGlobalRoleChecked={
+                       isChecked : false
+       }
+       if(message.role.name)
+               $scope.isGlobalRoleChecked.isChecked=(message.role.name.indexOf('global_')==-1)?false:true;             
+       $scope.availableRoleFunctions=[];
+       $scope.finalSelectedRoleFunctions=[];
+
+       if($scope.roleFunctions)
+               for(var i=0; i< $scope.roleFunctions.length; i++){
+                       var availableRoleFunction = $scope.roleFunctions[i];
+                       availableRoleFunction.selected = false;
+                       for(var j=0; j< $scope.role.roleFunctions.length; j++){
+                               if($scope.roleFunctions[i].code === $scope.role.roleFunctions[j].code) {
+                                       availableRoleFunction.selected = true;
+                                       console.log(availableRoleFunction.selected);
+                               }
+                       };
+                       $scope.availableRoleFunctions.push(availableRoleFunction);          
+               };
+       
+               $scope.toggleRoleFunction = function(selected,selectedRoleFunction){
+                       if($scope.roleFunctions){
+                               for(var i=0; i< $scope.roleFunctions.length; i++){
+                                       var availableRoleFunction = $scope.roleFunctions[i];                                    
+                                               if(availableRoleFunction.selected){
+                                                       $scope.finalSelectedRoleFunctions.push(availableRoleFunction);
+                                               }
+                               }
+                       }
+                       if(!selected) {
+                               for(var i=0; i<$scope.finalSelectedRoleFunctions.length; i++){
+                                       var availableRoleFunction = $scope.finalSelectedRoleFunctions[i];
+                                       if(availableRoleFunction.code == selectedRoleFunction.code){
+                                               $scope.finalSelectedRoleFunctions.splice(i, 1);
+                                       }
+                               }                                       
+                       }
+               }
+               
+               
+               $scope.saveRole = function() {                  
+                       var exists = false,x;   
+                       for(x in $scope.availableRoles){
+                               if($scope.availableRoles[x].name==$scope.role.name){
+                                       exists = true;
+                               }
+                       }
+                       if (exists) {
+                               confirmBoxService.showInformation( "Role already exists.");
+                       }                       
+                       else {  
+                               console.log($scope.role);
+                               var uuu = conf.api.saveRole.replace(':appId', $scope.appId);
+                               if($scope.isGlobalRoleChecked.isChecked ){
+                                       $scope.role.name = ($scope.role.name.indexOf('global_')==-1)?('global_'+$scope.role.name):($scope.role.name);
+                                       saveOrUpdateRole(uuu);
+                               }else{
+                                       var roleName = $scope.role.name.toLowerCase();
+                                       if(roleName.includes('global_')){
+                                               confirmBoxService.showInformation('Global prefix:"global_" can only be used when the global flag is checked for the role name:' +$scope.role.name+ '. Please try again!' ).then(confirmed => {
+                                               });
+                                       } else{
+                                               saveOrUpdateRole(uuu);
+                                       }
+                               }
+                       }
+               };
+               
+        let saveOrUpdateRole = (uuu) => {
+                       //overriding the final list of rolefunctions to role
+                       if($scope.finalSelectedRoleFunctions.length > 0)
+                               $scope.role.roleFunctions = $scope.finalSelectedRoleFunctions;
+                       var postData = {
+                                       role: $scope.role,
+                                       childRoles: $scope.role.childRoles,
+                                       roleFunctions :  $scope.role.roleFunctions
+                       };
+                       
+                       $http.post(uuu, postData).then(function(res) {
+                               if (res && res.data && res.data.role){
+                                       confirmBoxService.showInformation("Update Successful.").then(confirmed => {
+                                               $modalInstance.close("confirmed");
+                                       });
+                               }
+                               
+                               else{
+                                       confirmBoxService.showInformation('Failed to create role: ' + res.data.error)
+                               }
+                       },
+                       function(res){
+                               console.log('post failed', res.data);
+                               if (res.data.includes('BAD_REQUEST')){
+                                       confirmBoxService.showInformation("Error while saving." + "BAD_REQUEST");
+                                       }
+                               else{
+                                       confirmBoxService.showInformation("Error while saving." + res.data.error);
+                                       }                                       
+                       }
+                       );
+               }
+               
+})
\ No newline at end of file
index 5e7c62c..3821ed9 100644 (file)
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
-app.controller('roleFunctionListController', function ($scope,RoleService,$http,$state,conf,confirmBoxService, ngDialog,$modal){
-       $( "#dialog" ).hide();
-       $scope.isLoadingRoleFunctions = true;
-       RoleService.getRoleFunctionList().then(function(data){
-               
-               var j = data;
-               $scope.data = JSON.parse(j.data);
-               $scope.availableRoleFunctions =JSON.parse($scope.data.availableRoleFunctions);
-               //$scope.resetMenu();
-       
-       },function(error){
-               console.log("failed");
-               //reloadPageOnce();
-       }) .finally(function(){
-               $scope.isLoadingRoleFunctions = false;
-       });
+"use strict";
+
+app.controller('roleFunctionListController', function ($scope, RoleService, applicationsService, $http, $state, conf, confirmBoxService, ngDialog, $modal) {
+       $("#dialog").hide();
+       $scope.centralizedApps = RoleService.getManageRoleDetails().apps;
+       $scope.apps = {
+               selectedCentralizedApp: RoleService.getManageRoleDetails().id
+       };
+
+       $scope.getRoleFunctions = function (id) {
+               $scope.isLoadingRoleFunctions = true;
+               RoleService.getRoleFunctionList(id).then(function (data) {
+                       var j = data;
+                       $scope.data = JSON.parse(j.data);
+                       $scope.availableRoleFunctions = $scope.data.availableRoleFunctions;
+               }, function (error) {
+                       confirmBoxService.showInformation("Failed to get role functions. Please try again!");
+                       console.log("failed");
+               }).finally(function(){
+                       $scope.isLoadingRoleFunctions = false;
+               });
+       };
+
+       function init() {
+               if($scope.apps.selectedCentralizedApp){
+                       $scope.getRoleFunctions($scope.apps.selectedCentralizedApp);
+               }
+               if($scope.apps.selectedCentralizedApp == undefined){
+                       $scope.getCentralizedApps(sessionStorage.userId);
+               }
+       }
+
+       //getCentalizedApps
+       $scope.getCentralizedApps = function(userId) {
+               RoleService.getCentralizedApps(userId).then(res=> {
+           if (res.length>0) {
+                  $scope.centralizedApps = res;
+                  for(var i = 0; i<res.length; i++){
+                             if(res[i].appId == 1){
+                             $scope.apps.selectedCentralizedApp = res[i].appId;
+                                 return;
+                             }
+                              $scope.apps.selectedCentralizedApp = res[0].appId;
+                  }
+            }
+        }).catch(err=> {
+            $log.error('RoleListCtrl::centralizedApps retrieval error: ', err);
+        }).finally(() => {
+           // this.isLoadingTable = false;
+        });
+
+       }
        
        
+       init();
+
        $scope.editRoleFunction = null;
        var dialog = null;
        $scope.editRoleFunction = null;
        var dialog = null;
-       $scope.editRoleFunctionPopup = function(availableRoleFunction) {
-               $scope.editRoleFunction = availableRoleFunction;
-               $( "#dialog" ).dialog({
-                     modal: true
-           });
-       };
-       
-       $scope.editRoleFunctionModalPopup = function(availableRoleFunction) {
+
+       $scope.editRoleFunctionModalPopup = function (availableRoleFunction) {
                $scope.editRoleFunction = availableRoleFunction;
                $scope.editRoleFunction = availableRoleFunction;
-               $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions;
-               //$scope.availableRoleFunctions={};
-               
-                var modalInstance = $modal.open({
-             templateUrl: 'app/views/role/popup_modal_rolefunction.html',
-             controller: 'rolefunctionpopupController',
-             sizeClass: 'modal-small', 
-             resolve: {
-                       message: function () {
-                               var message = {
-                                               availableRoleFunction:  $scope.editRoleFunction,
-                                               availableRoleFunctions: $scope.availableRoleFunctionsTemp
-                               };
-                         return message;
-                       },
-                       isEditing: function () {
-                               return true;
-                       }
-                     }
-                 });
-         
-         modalInstance.result.then(function (response) {
-                if(response.value!=null){
-               if(response.value.result){
-                       $scope.availableRoleFunctions=response.value.availableRoleFunctions;    
-               }
-             }                 
-             else
-               $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp;
-             
-         });
+               $scope.availableRoleFunctionsTemp = $scope.availableRoleFunctions;
+
+               var modalInstance = $modal.open({
+                       templateUrl: 'app/views/role/popup_modal_rolefunction.html',
+                       controller: 'rolefunctionpopupController',
+                       sizeClass: 'modal-small',
+                       resolve: {
+                               message: function message() {
+                                       var message = {
+                                               availableRoleFunction: $scope.editRoleFunction,
+                                               availableRoleFunctions: $scope.availableRoleFunctionsTemp,
+                                               appId: $scope.apps.selectedCentralizedApp
+                                       };
+                                       return message;
+                               },
+                               isEditing: function isEditing() {
+                                       return true;
+                               }
+                       }
+               });
+
+               modalInstance.result.then(function (response) {
+                       if (response) {
+                               $scope.getRoleFunctions($scope.apps.selectedCentralizedApp);
+                       }
+                       else
+                               $scope.availableRoleFunctions = $scope.availableRoleFunctionsTemp;
+               });
        };
        };
-       
-       $scope.addNewRoleFunctionModalPopup = function(availableRoleFunction) {
-               
+
+       $scope.addNewRoleFunctionModalPopup = function (availableRoleFunction) {
+
                $scope.editRoleFunction = null;
                $scope.editRoleFunction = null;
-               $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions;
-               //$scope.availableRoleFunctions={};
-                var modalInstance = $modal.open({
-             templateUrl: 'app/views/role/popup_modal_rolefunction.html',
-             controller: 'rolefunctionpopupController',
-             sizeClass: 'modal-small', 
-             resolve: {
-                       message: function () {
-                               var message = {
-                                               availableRoleFunction: $scope.editRoleFunction,
-                                               availableRoleFunctions: $scope.availableRoleFunctionsTemp
-                               };
-                         return message;
-                       },
-                       isEditing: function () {
-                               return false;
-                       }
-                     }
-                 });
-         
-         modalInstance.result.then(function (response) {
-               if(response.value!=null){
-               if(response.value.result){
-                       $scope.availableRoleFunctions=response.value.availableRoleFunctions;    
-               }
-        }
-        if(response.availableRoleFunctions != undefined)
-               $scope.availableRoleFunctions=response.availableRoleFunctions;
-        else
-               $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp;
-               
-    });
+               $scope.availableRoleFunctionsTemp = $scope.availableRoleFunctions;
+               var modalInstance = $modal.open({
+                       templateUrl: 'app/views/role/popup_modal_rolefunction.html',
+                       controller: 'rolefunctionpopupController',
+                       sizeClass: 'modal-small',
+                       resolve: {
+                               message: function message() {
+                                       var message = {
+                                               availableRoleFunction: $scope.editRoleFunction,
+                                               availableRoleFunctions: $scope.availableRoleFunctionsTemp,
+                                               appId: $scope.apps.selectedCentralizedApp
+                                       };
+                                       return message;
+                               },
+                               isEditing: function isEditing() {
+                                       return false;
+                               }
+                       }
+               });
+
+               modalInstance.result.then(function (response) {
+                       if (response) {
+                               $scope.getRoleFunctions($scope.apps.selectedCentralizedApp);
+                       }
+                       if (response.availableRoleFunctions != undefined) 
+                               $scope.availableRoleFunctions = response.availableRoleFunctions;else $scope.availableRoleFunctions = $scope.availableRoleFunctionsTemp;
+               });
        };
        };
-       
-       $scope.addNewRoleFunctionPopup = function() {
+
+       $scope.addNewRoleFunctionPopup = function () {
                $scope.editRoleFunction = null;
                $scope.editRoleFunction = null;
-               $( "#dialog" ).dialog({
-                     modal: true
-           });
+               $("#dialog").dialog({
+                       modal: true
+               });
        };
        };
-       
-       $scope.saveRoleFunction = function(availableRoleFunction) {
-                 var uuu = conf.api.saveRoleFuncion;
-                 var postData={availableRoleFunction: availableRoleFunction};
-                 $http.post(uuu,postData).then(function(response) {
-                         var data = response.data;
-                       $scope.availableRoleFunctions=data.availableRoleFunctions; 
-                       $scope.editRoleFunction = null;
-                 },              
-               function() {
-                       
-                       confirmBoxService.showInformation("Error while saving");
-                 }
-                 );
-               };
-       
-               
-               $scope.removeRole = function(availableRoleFunction) {
-                       confirmBoxService.confirm("You are about to delete the role function "+availableRoleFunction.name+". Do you want to continue?").then(
-                       function(confirmed){
-                       if(confirmed){
-                       $scope.availableRoleFunctionsTemp=$scope.availableRoleFunctions;
-                       //$scope.availableRoleFunctions={};
-                       var uuu = conf.api.removeRoleFunction;
-                       var postData=availableRoleFunction;
-                       $http.post(uuu,postData).then(function(response) {
+
+        $scope.syncRoleFunctionsFromExternalAuthSystem = function(appId){
+               applicationsService.syncFunctionsFromExternalAuthSystem(appId).then(function(res){
+                       if(res.status == 200){
+                    confirmBoxService.showInformation('Sync operation completed successfully!').then(isConfirmed => {
+                        $scope.getRoleFunctions(appId);
+                    });                                
+                       } else{
+                                confirmBoxService.showInformation('Sync operation failed for '+app).then(isConfirmed => {});                           
+                       }
+               });
+        };
+        
+       $scope.saveRoleFunction = function (availableRoleFunction) {
+               var uuu = conf.api.saveRoleFuncion;
+               var postData = { availableRoleFunction: availableRoleFunction };
+               $http.post(uuu, postData).then(function (response) {
                        var data = response.data;
                        var data = response.data;
-                       if(data == undefined)
-                       confirmBoxService.showInformation("Error while deleting: "+ data);
-                       else
-                       $scope.availableRoleFunctionsTemp.splice($scope.availableRoleFunctionsTemp.indexOf(availableRoleFunction), 1);
-                       $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp;
-                       },
-                       function() {
-                       $scope.availableRoleFunctions=$scope.availableRoleFunctionsTemp;
-                       confirmBoxService.showInformation("Error while deleting: "+ data.responseText);
-                       }
-                       );
-                       }
-                       });
+                       $scope.availableRoleFunctions = data.availableRoleFunctions;
+                       $scope.editRoleFunction = null;
+               }, function () {
 
 
-                       };
+                       confirmBoxService.showInformation("Error while saving");
+               });
+       };
 
 
+       $scope.removeRole = function (availableRoleFunction) {
+               confirmBoxService.confirm("You are about to delete the role function " + availableRoleFunction.name + ". Do you want to continue?").then(function (confirmed) {
+                       if (confirmed) {
+                               $scope.availableRoleFunctionsTemp = $scope.availableRoleFunctions;
+                               var uuu = conf.api.removeRoleFunction.replace(':appId', $scope.apps.selectedCentralizedApp);
+                               var postData = availableRoleFunction;
+                               $http.post(uuu, postData).then(function (response) {
+                                       if(response.data.status == 'OK'){
+                                               confirmBoxService.showInformation(response.data.message);
+                                               $scope.availableRoleFunctionsTemp.splice($scope.availableRoleFunctionsTemp.indexOf(availableRoleFunction), 1);
+                                               $scope.availableRoleFunctions = $scope.availableRoleFunctionsTemp;
+                                       } else{
+                                               confirmBoxService.showInformation("Error while deleting: " + response.data.message);
+                                       }
+                               }, function () {
+                                       $scope.availableRoleFunctions = $scope.availableRoleFunctionsTemp;
+                               });
+                       }
+               });
+       };
 });
 });
index 2ca149c..4090f2f 100644 (file)
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
-app.controller('roleListController', function ($scope,RoleService,confirmBoxService,conf,$state,$http,$log){
-       $scope.showSpinner = true;
-       
-       RoleService.getRoles().then(function(data){
-               $scope.showSpinner = true;
-               var j = data;
-               $scope.data = JSON.parse(j.data);
-               $scope.availableRoles =JSON.parse($scope.data.availableRoles);
-               $scope.showSpinner = false;
-       
-       },function(error){
-               $log.debug('failed');
-       });
-       
-       
+app.controller('roleListController', function ($scope,RoleService, applicationsService, confirmBoxService,conf,$state,$http,$log, $modal){
+       $scope.showSpinner = true;      
+       $scope.syncRolesApplied = false; 
+        $scope.app = {
+                       appName: ''
+                   }
        $scope.goToUrl = function(roleIdVal) {
                        $state.go("root.role", {"roleId":roleIdVal});
                }
        $scope.goToUrl = function(roleIdVal) {
                        $state.go("root.role", {"roleId":roleIdVal});
                }
-               $scope.toggleRole = function(selected,availableRole) {
-                               var toggleType = null;
-                               if(selected) {
-                                       toggleType = "activate";
-                               } else {
-                                       toggleType = "inactivate";
-                               }
-                               if((availableRole.id == "1") || (availableRole.id =="999"))
-                               {
-                                confirmBoxService.showInformation(availableRole.name+" role cannot be disabled");
-                                availableRole.active=!availableRole.active
-                    return;
-                               }
-                               confirmBoxService.confirm("You are about to "+toggleType+" the role "+availableRole.name+". Do you want to continue?").then(
-                               function(confirmed){
-                                               
-                                       if(confirmed) {
-                                       var uuu = conf.api.toggleRole;
-                                                               
-                                                               var postData={role:availableRole};
-                                                               $http.post(uuu, postData).then(function(response) {
-                                                                       var data = response.data;
-                                                                       if (typeof data === 'object') {
-                                                                               $log.debug('data:'+data);
-                                                                               $scope.availableRoles=data.availableRoles; 
-                                                                               $log.debug('role::availableRoles:'+$scope.availableRoles);
-                                                                       } else {
-                                                                               //
-                                                                       }
+       $scope.toggleRole = function(appId, selected, availableRole) {          
+               var toggleType = null;
+               if(selected) {
+                       toggleType = "activate";
+               } else {
+                       toggleType = "inactivate";
+               }
+               if((availableRole.id == "1") || (availableRole.id =="999"))
+               {
+                confirmBoxService.showInformation(availableRole.name+" role cannot be disabled");
+                availableRole.active=!availableRole.active
+         return;
+               }
+               else if((appId != '1') && (availableRole.name.indexOf('global_')!=-1))
+                       {
+                       confirmBoxService.showInformation("Global role cannot be disabled");
+                       availableRole.active=!availableRole.active
+                       return;
+                       }
+               confirmBoxService.confirm("You are about to "+toggleType+" the role "+availableRole.name+". Do you want to continue?").then(
+               function(confirmed){
+                       if(confirmed) {
+                       var uuu = conf.api.toggleRole + '/' + appId + '/' + availableRole.id;
+                                               var postData={
+                                                               appId: appId,
+                                                               role:availableRole
+                                                               };
+                                               $http.post(uuu, postData).then(function(response) {
+                                                       var data = response.data;
+                                                       if (typeof data === 'object' & data.restcallStatus=='Success') {
+                                                               $scope.availableRoles = data.availableRoles; 
+                                                               $log.debug('role::availableRoles:'+$scope.availableRoles);
+                                                       } else {
+                                                               confirmBoxService.showInformation("Error while saving." + data.restCallStatus);
+                                                               availableRole.active=!availableRole.active;
+                                                       }
 
 
-                                                               }, function(response) {
-                                                                       debug.log('response:'+response);
-                                                                       availableRole.active=!availableRole.active;
-                                                                       confirmBoxService.showInformation("Error while saving.");
-                                                               });
-                                                               
-                                                }
+                                               }, function(response) {
+                                                       debug.log('response:'+response);
+                                                       availableRole.active=!availableRole.active;
+                                                       confirmBoxService.showInformation("Error while saving." + data.restCallStatus);
+                                               });
+                                               
+                                }
 
 
-                       }) .catch(function(err) {
-                               $log.error('roleListController::confirmBoxService.confirm error:', err);
-                               availableRole.active=!availableRole.active;                                     
-                       });
-                               
-                                 
-               };
+       }) .catch(function(err) {
+               $log.error('roleListController::confirmBoxService.confirm error:', err);
+               availableRole.active=!availableRole.active;                                     
+       });
+       };
 
 
-               $scope.removeRole = function(role) {
-                       
-                       confirmBoxService.confirm("You are about to delete the role "+role.name+". Do you want to continue?").then(
+               $scope.removeRole = function(appId, availableRole) {
+               if ((appId != '1') && (availableRole.name.indexOf('global_')!=-1)){
+                               confirmBoxService.showInformation("Global role cannot be deleted");
+                       }
+                       else{
+                               confirmBoxService.confirm("You are about to delete the role "+availableRole.name+". Do you want to continue?").then(
                                function(confirmed){
                                function(confirmed){
-                                                       var uuu = conf.api.removeRole;
-                                                         var postData={role:role};
-
-                                                         
-                                                         
+                                                       var uuu = conf.api.removeRole + '/' + appId + '/' + availableRole.id;
+                                                         var postData={ 
+                                                                         appId: appId,
+                                                                         availableRoleId: availableRole.id
+                                                                         };
                                                          $http.post(uuu, postData).then(function(response) {
                                                                        var data = response.data;
                                                          $http.post(uuu, postData).then(function(response) {
                                                                        var data = response.data;
-                                                                       if (typeof data === 'object') {
-                                                                               $scope.availableRoles=data.availableRoles; 
+                                                                       if (typeof data === 'object' & data.restCallStatus == 'Success') {
+                                                                               $scope.availableRoles = data.availableRoles; 
                                                                        } else {
                                                                        } else {
-                                                                               //
+                                                                               confirmBoxService.showInformation('Failed to remove role '+ data.error )
                                                                        }
 
                                                                }, function(response) {
                                                                        }
 
                                                                }, function(response) {
-                                                                       $log.debug('response:'+response.data);
-                                                                       confirmBoxService.showInformation("Error while deleting: "+ data.responseText);
+                                                                       confirmBoxService.showInformation("Error while deleting: "+ data.error);
                                                                });
                                
                                                                });
                                
-               });
-               
+                       }); 
+               }  
+               };
+                               
+               //getCentalizedApps
+               $scope.getCentralizedApps = function(userId) {
+                       RoleService.getCentralizedApps(userId).then(res=> {
+               if (res.length>0) {
+                  $scope.centralizedApps = res;
+                  for(var i = 0; i<res.length; i++){
+                             if(res[i].appId == 1){
+                                 $scope.getRolesForSelectedCentralizedApp(res[i].appId);
+                                 $scope.apps.selectedCentralizedApp = res[i].appId;
+                                 return;
+                             }  
+                             $scope.getRolesForSelectedCentralizedApp(res[0].appId);
+                             $scope.apps.selectedCentralizedApp = res[0].appId;
+                  }
+                }
+            }).catch(err=> {
+                $log.error('RoleListCtrl::centralizedApps retrieval error: ', err);
+            }).finally(() => {
+               // this.isLoadingTable = false;
+            });
+       
+               }
+               
+                  $scope.syncRolesFromExternalAuthSystem = function(appId){
+               applicationsService.syncRolesEcompFromExtAuthSystem(appId).then(function(res){
+                       if(res.status == 200){
+                    confirmBoxService.showInformation('Sync operation completed successfully!').then(isConfirmed => {
+                       $scope.getRolesForSelectedCentralizedApp(appId);
+                    });                                
+                       } else{
+                                confirmBoxService.showInformation('Sync operation failed for '+app).then(isConfirmed => {});                           
+                       }
+               });
+           };
+           
+                               
+               $scope.getRolesForSelectedCentralizedApp = function(val) {
+                       $scope.showSpinner = true;
+                         applicationsService.getSingleAppInfoById(val).then(function(res) {
+                         if(res.centralAuth == true){
+                                 $scope.syncRolesApplied = true;
+                         }
+                   });
+                       RoleService.getRoles(val).then(function(data){
+                               var j = data;
+                               $scope.data = JSON.parse(j.data);
+                               $scope.availableRoles =$scope.data.availableRoles;
+                               $scope.showSpinner = false;
                        
                        
+                       },function(error){
+                               $scope.showSpinner = false;
+                               confirmBoxService.showInformation('Failed to get roles. Please try again!').then(isConfirmed => {});
+                               $scope.availableRoles = [];
+                               $log.debug('failed');
+                       });
+               }
+               
+               $scope.fnManageRoleFunctions = function(){
+                       RoleService.setManageRoleDetails($scope.centralizedApps, $scope.apps.selectedCentralizedApp);
+               };
+               
+               function init(){        
+                       $scope.apps = {
+                                       selectedCentralizedApp:''
+                       };
+                       $scope.getCentralizedApps(sessionStorage.userId);
+               }
+               
+               init();
+               
+               //edit Role
+               $scope.editRoleModalPopup = function(appId, availableRole) {
+                       $scope.editRole = availableRole;
+                       if(appId != undefined && availableRole.id != undefined){
+                               RoleService.getRole(appId, availableRole.id).then(function(data){       
+                                       var response = JSON.parse(data.data);                                   
+                                       var role = JSON.parse(response.role);
+                                       var availableRoles = JSON.parse(response.availableRoles);
+                                       var availableRoleFunctions = JSON.parse(response.availableRoleFunctions);                                       
+                                       $scope.availableRoleFunctions = response.roleFunctions;
+                                       var modalInstance = $modal.open({
+                                    templateUrl: 'app/views/role/popup_createedit_role.html',
+                                    controller: 'roleCreateEditController',
+                                    sizeClass: 'modal-large', 
+                                    windowClass: "modal-docked",
+                                    resolve: {
+                                               message: function () {
+                                                       var message = {
+                                                                       availableRoles: availableRoles,
+                                                                       availableRoleFunctions: availableRoleFunctions,
+                                                                       appId: $scope.apps.selectedCentralizedApp,
+                                                                       role: role
+                                            };
+                                                 return message;
+                                               }
+                                             }
+                                         });
+                                       modalInstance.result.then(function (confirmed) {
+                                               if(confirmed == 'confirmed'){
+                                                       $scope.getRolesForSelectedCentralizedApp(appId);
+                                               }
+                                       });
+                               },function(error){
+                                       $log.debug('Failed to editRole');
+                               });
+                       }
+                        
                };
                
                };
                
+               //add Role
+               $scope.addRoleModalPopup = function(appId) {
+                       if(appId){
+                               var roleId = 0;
+                               RoleService.getRole(appId, roleId).then(function(data){ 
+                                       var response = JSON.parse(data.data);                                   
+                                       var role = JSON.parse(response.role);
+                                       var availableRoles = JSON.parse(response.availableRoles);
+                                       var availableRoleFunctions = JSON.parse(response.availableRoleFunctions);                                       
+                                       $scope.availableRoleFunctions = response.roleFunctions;
+                                       var modalInstance = $modal.open({
+                                    templateUrl: 'app/views/role/popup_createedit_role.html',
+                                    controller: 'roleCreateEditController',
+                                    sizeClass: 'modal-large', 
+                                    windowClass: "modal-docked",
+                                    resolve: {
+                                               message: function () {
+                                                       var message = {
+                                                                       role: role,
+                                                                       appId: $scope.apps.selectedCentralizedApp
+                                            };                                                 
+                                                 return message;
+                                               }
+                                             }
+                                         });   
+                                       modalInstance.result.then(function (confirmed) {
+                                               if(confirmed == 'confirmed'){
+                                                       $scope.getRolesForSelectedCentralizedApp(appId);
+                                               }
+                                       });
+                               },function(error){
+                                       $log.debug('Failed to AddRole');
+                               });
+                       }                        
+               };
 
 });
 
 });
index 6642b05..dfa3ce6 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index b6e92c9..4ed5dfd 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .p-info {
        font-size: 18px;
 }
 .p-info {
        font-size: 18px;
 }
index d52ce33..26bb2db 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 51362b6..ed4fdd7 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
     <div id="title" class="w-ecomp-main-view-title">
     <h3 class="heading-page" >Role Functions</h3>
     </div>
     <div id="title" class="w-ecomp-main-view-title">
     <h3 class="heading-page" >Role Functions</h3>
     </div>
-               
-       
-       <br>
        
        <div class="admins-table">
        
        <div class="admins-table">
+       <!-- Centralized Apps -->
+       <div class="table-dropdown" ng-if="apps.selectedCentralizedApp">
+               <select id="dropdown1" name="dropdown1" b2b-dropdown ng-change="getRoleFunctions(apps.selectedCentralizedApp);" 
+                                       ng-model="apps.selectedCentralizedApp">
+               <option b2b-dropdown-list option-repeat="item in centralizedApps" value="{{item.appId}}">{{item.appName}}</option>
+            </select>
+       </div>
+       <br/>   
        
        
-        <!-- <a ng-click="addNewRoleFunctionModalPopup();" class="icon-add" size="small" ></a> -->
-               <div id="create-new-admin" align="left" class="admins-table-create-new-admin">
-                               <button id="button-admin-create" type="submit" ng-click="addNewRoleFunctionModalPopup();" 
-                                        class="btn btn-alt btn-small">Create</button>
-                       </div>
-                       
-                       <div class="admins-table-space">
-                       <!--    Click on the edit icon to update a role function, the plus icon to add additional role functions, or the delete icon to remove them.  -->
-                       </div>
+       <div id="create-new-admin" align="left" class="admins-table-create-new-admin">
+               <button id="button-admin-create" type="submit" ng-click="addNewRoleFunctionModalPopup();" 
+                        class="btn btn-alt btn-small">Create</button>
+               <button ng-if="apps.selectedCentralizedApp" id="button-sync-functions" type="submit" ng-click="syncRoleFunctionsFromExternalAuthSystem(apps.selectedCentralizedApp)" 
+                        class="btn btn-alt btn-small"><i class="icon-arrows-update-refresh-syncL" aria-hidden="true"></i>&nbsp;Sync Functions</button>
+       </div>
+       
+       <div class="admins-table-space">
+       </div>
        
        <div id="rolesTable" class="c-ecomp-abs-table default"  title="Role Functions">
          <span class="ecomp-spinner" ng-show="isLoadingRoleFunctions"></span>
          <table b2b-table table-data="availableRoleFunctions" current-page="1">
                <thead b2b-table-row type="header">
                        <tr>
        
        <div id="rolesTable" class="c-ecomp-abs-table default"  title="Role Functions">
          <span class="ecomp-spinner" ng-show="isLoadingRoleFunctions"></span>
          <table b2b-table table-data="availableRoleFunctions" current-page="1">
                <thead b2b-table-row type="header">
                        <tr>
+                               <th id="table-header-type" b2b-table-header width="10%" key="type" sortable="true">Type</th>
+                               <th id="table-header-code" b2b-table-header width="10%" key="code" sortable="true">Instance</th>
+                               <th id="table-header-action" b2b-table-header width="10%" key="action" sortable="true">Action</th>
                                <th id="table-header-name" b2b-table-header width="70%" key="name" sortable="true">Name</th>
                                <th id="table-header-name" b2b-table-header width="70%" key="name" sortable="true">Name</th>
-                               <th id="table-header-code" b2b-table-header width="10%" key="code" sortable="true">Code</th>
                                <th id="table-header-edit" b2b-table-header width="10%" sortable="false">Edit?</th>
                                <th id="table-header-delete" b2b-table-header width="10%" sortable="false">Delete?</th>
                        </tr>
                </thead>
                <tbody b2b-table-row type="body" row-repeat="availableRoleFunction in availableRoleFunctions" class="admins-table-tbody" ><!-- background colors will alternate not properly with multiple tbody-->
                  <tr>
                                <th id="table-header-edit" b2b-table-header width="10%" sortable="false">Edit?</th>
                                <th id="table-header-delete" b2b-table-header width="10%" sortable="false">Delete?</th>
                        </tr>
                </thead>
                <tbody b2b-table-row type="body" row-repeat="availableRoleFunction in availableRoleFunctions" class="admins-table-tbody" ><!-- background colors will alternate not properly with multiple tbody-->
                  <tr>
+                   <td id="table-body-role-{{availableRoleFunction['type'].split(' ').join('-')}}" b2b-table-body width="10%" ng-bind="availableRoleFunction['type']"></td>
+                   <td id="table-body-role-{{availableRoleFunction['code'].split(' ').join('-')}}" b2b-table-body width="10%" ng-bind="availableRoleFunction['code']"></td>
+                   <td id="table-body-role-{{availableRoleFunction['action']}}" b2b-table-body width="10%" ng-bind="availableRoleFunction['action']"></td>
                    <td id="table-body-role-{{availableRoleFunction['name'].split(' ').join('-')}}" b2b-table-body width="70%" ng-bind="availableRoleFunction['name']"></td>
                    <td id="table-body-role-{{availableRoleFunction['name'].split(' ').join('-')}}" b2b-table-body width="70%" ng-bind="availableRoleFunction['name']"></td>
-                   <td id="table-body-role-{{availableRoleFunction['code']}}" b2b-table-body width="10%" ng-bind="availableRoleFunction['code']"></td>
                    <td id="table-body" b2b-table-body width="10%">
                    <td id="table-body" b2b-table-body width="10%">
-                   <!-- <a ng-click="editRoleFunctionPopup(availableRoleFunction);" >
-                   <img src="static/fusion/images/editicon.gif">
-                   </a> -->
-                   <div ng-click="editRoleFunctionModalPopup(availableRoleFunction);" class="admins-table-btn-txt"><a id="role-{{availableRoleFunction['name'].split(' ').join('-')}}-edit" href="javascript:void(0)" class="icon-edit"></a></div>
+                   <div ng-click="editRoleFunctionModalPopup(availableRoleFunction);" class="icon-edit" id="role-{{availableRoleFunction['name'].split(' ').join('-')}}-edit"></div>
                    </td>
                     <td b2b-table-body width="10%">
                        <!-- <a ng-click="removeRole(availableRoleFunction);" ><img src="static/fusion/images/deleteicon.gif"></a> -->
                    </td>
                     <td b2b-table-body width="10%">
                        <!-- <a ng-click="removeRole(availableRoleFunction);" ><img src="static/fusion/images/deleteicon.gif"></a> -->
-                       <div ng-click="removeRole(availableRoleFunction);" class="admins-table-btn-txt"><a id="role-{{availableRoleFunction['name'].split(' ').join('-')}}-trash" href="javascript:void(0)" class="icon-misc-trash"></a></div>
+                       <div ng-click="removeRole(availableRoleFunction);" class="icon-misc-trash" id="role-{{availableRoleFunction['name'].split(' ').join('-')}}-trash"></div>
                     </td>
                  </tr>
                </tbody>
                </table>
        </div>
        
                     </td>
                  </tr>
                </tbody>
                </table>
        </div>
        
-                  
-       
        </div>
        </div>
-       
-       
-       <div id="dialog" title="Add Role Function">
-               
-               <div id="fn-ebz-container-name" class="fn-ebz-container" >
-               <label id="fn-ebz-label-name" class="fn-ebz-text-label"><sup><b>*</b></sup>Name:</label><br>
-               <input id="fn-ebz-input-{{editRoleFunction.name}}" type="text" class="fn-ebz-text" ng-model="editRoleFunction.name"
-                       maxlength="30" /> 
-               </div>
-               <br/>
-               <div id="fn-ebz-container-code" class="fn-ebz-container" >
-               <label id="fn-ebz-label-code" class="fn-ebz-text-label"><sup><b>*</b></sup>Code:</label><br>
-               <input id="fn-ebz-input-{{editRoleFunction.code}}" type="text" class="fn-ebz-text" ng-model="editRoleFunction.code" ng-disabled="editRoleFunction.code!=null"
-                       maxlength="30" /> 
-               </div>
-               <br/>
-               <button id="button-admin-save" type="submit" ng-click="saveRoleFunction(editRoleFunction);"  class="btn btn-alt btn-small">Save</button>
-               
-       </div>
-       
 </div>
 </div>
 </div>
 </div>
index 3f2561c..1bccbd1 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index d761b72..81b0ece 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
                        <h1 class="heading-page" >Roles</h1>
                </div>
                <div class="admins-table">
                        <h1 class="heading-page" >Roles</h1>
                </div>
                <div class="admins-table">
+               
+               <!-- Centralized Apps -->
+               <div class="table-dropdown" ng-if="apps.selectedCentralizedApp">
+                       <select id="dropdown1" name="dropdown1" b2b-dropdown ng-change="getRolesForSelectedCentralizedApp(apps.selectedCentralizedApp);" 
+                                               ng-model="apps.selectedCentralizedApp">
+                       <option b2b-dropdown-list option-repeat="item in centralizedApps" value="{{item.appId}}">{{item.appName}}</option>
+                    </select>
+               </div>
+               
+               <br/>
+               
                        <div id="button-create-role" align="left" class="admins-table-btn-create" >
                        <div id="button-create-role" align="left" class="admins-table-btn-create" >
-                               <button id="button-create-role" ng-click="goToUrl(0)" class = "btn btn-alt btn-small">Create</button>
+                               <button id="button-create-role" ng-click="addRoleModalPopup(apps.selectedCentralizedApp)" class = "btn btn-alt btn-small">Create</button>
+                               <button id="button-sync-role"  ng-show="syncRolesApplied" ng-click="syncRolesFromExternalAuthSystem(apps.selectedCentralizedApp)" class = "btn btn-alt btn-small"><i class="icon-arrows-update-refresh-syncL" aria-hidden="true"></i>&nbsp;Sync Roles</button>
                        </div>
                        <br>
                          <div class="property-label">
                        </div>
                        <br>
                          <div class="property-label">
@@ -61,6 +73,7 @@
                                    <th b2b-table-header key="priority" sortable="true" id="col2">Priority</th>
                                    <th b2b-table-header id="col3" sortable="false">Active</th>
                                    <th b2b-table-header id="col4" sortable="false">Edit</th>
                                    <th b2b-table-header key="priority" sortable="true" id="col2">Priority</th>
                                    <th b2b-table-header id="col3" sortable="false">Active</th>
                                    <th b2b-table-header id="col4" sortable="false">Edit</th>
+                                   <th ng-if="apps.selectedCentralizedApp != 1" b2b-table-header id="col4" sortable="false">Delete</th>
                                </tr>
                            </thead>
                            <tbody b2b-table-row type="body" row-repeat="rowData in availableRoles">
                                </tr>
                            </thead>
                            <tbody b2b-table-row type="body" row-repeat="rowData in availableRoles">
                                    <td b2b-table-body headers="rowheader_t1_{{$index}} col3" >
                                        <div >
                                                                <label class="btn-switch-label" tabindex="0" role="option">
                                    <td b2b-table-body headers="rowheader_t1_{{$index}} col3" >
                                        <div >
                                                                <label class="btn-switch-label" tabindex="0" role="option">
-                                                                               <input type="checkbox" id="{{$index}}-button-toggle-role" b2b-switches ng-model="rowData.active" ng-click="toggleRole(rowData.active,rowData);">
+                                                                               <input type="checkbox" id="{{$index}}-button-toggle-role" b2b-switches ng-model="rowData.active" ng-click="toggleRole(apps.selectedCentralizedApp, rowData.active,rowData);">
                                                                    </label> 
                                                        </div>
                                    </td>
                                                                    </label> 
                                                        </div>
                                    </td>
-                                   <td b2b-table-body id="{{$index}}-button-edit-role" class="icon-misc-pen" ng-click="goToUrl(rowData.id)"></td>    
+                                   <td b2b-table-body id="{{$index}}-button-edit-role" class="icon-misc-pen" ng-click="editRoleModalPopup(apps.selectedCentralizedApp, rowData)"></td>
+                                   <td ng-if="apps.selectedCentralizedApp != 1"  b2b-table-body class="icon-trash" ng-click="removeRole(apps.selectedCentralizedApp, rowData)"></td>    
                                </tr>
                            </tbody>
                        </table>
                                </tr>
                            </tbody>
                        </table>
-                       
-                     
                    </div>
                    </div>
+                   
+                   <a id="manage-role" ng-click="fnManageRoleFunctions()" href="roleFunctions">Manage Role Functions</a><br><br>
+                   
                </div>
        </div>
 </div>
                </div>
        </div>
 </div>
index 4124150..9144bcb 100644 (file)
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
-app.controller('rolefunctionpopupController',function($scope, confirmBoxService, message, $http,RoleService, conf, isEditing) {
-                                       if (message.availableRoleFunction == null) {
-                                               $scope.label = 'Add Role Function';
-                                               var tempText = "";
-                                       } else {
-                                               $scope.label = 'Edit Role Function'
-                                               $scope.disableCd = true;
-                                               var tempText = new String(message.availableRoleFunction.name);
-                                               $scope.editRoleFunction = angular.copy(message.availableRoleFunction);
-                                       }
-
-                                       $scope.tempText = tempText;
-                                       $scope.isEditing = isEditing;
-
-                                       $scope.saveRoleFunction = function(availableRoleFunction) {
-                                               confirmBoxService.confirm(
-                                                                               "You are about to Create the role function "+ availableRoleFunction.name+ ". Do you want to continue?")
-                                                               .then(function(confirmed) {
-                                                                                       if (confirmed) {
-
-                                                                                               var uuu = conf.api.saveRoleFunction;
-                                                                                               var postData = availableRoleFunction;
-
-                                                                                               if (availableRoleFunction == null) {
-                                                                                                       confirmBoxService.showInformation("Please enter valid role function details.");
-                                                                                               }
-                                                                                               var exists = false, x;
-                                                                                               for (x in message.availableRoleFunctions) {
-                                                                                                       console.log(message.availableRoleFunctions[x].name);
-                                                                                                       if (message.availableRoleFunctions[x].name == availableRoleFunction.name) {
-                                                                                                               confirmBoxService.showInformation("Role Function already exists.");
-                                                                                                               exists = true;
-                                                                                                               availableRoleFunction.name = $scope.tempText;
-                                                                                                               break;
-                                                                                                       }
-                                                                                                       if (!isEditing) {
-                                                                                                               if (message.availableRoleFunctions[x].code == availableRoleFunction.code) {
-                                                                                                                       confirmBoxService.showInformation("Code already exists. Please create a role function with a different code to proceed.");
-                                                                                                                       exists = true;
-                                                                                                                       availableRoleFunction.name = $scope.tempText;
-                                                                                                                       break;
-                                                                                                               }
-                                                                                                       }
-                                                                                               }
-
-                                                                                               if (!exists&& availableRoleFunction.name.trim() != ''&& availableRoleFunction.code.trim() != '') {
-                                                                                                       $http.post(uuu,JSON.stringify(postData)).then(function(res) {
-                                                                                                                                               $scope.availableRoleFunctionsTemp = res.data.availableRoleFunctions;
-                                                                                                                                               RoleService.getRoleFunctionList().then(
-                                                                                                                                                                               function(data) {
-
-                                                                                                                                                                                       var j = data;
-                                                                                                                                                                                       $scope.data = JSON.parse(j.data);
-                                                                                                                                                                                       $scope.availableRoleFunctions = JSON.parse($scope.data.availableRoleFunctions);
+app.controller('rolefunctionpopupController',function($scope, confirmBoxService, message, $http, $modalInstance, RoleService, conf, isEditing) {
+       if (message.availableRoleFunction == null) {
+               $scope.label = 'Add Role Function';
+               var tempText = "";
+               $scope.selectedAppId = message.appId;
+               $scope.defaultAction = "*";
+               $scope.disableTypeAction = true;        
+                $scope.ngRepeatDemo = [
+                       {id: 'menuradiobutton1', value: 'menu', labelvalue: 'menu'},
+                       {id: 'urlradiobutton2', value: 'url', labelvalue: 'url'},
+                       {id: 'otherradiobutton3', value: 'other', labelvalue: 'other'}
+                   ]
+                $scope.selectedvalueradioButtonGroup = {
+                               type: 'menu'
+                           }
+                $scope.editRoleFunction = {
+                               action: '*'
+                           }
+       } else {
+                $scope.ngRepeatDemo = [
+                       {id: 'menuradiobutton1', value: 'menu', labelvalue: 'menu'},
+                       {id: 'urlradiobutton2', value: 'url', labelvalue: 'url'},
+                       {id: 'otherradiobutton3', value: 'other', labelvalue: 'other'}
+                   ]
+               $scope.label = 'Edit Role Function'
+               $scope.disableCd = true;
+               $scope.disableTypeAction = false;
+               var tempText = new String(message.availableRoleFunction.name);
+               $scope.editRoleFunction = angular.copy(message.availableRoleFunction);
+               if($scope.editRoleFunction.type.includes('menu')||$scope.editRoleFunction.type.includes('url')){
+                        $scope.selectedvalueradioButtonGroup = {
+                                       type: $scope.editRoleFunction.type
+                                   }
+               } else{
+                        $scope.selectedvalueradioButtonGroup = {
+                                       type: 'other'
+                                   }
+               }
+               $scope.selectedAppId = message.appId;
+       }
+       $scope.tempText = tempText;
+       $scope.isEditing = isEditing;
 
 
-                                                                                                                                                                                       // $scope.resetMenu();
-                                                                                                                                                                                       /*$scope.closeThisDialog({
-                                                                                                                                                                                                               result : true,
-                                                                                                                                                                                                               availableRoleFunctions : $scope.availableRoleFunctions
-                                                                                                                                                                                                       });*/
-                                                                                                                                                                                       $scope.$dismiss({result : true,availableRoleFunctions : $scope.availableRoleFunctions});
-                                                                                                                                                                               },
-                                                                                                                                                                               function(error) {
-                                                                                                                                                                                       console.log("failed");
-                                                                                                                                                                                       // reloadPageOnce();
-                                                                                                                                                                                       //$scope.closeThisDialog(true);
-                                                                                                                                                                                       $scope.$dismiss('cancel');
-                                                                                                                                                                               });
+       $scope.saveRoleFunction = function(availableRoleFunction, type) {
+               if(type !== 'other'){
+                       if (!availableRoleFunction.hasOwnProperty('type')) {
+                               availableRoleFunction['type'] = type ; 
+                       } else{
+                               availableRoleFunction.type = type ; 
+                       }
+               }
+               if(/[^a-zA-Z0-9\-\.\_]/.test(availableRoleFunction.type)){
+                       confirmBoxService.showInformation('Type can only contain alphanumeric characters, dots(.) and underscores(_)').then(isConfirmed => {});
+                       return;
+               }               
+               if(availableRoleFunction.action !== '*' && /[^a-zA-Z0-9\-\.\_]/.test(availableRoleFunction.action)){
+                       confirmBoxService.showInformation('Action can only contain alphanumeric characters, hyphens(-), dots(.) and underscores(_) and single asterisk character(*)').then(isConfirmed => {});
+                       return;
+               }
+               if(/[^a-zA-Z0-9\-\:\_\./*]/.test(availableRoleFunction.code)){
+                       confirmBoxService.showInformation('Instance can only contain alphanumeric characters, hyphens(-), dots(.), colons(:), forwardSlash(/) , asterisk(*) and underscores(_)').then(isConfirmed => {});
+                       return;
+               }
+               if(/[^a-zA-Z0-9\-\_ \.]/.test(availableRoleFunction.name)){
+                       confirmBoxService.showInformation('Name can only contain alphanumeric characters, spaces, hyphens(-), dots(.) and underscores(_)').then(isConfirmed => {});
+                       return;
+               }
+               confirmBoxService.confirm(
+                               "You are about to Create the role function "+ availableRoleFunction.name+ ". Do you want to continue?")
+                               .then(function(confirmed) {
+                                       if (confirmed) {
+                                                       var uuu = conf.api.saveRoleFunction.replace(':appId', $scope.selectedAppId);
+                                                       var postData = availableRoleFunction;
+                                               if (availableRoleFunction == null) {
+                                                       confirmBoxService.showInformation("Please enter valid role function details.");
+                                               }
+                                               var exists = false, x;
+                                               for (x in message.availableRoleFunctions) {
+                                                       console.log(message.availableRoleFunctions[x].name);
+                                                       if (message.availableRoleFunctions[x].name == availableRoleFunction.name) {
+                                                               confirmBoxService.showInformation("Role Function already exists.");
+                                                               exists = true;
+                                                               availableRoleFunction.name = $scope.tempText;
+                                                               break;
+                                                       }
+                                                       if (!isEditing) {
+                                                               if (message.availableRoleFunctions[x].code == availableRoleFunction.code) {
+                                                                       confirmBoxService.showInformation("Code already exists. Please create a role function with a different code to proceed.");
+                                                                       exists = true;
+                                                                       availableRoleFunction.name = $scope.tempText;
+                                                                       break;
+                                                               }
+                                                       }
+                                               }
 
 
-                                                                                                                                       });
+                                               if (!exists&& availableRoleFunction.name.trim() != ''&& availableRoleFunction.code.trim() != '') {
+                                                       $http.post(uuu,JSON.stringify(postData)).then(function(res) {
+                                                               if(res.data.status == 'OK'){
+                                                                       confirmBoxService.showInformation(res.data.message).then(isConfirmed => {});
+                                                               } else{
+                                                                       confirmBoxService.showInformation('Error:' + res.data.message).then(isConfirmed => {});
+                                                               }
+                                                               $scope.availableRoleFunctionsTemp = res.data.availableRoleFunctions;
+                                                               $modalInstance.close(true);
+                                                       });
 
 
-                                                                                               }
-                                                                                       };
+                                               }
+                                       };
 
 
-                                                                                       $scope.close = function() {
-                                                                                               this.closeThisDialog(true);
-                                                                                       };
-                                                                               }
+                                       $scope.close = function() {
+                                               this.closeThisDialog(true);
+                                       };
+                               }
 
 
-                                                               );
-                                       }
-                               });
\ No newline at end of file
+                               );
+       }
+});
\ No newline at end of file
index 67bf3b2..09b2eac 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 app.controller('rolepopupController',  function ($scope, role, roleId, confirmBoxService, $http, $state, availableRoles, conf, availableRoleFunctions,ngDialog){
        
  */
 app.controller('rolepopupController',  function ($scope, role, roleId, confirmBoxService, $http, $state, availableRoles, conf, availableRoleFunctions,ngDialog){
        
@@ -74,35 +92,13 @@ app.controller('rolepopupController',  function ($scope, role, roleId, confirmBo
                                confirmBoxService.confirm("You are about to remove the role function "+availableRoleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?").then(
                                        function(confirmed){
                                                        if(confirmed) { 
                                confirmBoxService.confirm("You are about to remove the role function "+availableRoleFunction.name+" from the role for "+$scope.role.name+". Do you want to continue?").then(
                                        function(confirmed){
                                                        if(confirmed) { 
-                                                               var postData={roleFunction:availableRoleFunction};
-                                                               $http.post(uuu, postData).then(
-                                                                               function(response) {
-                                                                                       $scope.role= response.data.role;
-                                                                               }, 
-                                                                               function(response) {
-                                                                                       confirmBoxService.showInformation("Error while saving.");
-                                                                               }
-                                                               );
-                                                                       
-                                                                       
-                                                                       
+                                                                       availableRoleFunction.id = roleId;
+                                                                       var index = $scope.role.roleFunctions.indexOf(availableRoleFunction);
+                                                                       if(index>=0)
+                                                                               $scope.role.roleFunctions.splice(index, 1);
+                                                                       return;                                                                         
                                                                        
                                                                }
                                                                        
                                                                }
-                                                               /*
-                                                                 $.ajax({
-                                                                        type : 'POST',
-                                                                        url : uuu,
-                                                                        dataType: 'json',
-                                                                        contentType: 'application/json',
-                                                                        data: JSON.stringify(postData),
-                                                                        success : function(data){
-                                                                               $scope.$apply(function(){$scope.role=data.role;}); 
-                                                                        },
-                                                                        error : function(data){
-                                                                                modalService.showFailure("Fail","Error while saving.");
-                                                                        }
-                                                                 });
-                                                                 */
                                        }).catch(function(err) {
                                                          availableRoleFunction.selected=!availableRoleFunction.selected;
                                                        $log.error('roleListController::confirmBoxService.confirm error:', err);
                                        }).catch(function(err) {
                                                          availableRoleFunction.selected=!availableRoleFunction.selected;
                                                        $log.error('roleListController::confirmBoxService.confirm error:', err);
@@ -120,34 +116,10 @@ app.controller('rolepopupController',  function ($scope, role, roleId, confirmBo
                                confirmBoxService.confirm("You are about to add the role function "+availableRoleFunction.name+" to the role for "+$scope.role.name+". Do you want to continue?").then(
                                        function(confirmed){
                                                if(confirmed) {
                                confirmBoxService.confirm("You are about to add the role function "+availableRoleFunction.name+" to the role for "+$scope.role.name+". Do you want to continue?").then(
                                        function(confirmed){
                                                if(confirmed) {
-                                                                 var postData={roleFunction:availableRoleFunction};
-                                                                 $http.post(uuu,postData).then( function(response) {
-                                                                         $scope.role=response.data.role;
-                                                                         },
-                                                                         
-                                                                         function(data) {
-                                                                                 confirmBoxService.showInformation("Error while saving.");
-                                                                         });
-                                                       }       /*                
-                                                                         $.ajax({
-                                                                                type : 'POST',
-                                                                                url : uuu,
-                                                                                dataType: 'json',
-                                                                                contentType: 'application/json',
-                                                                                data: JSON.stringify(postData),
-                                                                                success : function(data){
-                                                                                       $scope.$apply(function(){$scope.role=data.role;}); 
-                                                                                },
-                                                                                error : function(data){
-                                                                                        modalService.showFailure("Fail","Error while saving.");
-                                                                                }
-                                                                         });
-                                                                         
-                                                                       
-                                                       },
-                                                       function(){
-                                                               availableRoleFunction.selected=!availableRoleFunction.selected;
-                                                       })*/
+                                                       availableRoleFunction.id = roleId;
+                                                       $scope.role.roleFunctions.push(availableRoleFunction);
+                                                       return;
+                                                       }
                        }).catch(function(err) {
                                  availableRoleFunction.selected=!availableRoleFunction.selected;
                                $log.error('roleListController::confirmBoxService.confirm error:', err);
                        }).catch(function(err) {
                                  availableRoleFunction.selected=!availableRoleFunction.selected;
                                $log.error('roleListController::confirmBoxService.confirm error:', err);
@@ -186,21 +158,6 @@ app.controller('rolepopupController',  function ($scope, role, roleId, confirmBo
                                        availableRole.selected=!availableRole.selected;
                                        $log.error('roleListController::confirmBoxService.confirm error:', err);
                        });
                                        availableRole.selected=!availableRole.selected;
                                        $log.error('roleListController::confirmBoxService.confirm error:', err);
                        });
-                                                /* $.ajax({
-                                                        type : 'POST',
-                                                        url : uuu,
-                                                        dataType: 'json',
-                                                        contentType: 'application/json',
-                                                        data: JSON.stringify(postData),
-                                                        success : function(data){
-                                                                console.log('role',data.role);
-                                                                $scope.$apply(function(){$scope.role=data.role;}); 
-                                                        },
-                                                        error : function(data){
-                                                                modalService.showFailure("Fail","Error while saving.");
-                                                        }
-                                                 });
-                                                 */
                                
                
                } else {
                                
                
                } else {
@@ -222,19 +179,6 @@ app.controller('rolepopupController',  function ($scope, role, roleId, confirmBo
                                                                  confirmBoxService.showInformation("Error while saving.");
                                                          });
                                                  }
                                                                  confirmBoxService.showInformation("Error while saving.");
                                                          });
                                                  }
-                                /* $.ajax({
-                                        type : 'POST',
-                                        url : uuu,
-                                        dataType: 'json',
-                                        contentType: 'application/json',
-                                        data: JSON.stringify(postData),
-                                        success : function(data){
-                                               $scope.$apply(function(){$scope.role=data.role;}); 
-                                        },
-                                        error : function(data){
-                                                modalService.showFailure("Fail","Error while saving.");
-                                        }
-                               });*/
                                
                }).catch(function(err) {
                                availableRole.selected=!availableRole.selected;
                                
                }).catch(function(err) {
                                availableRole.selected=!availableRole.selected;
diff --git a/ecomp-portal-FE-common/client/app/views/scheduler/scheduler.controller.js b/ecomp-portal-FE-common/client/app/views/scheduler/scheduler.controller.js
new file mode 100644 (file)
index 0000000..fca0401
--- /dev/null
@@ -0,0 +1,128 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+'use strict';
+(function () {
+       class SchedulerCtrl {
+               constructor($scope,$state,message,$modalInstance,widgetsCatalogService,$log,schedulerService,$filter,confirmBoxService,userProfileService,conf,$interval,$compile,$rootScope) {
+                       $scope.parentData = message;
+                       /****define fields****/
+                       $scope.widgetName= '';
+                       $scope.widgetData = [];
+                       
+
+                       /**** Functions for widgets *****/
+                       $scope.getWidgetData =function(widgetId){
+                               $rootScope.showSpinner = true;
+                               var script = document.createElement('script');
+                               script.src =  conf.api.widgetCommon + "/" + widgetId + "/framework.js";
+                               script.async = true;
+                               var entry = document.getElementsByTagName('script')[0];
+                               entry.parentNode.insertBefore(script, entry);                   
+                       }
+                       $scope.getUserWidgets = function(loginName){ 
+                               this.isCommError = false;
+                               widgetsCatalogService.getUserWidgets(loginName).then(res => {
+                                       if(!(res instanceof Array)){
+                                               $rootScope.showSpinner = false;
+                                               this.isCommError = true;
+                                               return;
+                                       }
+                                       for(var i = 0; i < res.length; i++){    
+                                               var widget_id = res[i][0];
+                                               var widget_name = res[i][1];
+                                               if(widget_name== $scope.widgetName){
+                                                       var data={
+                                                               attr:'data-'+widget_id,
+                                                               value:''
+                                                       };
+                                                       $scope.widgetData.push(data);
+                                                       $scope.getWidgetData(widget_id);
+                                               }
+                                       }
+                               }).catch(err => {
+                                       $rootScope.showSpinner = false;
+                                       $log.error('WidgetCatalogCtrl::getUserWidgets caught error', err);
+                               })
+                       };
+                       
+
+                       $rootScope.closeModal = function(){
+                               $modalInstance.dismiss('cancel');
+                       }
+                       $scope.getUserIdAndWidget = function(){
+                               $rootScope.showSpinner = true;
+                               userProfileService.getUserProfile()
+                               .then(profile=> {
+                                       $scope.orgUserId = profile.orgUserId;
+                                       $scope.getUserWidgets($scope.orgUserId);  
+                               })
+                       }
+                       
+                       $scope.activateThis = function(ele){
+                               $compile(ele.contents())($scope);
+                               $scope.$apply();
+            };
+            
+            /*Calling Scheduler UI controller in microservice*/
+            $scope.submit = function(){
+               $scope.$broadcast('submit','');
+            }
+            
+            $scope.reject = function(){
+               $scope.$broadcast('reject','');
+            }
+            
+            $scope.schedule = function(){
+               $scope.$broadcast('schedule','');
+            }
+            
+            
+            /** init **/
+            var init = function () {                           
+                               $rootScope.showSpinner = false;
+                               $scope.widgetName = message.id;
+                               $scope.getUserIdAndWidget(); //get logged in user id, then widget data                  
+
+                       };
+                       init();
+               }
+       }
+       SchedulerCtrl.$inject = ['$scope','$state','message','$modalInstance','widgetsCatalogService','$log', 'schedulerService','$filter','confirmBoxService','userProfileService','conf','$interval','$compile','$rootScope'];
+       angular.module('ecompApp').controller('SchedulerCtrl', SchedulerCtrl);
+})();
diff --git a/ecomp-portal-FE-common/client/app/views/scheduler/scheduler.less b/ecomp-portal-FE-common/client/app/views/scheduler/scheduler.less
new file mode 100644 (file)
index 0000000..3b81afa
--- /dev/null
@@ -0,0 +1,43 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+.error{
+       color:red;
+}
+.widget-div{
+       margin : 5px;
+}
\ No newline at end of file
diff --git a/ecomp-portal-FE-common/client/app/views/scheduler/scheduler.tpl.html b/ecomp-portal-FE-common/client/app/views/scheduler/scheduler.tpl.html
new file mode 100644 (file)
index 0000000..d11c1cf
--- /dev/null
@@ -0,0 +1,53 @@
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+<div class="b2b-modal-header">
+       <h2 id="myModalLabel" modal-title="">Scheduler Change</h2>
+       <div class="corner-button in">
+               <button type="button" class="close" id="div-confirm-close-button"
+                       aria-label="Close" ng-click="$dismiss('cancel')"></button>
+       </div>
+</div>
+<div class="b2b-modal-body" tabindex="0" role="region" aria-label="Modal header text content" id="scheduler-body">     
+       <div ng-show="isCommError">Failed to communicate with the widget microservice.</div>
+       <div id="widgets">
+               <span class="ecomp-spinner" ng-show="showSpinner"></span>
+               <div class="widget-div">
+                       <div ng-if="widgetData.length!=0" dyn-attr="widgetData"></div>
+               </div>
+       </div>
+</div>
index 85d79d0..2adc3ea 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .searchLiHeader {
 font-weight: bold; 
 color: #0574ac; 
 .searchLiHeader {
 font-weight: bold; 
 color: #0574ac; 
index 63a3abb..adfb232 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 97650fe..26c0aed 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  .w-ecomp-sidebar {
     position: relative;
  */
  .w-ecomp-sidebar {
     position: relative;
index 6c4a1a0..42acbb5 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 8c76abc..8da506f 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 8dc9744..4113d8c 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .searchLiHeader {
 font-weight: bold; 
 color: #0574ac; 
 .searchLiHeader {
 font-weight: bold; 
 color: #0574ac; 
index b2b3ef4..f20c1e8 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 770f85e..c65a8cc 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 9b463e4..b0bbd16 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-contactUs-home {
   //.bg_portalWhite;//white for 1702
   .bg_portalGray;  // gray for 1610
 .w-ecomp-contactUs-home {
   //.bg_portalWhite;//white for 1702
   .bg_portalGray;  // gray for 1610
index 1ee6514..ccaba46 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
                                <div b2b-table table-data="contact.functionalTableData" class="b2b-table-div">
                                                <table>
                                                        <thead b2b-table-row type="header">
                                <div b2b-table table-data="contact.functionalTableData" class="b2b-table-div">
                                                <table>
                                                        <thead b2b-table-row type="header">
-                                                               <tr>
-                                                                 <th id="th-functionalItem-0" b2b-table-header sortable="false">Category</th>                       
-                                             <th id="th-functionalItem-1" b2b-table-header sortable="false">ECOMP Functions</th>
-                                             <th id="th-functionalItem-2" b2b-table-header sortable="false">ECOMP Application</th>
-                                                 <!-- <th id="th-functionalItem-3" b2b-table-header >Contact</th> --> 
-                                                         </tr>
+                                                               <tr ng-include src="'app/views/support/contact-us/contact-us-table-header.html'"></tr>
                                                        </thead>
                                                        <!--  Use track-by="UNIQUE KEY HERE" or leave out if no unique keys in data  -->
                                                        <tbody b2b-table-row type="body"
                                                        </thead>
                                                        <!--  Use track-by="UNIQUE KEY HERE" or leave out if no unique keys in data  -->
                                                        <tbody b2b-table-row type="body"
index 0c43c1f..48df419 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 7ac0d18..3ca779a 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-get-access-home {
     //.bg_portalWhite;//white for 1702
     .bg_portalGray;  // gray for 1610
 .w-ecomp-get-access-home {
     //.bg_portalWhite;//white for 1702
     .bg_portalGray;  // gray for 1610
index 9b7f796..d3170b2 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index cef1504..b760368 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index bab9ba5..f02e8c7 100644 (file)
@@ -1,27 +1,45 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
     const HTTP_PROTOCOL_RGX = /https?:\/\//;
     class  TabsCtrl {
  */
 'use strict';
 (function () {
     const HTTP_PROTOCOL_RGX = /https?:\/\//;
     class  TabsCtrl {
-        constructor(applicationsService, $log, $window, conf, userProfileService, userbarUpdateService, $scope,$cookies,$rootScope,confirmBoxService,auditLogService) {                
+        constructor(applicationsService, $log, $window, conf, userProfileService, userbarUpdateService, $scope,$cookies,$rootScope,confirmBoxService,auditLogService,schedulerService) {               
                // Tab counter
             var counter = 1;
             var tabLimit = 6;
                // Tab counter
             var counter = 1;
             var tabLimit = 6;
                        $cookies.remove('addTab');
                }
             });
                        $cookies.remove('addTab');
                }
             });
+            
+            /*Listening on partner applications */
+            var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
+           var eventer = window[eventMethod];
+           var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
+           eventer(messageEvent,function(e) {
+                 $scope.openModal(e.data);
+               },false);
+           
+           $scope.openModal = function(data){
+               schedulerService.showWidget(data.widgetName,data.widgetData,data.widgetParameter).then(isConfirmed => {});
+           }
         }
     }
         }
     }
-    TabsCtrl.$inject = ['applicationsService', '$log', '$window', 'conf', 'userProfileService', 'userbarUpdateService', '$scope','$cookies','$rootScope','confirmBoxService','auditLogService'];
+    TabsCtrl.$inject = ['applicationsService', '$log', '$window', 'conf', 'userProfileService', 'userbarUpdateService', '$scope','$cookies','$rootScope','confirmBoxService','auditLogService','schedulerService'];
     angular.module('ecompApp').controller('TabsCtrl', TabsCtrl);
     
     angular.module('ecompApp').directive('mainArea', function() {
     angular.module('ecompApp').controller('TabsCtrl', TabsCtrl);
     
     angular.module('ecompApp').directive('mainArea', function() {
index b9fd0ac..dc3cced 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 76ee598..478ea1b 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-tabs {
   //.bg_portalWhite;//white for 1702
   .bg_portalGray;  // gray for 1610
 .w-ecomp-tabs {
   //.bg_portalWhite;//white for 1702
   .bg_portalGray;  // gray for 1610
@@ -649,10 +686,7 @@ font-size: 14px;
 .tab-cross-sign{
        position: relative;
     margin-left: 123px;
 .tab-cross-sign{
        position: relative;
     margin-left: 123px;
-    top: -76px;
-        @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
-        top:-70px;
-       }    
+    top: -76px;           
 }
 
 #tab-cross-sign-icon{
 }
 
 #tab-cross-sign-icon{
index a691887..11bc9b3 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 146bc52..1c2f7c5 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 4374e0d..a494581 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 5792669..5e755d0 100644 (file)
@@ -1,4 +1,40 @@
-
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-user-json-notification-details-admin {
  .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
 .w-ecomp-user-json-notification-details-admin {
  .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
index 3be148c..252fd87 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-user-notification-admin{
  .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
 .w-ecomp-user-notification-admin{
  .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
index 65395f1..6478c81 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 17bbdab..e452a8e 100644 (file)
@@ -1,4 +1,40 @@
-
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .user-notification-details-modal {
    // width: 595px;
     margin:auto;
 .user-notification-details-modal {
    // width: 595px;
     margin:auto;
index 95da781..51e6c60 100644 (file)
@@ -1,21 +1,39 @@
 <!--
 <!--
-  ================================================================================
-  ECOMP Portal
-  ================================================================================
-  Copyright (C) 2017 AT&T Intellectual Property
-  ================================================================================
-  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
-  
+  ============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 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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
 <div class="user-notification-details-modal">
 
   -->
 <div class="user-notification-details-modal">
 
index 317ff01..c17038b 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 20248a9..b5139c7 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .w-ecomp-sidebar {
 
   position: relative;
 .w-ecomp-sidebar {
 
   position: relative;
index df218de..f9c1f97 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 90d3aa5..f10159b 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 1e16995..f6e2f51 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * bulk user upload controller
  */
 /**
  * bulk user upload controller
index c71f578..8b4eef7 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 07afd90..8ab5603 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .bulk-user-modal {
        height: 430px;
 
 .bulk-user-modal {
        height: 430px;
 
index 10d6c95..d989518 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/20/15.
  */
 /**
  * Created by nnaffar on 12/20/15.
index bdc2958..b6788cd 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/20/15.
  */
 /**
  * Created by nnaffar on 12/20/15.
index 858b9dc..69641e0 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 8a44b11..b2dad8b 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .new-user-modal {
   height: 430px;
 
 .new-user-modal {
   height: 430px;
 
index f74b167..33aafe8 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
@@ -26,6 +44,7 @@
             $scope.appsIsDown = false;
             $scope.noUsersInApp = false;
             $scope.multiAppAdmin = false;
             $scope.appsIsDown = false;
             $scope.noUsersInApp = false;
             $scope.multiAppAdmin = false;
+            $scope.syncRolesApplied = false;
 
             $log.info('UsersCtrl:: initializing...');
             /**
 
             $log.info('UsersCtrl:: initializing...');
             /**
             };
 
             let init = () => {
             };
 
             let init = () => {
+               $scope.app = {
+                       appId : ''      
+               };
                 this.isLoadingTable = false;
                 this.selectedApp = null;
                 this.isAppSelectDisabled = false;
                 this.isLoadingTable = false;
                 this.selectedApp = null;
                 this.isAppSelectDisabled = false;
-                this.selectApp = 'Select application';
+                this.selectApp = 'Select Application';
                 this.adminApps = [{index: 0, id: 0, value: this.selectApp, title: this.selectApp}];
                 getAdminApps();
 
                 this.adminApps = [{index: 0, id: 0, value: this.selectApp, title: this.selectApp}];
                 getAdminApps();
 
                      }
                 }
                
                      }
                 }
                
-                if (this.selectedApp.title != this.selectApp) { // 'Select Application'
+                if (this.selectedApp.value != this.selectApp) { // 'Select Application'
                     usersService.getAccountUsers(this.selectedApp.id)
                         .then(accountUsers => {
                             $log.debug('UsersCtrl::updateUsersList accountUsers: '+ accountUsers);
                     usersService.getAccountUsers(this.selectedApp.id)
                         .then(accountUsers => {
                             $log.debug('UsersCtrl::updateUsersList accountUsers: '+ accountUsers);
                });
             };
 
                });
             };
 
+            this.syncRolesFromExternalAuthSystem = (appId) =>{
+               applicationsService.syncRolesEcompFromExtAuthSystem(appId).then(function(res){
+                       if(res.status == 200){
+                    confirmBoxService.showInformation('Sync operation completed successfully!').then(isConfirmed => {});                               
+                       } else{
+                                confirmBoxService.showInformation('Sync operation failed for '+app).then(isConfirmed => {});                           
+                       }
+               });
+            };
 
             $scope.$watch('users.selectedApp.value', (newVal, oldVal) => {
 
             $scope.$watch('users.selectedApp.value', (newVal, oldVal) => {
+               if(typeof(newVal) != 'undefined' && !newVal.includes("Select")){
+                 applicationsService.getSingleAppInfo(newVal).then(function(res) {
+                         $scope.app.appId = res.id;
+                         if(res.centralAuth == true){
+                                 $scope.syncRolesApplied = true;
+                         } else{
+                                 $scope.syncRolesApplied = false; 
+                         }
+                           });
+               }
                 if (!newVal || _.isEqual(newVal, oldVal)) {
                     return;
                 }
                 $log.debug('UsersCtrl::openAddNewUserModal:$watch selectedApp -> Fire with: ', newVal);
                 if (!newVal || _.isEqual(newVal, oldVal)) {
                     return;
                 }
                 $log.debug('UsersCtrl::openAddNewUserModal:$watch selectedApp -> Fire with: ', newVal);
-                this.accountUsers = []; //reset table and show swirl here
+                this.accountUsers = []; // reset table and show swirl here
                 updateUsersList();
             });
 
                 updateUsersList();
             });
 
index 4c38b33..96f9b51 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .users-page-main{
          .bg_portalWhite;//white for 1702
         //.bg_portalGray;  // gray for 1610
 .users-page-main{
          .bg_portalWhite;//white for 1702
         //.bg_portalGray;  // gray for 1610
index 4196709..ead83ab 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -54,6 +54,7 @@
                                                </div>
                                                <button class="btn btn-alt btn-small" id="users-button-add"  ng-click="users.openAddNewUserModal()"><i class="icon-people-userbookmark" aria-hidden="true"></i>&nbsp;Add User</button> 
                                <button class="btn btn-alt btn-small" id="users-bulk-upload-button-add"  ng-click="users.openBulkUserUploadModal()"><i class="icon-arrows-upload" aria-hidden="true"></i>&nbsp;Bulk Upload</button>
                                                </div>
                                                <button class="btn btn-alt btn-small" id="users-button-add"  ng-click="users.openAddNewUserModal()"><i class="icon-people-userbookmark" aria-hidden="true"></i>&nbsp;Add User</button> 
                                <button class="btn btn-alt btn-small" id="users-bulk-upload-button-add"  ng-click="users.openBulkUserUploadModal()"><i class="icon-arrows-upload" aria-hidden="true"></i>&nbsp;Bulk Upload</button>
+                               <button class="btn btn-alt btn-small" id="users-button-sync" ng-show="syncRolesApplied" ng-click="users.syncRolesFromExternalAuthSystem(app.appId)"><i class="icon-arrows-update-refresh-syncL" aria-hidden="true"></i>&nbsp;Sync Roles</button>
                                        </div>
                 </div>
                 <div ng-hide="users.isLoadingTable">
                                        </div>
                 </div>
                 <div ng-hide="users.isLoadingTable">
index 859b9a8..0139974 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 5c42f4c..cfef2c7 100644 (file)
@@ -1,20 +1,38 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
  */
 
index 65a74a5..0c4e279 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .widget-catalog{
     .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
 .widget-catalog{
     .bg_portalWhite;//white for 1702
     //.bg_portalGray;  // gray for 1610
index ab69c98..8671b2a 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -37,7 +37,7 @@
   -->
 <div class="w-ecomp-main">
        <div class="w-ecomp-main-container">
   -->
 <div class="w-ecomp-main">
        <div class="w-ecomp-main-container">
-               <div class="widget-catalog" id="widget-page-content">
+               <div class="widget-catalog" id="page-content">
                        <div id="title" class="w-ecomp-main-view-title">
                                <h1 class="heading-page">Widget Catalog</h1>
                        </div>
                        <div id="title" class="w-ecomp-main-view-title">
                                <h1 class="heading-page">Widget Catalog</h1>
                        </div>
index 052d623..da94842 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 927836a..eb5146e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 // 'use strict';
 // describe('Controller: WidgetDetailsModalCtrl', ()=> {
  */
 // 'use strict';
 // describe('Controller: WidgetDetailsModalCtrl', ()=> {
index df49f8e..453f68a 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 065c542..06d7a38 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .widget-details-modal {
   .title {
     //.n18r;
 .widget-details-modal {
   .title {
     //.n18r;
index a579362..b08bbd4 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
@@ -25,7 +43,7 @@
             $scope.infoMessage = true;
 
             let populateAvailableApps = widgets => {
             $scope.infoMessage = true;
 
             let populateAvailableApps = widgets => {
-               let allPortalsFilterObject = {index: 0, title: 'All applications', value: ''};
+               let allPortalsFilterObject = {index: 0, title: 'All Applications', value: ''};
                 this.availableApps = [allPortalsFilterObject];
                 this.filterByApp = this.availableApps[0];
                 applicationsService.getAppsForSuperAdminAndAccountAdmin().then(myApps => {
                 this.availableApps = [allPortalsFilterObject];
                 this.filterByApp = this.availableApps[0];
                 applicationsService.getAppsForSuperAdminAndAccountAdmin().then(myApps => {
index 5c42f4c..cfef2c7 100644 (file)
@@ -1,20 +1,38 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
  */
 
index 7be0d47..2f5fe4e 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .widget-onboarding{
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
 .widget-onboarding{
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
index 3f46bf8..91d74db 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -46,7 +46,7 @@
                                        <div class="c-ecomp-abs-select default">
                                                <div class="table-dropdown">
                                                        <select id="dropdown1" name="dropdown1" b2b-dropdown
                                        <div class="c-ecomp-abs-select default">
                                                <div class="table-dropdown">
                                                        <select id="dropdown1" name="dropdown1" b2b-dropdown
-                                                               placeholder-text="All application"
+                                                               placeholder-text="All Applications"
                                                                ng-model="widgetOnboarding.filterByApp.value">
                                                                <option b2b-dropdown-list
                                                                        option-repeat="d in widgetOnboarding.availableApps"
                                                                ng-model="widgetOnboarding.filterByApp.value">
                                                                <option b2b-dropdown-list
                                                                        option-repeat="d in widgetOnboarding.availableApps"
index a7c2904..dbd8822 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 12/20/15.
  */
 /**
  * Created by nnaffar on 12/20/15.
index 927836a..eb5146e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 // 'use strict';
 // describe('Controller: WidgetDetailsModalCtrl', ()=> {
  */
 // 'use strict';
 // describe('Controller: WidgetDetailsModalCtrl', ()=> {
index 7125420..7a70dda 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 2ab7eba..713055e 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .widget-details-modal {
 
   .title {
 .widget-details-modal {
 
   .title {
index 1998d6d..e2cfd8c 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 43bae91..beaa892 100644 (file)
@@ -1,3 +1,40 @@
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .widgets-page-main{
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
 .widgets-page-main{
   .bg_portalWhite;//white for 1702
   position: @page-main-position;
index 0e72a16..7d08f6b 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index afa17ee..473e069 100644 (file)
@@ -12320,6 +12320,6932 @@ angular.module('b2b.att.treeNodeCheckbox', ['b2b.att.utilities'])
             }
         };
     }]);
             }
         };
     }]);
+/*!
+ * VERSION: 1.7.3
+ * DATE: 2014-01-14
+ * UPDATES AND DOCS AT: http://www.greensock.com
+ *
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
+ * Club GreenSock members, the software agreement that was issued with your membership.
+ * 
+ * @author: Jack Doyle, jack@greensock.com
+ **/
+(window._gsQueue || (window._gsQueue = [])).push( function() {
+
+       "use strict";
+
+       var _doc = document.documentElement,
+               _window = window,
+               _max = function(element, axis) {
+                       var dim = (axis === "x") ? "Width" : "Height",
+                               scroll = "scroll" + dim,
+                               client = "client" + dim,
+                               body = document.body;
+                       return (element === _window || element === _doc || element === body) ? Math.max(_doc[scroll], body[scroll]) - (_window["inner" + dim] || Math.max(_doc[client], body[client])) : element[scroll] - element["offset" + dim];
+               },
+
+               ScrollToPlugin = window._gsDefine.plugin({
+                       propName: "scrollTo",
+                       API: 2,
+                       version:"1.7.3",
+
+                       //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
+                       init: function(target, value, tween) {
+                               this._wdw = (target === _window);
+                               this._target = target;
+                               this._tween = tween;
+                               if (typeof(value) !== "object") {
+                                       value = {y:value}; //if we don't receive an object as the parameter, assume the user intends "y".
+                               }
+                               this._autoKill = (value.autoKill !== false);
+                               this.x = this.xPrev = this.getX();
+                               this.y = this.yPrev = this.getY();
+                               if (value.x != null) {
+                                       this._addTween(this, "x", this.x, (value.x === "max") ? _max(target, "x") : value.x, "scrollTo_x", true);
+                                       this._overwriteProps.push("scrollTo_x");
+                               } else {
+                                       this.skipX = true;
+                               }
+                               if (value.y != null) {
+                                       this._addTween(this, "y", this.y, (value.y === "max") ? _max(target, "y") : value.y, "scrollTo_y", true);
+                                       this._overwriteProps.push("scrollTo_y");
+                               } else {
+                                       this.skipY = true;
+                               }
+                               return true;
+                       },
+
+                       //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
+                       set: function(v) {
+                               this._super.setRatio.call(this, v);
+
+                               var x = (this._wdw || !this.skipX) ? this.getX() : this.xPrev,
+                                       y = (this._wdw || !this.skipY) ? this.getY() : this.yPrev,
+                                       yDif = y - this.yPrev,
+                                       xDif = x - this.xPrev;
+
+                               if (this._autoKill) {
+                                       //note: iOS has a bug that throws off the scroll by several pixels, so we need to check if it's within 7 pixels of the previous one that we set instead of just looking for an exact match.
+                                       if (!this.skipX && (xDif > 7 || xDif < -7) && x < _max(this._target, "x")) {
+                                               this.skipX = true; //if the user scrolls separately, we should stop tweening!
+                                       }
+                                       if (!this.skipY && (yDif > 7 || yDif < -7) && y < _max(this._target, "y")) {
+                                               this.skipY = true; //if the user scrolls separately, we should stop tweening!
+                                       }
+                                       if (this.skipX && this.skipY) {
+                                               this._tween.kill();
+                                       }
+                               }
+                               if (this._wdw) {
+                                       _window.scrollTo((!this.skipX) ? this.x : x, (!this.skipY) ? this.y : y);
+                               } else {
+                                       if (!this.skipY) {
+                                               this._target.scrollTop = this.y;
+                                       }
+                                       if (!this.skipX) {
+                                               this._target.scrollLeft = this.x;
+                                       }
+                               }
+                               this.xPrev = this.x;
+                               this.yPrev = this.y;
+                       }
+
+               }),
+               p = ScrollToPlugin.prototype;
+
+       ScrollToPlugin.max = _max;
+
+       p.getX = function() {
+               return (!this._wdw) ? this._target.scrollLeft : (_window.pageXOffset != null) ? _window.pageXOffset : (_doc.scrollLeft != null) ? _doc.scrollLeft : document.body.scrollLeft;
+       };
+
+       p.getY = function() {
+               return (!this._wdw) ? this._target.scrollTop : (_window.pageYOffset != null) ? _window.pageYOffset : (_doc.scrollTop != null) ? _doc.scrollTop : document.body.scrollTop;
+       };
+
+       p._kill = function(lookup) {
+               if (lookup.scrollTo_x) {
+                       this.skipX = true;
+               }
+               if (lookup.scrollTo_y) {
+                       this.skipY = true;
+               }
+               return this._super._kill.call(this, lookup);
+       };
+
+}); if (window._gsDefine) { window._gsQueue.pop()(); }
+/*!
+ * VERSION: 1.12.1
+ * DATE: 2014-06-26
+ * UPDATES AND DOCS AT: http://www.greensock.com
+ * 
+ * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
+ *
+ * @license Copyright (c) 2008-2014, GreenSock. All rights reserved.
+ * This work is subject to the terms at http://www.greensock.com/terms_of_use.html or for
+ * Club GreenSock members, the software agreement that was issued with your membership.
+ * 
+ * @author: Jack Doyle, jack@greensock.com
+ **/
+
+(window._gsQueue || (window._gsQueue = [])).push( function() {
+
+       "use strict";
+
+       window._gsDefine("TweenMax", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) {
+
+               var _slice = [].slice,
+                       TweenMax = function(target, duration, vars) {
+                               TweenLite.call(this, target, duration, vars);
+                               this._cycle = 0;
+                               this._yoyo = (this.vars.yoyo === true);
+                               this._repeat = this.vars.repeat || 0;
+                               this._repeatDelay = this.vars.repeatDelay || 0;
+                               this._dirty = true; //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it.
+                               this.render = TweenMax.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method)
+                       },
+                       _tinyNum = 0.0000000001,
+                       TweenLiteInternals = TweenLite._internals,
+                       _isSelector = TweenLiteInternals.isSelector,
+                       _isArray = TweenLiteInternals.isArray,
+                       p = TweenMax.prototype = TweenLite.to({}, 0.1, {}),
+                       _blankArray = [];
+
+               TweenMax.version = "1.12.1";
+               p.constructor = TweenMax;
+               p.kill()._gc = false;
+               TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf;
+               TweenMax.getTweensOf = TweenLite.getTweensOf;
+               TweenMax.lagSmoothing = TweenLite.lagSmoothing;
+               TweenMax.ticker = TweenLite.ticker;
+               TweenMax.render = TweenLite.render;
+
+               p.invalidate = function() {
+                       this._yoyo = (this.vars.yoyo === true);
+                       this._repeat = this.vars.repeat || 0;
+                       this._repeatDelay = this.vars.repeatDelay || 0;
+                       this._uncache(true);
+                       return TweenLite.prototype.invalidate.call(this);
+               };
+               
+               p.updateTo = function(vars, resetDuration) {
+                       var curRatio = this.ratio, p;
+                       if (resetDuration && this._startTime < this._timeline._time) {
+                               this._startTime = this._timeline._time;
+                               this._uncache(false);
+                               if (this._gc) {
+                                       this._enabled(true, false);
+                               } else {
+                                       this._timeline.insert(this, this._startTime - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct.
+                               }
+                       }
+                       for (p in vars) {
+                               this.vars[p] = vars[p];
+                       }
+                       if (this._initted) {
+                               if (resetDuration) {
+                                       this._initted = false;
+                               } else {
+                                       if (this._gc) {
+                                               this._enabled(true, false);
+                                       }
+                                       if (this._notifyPluginsOfEnabled && this._firstPT) {
+                                               TweenLite._onPluginEvent("_onDisable", this); //in case a plugin like MotionBlur must perform some cleanup tasks
+                                       }
+                                       if (this._time / this._duration > 0.998) { //if the tween has finished (or come extremely close to finishing), we just need to rewind it to 0 and then render it again at the end which forces it to re-initialize (parsing the new vars). We allow tweens that are close to finishing (but haven't quite finished) to work this way too because otherwise, the values are so small when determining where to project the starting values that binary math issues creep in and can make the tween appear to render incorrectly when run backwards. 
+                                               var prevTime = this._time;
+                                               this.render(0, true, false);
+                                               this._initted = false;
+                                               this.render(prevTime, true, false);
+                                       } else if (this._time > 0) {
+                                               this._initted = false;
+                                               this._init();
+                                               var inv = 1 / (1 - curRatio),
+                                                       pt = this._firstPT, endValue;
+                                               while (pt) {
+                                                       endValue = pt.s + pt.c; 
+                                                       pt.c *= inv;
+                                                       pt.s = endValue - pt.c;
+                                                       pt = pt._next;
+                                               }
+                                       }
+                               }
+                       }
+                       return this;
+               };
+                               
+               p.render = function(time, suppressEvents, force) {
+                       if (!this._initted) if (this._duration === 0 && this.vars.repeat) { //zero duration tweens that render immediately have render() called from TweenLite's constructor, before TweenMax's constructor has finished setting _repeat, _repeatDelay, and _yoyo which are critical in determining totalDuration() so we need to call invalidate() which is a low-kb way to get those set properly.
+                               this.invalidate();
+                       }
+                       var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
+                               prevTime = this._time,
+                               prevTotalTime = this._totalTime, 
+                               prevCycle = this._cycle,
+                               duration = this._duration,
+                               prevRawPrevTime = this._rawPrevTime,
+                               isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime, i;
+                       if (time >= totalDur) {
+                               this._totalTime = totalDur;
+                               this._cycle = this._repeat;
+                               if (this._yoyo && (this._cycle & 1) !== 0) {
+                                       this._time = 0;
+                                       this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;
+                               } else {
+                                       this._time = duration;
+                                       this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1;
+                               }
+                               if (!this._reversed) {
+                                       isComplete = true;
+                                       callback = "onComplete";
+                               }
+                               if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
+                                       if (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate.
+                                               time = 0;
+                                       }
+                                       if (time === 0 || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time) {
+                                               force = true;
+                                               if (prevRawPrevTime > _tinyNum) {
+                                                       callback = "onReverseComplete";
+                                               }
+                                       }
+                                       this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                               }
+                               
+                       } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.
+                               this._totalTime = this._time = this._cycle = 0;
+                               this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;
+                               if (prevTotalTime !== 0 || (duration === 0 && prevRawPrevTime > 0 && prevRawPrevTime !== _tinyNum)) {
+                                       callback = "onReverseComplete";
+                                       isComplete = this._reversed;
+                               }
+                               if (time < 0) {
+                                       this._active = false;
+                                       if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
+                                               if (prevRawPrevTime >= 0) {
+                                                       force = true;
+                                               }
+                                               this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                                       }
+                               } else if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.
+                                       force = true;
+                               }
+                       } else {
+                               this._totalTime = this._time = time;
+                               
+                               if (this._repeat !== 0) {
+                                       cycleDuration = duration + this._repeatDelay;
+                                       this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but Flash reports it as 0.79999999!)
+                                       if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration) {
+                                               this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning)
+                                       }
+                                       this._time = this._totalTime - (this._cycle * cycleDuration);
+                                       if (this._yoyo) if ((this._cycle & 1) !== 0) {
+                                               this._time = duration - this._time;
+                                       }
+                                       if (this._time > duration) {
+                                               this._time = duration;
+                                       } else if (this._time < 0) {
+                                               this._time = 0;
+                                       }
+                               }
+
+                               if (this._easeType) {
+                                       r = this._time / duration;
+                                       type = this._easeType;
+                                       pow = this._easePower;
+                                       if (type === 1 || (type === 3 && r >= 0.5)) {
+                                               r = 1 - r;
+                                       }
+                                       if (type === 3) {
+                                               r *= 2;
+                                       }
+                                       if (pow === 1) {
+                                               r *= r;
+                                       } else if (pow === 2) {
+                                               r *= r * r;
+                                       } else if (pow === 3) {
+                                               r *= r * r * r;
+                                       } else if (pow === 4) {
+                                               r *= r * r * r * r;
+                                       }
+
+                                       if (type === 1) {
+                                               this.ratio = 1 - r;
+                                       } else if (type === 2) {
+                                               this.ratio = r;
+                                       } else if (this._time / duration < 0.5) {
+                                               this.ratio = r / 2;
+                                       } else {
+                                               this.ratio = 1 - (r / 2);
+                                       }
+
+                               } else {
+                                       this.ratio = this._ease.getRatio(this._time / duration);
+                               }
+                               
+                       }
+                               
+                       if (prevTime === this._time && !force && prevCycle === this._cycle) {
+                               if (prevTotalTime !== this._totalTime) if (this._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate.
+                                       this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
+                               }
+                               return;
+                       } else if (!this._initted) {
+                               this._init();
+                               if (!this._initted || this._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example.
+                                       return;
+                               } else if (!force && this._firstPT && ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration))) { //we stick it in the queue for rendering at the very end of the tick - this is a performance optimization because browsers invalidate styles and force a recalculation if you read, write, and then read style data (so it's better to read/read/read/write/write/write than read/write/read/write/read/write). The down side, of course, is that usually you WANT things to render immediately because you may have code running right after that which depends on the change. Like imagine running TweenLite.set(...) and then immediately after that, creating a nother tween that animates the same property to another value; the starting values of that 2nd tween wouldn't be accurate if lazy is true.
+                                       this._time = prevTime;
+                                       this._totalTime = prevTotalTime;
+                                       this._rawPrevTime = prevRawPrevTime;
+                                       this._cycle = prevCycle;
+                                       TweenLiteInternals.lazyTweens.push(this);
+                                       this._lazy = time;
+                                       return;
+                               }
+                               //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently.
+                               if (this._time && !isComplete) {
+                                       this.ratio = this._ease.getRatio(this._time / duration);
+                               } else if (isComplete && this._ease._calcEnd) {
+                                       this.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1);
+                               }
+                       }
+                       if (this._lazy !== false) {
+                               this._lazy = false;
+                       }
+
+                       if (!this._active) if (!this._paused && this._time !== prevTime && time >= 0) {
+                               this._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done.
+                       }
+                       if (prevTotalTime === 0) {
+                               if (this._initted === 2 && time > 0) {
+                                       //this.invalidate();
+                                       this._init(); //will just apply overwriting since _initted of (2) means it was a from() tween that had immediateRender:true
+                               }
+                               if (this._startAt) {
+                                       if (time >= 0) {
+                                               this._startAt.render(time, suppressEvents, force);
+                                       } else if (!callback) {
+                                               callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area.
+                                       }
+                               }
+                               if (this.vars.onStart) if (this._totalTime !== 0 || duration === 0) if (!suppressEvents) {
+                                       this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
+                               }
+                       }
+                       
+                       pt = this._firstPT;
+                       while (pt) {
+                               if (pt.f) {
+                                       pt.t[pt.p](pt.c * this.ratio + pt.s);
+                               } else {
+                                       pt.t[pt.p] = pt.c * this.ratio + pt.s;
+                               }
+                               pt = pt._next;
+                       }
+                       
+                       if (this._onUpdate) {
+                               if (time < 0) if (this._startAt && this._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values.
+                                       this._startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.
+                               }
+                               if (!suppressEvents) if (this._totalTime !== prevTotalTime || isComplete) {
+                                       this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
+                               }
+                       }
+                       if (this._cycle !== prevCycle) if (!suppressEvents) if (!this._gc) if (this.vars.onRepeat) {
+                               this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || _blankArray);
+                       }
+                       if (callback) if (!this._gc) { //check gc because there's a chance that kill() could be called in an onUpdate
+                               if (time < 0 && this._startAt && !this._onUpdate && this._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values.
+                                       this._startAt.render(time, suppressEvents, force);
+                               }
+                               if (isComplete) {
+                                       if (this._timeline.autoRemoveChildren) {
+                                               this._enabled(false, false);
+                                       }
+                                       this._active = false;
+                               }
+                               if (!suppressEvents && this.vars[callback]) {
+                                       this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
+                               }
+                               if (duration === 0 && this._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless.
+                                       this._rawPrevTime = 0;
+                               }
+                       }
+               };
+               
+//---- STATIC FUNCTIONS -----------------------------------------------------------------------------------------------------------
+               
+               TweenMax.to = function(target, duration, vars) {
+                       return new TweenMax(target, duration, vars);
+               };
+               
+               TweenMax.from = function(target, duration, vars) {
+                       vars.runBackwards = true;
+                       vars.immediateRender = (vars.immediateRender != false);
+                       return new TweenMax(target, duration, vars);
+               };
+               
+               TweenMax.fromTo = function(target, duration, fromVars, toVars) {
+                       toVars.startAt = fromVars;
+                       toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);
+                       return new TweenMax(target, duration, toVars);
+               };
+               
+               TweenMax.staggerTo = TweenMax.allTo = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
+                       stagger = stagger || 0;
+                       var delay = vars.delay || 0,
+                               a = [],
+                               finalComplete = function() {
+                                       if (vars.onComplete) {
+                                               vars.onComplete.apply(vars.onCompleteScope || this, arguments);
+                                       }
+                                       onCompleteAll.apply(onCompleteAllScope || this, onCompleteAllParams || _blankArray);
+                               },
+                               l, copy, i, p;
+                       if (!_isArray(targets)) {
+                               if (typeof(targets) === "string") {
+                                       targets = TweenLite.selector(targets) || targets;
+                               }
+                               if (_isSelector(targets)) {
+                                       targets = _slice.call(targets, 0);
+                               }
+                       }
+                       l = targets.length;
+                       for (i = 0; i < l; i++) {
+                               copy = {};
+                               for (p in vars) {
+                                       copy[p] = vars[p];
+                               }
+                               copy.delay = delay;
+                               if (i === l - 1 && onCompleteAll) {
+                                       copy.onComplete = finalComplete;
+                               }
+                               a[i] = new TweenMax(targets[i], duration, copy);
+                               delay += stagger;
+                       }
+                       return a;
+               };
+               
+               TweenMax.staggerFrom = TweenMax.allFrom = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
+                       vars.runBackwards = true;
+                       vars.immediateRender = (vars.immediateRender != false);
+                       return TweenMax.staggerTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
+               };
+               
+               TweenMax.staggerFromTo = TweenMax.allFromTo = function(targets, duration, fromVars, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
+                       toVars.startAt = fromVars;
+                       toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);
+                       return TweenMax.staggerTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
+               };
+                               
+               TweenMax.delayedCall = function(delay, callback, params, scope, useFrames) {
+                       return new TweenMax(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, onCompleteScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, onReverseCompleteScope:scope, immediateRender:false, useFrames:useFrames, overwrite:0});
+               };
+               
+               TweenMax.set = function(target, vars) {
+                       return new TweenMax(target, 0, vars);
+               };
+               
+               TweenMax.isTweening = function(target) {
+                       return (TweenLite.getTweensOf(target, true).length > 0);
+               };
+               
+               var _getChildrenOf = function(timeline, includeTimelines) {
+                               var a = [],
+                                       cnt = 0,
+                                       tween = timeline._first;
+                               while (tween) {
+                                       if (tween instanceof TweenLite) {
+                                               a[cnt++] = tween;
+                                       } else {
+                                               if (includeTimelines) {
+                                                       a[cnt++] = tween;
+                                               }
+                                               a = a.concat(_getChildrenOf(tween, includeTimelines));
+                                               cnt = a.length;
+                                       }
+                                       tween = tween._next;
+                               }
+                               return a;
+                       }, 
+                       getAllTweens = TweenMax.getAllTweens = function(includeTimelines) {
+                               return _getChildrenOf(Animation._rootTimeline, includeTimelines).concat( _getChildrenOf(Animation._rootFramesTimeline, includeTimelines) );
+                       };
+               
+               TweenMax.killAll = function(complete, tweens, delayedCalls, timelines) {
+                       if (tweens == null) {
+                               tweens = true;
+                       }
+                       if (delayedCalls == null) {
+                               delayedCalls = true;
+                       }
+                       var a = getAllTweens((timelines != false)),
+                               l = a.length,
+                               allTrue = (tweens && delayedCalls && timelines),
+                               isDC, tween, i;
+                       for (i = 0; i < l; i++) {
+                               tween = a[i];
+                               if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) {
+                                       if (complete) {
+                                               tween.totalTime(tween._reversed ? 0 : tween.totalDuration());
+                                       } else {
+                                               tween._enabled(false, false);
+                                       }
+                               }
+                       }
+               };
+               
+               TweenMax.killChildTweensOf = function(parent, complete) {
+                       if (parent == null) {
+                               return;
+                       }
+                       var tl = TweenLiteInternals.tweenLookup,
+                               a, curParent, p, i, l;
+                       if (typeof(parent) === "string") {
+                               parent = TweenLite.selector(parent) || parent;
+                       }
+                       if (_isSelector(parent)) {
+                               parent = _slice.call(parent, 0);
+                       }
+                       if (_isArray(parent)) {
+                               i = parent.length;
+                               while (--i > -1) {
+                                       TweenMax.killChildTweensOf(parent[i], complete);
+                               }
+                               return;
+                       }
+                       a = [];
+                       for (p in tl) {
+                               curParent = tl[p].target.parentNode;
+                               while (curParent) {
+                                       if (curParent === parent) {
+                                               a = a.concat(tl[p].tweens);
+                                       }
+                                       curParent = curParent.parentNode;
+                               }
+                       }
+                       l = a.length;
+                       for (i = 0; i < l; i++) {
+                               if (complete) {
+                                       a[i].totalTime(a[i].totalDuration());
+                               }
+                               a[i]._enabled(false, false);
+                       }
+               };
+
+               var _changePause = function(pause, tweens, delayedCalls, timelines) {
+                       tweens = (tweens !== false);
+                       delayedCalls = (delayedCalls !== false);
+                       timelines = (timelines !== false);
+                       var a = getAllTweens(timelines),
+                               allTrue = (tweens && delayedCalls && timelines),
+                               i = a.length,
+                               isDC, tween;
+                       while (--i > -1) {
+                               tween = a[i];
+                               if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) {
+                                       tween.paused(pause);
+                               }
+                       }
+               };
+               
+               TweenMax.pauseAll = function(tweens, delayedCalls, timelines) {
+                       _changePause(true, tweens, delayedCalls, timelines);
+               };
+               
+               TweenMax.resumeAll = function(tweens, delayedCalls, timelines) {
+                       _changePause(false, tweens, delayedCalls, timelines);
+               };
+
+               TweenMax.globalTimeScale = function(value) {
+                       var tl = Animation._rootTimeline,
+                               t = TweenLite.ticker.time;
+                       if (!arguments.length) {
+                               return tl._timeScale;
+                       }
+                       value = value || _tinyNum; //can't allow zero because it'll throw the math off
+                       tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value);
+                       tl = Animation._rootFramesTimeline;
+                       t = TweenLite.ticker.frame;
+                       tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value);
+                       tl._timeScale = Animation._rootTimeline._timeScale = value;
+                       return value;
+               };
+               
+       
+//---- GETTERS / SETTERS ----------------------------------------------------------------------------------------------------------
+               
+               p.progress = function(value) {
+                       return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), false);
+               };
+               
+               p.totalProgress = function(value) {
+                       return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, false);
+               };
+               
+               p.time = function(value, suppressEvents) {
+                       if (!arguments.length) {
+                               return this._time;
+                       }
+                       if (this._dirty) {
+                               this.totalDuration();
+                       }
+                       if (value > this._duration) {
+                               value = this._duration;
+                       }
+                       if (this._yoyo && (this._cycle & 1) !== 0) {
+                               value = (this._duration - value) + (this._cycle * (this._duration + this._repeatDelay));
+                       } else if (this._repeat !== 0) {
+                               value += this._cycle * (this._duration + this._repeatDelay);
+                       }
+                       return this.totalTime(value, suppressEvents);
+               };
+
+               p.duration = function(value) {
+                       if (!arguments.length) {
+                               return this._duration; //don't set _dirty = false because there could be repeats that haven't been factored into the _totalDuration yet. Otherwise, if you create a repeated TweenMax and then immediately check its duration(), it would cache the value and the totalDuration would not be correct, thus repeats wouldn't take effect.
+                       }
+                       return Animation.prototype.duration.call(this, value);
+               };
+
+               p.totalDuration = function(value) {
+                       if (!arguments.length) {
+                               if (this._dirty) {
+                                       //instead of Infinity, we use 999999999999 so that we can accommodate reverses
+                                       this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat);
+                                       this._dirty = false;
+                               }
+                               return this._totalDuration;
+                       }
+                       return (this._repeat === -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) );
+               };
+               
+               p.repeat = function(value) {
+                       if (!arguments.length) {
+                               return this._repeat;
+                       }
+                       this._repeat = value;
+                       return this._uncache(true);
+               };
+               
+               p.repeatDelay = function(value) {
+                       if (!arguments.length) {
+                               return this._repeatDelay;
+                       }
+                       this._repeatDelay = value;
+                       return this._uncache(true);
+               };
+               
+               p.yoyo = function(value) {
+                       if (!arguments.length) {
+                               return this._yoyo;
+                       }
+                       this._yoyo = value;
+                       return this;
+               };
+               
+               
+               return TweenMax;
+               
+       }, true);
+
+
+
+
+
+
+
+
+/*
+ * ----------------------------------------------------------------
+ * TimelineLite
+ * ----------------------------------------------------------------
+ */
+       window._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) {
+
+               var TimelineLite = function(vars) {
+                               SimpleTimeline.call(this, vars);
+                               this._labels = {};
+                               this.autoRemoveChildren = (this.vars.autoRemoveChildren === true);
+                               this.smoothChildTiming = (this.vars.smoothChildTiming === true);
+                               this._sortChildren = true;
+                               this._onUpdate = this.vars.onUpdate;
+                               var v = this.vars,
+                                       val, p;
+                               for (p in v) {
+                                       val = v[p];
+                                       if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) {
+                                               v[p] = this._swapSelfInParams(val);
+                                       }
+                               }
+                               if (_isArray(v.tweens)) {
+                                       this.add(v.tweens, 0, v.align, v.stagger);
+                               }
+                       },
+                       _tinyNum = 0.0000000001,
+                       _isSelector = TweenLite._internals.isSelector,
+                       _isArray = TweenLite._internals.isArray,
+                       _blankArray = [],
+                       _globals = window._gsDefine.globals,
+                       _copy = function(vars) {
+                               var copy = {}, p;
+                               for (p in vars) {
+                                       copy[p] = vars[p];
+                               }
+                               return copy;
+                       },
+                       _pauseCallback = function(tween, callback, params, scope) {
+                               tween._timeline.pause(tween._startTime);
+                               if (callback) {
+                                       callback.apply(scope || tween._timeline, params || _blankArray);
+                               }
+                       },
+                       _slice = _blankArray.slice,
+                       p = TimelineLite.prototype = new SimpleTimeline();
+
+               TimelineLite.version = "1.12.1";
+               p.constructor = TimelineLite;
+               p.kill()._gc = false;
+
+               p.to = function(target, duration, vars, position) {
+                       var Engine = (vars.repeat && _globals.TweenMax) || TweenLite;
+                       return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position);
+               };
+
+               p.from = function(target, duration, vars, position) {
+                       return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, vars), position);
+               };
+
+               p.fromTo = function(target, duration, fromVars, toVars, position) {
+                       var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite;
+                       return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position);
+               };
+
+               p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
+                       var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, onCompleteScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}),
+                               i;
+                       if (typeof(targets) === "string") {
+                               targets = TweenLite.selector(targets) || targets;
+                       }
+                       if (_isSelector(targets)) { //senses if the targets object is a selector. If it is, we should translate it into an array.
+                               targets = _slice.call(targets, 0);
+                       }
+                       stagger = stagger || 0;
+                       for (i = 0; i < targets.length; i++) {
+                               if (vars.startAt) {
+                                       vars.startAt = _copy(vars.startAt);
+                               }
+                               tl.to(targets[i], duration, _copy(vars), i * stagger);
+                       }
+                       return this.add(tl, position);
+               };
+
+               p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
+                       vars.immediateRender = (vars.immediateRender != false);
+                       vars.runBackwards = true;
+                       return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
+               };
+
+               p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) {
+                       toVars.startAt = fromVars;
+                       toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);
+                       return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope);
+               };
+
+               p.call = function(callback, params, scope, position) {
+                       return this.add( TweenLite.delayedCall(0, callback, params, scope), position);
+               };
+
+               p.set = function(target, vars, position) {
+                       position = this._parseTimeOrLabel(position, 0, true);
+                       if (vars.immediateRender == null) {
+                               vars.immediateRender = (position === this._time && !this._paused);
+                       }
+                       return this.add( new TweenLite(target, 0, vars), position);
+               };
+
+               TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) {
+                       vars = vars || {};
+                       if (vars.smoothChildTiming == null) {
+                               vars.smoothChildTiming = true;
+                       }
+                       var tl = new TimelineLite(vars),
+                               root = tl._timeline,
+                               tween, next;
+                       if (ignoreDelayedCalls == null) {
+                               ignoreDelayedCalls = true;
+                       }
+                       root._remove(tl, true);
+                       tl._startTime = 0;
+                       tl._rawPrevTime = tl._time = tl._totalTime = root._time;
+                       tween = root._first;
+                       while (tween) {
+                               next = tween._next;
+                               if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) {
+                                       tl.add(tween, tween._startTime - tween._delay);
+                               }
+                               tween = next;
+                       }
+                       root.add(tl, 0);
+                       return tl;
+               };
+
+               p.add = function(value, position, align, stagger) {
+                       var curTime, l, i, child, tl, beforeRawTime;
+                       if (typeof(position) !== "number") {
+                               position = this._parseTimeOrLabel(position, 0, true, value);
+                       }
+                       if (!(value instanceof Animation)) {
+                               if ((value instanceof Array) || (value && value.push && _isArray(value))) {
+                                       align = align || "normal";
+                                       stagger = stagger || 0;
+                                       curTime = position;
+                                       l = value.length;
+                                       for (i = 0; i < l; i++) {
+                                               if (_isArray(child = value[i])) {
+                                                       child = new TimelineLite({tweens:child});
+                                               }
+                                               this.add(child, curTime);
+                                               if (typeof(child) !== "string" && typeof(child) !== "function") {
+                                                       if (align === "sequence") {
+                                                               curTime = child._startTime + (child.totalDuration() / child._timeScale);
+                                                       } else if (align === "start") {
+                                                               child._startTime -= child.delay();
+                                                       }
+                                               }
+                                               curTime += stagger;
+                                       }
+                                       return this._uncache(true);
+                               } else if (typeof(value) === "string") {
+                                       return this.addLabel(value, position);
+                               } else if (typeof(value) === "function") {
+                                       value = TweenLite.delayedCall(0, value);
+                               } else {
+                                       throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string.");
+                               }
+                       }
+
+                       SimpleTimeline.prototype.add.call(this, value, position);
+
+                       //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.
+                       if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) {
+                               //in case any of the ancestors had completed but should now be enabled...
+                               tl = this;
+                               beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect.
+                               while (tl._timeline) {
+                                       if (beforeRawTime && tl._timeline.smoothChildTiming) {
+                                               tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it.
+                                       } else if (tl._gc) {
+                                               tl._enabled(true, false);
+                                       }
+                                       tl = tl._timeline;
+                               }
+                       }
+
+                       return this;
+               };
+
+               p.remove = function(value) {
+                       if (value instanceof Animation) {
+                               return this._remove(value, false);
+                       } else if (value instanceof Array || (value && value.push && _isArray(value))) {
+                               var i = value.length;
+                               while (--i > -1) {
+                                       this.remove(value[i]);
+                               }
+                               return this;
+                       } else if (typeof(value) === "string") {
+                               return this.removeLabel(value);
+                       }
+                       return this.kill(null, value);
+               };
+
+               p._remove = function(tween, skipDisable) {
+                       SimpleTimeline.prototype._remove.call(this, tween, skipDisable);
+                       var last = this._last;
+                       if (!last) {
+                               this._time = this._totalTime = this._duration = this._totalDuration = 0;
+                       } else if (this._time > last._startTime + last._totalDuration / last._timeScale) {
+                               this._time = this.duration();
+                               this._totalTime = this._totalDuration;
+                       }
+                       return this;
+               };
+
+               p.append = function(value, offsetOrLabel) {
+                       return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value));
+               };
+
+               p.insert = p.insertMultiple = function(value, position, align, stagger) {
+                       return this.add(value, position || 0, align, stagger);
+               };
+
+               p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) {
+                       return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger);
+               };
+
+               p.addLabel = function(label, position) {
+                       this._labels[label] = this._parseTimeOrLabel(position);
+                       return this;
+               };
+
+               p.addPause = function(position, callback, params, scope) {
+                       return this.call(_pauseCallback, ["{self}", callback, params, scope], this, position);
+               };
+
+               p.removeLabel = function(label) {
+                       delete this._labels[label];
+                       return this;
+               };
+
+               p.getLabelTime = function(label) {
+                       return (this._labels[label] != null) ? this._labels[label] : -1;
+               };
+
+               p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) {
+                       var i;
+                       //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration().
+                       if (ignore instanceof Animation && ignore.timeline === this) {
+                               this.remove(ignore);
+                       } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) {
+                               i = ignore.length;
+                               while (--i > -1) {
+                                       if (ignore[i] instanceof Animation && ignore[i].timeline === this) {
+                                               this.remove(ignore[i]);
+                                       }
+                               }
+                       }
+                       if (typeof(offsetOrLabel) === "string") {
+                               return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent);
+                       }
+                       offsetOrLabel = offsetOrLabel || 0;
+                       if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
+                               i = timeOrLabel.indexOf("=");
+                               if (i === -1) {
+                                       if (this._labels[timeOrLabel] == null) {
+                                               return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel;
+                                       }
+                                       return this._labels[timeOrLabel] + offsetOrLabel;
+                               }
+                               offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1));
+                               timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration();
+                       } else if (timeOrLabel == null) {
+                               timeOrLabel = this.duration();
+                       }
+                       return Number(timeOrLabel) + offsetOrLabel;
+               };
+
+               p.seek = function(position, suppressEvents) {
+                       return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false));
+               };
+
+               p.stop = function() {
+                       return this.paused(true);
+               };
+
+               p.gotoAndPlay = function(position, suppressEvents) {
+                       return this.play(position, suppressEvents);
+               };
+
+               p.gotoAndStop = function(position, suppressEvents) {
+                       return this.pause(position, suppressEvents);
+               };
+
+               p.render = function(time, suppressEvents, force) {
+                       if (this._gc) {
+                               this._enabled(true, false);
+                       }
+                       var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
+                               prevTime = this._time,
+                               prevStart = this._startTime,
+                               prevTimeScale = this._timeScale,
+                               prevPaused = this._paused,
+                               tween, isComplete, next, callback, internalForce;
+                       if (time >= totalDur) {
+                               this._totalTime = this._time = totalDur;
+                               if (!this._reversed) if (!this._hasPausedChild()) {
+                                       isComplete = true;
+                                       callback = "onComplete";
+                                       if (this._duration === 0) if (time === 0 || this._rawPrevTime < 0 || this._rawPrevTime === _tinyNum) if (this._rawPrevTime !== time && this._first) {
+                                               internalForce = true;
+                                               if (this._rawPrevTime > _tinyNum) {
+                                                       callback = "onReverseComplete";
+                                               }
+                                       }
+                               }
+                               this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                               time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7.
+
+                       } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.
+                               this._totalTime = this._time = 0;
+                               if (prevTime !== 0 || (this._duration === 0 && this._rawPrevTime !== _tinyNum && (this._rawPrevTime > 0 || (time < 0 && this._rawPrevTime >= 0)))) {
+                                       callback = "onReverseComplete";
+                                       isComplete = this._reversed;
+                               }
+                               if (time < 0) {
+                                       this._active = false;
+                                       if (this._duration === 0) if (this._rawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
+                                               internalForce = true;
+                                       }
+                                       this._rawPrevTime = time;
+                               } else {
+                                       this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+
+                                       time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline)
+                                       if (!this._initted) {
+                                               internalForce = true;
+                                       }
+                               }
+
+                       } else {
+                               this._totalTime = this._time = this._rawPrevTime = time;
+                       }
+                       if ((this._time === prevTime || !this._first) && !force && !internalForce) {
+                               return;
+                       } else if (!this._initted) {
+                               this._initted = true;
+                       }
+
+                       if (!this._active) if (!this._paused && this._time !== prevTime && time > 0) {
+                               this._active = true;  //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example.
+                       }
+
+                       if (prevTime === 0) if (this.vars.onStart) if (this._time !== 0) if (!suppressEvents) {
+                               this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
+                       }
+
+                       if (this._time >= prevTime) {
+                               tween = this._first;
+                               while (tween) {
+                                       next = tween._next; //record it here because the value could change after rendering...
+                                       if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
+                                               break;
+                                       } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
+                                               if (!tween._reversed) {
+                                                       tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
+                                               } else {
+                                                       tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
+                                               }
+                                       }
+                                       tween = next;
+                               }
+                       } else {
+                               tween = this._last;
+                               while (tween) {
+                                       next = tween._prev; //record it here because the value could change after rendering...
+                                       if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
+                                               break;
+                                       } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
+                                               if (!tween._reversed) {
+                                                       tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
+                                               } else {
+                                                       tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
+                                               }
+                                       }
+                                       tween = next;
+                               }
+                       }
+
+                       if (this._onUpdate) if (!suppressEvents) {
+                               this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
+                       }
+
+                       if (callback) if (!this._gc) if (prevStart === this._startTime || prevTimeScale !== this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate
+                               if (isComplete) {
+                                       if (this._timeline.autoRemoveChildren) {
+                                               this._enabled(false, false);
+                                       }
+                                       this._active = false;
+                               }
+                               if (!suppressEvents && this.vars[callback]) {
+                                       this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
+                               }
+                       }
+               };
+
+               p._hasPausedChild = function() {
+                       var tween = this._first;
+                       while (tween) {
+                               if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) {
+                                       return true;
+                               }
+                               tween = tween._next;
+                       }
+                       return false;
+               };
+
+               p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) {
+                       ignoreBeforeTime = ignoreBeforeTime || -9999999999;
+                       var a = [],
+                               tween = this._first,
+                               cnt = 0;
+                       while (tween) {
+                               if (tween._startTime < ignoreBeforeTime) {
+                                       //do nothing
+                               } else if (tween instanceof TweenLite) {
+                                       if (tweens !== false) {
+                                               a[cnt++] = tween;
+                                       }
+                               } else {
+                                       if (timelines !== false) {
+                                               a[cnt++] = tween;
+                                       }
+                                       if (nested !== false) {
+                                               a = a.concat(tween.getChildren(true, tweens, timelines));
+                                               cnt = a.length;
+                                       }
+                               }
+                               tween = tween._next;
+                       }
+                       return a;
+               };
+
+               p.getTweensOf = function(target, nested) {
+                       var disabled = this._gc,
+                               a = [],
+                               cnt = 0,
+                               tweens, i;
+                       if (disabled) {
+                               this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here.
+                       }
+                       tweens = TweenLite.getTweensOf(target);
+                       i = tweens.length;
+                       while (--i > -1) {
+                               if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) {
+                                       a[cnt++] = tweens[i];
+                               }
+                       }
+                       if (disabled) {
+                               this._enabled(false, true);
+                       }
+                       return a;
+               };
+
+               p._contains = function(tween) {
+                       var tl = tween.timeline;
+                       while (tl) {
+                               if (tl === this) {
+                                       return true;
+                               }
+                               tl = tl.timeline;
+                       }
+                       return false;
+               };
+
+               p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) {
+                       ignoreBeforeTime = ignoreBeforeTime || 0;
+                       var tween = this._first,
+                               labels = this._labels,
+                               p;
+                       while (tween) {
+                               if (tween._startTime >= ignoreBeforeTime) {
+                                       tween._startTime += amount;
+                               }
+                               tween = tween._next;
+                       }
+                       if (adjustLabels) {
+                               for (p in labels) {
+                                       if (labels[p] >= ignoreBeforeTime) {
+                                               labels[p] += amount;
+                                       }
+                               }
+                       }
+                       return this._uncache(true);
+               };
+
+               p._kill = function(vars, target) {
+                       if (!vars && !target) {
+                               return this._enabled(false, false);
+                       }
+                       var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target),
+                               i = tweens.length,
+                               changed = false;
+                       while (--i > -1) {
+                               if (tweens[i]._kill(vars, target)) {
+                                       changed = true;
+                               }
+                       }
+                       return changed;
+               };
+
+               p.clear = function(labels) {
+                       var tweens = this.getChildren(false, true, true),
+                               i = tweens.length;
+                       this._time = this._totalTime = 0;
+                       while (--i > -1) {
+                               tweens[i]._enabled(false, false);
+                       }
+                       if (labels !== false) {
+                               this._labels = {};
+                       }
+                       return this._uncache(true);
+               };
+
+               p.invalidate = function() {
+                       var tween = this._first;
+                       while (tween) {
+                               tween.invalidate();
+                               tween = tween._next;
+                       }
+                       return this;
+               };
+
+               p._enabled = function(enabled, ignoreTimeline) {
+                       if (enabled === this._gc) {
+                               var tween = this._first;
+                               while (tween) {
+                                       tween._enabled(enabled, true);
+                                       tween = tween._next;
+                               }
+                       }
+                       return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline);
+               };
+
+               p.duration = function(value) {
+                       if (!arguments.length) {
+                               if (this._dirty) {
+                                       this.totalDuration(); //just triggers recalculation
+                               }
+                               return this._duration;
+                       }
+                       if (this.duration() !== 0 && value !== 0) {
+                               this.timeScale(this._duration / value);
+                       }
+                       return this;
+               };
+
+               p.totalDuration = function(value) {
+                       if (!arguments.length) {
+                               if (this._dirty) {
+                                       var max = 0,
+                                               tween = this._last,
+                                               prevStart = 999999999999,
+                                               prev, end;
+                                       while (tween) {
+                                               prev = tween._prev; //record it here in case the tween changes position in the sequence...
+                                               if (tween._dirty) {
+                                                       tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it.
+                                               }
+                                               if (tween._startTime > prevStart && this._sortChildren && !tween._paused) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence
+                                                       this.add(tween, tween._startTime - tween._delay);
+                                               } else {
+                                                       prevStart = tween._startTime;
+                                               }
+                                               if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.
+                                                       max -= tween._startTime;
+                                                       if (this._timeline.smoothChildTiming) {
+                                                               this._startTime += tween._startTime / this._timeScale;
+                                                       }
+                                                       this.shiftChildren(-tween._startTime, false, -9999999999);
+                                                       prevStart = 0;
+                                               }
+                                               end = tween._startTime + (tween._totalDuration / tween._timeScale);
+                                               if (end > max) {
+                                                       max = end;
+                                               }
+                                               tween = prev;
+                                       }
+                                       this._duration = this._totalDuration = max;
+                                       this._dirty = false;
+                               }
+                               return this._totalDuration;
+                       }
+                       if (this.totalDuration() !== 0) if (value !== 0) {
+                               this.timeScale(this._totalDuration / value);
+                       }
+                       return this;
+               };
+
+               p.usesFrames = function() {
+                       var tl = this._timeline;
+                       while (tl._timeline) {
+                               tl = tl._timeline;
+                       }
+                       return (tl === Animation._rootFramesTimeline);
+               };
+
+               p.rawTime = function() {
+                       return this._paused ? this._totalTime : (this._timeline.rawTime() - this._startTime) * this._timeScale;
+               };
+
+               return TimelineLite;
+
+       }, true);
+       
+
+
+
+
+
+
+
+       
+       
+       
+       
+       
+/*
+ * ----------------------------------------------------------------
+ * TimelineMax
+ * ----------------------------------------------------------------
+ */
+       window._gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) {
+
+               var TimelineMax = function(vars) {
+                               TimelineLite.call(this, vars);
+                               this._repeat = this.vars.repeat || 0;
+                               this._repeatDelay = this.vars.repeatDelay || 0;
+                               this._cycle = 0;
+                               this._yoyo = (this.vars.yoyo === true);
+                               this._dirty = true;
+                       },
+                       _tinyNum = 0.0000000001,
+                       _blankArray = [],
+                       _easeNone = new Ease(null, null, 1, 0),
+                       p = TimelineMax.prototype = new TimelineLite();
+
+               p.constructor = TimelineMax;
+               p.kill()._gc = false;
+               TimelineMax.version = "1.12.1";
+
+               p.invalidate = function() {
+                       this._yoyo = (this.vars.yoyo === true);
+                       this._repeat = this.vars.repeat || 0;
+                       this._repeatDelay = this.vars.repeatDelay || 0;
+                       this._uncache(true);
+                       return TimelineLite.prototype.invalidate.call(this);
+               };
+
+               p.addCallback = function(callback, position, params, scope) {
+                       return this.add( TweenLite.delayedCall(0, callback, params, scope), position);
+               };
+
+               p.removeCallback = function(callback, position) {
+                       if (callback) {
+                               if (position == null) {
+                                       this._kill(null, callback);
+                               } else {
+                                       var a = this.getTweensOf(callback, false),
+                                               i = a.length,
+                                               time = this._parseTimeOrLabel(position);
+                                       while (--i > -1) {
+                                               if (a[i]._startTime === time) {
+                                                       a[i]._enabled(false, false);
+                                               }
+                                       }
+                               }
+                       }
+                       return this;
+               };
+
+               p.tweenTo = function(position, vars) {
+                       vars = vars || {};
+                       var copy = {ease:_easeNone, overwrite:(vars.delay ? 2 : 1), useFrames:this.usesFrames(), immediateRender:false},//note: set overwrite to 1 (true/all) by default unless there's a delay so that we avoid a racing situation that could happen if, for example, an onmousemove creates the same tweenTo() over and over again.
+                               duration, p, t;
+                       for (p in vars) {
+                               copy[p] = vars[p];
+                       }
+                       copy.time = this._parseTimeOrLabel(position);
+                       duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001;
+                       t = new TweenLite(this, duration, copy);
+                       copy.onStart = function() {
+                               t.target.paused(true);
+                               if (t.vars.time !== t.target.time() && duration === t.duration()) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all.
+                                       t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale );
+                               }
+                               if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it.
+                                       vars.onStart.apply(vars.onStartScope || t, vars.onStartParams || _blankArray);
+                               }
+                       };
+                       return t;
+               };
+
+               p.tweenFromTo = function(fromPosition, toPosition, vars) {
+                       vars = vars || {};
+                       fromPosition = this._parseTimeOrLabel(fromPosition);
+                       vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], onCompleteScope:this};
+                       vars.immediateRender = (vars.immediateRender !== false);
+                       var t = this.tweenTo(toPosition, vars);
+                       return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001);
+               };
+
+               p.render = function(time, suppressEvents, force) {
+                       if (this._gc) {
+                               this._enabled(true, false);
+                       }
+                       var totalDur = (!this._dirty) ? this._totalDuration : this.totalDuration(),
+                               dur = this._duration,
+                               prevTime = this._time,
+                               prevTotalTime = this._totalTime,
+                               prevStart = this._startTime,
+                               prevTimeScale = this._timeScale,
+                               prevRawPrevTime = this._rawPrevTime,
+                               prevPaused = this._paused,
+                               prevCycle = this._cycle,
+                               tween, isComplete, next, callback, internalForce, cycleDuration;
+                       if (time >= totalDur) {
+                               if (!this._locked) {
+                                       this._totalTime = totalDur;
+                                       this._cycle = this._repeat;
+                               }
+                               if (!this._reversed) if (!this._hasPausedChild()) {
+                                       isComplete = true;
+                                       callback = "onComplete";
+                                       if (this._duration === 0) if (time === 0 || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time && this._first) {
+                                               internalForce = true;
+                                               if (prevRawPrevTime > _tinyNum) {
+                                                       callback = "onReverseComplete";
+                                               }
+                                       }
+                               }
+                               this._rawPrevTime = (this._duration || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                               if (this._yoyo && (this._cycle & 1) !== 0) {
+                                       this._time = time = 0;
+                               } else {
+                                       this._time = dur;
+                                       time = dur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. We cannot do less then 0.0001 because the same issue can occur when the duration is extremely large like 999999999999 in which case adding 0.00000001, for example, causes it to act like nothing was added.
+                               }
+
+                       } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.
+                               if (!this._locked) {
+                                       this._totalTime = this._cycle = 0;
+                               }
+                               this._time = 0;
+                               if (prevTime !== 0 || (dur === 0 && prevRawPrevTime !== _tinyNum && (prevRawPrevTime > 0 || (time < 0 && prevRawPrevTime >= 0)) && !this._locked)) { //edge case for checking time < 0 && prevRawPrevTime >= 0: a zero-duration fromTo() tween inside a zero-duration timeline (yeah, very rare)
+                                       callback = "onReverseComplete";
+                                       isComplete = this._reversed;
+                               }
+                               if (time < 0) {
+                                       this._active = false;
+                                       if (dur === 0) if (prevRawPrevTime >= 0 && this._first) { //zero-duration timelines are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
+                                               internalForce = true;
+                                       }
+                                       this._rawPrevTime = time;
+                               } else {
+                                       this._rawPrevTime = (dur || !suppressEvents || time || this._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                                       time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline)
+                                       if (!this._initted) {
+                                               internalForce = true;
+                                       }
+                               }
+
+                       } else {
+                               if (dur === 0 && prevRawPrevTime < 0) { //without this, zero-duration repeating timelines (like with a simple callback nested at the very beginning and a repeatDelay) wouldn't render the first time through.
+                                       internalForce = true;
+                               }
+                               this._time = this._rawPrevTime = time;
+                               if (!this._locked) {
+                                       this._totalTime = time;
+                                       if (this._repeat !== 0) {
+                                               cycleDuration = dur + this._repeatDelay;
+                                               this._cycle = (this._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but it gets reported as 0.79999999!)
+                                               if (this._cycle !== 0) if (this._cycle === this._totalTime / cycleDuration) {
+                                                       this._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning)
+                                               }
+                                               this._time = this._totalTime - (this._cycle * cycleDuration);
+                                               if (this._yoyo) if ((this._cycle & 1) !== 0) {
+                                                       this._time = dur - this._time;
+                                               }
+                                               if (this._time > dur) {
+                                                       this._time = dur;
+                                                       time = dur + 0.0001; //to avoid occasional floating point rounding error
+                                               } else if (this._time < 0) {
+                                                       this._time = time = 0;
+                                               } else {
+                                                       time = this._time;
+                                               }
+                                       }
+                               }
+                       }
+
+                       if (this._cycle !== prevCycle) if (!this._locked) {
+                               /*
+                               make sure children at the end/beginning of the timeline are rendered properly. If, for example,
+                               a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which
+                               would get transated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there
+                               could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So
+                               we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must
+                               ensure that zero-duration tweens at the very beginning or end of the TimelineMax work.
+                               */
+                               var backwards = (this._yoyo && (prevCycle & 1) !== 0),
+                                       wrap = (backwards === (this._yoyo && (this._cycle & 1) !== 0)),
+                                       recTotalTime = this._totalTime,
+                                       recCycle = this._cycle,
+                                       recRawPrevTime = this._rawPrevTime,
+                                       recTime = this._time;
+
+                               this._totalTime = prevCycle * dur;
+                               if (this._cycle < prevCycle) {
+                                       backwards = !backwards;
+                               } else {
+                                       this._totalTime += dur;
+                               }
+                               this._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method.
+
+                               this._rawPrevTime = (dur === 0) ? prevRawPrevTime - 0.0001 : prevRawPrevTime;
+                               this._cycle = prevCycle;
+                               this._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render()
+                               prevTime = (backwards) ? 0 : dur;
+                               this.render(prevTime, suppressEvents, (dur === 0));
+                               if (!suppressEvents) if (!this._gc) {
+                                       if (this.vars.onRepeat) {
+                                               this.vars.onRepeat.apply(this.vars.onRepeatScope || this, this.vars.onRepeatParams || _blankArray);
+                                       }
+                               }
+                               if (wrap) {
+                                       prevTime = (backwards) ? dur + 0.0001 : -0.0001;
+                                       this.render(prevTime, true, false);
+                               }
+                               this._locked = false;
+                               if (this._paused && !prevPaused) { //if the render() triggered callback that paused this timeline, we should abort (very rare, but possible)
+                                       return;
+                               }
+                               this._time = recTime;
+                               this._totalTime = recTotalTime;
+                               this._cycle = recCycle;
+                               this._rawPrevTime = recRawPrevTime;
+                       }
+
+                       if ((this._time === prevTime || !this._first) && !force && !internalForce) {
+                               if (prevTotalTime !== this._totalTime) if (this._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate.
+                                       this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
+                               }
+                               return;
+                       } else if (!this._initted) {
+                               this._initted = true;
+                       }
+
+                       if (!this._active) if (!this._paused && this._totalTime !== prevTotalTime && time > 0) {
+                               this._active = true;  //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example.
+                       }
+
+                       if (prevTotalTime === 0) if (this.vars.onStart) if (this._totalTime !== 0) if (!suppressEvents) {
+                               this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
+                       }
+
+                       if (this._time >= prevTime) {
+                               tween = this._first;
+                               while (tween) {
+                                       next = tween._next; //record it here because the value could change after rendering...
+                                       if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
+                                               break;
+                                       } else if (tween._active || (tween._startTime <= this._time && !tween._paused && !tween._gc)) {
+                                               if (!tween._reversed) {
+                                                       tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
+                                               } else {
+                                                       tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
+                                               }
+
+                                       }
+                                       tween = next;
+                               }
+                       } else {
+                               tween = this._last;
+                               while (tween) {
+                                       next = tween._prev; //record it here because the value could change after rendering...
+                                       if (this._paused && !prevPaused) { //in case a tween pauses the timeline when rendering
+                                               break;
+                                       } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) {
+                                               if (!tween._reversed) {
+                                                       tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
+                                               } else {
+                                                       tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
+                                               }
+                                       }
+                                       tween = next;
+                               }
+                       }
+
+                       if (this._onUpdate) if (!suppressEvents) {
+                               this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
+                       }
+                       if (callback) if (!this._locked) if (!this._gc) if (prevStart === this._startTime || prevTimeScale !== this._timeScale) if (this._time === 0 || totalDur >= this.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate
+                               if (isComplete) {
+                                       if (this._timeline.autoRemoveChildren) {
+                                               this._enabled(false, false);
+                                       }
+                                       this._active = false;
+                               }
+                               if (!suppressEvents && this.vars[callback]) {
+                                       this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
+                               }
+                       }
+               };
+
+               p.getActive = function(nested, tweens, timelines) {
+                       if (nested == null) {
+                               nested = true;
+                       }
+                       if (tweens == null) {
+                               tweens = true;
+                       }
+                       if (timelines == null) {
+                               timelines = false;
+                       }
+                       var a = [],
+                               all = this.getChildren(nested, tweens, timelines),
+                               cnt = 0,
+                               l = all.length,
+                               i, tween;
+                       for (i = 0; i < l; i++) {
+                               tween = all[i];
+                               if (tween.isActive()) {
+                                       a[cnt++] = tween;
+                               }
+                       }
+                       return a;
+               };
+
+
+               p.getLabelAfter = function(time) {
+                       if (!time) if (time !== 0) { //faster than isNan()
+                               time = this._time;
+                       }
+                       var labels = this.getLabelsArray(),
+                               l = labels.length,
+                               i;
+                       for (i = 0; i < l; i++) {
+                               if (labels[i].time > time) {
+                                       return labels[i].name;
+                               }
+                       }
+                       return null;
+               };
+
+               p.getLabelBefore = function(time) {
+                       if (time == null) {
+                               time = this._time;
+                       }
+                       var labels = this.getLabelsArray(),
+                               i = labels.length;
+                       while (--i > -1) {
+                               if (labels[i].time < time) {
+                                       return labels[i].name;
+                               }
+                       }
+                       return null;
+               };
+
+               p.getLabelsArray = function() {
+                       var a = [],
+                               cnt = 0,
+                               p;
+                       for (p in this._labels) {
+                               a[cnt++] = {time:this._labels[p], name:p};
+                       }
+                       a.sort(function(a,b) {
+                               return a.time - b.time;
+                       });
+                       return a;
+               };
+
+
+//---- GETTERS / SETTERS -------------------------------------------------------------------------------------------------------
+
+               p.progress = function(value) {
+                       return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), false);
+               };
+
+               p.totalProgress = function(value) {
+                       return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, false);
+               };
+
+               p.totalDuration = function(value) {
+                       if (!arguments.length) {
+                               if (this._dirty) {
+                                       TimelineLite.prototype.totalDuration.call(this); //just forces refresh
+                                       //Instead of Infinity, we use 999999999999 so that we can accommodate reverses.
+                                       this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat);
+                               }
+                               return this._totalDuration;
+                       }
+                       return (this._repeat === -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) );
+               };
+
+               p.time = function(value, suppressEvents) {
+                       if (!arguments.length) {
+                               return this._time;
+                       }
+                       if (this._dirty) {
+                               this.totalDuration();
+                       }
+                       if (value > this._duration) {
+                               value = this._duration;
+                       }
+                       if (this._yoyo && (this._cycle & 1) !== 0) {
+                               value = (this._duration - value) + (this._cycle * (this._duration + this._repeatDelay));
+                       } else if (this._repeat !== 0) {
+                               value += this._cycle * (this._duration + this._repeatDelay);
+                       }
+                       return this.totalTime(value, suppressEvents);
+               };
+
+               p.repeat = function(value) {
+                       if (!arguments.length) {
+                               return this._repeat;
+                       }
+                       this._repeat = value;
+                       return this._uncache(true);
+               };
+
+               p.repeatDelay = function(value) {
+                       if (!arguments.length) {
+                               return this._repeatDelay;
+                       }
+                       this._repeatDelay = value;
+                       return this._uncache(true);
+               };
+
+               p.yoyo = function(value) {
+                       if (!arguments.length) {
+                               return this._yoyo;
+                       }
+                       this._yoyo = value;
+                       return this;
+               };
+
+               p.currentLabel = function(value) {
+                       if (!arguments.length) {
+                               return this.getLabelBefore(this._time + 0.00000001);
+                       }
+                       return this.seek(value, true);
+               };
+
+               return TimelineMax;
+
+       }, true);
+       
+
+
+
+
+       
+       
+       
+       
+       
+       
+       
+/*
+ * ----------------------------------------------------------------
+ * BezierPlugin
+ * ----------------------------------------------------------------
+ */
+       (function() {
+
+               var _RAD2DEG = 180 / Math.PI,
+                       _r1 = [],
+                       _r2 = [],
+                       _r3 = [],
+                       _corProps = {},
+                       Segment = function(a, b, c, d) {
+                               this.a = a;
+                               this.b = b;
+                               this.c = c;
+                               this.d = d;
+                               this.da = d - a;
+                               this.ca = c - a;
+                               this.ba = b - a;
+                       },
+                       _correlate = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",
+                       cubicToQuadratic = function(a, b, c, d) {
+                               var q1 = {a:a},
+                                       q2 = {},
+                                       q3 = {},
+                                       q4 = {c:d},
+                                       mab = (a + b) / 2,
+                                       mbc = (b + c) / 2,
+                                       mcd = (c + d) / 2,
+                                       mabc = (mab + mbc) / 2,
+                                       mbcd = (mbc + mcd) / 2,
+                                       m8 = (mbcd - mabc) / 8;
+                               q1.b = mab + (a - mab) / 4;
+                               q2.b = mabc + m8;
+                               q1.c = q2.a = (q1.b + q2.b) / 2;
+                               q2.c = q3.a = (mabc + mbcd) / 2;
+                               q3.b = mbcd - m8;
+                               q4.b = mcd + (d - mcd) / 4;
+                               q3.c = q4.a = (q3.b + q4.b) / 2;
+                               return [q1, q2, q3, q4];
+                       },
+                       _calculateControlPoints = function(a, curviness, quad, basic, correlate) {
+                               var l = a.length - 1,
+                                       ii = 0,
+                                       cp1 = a[0].a,
+                                       i, p1, p2, p3, seg, m1, m2, mm, cp2, qb, r1, r2, tl;
+                               for (i = 0; i < l; i++) {
+                                       seg = a[ii];
+                                       p1 = seg.a;
+                                       p2 = seg.d;
+                                       p3 = a[ii+1].d;
+
+                                       if (correlate) {
+                                               r1 = _r1[i];
+                                               r2 = _r2[i];
+                                               tl = ((r2 + r1) * curviness * 0.25) / (basic ? 0.5 : _r3[i] || 0.5);
+                                               m1 = p2 - (p2 - p1) * (basic ? curviness * 0.5 : (r1 !== 0 ? tl / r1 : 0));
+                                               m2 = p2 + (p3 - p2) * (basic ? curviness * 0.5 : (r2 !== 0 ? tl / r2 : 0));
+                                               mm = p2 - (m1 + (((m2 - m1) * ((r1 * 3 / (r1 + r2)) + 0.5) / 4) || 0));
+                                       } else {
+                                               m1 = p2 - (p2 - p1) * curviness * 0.5;
+                                               m2 = p2 + (p3 - p2) * curviness * 0.5;
+                                               mm = p2 - (m1 + m2) / 2;
+                                       }
+                                       m1 += mm;
+                                       m2 += mm;
+
+                                       seg.c = cp2 = m1;
+                                       if (i !== 0) {
+                                               seg.b = cp1;
+                                       } else {
+                                               seg.b = cp1 = seg.a + (seg.c - seg.a) * 0.6; //instead of placing b on a exactly, we move it inline with c so that if the user specifies an ease like Back.easeIn or Elastic.easeIn which goes BEYOND the beginning, it will do so smoothly.
+                                       }
+
+                                       seg.da = p2 - p1;
+                                       seg.ca = cp2 - p1;
+                                       seg.ba = cp1 - p1;
+
+                                       if (quad) {
+                                               qb = cubicToQuadratic(p1, cp1, cp2, p2);
+                                               a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]);
+                                               ii += 4;
+                                       } else {
+                                               ii++;
+                                       }
+
+                                       cp1 = m2;
+                               }
+                               seg = a[ii];
+                               seg.b = cp1;
+                               seg.c = cp1 + (seg.d - cp1) * 0.4; //instead of placing c on d exactly, we move it inline with b so that if the user specifies an ease like Back.easeOut or Elastic.easeOut which goes BEYOND the end, it will do so smoothly.
+                               seg.da = seg.d - seg.a;
+                               seg.ca = seg.c - seg.a;
+                               seg.ba = cp1 - seg.a;
+                               if (quad) {
+                                       qb = cubicToQuadratic(seg.a, cp1, seg.c, seg.d);
+                                       a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]);
+                               }
+                       },
+                       _parseAnchors = function(values, p, correlate, prepend) {
+                               var a = [],
+                                       l, i, p1, p2, p3, tmp;
+                               if (prepend) {
+                                       values = [prepend].concat(values);
+                                       i = values.length;
+                                       while (--i > -1) {
+                                               if (typeof( (tmp = values[i][p]) ) === "string") if (tmp.charAt(1) === "=") {
+                                                       values[i][p] = prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)); //accommodate relative values. Do it inline instead of breaking it out into a function for speed reasons
+                                               }
+                                       }
+                               }
+                               l = values.length - 2;
+                               if (l < 0) {
+                                       a[0] = new Segment(values[0][p], 0, 0, values[(l < -1) ? 0 : 1][p]);
+                                       return a;
+                               }
+                               for (i = 0; i < l; i++) {
+                                       p1 = values[i][p];
+                                       p2 = values[i+1][p];
+                                       a[i] = new Segment(p1, 0, 0, p2);
+                                       if (correlate) {
+                                               p3 = values[i+2][p];
+                                               _r1[i] = (_r1[i] || 0) + (p2 - p1) * (p2 - p1);
+                                               _r2[i] = (_r2[i] || 0) + (p3 - p2) * (p3 - p2);
+                                       }
+                               }
+                               a[i] = new Segment(values[i][p], 0, 0, values[i+1][p]);
+                               return a;
+                       },
+                       bezierThrough = function(values, curviness, quadratic, basic, correlate, prepend) {
+                               var obj = {},
+                                       props = [],
+                                       first = prepend || values[0],
+                                       i, p, a, j, r, l, seamless, last;
+                               correlate = (typeof(correlate) === "string") ? ","+correlate+"," : _correlate;
+                               if (curviness == null) {
+                                       curviness = 1;
+                               }
+                               for (p in values[0]) {
+                                       props.push(p);
+                               }
+                               //check to see if the last and first values are identical (well, within 0.05). If so, make seamless by appending the second element to the very end of the values array and the 2nd-to-last element to the very beginning (we'll remove those segments later)
+                               if (values.length > 1) {
+                                       last = values[values.length - 1];
+                                       seamless = true;
+                                       i = props.length;
+                                       while (--i > -1) {
+                                               p = props[i];
+                                               if (Math.abs(first[p] - last[p]) > 0.05) { //build in a tolerance of +/-0.05 to accommodate rounding errors. For example, if you set an object's position to 4.945, Flash will make it 4.9
+                                                       seamless = false;
+                                                       break;
+                                               }
+                                       }
+                                       if (seamless) {
+                                               values = values.concat(); //duplicate the array to avoid contaminating the original which the user may be reusing for other tweens
+                                               if (prepend) {
+                                                       values.unshift(prepend);
+                                               }
+                                               values.push(values[1]);
+                                               prepend = values[values.length - 3];
+                                       }
+                               }
+                               _r1.length = _r2.length = _r3.length = 0;
+                               i = props.length;
+                               while (--i > -1) {
+                                       p = props[i];
+                                       _corProps[p] = (correlate.indexOf(","+p+",") !== -1);
+                                       obj[p] = _parseAnchors(values, p, _corProps[p], prepend);
+                               }
+                               i = _r1.length;
+                               while (--i > -1) {
+                                       _r1[i] = Math.sqrt(_r1[i]);
+                                       _r2[i] = Math.sqrt(_r2[i]);
+                               }
+                               if (!basic) {
+                                       i = props.length;
+                                       while (--i > -1) {
+                                               if (_corProps[p]) {
+                                                       a = obj[props[i]];
+                                                       l = a.length - 1;
+                                                       for (j = 0; j < l; j++) {
+                                                               r = a[j+1].da / _r2[j] + a[j].da / _r1[j];
+                                                               _r3[j] = (_r3[j] || 0) + r * r;
+                                                       }
+                                               }
+                                       }
+                                       i = _r3.length;
+                                       while (--i > -1) {
+                                               _r3[i] = Math.sqrt(_r3[i]);
+                                       }
+                               }
+                               i = props.length;
+                               j = quadratic ? 4 : 1;
+                               while (--i > -1) {
+                                       p = props[i];
+                                       a = obj[p];
+                                       _calculateControlPoints(a, curviness, quadratic, basic, _corProps[p]); //this method requires that _parseAnchors() and _setSegmentRatios() ran first so that _r1, _r2, and _r3 values are populated for all properties
+                                       if (seamless) {
+                                               a.splice(0, j);
+                                               a.splice(a.length - j, j);
+                                       }
+                               }
+                               return obj;
+                       },
+                       _parseBezierData = function(values, type, prepend) {
+                               type = type || "soft";
+                               var obj = {},
+                                       inc = (type === "cubic") ? 3 : 2,
+                                       soft = (type === "soft"),
+                                       props = [],
+                                       a, b, c, d, cur, i, j, l, p, cnt, tmp;
+                               if (soft && prepend) {
+                                       values = [prepend].concat(values);
+                               }
+                               if (values == null || values.length < inc + 1) { throw "invalid Bezier data"; }
+                               for (p in values[0]) {
+                                       props.push(p);
+                               }
+                               i = props.length;
+                               while (--i > -1) {
+                                       p = props[i];
+                                       obj[p] = cur = [];
+                                       cnt = 0;
+                                       l = values.length;
+                                       for (j = 0; j < l; j++) {
+                                               a = (prepend == null) ? values[j][p] : (typeof( (tmp = values[j][p]) ) === "string" && tmp.charAt(1) === "=") ? prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)) : Number(tmp);
+                                               if (soft) if (j > 1) if (j < l - 1) {
+                                                       cur[cnt++] = (a + cur[cnt-2]) / 2;
+                                               }
+                                               cur[cnt++] = a;
+                                       }
+                                       l = cnt - inc + 1;
+                                       cnt = 0;
+                                       for (j = 0; j < l; j += inc) {
+                                               a = cur[j];
+                                               b = cur[j+1];
+                                               c = cur[j+2];
+                                               d = (inc === 2) ? 0 : cur[j+3];
+                                               cur[cnt++] = tmp = (inc === 3) ? new Segment(a, b, c, d) : new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c);
+                                       }
+                                       cur.length = cnt;
+                               }
+                               return obj;
+                       },
+                       _addCubicLengths = function(a, steps, resolution) {
+                               var inc = 1 / resolution,
+                                       j = a.length,
+                                       d, d1, s, da, ca, ba, p, i, inv, bez, index;
+                               while (--j > -1) {
+                                       bez = a[j];
+                                       s = bez.a;
+                                       da = bez.d - s;
+                                       ca = bez.c - s;
+                                       ba = bez.b - s;
+                                       d = d1 = 0;
+                                       for (i = 1; i <= resolution; i++) {
+                                               p = inc * i;
+                                               inv = 1 - p;
+                                               d = d1 - (d1 = (p * p * da + 3 * inv * (p * ca + inv * ba)) * p);
+                                               index = j * resolution + i - 1;
+                                               steps[index] = (steps[index] || 0) + d * d;
+                                       }
+                               }
+                       },
+                       _parseLengthData = function(obj, resolution) {
+                               resolution = resolution >> 0 || 6;
+                               var a = [],
+                                       lengths = [],
+                                       d = 0,
+                                       total = 0,
+                                       threshold = resolution - 1,
+                                       segments = [],
+                                       curLS = [], //current length segments array
+                                       p, i, l, index;
+                               for (p in obj) {
+                                       _addCubicLengths(obj[p], a, resolution);
+                               }
+                               l = a.length;
+                               for (i = 0; i < l; i++) {
+                                       d += Math.sqrt(a[i]);
+                                       index = i % resolution;
+                                       curLS[index] = d;
+                                       if (index === threshold) {
+                                               total += d;
+                                               index = (i / resolution) >> 0;
+                                               segments[index] = curLS;
+                                               lengths[index] = total;
+                                               d = 0;
+                                               curLS = [];
+                                       }
+                               }
+                               return {length:total, lengths:lengths, segments:segments};
+                       },
+
+
+
+                       BezierPlugin = window._gsDefine.plugin({
+                                       propName: "bezier",
+                                       priority: -1,
+                                       version: "1.3.2",
+                                       API: 2,
+                                       global:true,
+
+                                       //gets called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
+                                       init: function(target, vars, tween) {
+                                               this._target = target;
+                                               if (vars instanceof Array) {
+                                                       vars = {values:vars};
+                                               }
+                                               this._func = {};
+                                               this._round = {};
+                                               this._props = [];
+                                               this._timeRes = (vars.timeResolution == null) ? 6 : parseInt(vars.timeResolution, 10);
+                                               var values = vars.values || [],
+                                                       first = {},
+                                                       second = values[0],
+                                                       autoRotate = vars.autoRotate || tween.vars.orientToBezier,
+                                                       p, isFunc, i, j, prepend;
+
+                                               this._autoRotate = autoRotate ? (autoRotate instanceof Array) ? autoRotate : [["x","y","rotation",((autoRotate === true) ? 0 : Number(autoRotate) || 0)]] : null;
+                                               for (p in second) {
+                                                       this._props.push(p);
+                                               }
+
+                                               i = this._props.length;
+                                               while (--i > -1) {
+                                                       p = this._props[i];
+
+                                                       this._overwriteProps.push(p);
+                                                       isFunc = this._func[p] = (typeof(target[p]) === "function");
+                                                       first[p] = (!isFunc) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
+                                                       if (!prepend) if (first[p] !== values[0][p]) {
+                                                               prepend = first;
+                                                       }
+                                               }
+                                               this._beziers = (vars.type !== "cubic" && vars.type !== "quadratic" && vars.type !== "soft") ? bezierThrough(values, isNaN(vars.curviness) ? 1 : vars.curviness, false, (vars.type === "thruBasic"), vars.correlate, prepend) : _parseBezierData(values, vars.type, first);
+                                               this._segCount = this._beziers[p].length;
+
+                                               if (this._timeRes) {
+                                                       var ld = _parseLengthData(this._beziers, this._timeRes);
+                                                       this._length = ld.length;
+                                                       this._lengths = ld.lengths;
+                                                       this._segments = ld.segments;
+                                                       this._l1 = this._li = this._s1 = this._si = 0;
+                                                       this._l2 = this._lengths[0];
+                                                       this._curSeg = this._segments[0];
+                                                       this._s2 = this._curSeg[0];
+                                                       this._prec = 1 / this._curSeg.length;
+                                               }
+
+                                               if ((autoRotate = this._autoRotate)) {
+                                                       this._initialRotations = [];
+                                                       if (!(autoRotate[0] instanceof Array)) {
+                                                               this._autoRotate = autoRotate = [autoRotate];
+                                                       }
+                                                       i = autoRotate.length;
+                                                       while (--i > -1) {
+                                                               for (j = 0; j < 3; j++) {
+                                                                       p = autoRotate[i][j];
+                                                                       this._func[p] = (typeof(target[p]) === "function") ? target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ] : false;
+                                                               }
+                                                               p = autoRotate[i][2];
+                                                               this._initialRotations[i] = this._func[p] ? this._func[p].call(this._target) : this._target[p];
+                                                       }
+                                               }
+                                               this._startRatio = tween.vars.runBackwards ? 1 : 0; //we determine the starting ratio when the tween inits which is always 0 unless the tween has runBackwards:true (indicating it's a from() tween) in which case it's 1.
+                                               return true;
+                                       },
+
+                                       //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
+                                       set: function(v) {
+                                               var segments = this._segCount,
+                                                       func = this._func,
+                                                       target = this._target,
+                                                       notStart = (v !== this._startRatio),
+                                                       curIndex, inv, i, p, b, t, val, l, lengths, curSeg;
+                                               if (!this._timeRes) {
+                                                       curIndex = (v < 0) ? 0 : (v >= 1) ? segments - 1 : (segments * v) >> 0;
+                                                       t = (v - (curIndex * (1 / segments))) * segments;
+                                               } else {
+                                                       lengths = this._lengths;
+                                                       curSeg = this._curSeg;
+                                                       v *= this._length;
+                                                       i = this._li;
+                                                       //find the appropriate segment (if the currently cached one isn't correct)
+                                                       if (v > this._l2 && i < segments - 1) {
+                                                               l = segments - 1;
+                                                               while (i < l && (this._l2 = lengths[++i]) <= v) {       }
+                                                               this._l1 = lengths[i-1];
+                                                               this._li = i;
+                                                               this._curSeg = curSeg = this._segments[i];
+                                                               this._s2 = curSeg[(this._s1 = this._si = 0)];
+                                                       } else if (v < this._l1 && i > 0) {
+                                                               while (i > 0 && (this._l1 = lengths[--i]) >= v) { }
+                                                               if (i === 0 && v < this._l1) {
+                                                                       this._l1 = 0;
+                                                               } else {
+                                                                       i++;
+                                                               }
+                                                               this._l2 = lengths[i];
+                                                               this._li = i;
+                                                               this._curSeg = curSeg = this._segments[i];
+                                                               this._s1 = curSeg[(this._si = curSeg.length - 1) - 1] || 0;
+                                                               this._s2 = curSeg[this._si];
+                                                       }
+                                                       curIndex = i;
+                                                       //now find the appropriate sub-segment (we split it into the number of pieces that was defined by "precision" and measured each one)
+                                                       v -= this._l1;
+                                                       i = this._si;
+                                                       if (v > this._s2 && i < curSeg.length - 1) {
+                                                               l = curSeg.length - 1;
+                                                               while (i < l && (this._s2 = curSeg[++i]) <= v) {        }
+                                                               this._s1 = curSeg[i-1];
+                                                               this._si = i;
+                                                       } else if (v < this._s1 && i > 0) {
+                                                               while (i > 0 && (this._s1 = curSeg[--i]) >= v) {        }
+                                                               if (i === 0 && v < this._s1) {
+                                                                       this._s1 = 0;
+                                                               } else {
+                                                                       i++;
+                                                               }
+                                                               this._s2 = curSeg[i];
+                                                               this._si = i;
+                                                       }
+                                                       t = (i + (v - this._s1) / (this._s2 - this._s1)) * this._prec;
+                                               }
+                                               inv = 1 - t;
+
+                                               i = this._props.length;
+                                               while (--i > -1) {
+                                                       p = this._props[i];
+                                                       b = this._beziers[p][curIndex];
+                                                       val = (t * t * b.da + 3 * inv * (t * b.ca + inv * b.ba)) * t + b.a;
+                                                       if (this._round[p]) {
+                                                               val = Math.round(val);
+                                                       }
+                                                       if (func[p]) {
+                                                               target[p](val);
+                                                       } else {
+                                                               target[p] = val;
+                                                       }
+                                               }
+
+                                               if (this._autoRotate) {
+                                                       var ar = this._autoRotate,
+                                                               b2, x1, y1, x2, y2, add, conv;
+                                                       i = ar.length;
+                                                       while (--i > -1) {
+                                                               p = ar[i][2];
+                                                               add = ar[i][3] || 0;
+                                                               conv = (ar[i][4] === true) ? 1 : _RAD2DEG;
+                                                               b = this._beziers[ar[i][0]];
+                                                               b2 = this._beziers[ar[i][1]];
+
+                                                               if (b && b2) { //in case one of the properties got overwritten.
+                                                                       b = b[curIndex];
+                                                                       b2 = b2[curIndex];
+
+                                                                       x1 = b.a + (b.b - b.a) * t;
+                                                                       x2 = b.b + (b.c - b.b) * t;
+                                                                       x1 += (x2 - x1) * t;
+                                                                       x2 += ((b.c + (b.d - b.c) * t) - x2) * t;
+
+                                                                       y1 = b2.a + (b2.b - b2.a) * t;
+                                                                       y2 = b2.b + (b2.c - b2.b) * t;
+                                                                       y1 += (y2 - y1) * t;
+                                                                       y2 += ((b2.c + (b2.d - b2.c) * t) - y2) * t;
+
+                                                                       val = notStart ? Math.atan2(y2 - y1, x2 - x1) * conv + add : this._initialRotations[i];
+
+                                                                       if (func[p]) {
+                                                                               target[p](val);
+                                                                       } else {
+                                                                               target[p] = val;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                       }),
+                       p = BezierPlugin.prototype;
+
+
+               BezierPlugin.bezierThrough = bezierThrough;
+               BezierPlugin.cubicToQuadratic = cubicToQuadratic;
+               BezierPlugin._autoCSS = true; //indicates that this plugin can be inserted into the "css" object using the autoCSS feature of TweenLite
+               BezierPlugin.quadraticToCubic = function(a, b, c) {
+                       return new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c);
+               };
+
+               BezierPlugin._cssRegister = function() {
+                       var CSSPlugin = window._gsDefine.globals.CSSPlugin;
+                       if (!CSSPlugin) {
+                               return;
+                       }
+                       var _internals = CSSPlugin._internals,
+                               _parseToProxy = _internals._parseToProxy,
+                               _setPluginRatio = _internals._setPluginRatio,
+                               CSSPropTween = _internals.CSSPropTween;
+                       _internals._registerComplexSpecialProp("bezier", {parser:function(t, e, prop, cssp, pt, plugin) {
+                               if (e instanceof Array) {
+                                       e = {values:e};
+                               }
+                               plugin = new BezierPlugin();
+                               var values = e.values,
+                                       l = values.length - 1,
+                                       pluginValues = [],
+                                       v = {},
+                                       i, p, data;
+                               if (l < 0) {
+                                       return pt;
+                               }
+                               for (i = 0; i <= l; i++) {
+                                       data = _parseToProxy(t, values[i], cssp, pt, plugin, (l !== i));
+                                       pluginValues[i] = data.end;
+                               }
+                               for (p in e) {
+                                       v[p] = e[p]; //duplicate the vars object because we need to alter some things which would cause problems if the user plans to reuse the same vars object for another tween.
+                               }
+                               v.values = pluginValues;
+                               pt = new CSSPropTween(t, "bezier", 0, 0, data.pt, 2);
+                               pt.data = data;
+                               pt.plugin = plugin;
+                               pt.setRatio = _setPluginRatio;
+                               if (v.autoRotate === 0) {
+                                       v.autoRotate = true;
+                               }
+                               if (v.autoRotate && !(v.autoRotate instanceof Array)) {
+                                       i = (v.autoRotate === true) ? 0 : Number(v.autoRotate);
+                                       v.autoRotate = (data.end.left != null) ? [["left","top","rotation",i,false]] : (data.end.x != null) ? [["x","y","rotation",i,false]] : false;
+                               }
+                               if (v.autoRotate) {
+                                       if (!cssp._transform) {
+                                               cssp._enableTransforms(false);
+                                       }
+                                       data.autoRotate = cssp._target._gsTransform;
+                               }
+                               plugin._onInitTween(data.proxy, v, cssp._tween);
+                               return pt;
+                       }});
+               };
+
+               p._roundProps = function(lookup, value) {
+                       var op = this._overwriteProps,
+                               i = op.length;
+                       while (--i > -1) {
+                               if (lookup[op[i]] || lookup.bezier || lookup.bezierThrough) {
+                                       this._round[op[i]] = value;
+                               }
+                       }
+               };
+
+               p._kill = function(lookup) {
+                       var a = this._props,
+                               p, i;
+                       for (p in this._beziers) {
+                               if (p in lookup) {
+                                       delete this._beziers[p];
+                                       delete this._func[p];
+                                       i = a.length;
+                                       while (--i > -1) {
+                                               if (a[i] === p) {
+                                                       a.splice(i, 1);
+                                               }
+                                       }
+                               }
+                       }
+                       return this._super._kill.call(this, lookup);
+               };
+
+       }());
+
+
+
+
+
+
+       
+       
+       
+       
+       
+       
+       
+       
+/*
+ * ----------------------------------------------------------------
+ * CSSPlugin
+ * ----------------------------------------------------------------
+ */
+       window._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin","TweenLite"], function(TweenPlugin, TweenLite) {
+
+               /** @constructor **/
+               var CSSPlugin = function() {
+                               TweenPlugin.call(this, "css");
+                               this._overwriteProps.length = 0;
+                               this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method)
+                       },
+                       _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called.
+                       _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance
+                       _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter
+                       _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification.
+                       _specialProps = {},
+                       p = CSSPlugin.prototype = new TweenPlugin("css");
+
+               p.constructor = CSSPlugin;
+               CSSPlugin.version = "1.12.1";
+               CSSPlugin.API = 2;
+               CSSPlugin.defaultTransformPerspective = 0;
+               CSSPlugin.defaultSkewType = "compensated";
+               p = "px"; //we'll reuse the "p" variable to keep file size down
+               CSSPlugin.suffixMap = {top:p, right:p, bottom:p, left:p, width:p, height:p, fontSize:p, padding:p, margin:p, perspective:p, lineHeight:""};
+
+
+               var _numExp = /(?:\d|\-\d|\.\d|\-\.\d)+/g,
+                       _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,
+                       _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)"
+                       _NaNExp = /[^\d\-\.]/g,
+                       _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g,
+                       _opacityExp = /opacity *= *([^)]*)/i,
+                       _opacityValExp = /opacity:([^;]*)/i,
+                       _alphaFilterExp = /alpha\(opacity *=.+?\)/i,
+                       _rgbhslExp = /^(rgb|hsl)/,
+                       _capsExp = /([A-Z])/g,
+                       _camelExp = /-([a-z])/gi,
+                       _urlExp = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, //for pulling out urls from url(...) or url("...") strings (some browsers wrap urls in quotes, some don't when reporting things like backgroundImage)
+                       _camelFunc = function(s, g) { return g.toUpperCase(); },
+                       _horizExp = /(?:Left|Right|Width)/i,
+                       _ieGetMatrixExp = /(M11|M12|M21|M22)=[\d\-\.e]+/gi,
+                       _ieSetMatrixExp = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,
+                       _commasOutsideParenExp = /,(?=[^\)]*(?:\(|$))/gi, //finds any commas that are not within parenthesis
+                       _DEG2RAD = Math.PI / 180,
+                       _RAD2DEG = 180 / Math.PI,
+                       _forcePT = {},
+                       _doc = document,
+                       _tempDiv = _doc.createElement("div"),
+                       _tempImg = _doc.createElement("img"),
+                       _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins
+                       _agent = navigator.userAgent,
+                       _autoRound,
+                       _reqSafariFix, //we won't apply the Safari transform fix until we actually come across a tween that affects a transform property (to maintain best performance).
+
+                       _isSafari,
+                       _isFirefox, //Firefox has a bug that causes 3D transformed elements to randomly disappear unless a repaint is forced after each update on each element.
+                       _isSafariLT6, //Safari (and Android 4 which uses a flavor of Safari) has a bug that prevents changes to "top" and "left" properties from rendering properly if changed on the same frame as a transform UNLESS we set the element's WebkitBackfaceVisibility to hidden (weird, I know). Doing this for Android 3 and earlier seems to actually cause other problems, though (fun!)
+                       _ieVers,
+                       _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version.
+                               var i = _agent.indexOf("Android"),
+                                       d = _doc.createElement("div"), a;
+
+                               _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || Number(_agent.substr(i+8, 1)) > 3));
+                               _isSafariLT6 = (_isSafari && (Number(_agent.substr(_agent.indexOf("Version/")+8, 1)) < 6));
+                               _isFirefox = (_agent.indexOf("Firefox") !== -1);
+
+                               if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) {
+                                       _ieVers = parseFloat( RegExp.$1 );
+                               }
+
+                               d.innerHTML = "<a title='' style='top:1px;opacity:.55;'>a</a>";
+                               a = d.getElementsByTagName("a")[0];
+                               return a ? /^0.55/.test(a.style.opacity) : false;
+                       }()),
+                       _getIEOpacity = function(v) {
+                               return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1);
+                       },
+                       _log = function(s) {//for logging messages, but in a way that won't throw errors in old versions of IE.
+                               if (window.console) {
+                                       //console.log(s);
+                               }
+                       },
+                       _prefixCSS = "", //the non-camelCase vendor prefix like "-o-", "-moz-", "-ms-", or "-webkit-"
+                       _prefix = "", //camelCase vendor prefix like "O", "ms", "Webkit", or "Moz".
+
+                       // @private feed in a camelCase property name like "transform" and it will check to see if it is valid as-is or if it needs a vendor prefix. It returns the corrected camelCase property name (i.e. "WebkitTransform" or "MozTransform" or "transform" or null if no such property is found, like if the browser is IE8 or before, "transform" won't be found at all)
+                       _checkPropPrefix = function(p, e) {
+                               e = e || _tempDiv;
+                               var s = e.style,
+                                       a, i;
+                               if (s[p] !== undefined) {
+                                       return p;
+                               }
+                               p = p.charAt(0).toUpperCase() + p.substr(1);
+                               a = ["O","Moz","ms","Ms","Webkit"];
+                               i = 5;
+                               while (--i > -1 && s[a[i]+p] === undefined) { }
+                               if (i >= 0) {
+                                       _prefix = (i === 3) ? "ms" : a[i];
+                                       _prefixCSS = "-" + _prefix.toLowerCase() + "-";
+                                       return _prefix + p;
+                               }
+                               return null;
+                       },
+
+                       _getComputedStyle = _doc.defaultView ? _doc.defaultView.getComputedStyle : function() {},
+
+                       /**
+                        * @private Returns the css style for a particular property of an element. For example, to get whatever the current "left" css value for an element with an ID of "myElement", you could do:
+                        * var currentLeft = CSSPlugin.getStyle( document.getElementById("myElement"), "left");
+                        *
+                        * @param {!Object} t Target element whose style property you want to query
+                        * @param {!string} p Property name (like "left" or "top" or "marginTop", etc.)
+                        * @param {Object=} cs Computed style object. This just provides a way to speed processing if you're going to get several properties on the same element in quick succession - you can reuse the result of the getComputedStyle() call.
+                        * @param {boolean=} calc If true, the value will not be read directly from the element's "style" property (if it exists there), but instead the getComputedStyle() result will be used. This can be useful when you want to ensure that the browser itself is interpreting the value.
+                        * @param {string=} dflt Default value that should be returned in the place of null, "none", "auto" or "auto auto".
+                        * @return {?string} The current property value
+                        */
+                       _getStyle = CSSPlugin.getStyle = function(t, p, cs, calc, dflt) {
+                               var rv;
+                               if (!_supportsOpacity) if (p === "opacity") { //several versions of IE don't use the standard "opacity" property - they use things like filter:alpha(opacity=50), so we parse that here.
+                                       return _getIEOpacity(t);
+                               }
+                               if (!calc && t.style[p]) {
+                                       rv = t.style[p];
+                               } else if ((cs = cs || _getComputedStyle(t))) {
+                                       rv = cs[p] || cs.getPropertyValue(p) || cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase());
+                               } else if (t.currentStyle) {
+                                       rv = t.currentStyle[p];
+                               }
+                               return (dflt != null && (!rv || rv === "none" || rv === "auto" || rv === "auto auto")) ? dflt : rv;
+                       },
+
+                       /**
+                        * @private Pass the target element, the property name, the numeric value, and the suffix (like "%", "em", "px", etc.) and it will spit back the equivalent pixel number.
+                        * @param {!Object} t Target element
+                        * @param {!string} p Property name (like "left", "top", "marginLeft", etc.)
+                        * @param {!number} v Value
+                        * @param {string=} sfx Suffix (like "px" or "%" or "em")
+                        * @param {boolean=} recurse If true, the call is a recursive one. In some browsers (like IE7/8), occasionally the value isn't accurately reported initially, but if we run the function again it will take effect.
+                        * @return {number} value in pixels
+                        */
+                       _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) {
+                               if (sfx === "px" || !sfx) { return v; }
+                               if (sfx === "auto" || !v) { return 0; }
+                               var horiz = _horizExp.test(p),
+                                       node = t,
+                                       style = _tempDiv.style,
+                                       neg = (v < 0),
+                                       pix, cache, time;
+                               if (neg) {
+                                       v = -v;
+                               }
+                               if (sfx === "%" && p.indexOf("border") !== -1) {
+                                       pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight);
+                               } else {
+                                       style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;";
+                                       if (sfx === "%" || !node.appendChild) {
+                                               node = t.parentNode || _doc.body;
+                                               cache = node._gsCache;
+                                               time = TweenLite.ticker.frame;
+                                               if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick)
+                                                       return cache.width * v / 100;
+                                               }
+                                               style[(horiz ? "width" : "height")] = v + sfx;
+                                       } else {
+                                               style[(horiz ? "borderLeftWidth" : "borderTopWidth")] = v + sfx;
+                                       }
+                                       node.appendChild(_tempDiv);
+                                       pix = parseFloat(_tempDiv[(horiz ? "offsetWidth" : "offsetHeight")]);
+                                       node.removeChild(_tempDiv);
+                                       if (horiz && sfx === "%" && CSSPlugin.cacheWidths !== false) {
+                                               cache = node._gsCache = node._gsCache || {};
+                                               cache.time = time;
+                                               cache.width = pix / v * 100;
+                                       }
+                                       if (pix === 0 && !recurse) {
+                                               pix = _convertToPixels(t, p, v, sfx, true);
+                                       }
+                               }
+                               return neg ? -pix : pix;
+                       },
+                       _calculateOffset = _internals.calculateOffset = function(t, p, cs) { //for figuring out "top" or "left" in px when it's "auto". We need to factor in margin with the offsetLeft/offsetTop
+                               if (_getStyle(t, "position", cs) !== "absolute") { return 0; }
+                               var dim = ((p === "left") ? "Left" : "Top"),
+                                       v = _getStyle(t, "margin" + dim, cs);
+                               return t["offset" + dim] - (_convertToPixels(t, p, parseFloat(v), v.replace(_suffixExp, "")) || 0);
+                       },
+
+                       // @private returns at object containing ALL of the style properties in camelCase and their associated values.
+                       _getAllStyles = function(t, cs) {
+                               var s = {},
+                                       i, tr;
+                               if ((cs = cs || _getComputedStyle(t, null))) {
+                                       if ((i = cs.length)) {
+                                               while (--i > -1) {
+                                                       s[cs[i].replace(_camelExp, _camelFunc)] = cs.getPropertyValue(cs[i]);
+                                               }
+                                       } else { //Opera behaves differently - cs.length is always 0, so we must do a for...in loop.
+                                               for (i in cs) {
+                                                       s[i] = cs[i];
+                                               }
+                                       }
+                               } else if ((cs = t.currentStyle || t.style)) {
+                                       for (i in cs) {
+                                               if (typeof(i) === "string" && s[i] === undefined) {
+                                                       s[i.replace(_camelExp, _camelFunc)] = cs[i];
+                                               }
+                                       }
+                               }
+                               if (!_supportsOpacity) {
+                                       s.opacity = _getIEOpacity(t);
+                               }
+                               tr = _getTransform(t, cs, false);
+                               s.rotation = tr.rotation;
+                               s.skewX = tr.skewX;
+                               s.scaleX = tr.scaleX;
+                               s.scaleY = tr.scaleY;
+                               s.x = tr.x;
+                               s.y = tr.y;
+                               if (_supports3D) {
+                                       s.z = tr.z;
+                                       s.rotationX = tr.rotationX;
+                                       s.rotationY = tr.rotationY;
+                                       s.scaleZ = tr.scaleZ;
+                               }
+                               if (s.filters) {
+                                       delete s.filters;
+                               }
+                               return s;
+                       },
+
+                       // @private analyzes two style objects (as returned by _getAllStyles()) and only looks for differences between them that contain tweenable values (like a number or color). It returns an object with a "difs" property which refers to an object containing only those isolated properties and values for tweening, and a "firstMPT" property which refers to the first MiniPropTween instance in a linked list that recorded all the starting values of the different properties so that we can revert to them at the end or beginning of the tween - we don't want the cascading to get messed up. The forceLookup parameter is an optional generic object with properties that should be forced into the results - this is necessary for className tweens that are overwriting others because imagine a scenario where a rollover/rollout adds/removes a class and the user swipes the mouse over the target SUPER fast, thus nothing actually changed yet and the subsequent comparison of the properties would indicate they match (especially when px rounding is taken into consideration), thus no tweening is necessary even though it SHOULD tween and remove those properties after the tween (otherwise the inline styles will contaminate things). See the className SpecialProp code for details.
+                       _cssDif = function(t, s1, s2, vars, forceLookup) {
+                               var difs = {},
+                                       style = t.style,
+                                       val, p, mpt;
+                               for (p in s2) {
+                                       if (p !== "cssText") if (p !== "length") if (isNaN(p)) if (s1[p] !== (val = s2[p]) || (forceLookup && forceLookup[p])) if (p.indexOf("Origin") === -1) if (typeof(val) === "number" || typeof(val) === "string") {
+                                               difs[p] = (val === "auto" && (p === "left" || p === "top")) ? _calculateOffset(t, p) : ((val === "" || val === "auto" || val === "none") && typeof(s1[p]) === "string" && s1[p].replace(_NaNExp, "") !== "") ? 0 : val; //if the ending value is defaulting ("" or "auto"), we check the starting value and if it can be parsed into a number (a string which could have a suffix too, like 700px), then we swap in 0 for "" or "auto" so that things actually tween.
+                                               if (style[p] !== undefined) { //for className tweens, we must remember which properties already existed inline - the ones that didn't should be removed when the tween isn't in progress because they were only introduced to facilitate the transition between classes.
+                                                       mpt = new MiniPropTween(style, p, style[p], mpt);
+                                               }
+                                       }
+                               }
+                               if (vars) {
+                                       for (p in vars) { //copy properties (except className)
+                                               if (p !== "className") {
+                                                       difs[p] = vars[p];
+                                               }
+                                       }
+                               }
+                               return {difs:difs, firstMPT:mpt};
+                       },
+                       _dimensions = {width:["Left","Right"], height:["Top","Bottom"]},
+                       _margins = ["marginLeft","marginRight","marginTop","marginBottom"],
+
+                       /**
+                        * @private Gets the width or height of an element
+                        * @param {!Object} t Target element
+                        * @param {!string} p Property name ("width" or "height")
+                        * @param {Object=} cs Computed style object (if one exists). Just a speed optimization.
+                        * @return {number} Dimension (in pixels)
+                        */
+                       _getDimension = function(t, p, cs) {
+                               var v = parseFloat((p === "width") ? t.offsetWidth : t.offsetHeight),
+                                       a = _dimensions[p],
+                                       i = a.length;
+                               cs = cs || _getComputedStyle(t, null);
+                               while (--i > -1) {
+                                       v -= parseFloat( _getStyle(t, "padding" + a[i], cs, true) ) || 0;
+                                       v -= parseFloat( _getStyle(t, "border" + a[i] + "Width", cs, true) ) || 0;
+                               }
+                               return v;
+                       },
+
+                       // @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value)
+                       _parsePosition = function(v, recObj) {
+                               if (v == null || v === "" || v === "auto" || v === "auto auto") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto".
+                                       v = "0 0";
+                               }
+                               var a = v.split(" "),
+                                       x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0],
+                                       y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1];
+                               if (y == null) {
+                                       y = "0";
+                               } else if (y === "center") {
+                                       y = "50%";
+                               }
+                               if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it could be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative.
+                                       x = "50%";
+                               }
+                               if (recObj) {
+                                       recObj.oxp = (x.indexOf("%") !== -1);
+                                       recObj.oyp = (y.indexOf("%") !== -1);
+                                       recObj.oxr = (x.charAt(1) === "=");
+                                       recObj.oyr = (y.charAt(1) === "=");
+                                       recObj.ox = parseFloat(x.replace(_NaNExp, ""));
+                                       recObj.oy = parseFloat(y.replace(_NaNExp, ""));
+                               }
+                               return x + " " + y + ((a.length > 2) ? " " + a[2] : "");
+                       },
+
+                       /**
+                        * @private Takes an ending value (typically a string, but can be a number) and a starting value and returns the change between the two, looking for relative value indicators like += and -= and it also ignores suffixes (but make sure the ending value starts with a number or +=/-= and that the starting value is a NUMBER!)
+                        * @param {(number|string)} e End value which is typically a string, but could be a number
+                        * @param {(number|string)} b Beginning value which is typically a string but could be a number
+                        * @return {number} Amount of change between the beginning and ending values (relative values that have a "+=" or "-=" are recognized)
+                        */
+                       _parseChange = function(e, b) {
+                               return (typeof(e) === "string" && e.charAt(1) === "=") ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : parseFloat(e) - parseFloat(b);
+                       },
+
+                       /**
+                        * @private Takes a value and a default number, checks if the value is relative, null, or numeric and spits back a normalized number accordingly. Primarily used in the _parseTransform() function.
+                        * @param {Object} v Value to be parsed
+                        * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter)
+                        * @return {number} Parsed value
+                        */
+                       _parseVal = function(v, d) {
+                               return (v == null) ? d : (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) + d : parseFloat(v);
+                       },
+
+                       /**
+                        * @private Translates strings like "40deg" or "40" or 40rad" or "+=40deg" or "270_short" or "-90_cw" or "+=45_ccw" to a numeric radian angle. Of course a starting/default value must be fed in too so that relative values can be calculated properly.
+                        * @param {Object} v Value to be parsed
+                        * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter)
+                        * @param {string=} p property name for directionalEnd (optional - only used when the parsed value is directional ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation). Property name would be "rotation", "rotationX", or "rotationY"
+                        * @param {Object=} directionalEnd An object that will store the raw end values for directional angles ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation.
+                        * @return {number} parsed angle in radians
+                        */
+                       _parseAngle = function(v, d, p, directionalEnd) {
+                               var min = 0.000001,
+                                       cap, split, dif, result;
+                               if (v == null) {
+                                       result = d;
+                               } else if (typeof(v) === "number") {
+                                       result = v;
+                               } else {
+                                       cap = 360;
+                                       split = v.split("_");
+                                       dif = Number(split[0].replace(_NaNExp, "")) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - ((v.charAt(1) === "=") ? 0 : d);
+                                       if (split.length) {
+                                               if (directionalEnd) {
+                                                       directionalEnd[p] = d + dif;
+                                               }
+                                               if (v.indexOf("short") !== -1) {
+                                                       dif = dif % cap;
+                                                       if (dif !== dif % (cap / 2)) {
+                                                               dif = (dif < 0) ? dif + cap : dif - cap;
+                                                       }
+                                               }
+                                               if (v.indexOf("_cw") !== -1 && dif < 0) {
+                                                       dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
+                                               } else if (v.indexOf("ccw") !== -1 && dif > 0) {
+                                                       dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
+                                               }
+                                       }
+                                       result = d + dif;
+                               }
+                               if (result < min && result > -min) {
+                                       result = 0;
+                               }
+                               return result;
+                       },
+
+                       _colorLookup = {aqua:[0,255,255],
+                               lime:[0,255,0],
+                               silver:[192,192,192],
+                               black:[0,0,0],
+                               maroon:[128,0,0],
+                               teal:[0,128,128],
+                               blue:[0,0,255],
+                               navy:[0,0,128],
+                               white:[255,255,255],
+                               fuchsia:[255,0,255],
+                               olive:[128,128,0],
+                               yellow:[255,255,0],
+                               orange:[255,165,0],
+                               gray:[128,128,128],
+                               purple:[128,0,128],
+                               green:[0,128,0],
+                               red:[255,0,0],
+                               pink:[255,192,203],
+                               cyan:[0,255,255],
+                               transparent:[255,255,255,0]},
+
+                       _hue = function(h, m1, m2) {
+                               h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h;
+                               return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0;
+                       },
+
+                       /**
+                        * @private Parses a color (like #9F0, #FF9900, or rgb(255,51,153)) into an array with 3 elements for red, green, and blue. Also handles rgba() values (splits into array of 4 elements of course)
+                        * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc.
+                        * @return {Array.<number>} An array containing red, green, and blue (and optionally alpha) in that order.
+                        */
+                       _parseColor = function(v) {
+                               var c1, c2, c3, h, s, l;
+                               if (!v || v === "") {
+                                       return _colorLookup.black;
+                               }
+                               if (typeof(v) === "number") {
+                                       return [v >> 16, (v >> 8) & 255, v & 255];
+                               }
+                               if (v.charAt(v.length - 1) === ",") { //sometimes a trailing commma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.
+                                       v = v.substr(0, v.length - 1);
+                               }
+                               if (_colorLookup[v]) {
+                                       return _colorLookup[v];
+                               }
+                               if (v.charAt(0) === "#") {
+                                       if (v.length === 4) { //for shorthand like #9F0
+                                               c1 = v.charAt(1),
+                                               c2 = v.charAt(2),
+                                               c3 = v.charAt(3);
+                                               v = "#" + c1 + c1 + c2 + c2 + c3 + c3;
+                                       }
+                                       v = parseInt(v.substr(1), 16);
+                                       return [v >> 16, (v >> 8) & 255, v & 255];
+                               }
+                               if (v.substr(0, 3) === "hsl") {
+                                       v = v.match(_numExp);
+                                       h = (Number(v[0]) % 360) / 360;
+                                       s = Number(v[1]) / 100;
+                                       l = Number(v[2]) / 100;
+                                       c2 = (l <= 0.5) ? l * (s + 1) : l + s - l * s;
+                                       c1 = l * 2 - c2;
+                                       if (v.length > 3) {
+                                               v[3] = Number(v[3]);
+                                       }
+                                       v[0] = _hue(h + 1 / 3, c1, c2);
+                                       v[1] = _hue(h, c1, c2);
+                                       v[2] = _hue(h - 1 / 3, c1, c2);
+                                       return v;
+                               }
+                               v = v.match(_numExp) || _colorLookup.transparent;
+                               v[0] = Number(v[0]);
+                               v[1] = Number(v[1]);
+                               v[2] = Number(v[2]);
+                               if (v.length > 3) {
+                                       v[3] = Number(v[3]);
+                               }
+                               return v;
+                       },
+                       _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.
+
+               for (p in _colorLookup) {
+                       _colorExp += "|" + p + "\\b";
+               }
+               _colorExp = new RegExp(_colorExp+")", "gi");
+
+               /**
+                * @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned.
+                * @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned.
+                * @param {boolean=} clr If true, the values should be searched for color-related data. For example, boxShadow values typically contain a color whereas borderRadius don't.
+                * @param {boolean=} collapsible If true, the value is a top/left/right/bottom style one that acts like margin or padding, where if only one value is received, it's used for all 4; if 2 are received, the first is duplicated for 3rd (bottom) and the 2nd is duplicated for the 4th spot (left), etc.
+                * @return {Function} formatter function
+                */
+               var _getFormatter = function(dflt, clr, collapsible, multi) {
+                               if (dflt == null) {
+                                       return function(v) {return v;};
+                               }
+                               var dColor = clr ? (dflt.match(_colorExp) || [""])[0] : "",
+                                       dVals = dflt.split(dColor).join("").match(_valuesExp) || [],
+                                       pfx = dflt.substr(0, dflt.indexOf(dVals[0])),
+                                       sfx = (dflt.charAt(dflt.length - 1) === ")") ? ")" : "",
+                                       delim = (dflt.indexOf(" ") !== -1) ? " " : ",",
+                                       numVals = dVals.length,
+                                       dSfx = (numVals > 0) ? dVals[0].replace(_numExp, "") : "",
+                                       formatter;
+                               if (!numVals) {
+                                       return function(v) {return v;};
+                               }
+                               if (clr) {
+                                       formatter = function(v) {
+                                               var color, vals, i, a;
+                                               if (typeof(v) === "number") {
+                                                       v += dSfx;
+                                               } else if (multi && _commasOutsideParenExp.test(v)) {
+                                                       a = v.replace(_commasOutsideParenExp, "|").split("|");
+                                                       for (i = 0; i < a.length; i++) {
+                                                               a[i] = formatter(a[i]);
+                                                       }
+                                                       return a.join(",");
+                                               }
+                                               color = (v.match(_colorExp) || [dColor])[0];
+                                               vals = v.split(color).join("").match(_valuesExp) || [];
+                                               i = vals.length;
+                                               if (numVals > i--) {
+                                                       while (++i < numVals) {
+                                                               vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i];
+                                                       }
+                                               }
+                                               return pfx + vals.join(delim) + delim + color + sfx + (v.indexOf("inset") !== -1 ? " inset" : "");
+                                       };
+                                       return formatter;
+
+                               }
+                               formatter = function(v) {
+                                       var vals, a, i;
+                                       if (typeof(v) === "number") {
+                                               v += dSfx;
+                                       } else if (multi && _commasOutsideParenExp.test(v)) {
+                                               a = v.replace(_commasOutsideParenExp, "|").split("|");
+                                               for (i = 0; i < a.length; i++) {
+                                                       a[i] = formatter(a[i]);
+                                               }
+                                               return a.join(",");
+                                       }
+                                       vals = v.match(_valuesExp) || [];
+                                       i = vals.length;
+                                       if (numVals > i--) {
+                                               while (++i < numVals) {
+                                                       vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i];
+                                               }
+                                       }
+                                       return pfx + vals.join(delim) + sfx;
+                               };
+                               return formatter;
+                       },
+
+                       /**
+                        * @private returns a formatter function that's used for edge-related values like marginTop, marginLeft, paddingBottom, paddingRight, etc. Just pass a comma-delimited list of property names related to the edges.
+                        * @param {!string} props a comma-delimited list of property names in order from top to left, like "marginTop,marginRight,marginBottom,marginLeft"
+                        * @return {Function} a formatter function
+                        */
+                       _getEdgeParser = function(props) {
+                               props = props.split(",");
+                               return function(t, e, p, cssp, pt, plugin, vars) {
+                                       var a = (e + "").split(" "),
+                                               i;
+                                       vars = {};
+                                       for (i = 0; i < 4; i++) {
+                                               vars[props[i]] = a[i] = a[i] || a[(((i - 1) / 2) >> 0)];
+                                       }
+                                       return cssp.parse(t, vars, pt, plugin);
+                               };
+                       },
+
+                       // @private used when other plugins must tween values first, like BezierPlugin or ThrowPropsPlugin, etc. That plugin's setRatio() gets called first so that the values are updated, and then we loop through the MiniPropTweens  which handle copying the values into their appropriate slots so that they can then be applied correctly in the main CSSPlugin setRatio() method. Remember, we typically create a proxy object that has a bunch of uniquely-named properties that we feed to the sub-plugin and it does its magic normally, and then we must interpret those values and apply them to the css because often numbers must get combined/concatenated, suffixes added, etc. to work with css, like boxShadow could have 4 values plus a color.
+                       _setPluginRatio = _internals._setPluginRatio = function(v) {
+                               this.plugin.setRatio(v);
+                               var d = this.data,
+                                       proxy = d.proxy,
+                                       mpt = d.firstMPT,
+                                       min = 0.000001,
+                                       val, pt, i, str;
+                               while (mpt) {
+                                       val = proxy[mpt.v];
+                                       if (mpt.r) {
+                                               val = Math.round(val);
+                                       } else if (val < min && val > -min) {
+                                               val = 0;
+                                       }
+                                       mpt.t[mpt.p] = val;
+                                       mpt = mpt._next;
+                               }
+                               if (d.autoRotate) {
+                                       d.autoRotate.rotation = proxy.rotation;
+                               }
+                               //at the end, we must set the CSSPropTween's "e" (end) value dynamically here because that's what is used in the final setRatio() method.
+                               if (v === 1) {
+                                       mpt = d.firstMPT;
+                                       while (mpt) {
+                                               pt = mpt.t;
+                                               if (!pt.type) {
+                                                       pt.e = pt.s + pt.xs0;
+                                               } else if (pt.type === 1) {
+                                                       str = pt.xs0 + pt.s + pt.xs1;
+                                                       for (i = 1; i < pt.l; i++) {
+                                                               str += pt["xn"+i] + pt["xs"+(i+1)];
+                                                       }
+                                                       pt.e = str;
+                                               }
+                                               mpt = mpt._next;
+                                       }
+                               }
+                       },
+
+                       /**
+                        * @private @constructor Used by a few SpecialProps to hold important values for proxies. For example, _parseToProxy() creates a MiniPropTween instance for each property that must get tweened on the proxy, and we record the original property name as well as the unique one we create for the proxy, plus whether or not the value needs to be rounded plus the original value.
+                        * @param {!Object} t target object whose property we're tweening (often a CSSPropTween)
+                        * @param {!string} p property name
+                        * @param {(number|string|object)} v value
+                        * @param {MiniPropTween=} next next MiniPropTween in the linked list
+                        * @param {boolean=} r if true, the tweened value should be rounded to the nearest integer
+                        */
+                       MiniPropTween = function(t, p, v, next, r) {
+                               this.t = t;
+                               this.p = p;
+                               this.v = v;
+                               this.r = r;
+                               if (next) {
+                                       next._prev = this;
+                                       this._next = next;
+                               }
+                       },
+
+                       /**
+                        * @private Most other plugins (like BezierPlugin and ThrowPropsPlugin and others) can only tween numeric values, but CSSPlugin must accommodate special values that have a bunch of extra data (like a suffix or strings between numeric values, etc.). For example, boxShadow has values like "10px 10px 20px 30px rgb(255,0,0)" which would utterly confuse other plugins. This method allows us to split that data apart and grab only the numeric data and attach it to uniquely-named properties of a generic proxy object ({}) so that we can feed that to virtually any plugin to have the numbers tweened. However, we must also keep track of which properties from the proxy go with which CSSPropTween values and instances. So we create a linked list of MiniPropTweens. Each one records a target (the original CSSPropTween), property (like "s" or "xn1" or "xn2") that we're tweening and the unique property name that was used for the proxy (like "boxShadow_xn1" and "boxShadow_xn2") and whether or not they need to be rounded. That way, in the _setPluginRatio() method we can simply copy the values over from the proxy to the CSSPropTween instance(s). Then, when the main CSSPlugin setRatio() method runs and applies the CSSPropTween values accordingly, they're updated nicely. So the external plugin tweens the numbers, _setPluginRatio() copies them over, and setRatio() acts normally, applying css-specific values to the element.
+                        * This method returns an object that has the following properties:
+                        *  - proxy: a generic object containing the starting values for all the properties that will be tweened by the external plugin.  This is what we feed to the external _onInitTween() as the target
+                        *  - end: a generic object containing the ending values for all the properties that will be tweened by the external plugin. This is what we feed to the external plugin's _onInitTween() as the destination values
+                        *  - firstMPT: the first MiniPropTween in the linked list
+                        *  - pt: the first CSSPropTween in the linked list that was created when parsing. If shallow is true, this linked list will NOT attach to the one passed into the _parseToProxy() as the "pt" (4th) parameter.
+                        * @param {!Object} t target object to be tweened
+                        * @param {!(Object|string)} vars the object containing the information about the tweening values (typically the end/destination values) that should be parsed
+                        * @param {!CSSPlugin} cssp The CSSPlugin instance
+                        * @param {CSSPropTween=} pt the next CSSPropTween in the linked list
+                        * @param {TweenPlugin=} plugin the external TweenPlugin instance that will be handling tweening the numeric values
+                        * @param {boolean=} shallow if true, the resulting linked list from the parse will NOT be attached to the CSSPropTween that was passed in as the "pt" (4th) parameter.
+                        * @return An object containing the following properties: proxy, end, firstMPT, and pt (see above for descriptions)
+                        */
+                       _parseToProxy = _internals._parseToProxy = function(t, vars, cssp, pt, plugin, shallow) {
+                               var bpt = pt,
+                                       start = {},
+                                       end = {},
+                                       transform = cssp._transform,
+                                       oldForce = _forcePT,
+                                       i, p, xp, mpt, firstPT;
+                               cssp._transform = null;
+                               _forcePT = vars;
+                               pt = firstPT = cssp.parse(t, vars, pt, plugin);
+                               _forcePT = oldForce;
+                               //break off from the linked list so the new ones are isolated.
+                               if (shallow) {
+                                       cssp._transform = transform;
+                                       if (bpt) {
+                                               bpt._prev = null;
+                                               if (bpt._prev) {
+                                                       bpt._prev._next = null;
+                                               }
+                                       }
+                               }
+                               while (pt && pt !== bpt) {
+                                       if (pt.type <= 1) {
+                                               p = pt.p;
+                                               end[p] = pt.s + pt.c;
+                                               start[p] = pt.s;
+                                               if (!shallow) {
+                                                       mpt = new MiniPropTween(pt, "s", p, mpt, pt.r);
+                                                       pt.c = 0;
+                                               }
+                                               if (pt.type === 1) {
+                                                       i = pt.l;
+                                                       while (--i > 0) {
+                                                               xp = "xn" + i;
+                                                               p = pt.p + "_" + xp;
+                                                               end[p] = pt.data[xp];
+                                                               start[p] = pt[xp];
+                                                               if (!shallow) {
+                                                                       mpt = new MiniPropTween(pt, xp, p, mpt, pt.rxp[xp]);
+                                                               }
+                                                       }
+                                               }
+                                       }
+                                       pt = pt._next;
+                               }
+                               return {proxy:start, end:end, firstMPT:mpt, pt:firstPT};
+                       },
+
+
+
+                       /**
+                        * @constructor Each property that is tweened has at least one CSSPropTween associated with it. These instances store important information like the target, property, starting value, amount of change, etc. They can also optionally have a number of "extra" strings and numeric values named xs1, xn1, xs2, xn2, xs3, xn3, etc. where "s" indicates string and "n" indicates number. These can be pieced together in a complex-value tween (type:1) that has alternating types of data like a string, number, string, number, etc. For example, boxShadow could be "5px 5px 8px rgb(102, 102, 51)". In that value, there are 6 numbers that may need to tween and then pieced back together into a string again with spaces, suffixes, etc. xs0 is special in that it stores the suffix for standard (type:0) tweens, -OR- the first string (prefix) in a complex-value (type:1) CSSPropTween -OR- it can be the non-tweening value in a type:-1 CSSPropTween. We do this to conserve memory.
+                        * CSSPropTweens have the following optional properties as well (not defined through the constructor):
+                        *  - l: Length in terms of the number of extra properties that the CSSPropTween has (default: 0). For example, for a boxShadow we may need to tween 5 numbers in which case l would be 5; Keep in mind that the start/end values for the first number that's tweened are always stored in the s and c properties to conserve memory. All additional values thereafter are stored in xn1, xn2, etc.
+                        *  - xfirst: The first instance of any sub-CSSPropTweens that are tweening properties of this instance. For example, we may split up a boxShadow tween so that there's a main CSSPropTween of type:1 that has various xs* and xn* values associated with the h-shadow, v-shadow, blur, color, etc. Then we spawn a CSSPropTween for each of those that has a higher priority and runs BEFORE the main CSSPropTween so that the values are all set by the time it needs to re-assemble them. The xfirst gives us an easy way to identify the first one in that chain which typically ends at the main one (because they're all prepende to the linked list)
+                        *  - plugin: The TweenPlugin instance that will handle the tweening of any complex values. For example, sometimes we don't want to use normal subtweens (like xfirst refers to) to tween the values - we might want ThrowPropsPlugin or BezierPlugin some other plugin to do the actual tweening, so we create a plugin instance and store a reference here. We need this reference so that if we get a request to round values or disable a tween, we can pass along that request.
+                        *  - data: Arbitrary data that needs to be stored with the CSSPropTween. Typically if we're going to have a plugin handle the tweening of a complex-value tween, we create a generic object that stores the END values that we're tweening to and the CSSPropTween's xs1, xs2, etc. have the starting values. We store that object as data. That way, we can simply pass that object to the plugin and use the CSSPropTween as the target.
+                        *  - setRatio: Only used for type:2 tweens that require custom functionality. In this case, we call the CSSPropTween's setRatio() method and pass the ratio each time the tween updates. This isn't quite as efficient as doing things directly in the CSSPlugin's setRatio() method, but it's very convenient and flexible.
+                        * @param {!Object} t Target object whose property will be tweened. Often a DOM element, but not always. It could be anything.
+                        * @param {string} p Property to tween (name). For example, to tween element.width, p would be "width".
+                        * @param {number} s Starting numeric value
+                        * @param {number} c Change in numeric value over the course of the entire tween. For example, if element.width starts at 5 and should end at 100, c would be 95.
+                        * @param {CSSPropTween=} next The next CSSPropTween in the linked list. If one is defined, we will define its _prev as the new instance, and the new instance's _next will be pointed at it.
+                        * @param {number=} type The type of CSSPropTween where -1 = a non-tweening value, 0 = a standard simple tween, 1 = a complex value (like one that has multiple numbers in a comma- or space-delimited string like border:"1px solid red"), and 2 = one that uses a custom setRatio function that does all of the work of applying the values on each update.
+                        * @param {string=} n Name of the property that should be used for overwriting purposes which is typically the same as p but not always. For example, we may need to create a subtween for the 2nd part of a "clip:rect(...)" tween in which case "p" might be xs1 but "n" is still "clip"
+                        * @param {boolean=} r If true, the value(s) should be rounded
+                        * @param {number=} pr Priority in the linked list order. Higher priority CSSPropTweens will be updated before lower priority ones. The default priority is 0.
+                        * @param {string=} b Beginning value. We store this to ensure that it is EXACTLY what it was when the tween began without any risk of interpretation issues.
+                        * @param {string=} e Ending value. We store this to ensure that it is EXACTLY what the user defined at the end of the tween without any risk of interpretation issues.
+                        */
+                       CSSPropTween = _internals.CSSPropTween = function(t, p, s, c, next, type, n, r, pr, b, e) {
+                               this.t = t; //target
+                               this.p = p; //property
+                               this.s = s; //starting value
+                               this.c = c; //change value
+                               this.n = n || p; //name that this CSSPropTween should be associated to (usually the same as p, but not always - n is what overwriting looks at)
+                               if (!(t instanceof CSSPropTween)) {
+                                       _overwriteProps.push(this.n);
+                               }
+                               this.r = r; //round (boolean)
+                               this.type = type || 0; //0 = normal tween, -1 = non-tweening (in which case xs0 will be applied to the target's property, like tp.t[tp.p] = tp.xs0), 1 = complex-value SpecialProp, 2 = custom setRatio() that does all the work
+                               if (pr) {
+                                       this.pr = pr;
+                                       _hasPriority = true;
+                               }
+                               this.b = (b === undefined) ? s : b;
+                               this.e = (e === undefined) ? s + c : e;
+                               if (next) {
+                                       this._next = next;
+                                       next._prev = this;
+                               }
+                       },
+
+                       /**
+                        * Takes a target, the beginning value and ending value (as strings) and parses them into a CSSPropTween (possibly with child CSSPropTweens) that accommodates multiple numbers, colors, comma-delimited values, etc. For example:
+                        * sp.parseComplex(element, "boxShadow", "5px 10px 20px rgb(255,102,51)", "0px 0px 0px red", true, "0px 0px 0px rgb(0,0,0,0)", pt);
+                        * It will walk through the beginning and ending values (which should be in the same format with the same number and type of values) and figure out which parts are numbers, what strings separate the numeric/tweenable values, and then create the CSSPropTweens accordingly. If a plugin is defined, no child CSSPropTweens will be created. Instead, the ending values will be stored in the "data" property of the returned CSSPropTween like: {s:-5, xn1:-10, xn2:-20, xn3:255, xn4:0, xn5:0} so that it can be fed to any other plugin and it'll be plain numeric tweens but the recomposition of the complex value will be handled inside CSSPlugin's setRatio().
+                        * If a setRatio is defined, the type of the CSSPropTween will be set to 2 and recomposition of the values will be the responsibility of that method.
+                        *
+                        * @param {!Object} t Target whose property will be tweened
+                        * @param {!string} p Property that will be tweened (its name, like "left" or "backgroundColor" or "boxShadow")
+                        * @param {string} b Beginning value
+                        * @param {string} e Ending value
+                        * @param {boolean} clrs If true, the value could contain a color value like "rgb(255,0,0)" or "#F00" or "red". The default is false, so no colors will be recognized (a performance optimization)
+                        * @param {(string|number|Object)} dflt The default beginning value that should be used if no valid beginning value is defined or if the number of values inside the complex beginning and ending values don't match
+                        * @param {?CSSPropTween} pt CSSPropTween instance that is the current head of the linked list (we'll prepend to this).
+                        * @param {number=} pr Priority in the linked list order. Higher priority properties will be updated before lower priority ones. The default priority is 0.
+                        * @param {TweenPlugin=} plugin If a plugin should handle the tweening of extra properties, pass the plugin instance here. If one is defined, then NO subtweens will be created for any extra properties (the properties will be created - just not additional CSSPropTween instances to tween them) because the plugin is expected to do so. However, the end values WILL be populated in the "data" property, like {s:100, xn1:50, xn2:300}
+                        * @param {function(number)=} setRatio If values should be set in a custom function instead of being pieced together in a type:1 (complex-value) CSSPropTween, define that custom function here.
+                        * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parseComplex() call.
+                        */
+                       _parseComplex = CSSPlugin.parseComplex = function(t, p, b, e, clrs, dflt, pt, pr, plugin, setRatio) {
+                               //DEBUG: _log("parseComplex: "+p+", b: "+b+", e: "+e);
+                               b = b || dflt || "";
+                               pt = new CSSPropTween(t, p, 0, 0, pt, (setRatio ? 2 : 1), null, false, pr, b, e);
+                               e += ""; //ensures it's a string
+                               var ba = b.split(", ").join(",").split(" "), //beginning array
+                                       ea = e.split(", ").join(",").split(" "), //ending array
+                                       l = ba.length,
+                                       autoRound = (_autoRound !== false),
+                                       i, xi, ni, bv, ev, bnums, enums, bn, rgba, temp, cv, str;
+                               if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) {
+                                       ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" ");
+                                       ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" ");
+                                       l = ba.length;
+                               }
+                               if (l !== ea.length) {
+                                       //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")");
+                                       ba = (dflt || "").split(" ");
+                                       l = ba.length;
+                               }
+                               pt.plugin = plugin;
+                               pt.setRatio = setRatio;
+                               for (i = 0; i < l; i++) {
+                                       bv = ba[i];
+                                       ev = ea[i];
+                                       bn = parseFloat(bv);
+
+                                       //if the value begins with a number (most common). It's fine if it has a suffix like px
+                                       if (bn || bn === 0) {
+                                               pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1), true);
+
+                                       //if the value is a color
+                                       } else if (clrs && (bv.charAt(0) === "#" || _colorLookup[bv] || _rgbhslExp.test(bv))) {
+                                               str = ev.charAt(ev.length - 1) === "," ? ")," : ")"; //if there's a comma at the end, retain it.
+                                               bv = _parseColor(bv);
+                                               ev = _parseColor(ev);
+                                               rgba = (bv.length + ev.length > 6);
+                                               if (rgba && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color
+                                                       pt["xs" + pt.l] += pt.l ? " transparent" : "transparent";
+                                                       pt.e = pt.e.split(ea[i]).join("transparent");
+                                               } else {
+                                                       if (!_supportsOpacity) { //old versions of IE don't support rgba().
+                                                               rgba = false;
+                                                       }
+                                                       pt.appendXtra((rgba ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true)
+                                                               .appendXtra("", bv[1], ev[1] - bv[1], ",", true)
+                                                               .appendXtra("", bv[2], ev[2] - bv[2], (rgba ? "," : str), true);
+                                                       if (rgba) {
+                                                               bv = (bv.length < 4) ? 1 : bv[3];
+                                                               pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false);
+                                                       }
+                                               }
+
+                                       } else {
+                                               bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array
+
+                                               //if no number is found, treat it as a non-tweening value and just append the string to the current xs.
+                                               if (!bnums) {
+                                                       pt["xs" + pt.l] += pt.l ? " " + bv : bv;
+
+                                               //loop through all the numbers that are found and construct the extra values on the pt.
+                                               } else {
+                                                       enums = ev.match(_relNumExp); //get each group of numbers in the end value string and drop them into an array. We allow relative values too, like +=50 or -=.5
+                                                       if (!enums || enums.length !== bnums.length) {
+                                                               //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")");
+                                                               return pt;
+                                                       }
+                                                       ni = 0;
+                                                       for (xi = 0; xi < bnums.length; xi++) {
+                                                               cv = bnums[xi];
+                                                               temp = bv.indexOf(cv, ni);
+                                                               pt.appendXtra(bv.substr(ni, temp - ni), Number(cv), _parseChange(enums[xi], cv), "", (autoRound && bv.substr(temp + cv.length, 2) === "px"), (xi === 0));
+                                                               ni = temp + cv.length;
+                                                       }
+                                                       pt["xs" + pt.l] += bv.substr(ni);
+                                               }
+                                       }
+                               }
+                               //if there are relative values ("+=" or "-=" prefix), we need to adjust the ending value to eliminate the prefixes and combine the values properly.
+                               if (e.indexOf("=") !== -1) if (pt.data) {
+                                       str = pt.xs0 + pt.data.s;
+                                       for (i = 1; i < pt.l; i++) {
+                                               str += pt["xs" + i] + pt.data["xn" + i];
+                                       }
+                                       pt.e = str + pt["xs" + i];
+                               }
+                               if (!pt.l) {
+                                       pt.type = -1;
+                                       pt.xs0 = pt.e;
+                               }
+                               return pt.xfirst || pt;
+                       },
+                       i = 9;
+
+
+               p = CSSPropTween.prototype;
+               p.l = p.pr = 0; //length (number of extra properties like xn1, xn2, xn3, etc.
+               while (--i > 0) {
+                       p["xn" + i] = 0;
+                       p["xs" + i] = "";
+               }
+               p.xs0 = "";
+               p._next = p._prev = p.xfirst = p.data = p.plugin = p.setRatio = p.rxp = null;
+
+
+               /**
+                * Appends and extra tweening value to a CSSPropTween and automatically manages any prefix and suffix strings. The first extra value is stored in the s and c of the main CSSPropTween instance, but thereafter any extras are stored in the xn1, xn2, xn3, etc. The prefixes and suffixes are stored in the xs0, xs1, xs2, etc. properties. For example, if I walk through a clip value like "rect(10px, 5px, 0px, 20px)", the values would be stored like this:
+                * xs0:"rect(", s:10, xs1:"px, ", xn1:5, xs2:"px, ", xn2:0, xs3:"px, ", xn3:20, xn4:"px)"
+                * And they'd all get joined together when the CSSPlugin renders (in the setRatio() method).
+                * @param {string=} pfx Prefix (if any)
+                * @param {!number} s Starting value
+                * @param {!number} c Change in numeric value over the course of the entire tween. For example, if the start is 5 and the end is 100, the change would be 95.
+                * @param {string=} sfx Suffix (if any)
+                * @param {boolean=} r Round (if true).
+                * @param {boolean=} pad If true, this extra value should be separated by the previous one by a space. If there is no previous extra and pad is true, it will automatically drop the space.
+                * @return {CSSPropTween} returns itself so that multiple methods can be chained together.
+                */
+               p.appendXtra = function(pfx, s, c, sfx, r, pad) {
+                       var pt = this,
+                               l = pt.l;
+                       pt["xs" + l] += (pad && l) ? " " + pfx : pfx || "";
+                       if (!c) if (l !== 0 && !pt.plugin) { //typically we'll combine non-changing values right into the xs to optimize performance, but we don't combine them when there's a plugin that will be tweening the values because it may depend on the values being split apart, like for a bezier, if a value doesn't change between the first and second iteration but then it does on the 3rd, we'll run into trouble because there's no xn slot for that value!
+                               pt["xs" + l] += s + (sfx || "");
+                               return pt;
+                       }
+                       pt.l++;
+                       pt.type = pt.setRatio ? 2 : 1;
+                       pt["xs" + pt.l] = sfx || "";
+                       if (l > 0) {
+                               pt.data["xn" + l] = s + c;
+                               pt.rxp["xn" + l] = r; //round extra property (we need to tap into this in the _parseToProxy() method)
+                               pt["xn" + l] = s;
+                               if (!pt.plugin) {
+                                       pt.xfirst = new CSSPropTween(pt, "xn" + l, s, c, pt.xfirst || pt, 0, pt.n, r, pt.pr);
+                                       pt.xfirst.xs0 = 0; //just to ensure that the property stays numeric which helps modern browsers speed up processing. Remember, in the setRatio() method, we do pt.t[pt.p] = val + pt.xs0 so if pt.xs0 is "" (the default), it'll cast the end value as a string. When a property is a number sometimes and a string sometimes, it prevents the compiler from locking in the data type, slowing things down slightly.
+                               }
+                               return pt;
+                       }
+                       pt.data = {s:s + c};
+                       pt.rxp = {};
+                       pt.s = s;
+                       pt.c = c;
+                       pt.r = r;
+                       return pt;
+               };
+
+               /**
+                * @constructor A SpecialProp is basically a css property that needs to be treated in a non-standard way, like if it may contain a complex value like boxShadow:"5px 10px 15px rgb(255, 102, 51)" or if it is associated with another plugin like ThrowPropsPlugin or BezierPlugin. Every SpecialProp is associated with a particular property name like "boxShadow" or "throwProps" or "bezier" and it will intercept those values in the vars object that's passed to the CSSPlugin and handle them accordingly.
+                * @param {!string} p Property name (like "boxShadow" or "throwProps")
+                * @param {Object=} options An object containing any of the following configuration options:
+                *                      - defaultValue: the default value
+                *                      - parser: A function that should be called when the associated property name is found in the vars. This function should return a CSSPropTween instance and it should ensure that it is properly inserted into the linked list. It will receive 4 paramters: 1) The target, 2) The value defined in the vars, 3) The CSSPlugin instance (whose _firstPT should be used for the linked list), and 4) A computed style object if one was calculated (this is a speed optimization that allows retrieval of starting values quicker)
+                *                      - formatter: a function that formats any value received for this special property (for example, boxShadow could take "5px 5px red" and format it to "5px 5px 0px 0px red" so that both the beginning and ending values have a common order and quantity of values.)
+                *                      - prefix: if true, we'll determine whether or not this property requires a vendor prefix (like Webkit or Moz or ms or O)
+                *                      - color: set this to true if the value for this SpecialProp may contain color-related values like rgb(), rgba(), etc.
+                *                      - priority: priority in the linked list order. Higher priority SpecialProps will be updated before lower priority ones. The default priority is 0.
+                *                      - multi: if true, the formatter should accommodate a comma-delimited list of values, like boxShadow could have multiple boxShadows listed out.
+                *                      - collapsible: if true, the formatter should treat the value like it's a top/right/bottom/left value that could be collapsed, like "5px" would apply to all, "5px, 10px" would use 5px for top/bottom and 10px for right/left, etc.
+                *                      - keyword: a special keyword that can [optionally] be found inside the value (like "inset" for boxShadow). This allows us to validate beginning/ending values to make sure they match (if the keyword is found in one, it'll be added to the other for consistency by default).
+                */
+               var SpecialProp = function(p, options) {
+                               options = options || {};
+                               this.p = options.prefix ? _checkPropPrefix(p) || p : p;
+                               _specialProps[p] = _specialProps[this.p] = this;
+                               this.format = options.formatter || _getFormatter(options.defaultValue, options.color, options.collapsible, options.multi);
+                               if (options.parser) {
+                                       this.parse = options.parser;
+                               }
+                               this.clrs = options.color;
+                               this.multi = options.multi;
+                               this.keyword = options.keyword;
+                               this.dflt = options.defaultValue;
+                               this.pr = options.priority || 0;
+                       },
+
+                       //shortcut for creating a new SpecialProp that can accept multiple properties as a comma-delimited list (helps minification). dflt can be an array for multiple values (we don't do a comma-delimited list because the default value may contain commas, like rect(0px,0px,0px,0px)). We attach this method to the SpecialProp class/object instead of using a private _createSpecialProp() method so that we can tap into it externally if necessary, like from another plugin.
+                       _registerComplexSpecialProp = _internals._registerComplexSpecialProp = function(p, options, defaults) {
+                               if (typeof(options) !== "object") {
+                                       options = {parser:defaults}; //to make backwards compatible with older versions of BezierPlugin and ThrowPropsPlugin
+                               }
+                               var a = p.split(","),
+                                       d = options.defaultValue,
+                                       i, temp;
+                               defaults = defaults || [d];
+                               for (i = 0; i < a.length; i++) {
+                                       options.prefix = (i === 0 && options.prefix);
+                                       options.defaultValue = defaults[i] || d;
+                                       temp = new SpecialProp(a[i], options);
+                               }
+                       },
+
+                       //creates a placeholder special prop for a plugin so that the property gets caught the first time a tween of it is attempted, and at that time it makes the plugin register itself, thus taking over for all future tweens of that property. This allows us to not mandate that things load in a particular order and it also allows us to log() an error that informs the user when they attempt to tween an external plugin-related property without loading its .js file.
+                       _registerPluginProp = function(p) {
+                               if (!_specialProps[p]) {
+                                       var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin";
+                                       _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) {
+                                               var pluginClass = (window.GreenSockGlobals || window).com.greensock.plugins[pluginName];
+                                               if (!pluginClass) {
+                                                       _log("Error: " + pluginName + " js file not loaded.");
+                                                       return pt;
+                                               }
+                                               pluginClass._cssRegister();
+                                               return _specialProps[p].parse(t, e, p, cssp, pt, plugin, vars);
+                                       }});
+                               }
+                       };
+
+
+               p = SpecialProp.prototype;
+
+               /**
+                * Alias for _parseComplex() that automatically plugs in certain values for this SpecialProp, like its property name, whether or not colors should be sensed, the default value, and priority. It also looks for any keyword that the SpecialProp defines (like "inset" for boxShadow) and ensures that the beginning and ending values have the same number of values for SpecialProps where multi is true (like boxShadow and textShadow can have a comma-delimited list)
+                * @param {!Object} t target element
+                * @param {(string|number|object)} b beginning value
+                * @param {(string|number|object)} e ending (destination) value
+                * @param {CSSPropTween=} pt next CSSPropTween in the linked list
+                * @param {TweenPlugin=} plugin If another plugin will be tweening the complex value, that TweenPlugin instance goes here.
+                * @param {function=} setRatio If a custom setRatio() method should be used to handle this complex value, that goes here.
+                * @return {CSSPropTween=} First CSSPropTween in the linked list
+                */
+               p.parseComplex = function(t, b, e, pt, plugin, setRatio) {
+                       var kwd = this.keyword,
+                               i, ba, ea, l, bi, ei;
+                       //if this SpecialProp's value can contain a comma-delimited list of values (like boxShadow or textShadow), we must parse them in a special way, and look for a keyword (like "inset" for boxShadow) and ensure that the beginning and ending BOTH have it if the end defines it as such. We also must ensure that there are an equal number of values specified (we can't tween 1 boxShadow to 3 for example)
+                       if (this.multi) if (_commasOutsideParenExp.test(e) || _commasOutsideParenExp.test(b)) {
+                               ba = b.replace(_commasOutsideParenExp, "|").split("|");
+                               ea = e.replace(_commasOutsideParenExp, "|").split("|");
+                       } else if (kwd) {
+                               ba = [b];
+                               ea = [e];
+                       }
+                       if (ea) {
+                               l = (ea.length > ba.length) ? ea.length : ba.length;
+                               for (i = 0; i < l; i++) {
+                                       b = ba[i] = ba[i] || this.dflt;
+                                       e = ea[i] = ea[i] || this.dflt;
+                                       if (kwd) {
+                                               bi = b.indexOf(kwd);
+                                               ei = e.indexOf(kwd);
+                                               if (bi !== ei) {
+                                                       e = (ei === -1) ? ea : ba;
+                                                       e[i] += " " + kwd;
+                                               }
+                                       }
+                               }
+                               b = ba.join(", ");
+                               e = ea.join(", ");
+                       }
+                       return _parseComplex(t, this.p, b, e, this.clrs, this.dflt, pt, this.pr, plugin, setRatio);
+               };
+
+               /**
+                * Accepts a target and end value and spits back a CSSPropTween that has been inserted into the CSSPlugin's linked list and conforms with all the conventions we use internally, like type:-1, 0, 1, or 2, setting up any extra property tweens, priority, etc. For example, if we have a boxShadow SpecialProp and call:
+                * this._firstPT = sp.parse(element, "5px 10px 20px rgb(2550,102,51)", "boxShadow", this);
+                * It should figure out the starting value of the element's boxShadow, compare it to the provided end value and create all the necessary CSSPropTweens of the appropriate types to tween the boxShadow. The CSSPropTween that gets spit back should already be inserted into the linked list (the 4th parameter is the current head, so prepend to that).
+                * @param {!Object} t Target object whose property is being tweened
+                * @param {Object} e End value as provided in the vars object (typically a string, but not always - like a throwProps would be an object).
+                * @param {!string} p Property name
+                * @param {!CSSPlugin} cssp The CSSPlugin instance that should be associated with this tween.
+                * @param {?CSSPropTween} pt The CSSPropTween that is the current head of the linked list (we'll prepend to it)
+                * @param {TweenPlugin=} plugin If a plugin will be used to tween the parsed value, this is the plugin instance.
+                * @param {Object=} vars Original vars object that contains the data for parsing.
+                * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parse() call.
+                */
+               p.parse = function(t, e, p, cssp, pt, plugin, vars) {
+                       return this.parseComplex(t.style, this.format(_getStyle(t, this.p, _cs, false, this.dflt)), this.format(e), pt, plugin);
+               };
+
+               /**
+                * Registers a special property that should be intercepted from any "css" objects defined in tweens. This allows you to handle them however you want without CSSPlugin doing it for you. The 2nd parameter should be a function that accepts 3 parameters:
+                *  1) Target object whose property should be tweened (typically a DOM element)
+                *  2) The end/destination value (could be a string, number, object, or whatever you want)
+                *  3) The tween instance (you probably don't need to worry about this, but it can be useful for looking up information like the duration)
+                *
+                * Then, your function should return a function which will be called each time the tween gets rendered, passing a numeric "ratio" parameter to your function that indicates the change factor (usually between 0 and 1). For example:
+                *
+                * CSSPlugin.registerSpecialProp("myCustomProp", function(target, value, tween) {
+                *      var start = target.style.width;
+                *      return function(ratio) {
+                *              target.style.width = (start + value * ratio) + "px";
+                *              console.log("set width to " + target.style.width);
+                *          }
+                * }, 0);
+                *
+                * Then, when I do this tween, it will trigger my special property:
+                *
+                * TweenLite.to(element, 1, {css:{myCustomProp:100}});
+                *
+                * In the example, of course, we're just changing the width, but you can do anything you want.
+                *
+                * @param {!string} name Property name (or comma-delimited list of property names) that should be intercepted and handled by your function. For example, if I define "myCustomProp", then it would handle that portion of the following tween: TweenLite.to(element, 1, {css:{myCustomProp:100}})
+                * @param {!function(Object, Object, Object, string):function(number)} onInitTween The function that will be called when a tween of this special property is performed. The function will receive 4 parameters: 1) Target object that should be tweened, 2) Value that was passed to the tween, 3) The tween instance itself (rarely used), and 4) The property name that's being tweened. Your function should return a function that should be called on every update of the tween. That function will receive a single parameter that is a "change factor" value (typically between 0 and 1) indicating the amount of change as a ratio. You can use this to determine how to set the values appropriately in your function.
+                * @param {number=} priority Priority that helps the engine determine the order in which to set the properties (default: 0). Higher priority properties will be updated before lower priority ones.
+                */
+               CSSPlugin.registerSpecialProp = function(name, onInitTween, priority) {
+                       _registerComplexSpecialProp(name, {parser:function(t, e, p, cssp, pt, plugin, vars) {
+                               var rv = new CSSPropTween(t, p, 0, 0, pt, 2, p, false, priority);
+                               rv.plugin = plugin;
+                               rv.setRatio = onInitTween(t, e, cssp._tween, p);
+                               return rv;
+                       }, priority:priority});
+               };
+
+
+
+
+
+
+
+
+               //transform-related methods and properties
+               var _transformProps = ("scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective").split(","),
+                       _transformProp = _checkPropPrefix("transform"), //the Javascript (camelCase) transform property, like msTransform, WebkitTransform, MozTransform, or OTransform.
+                       _transformPropCSS = _prefixCSS + "transform",
+                       _transformOriginProp = _checkPropPrefix("transformOrigin"),
+                       _supports3D = (_checkPropPrefix("perspective") !== null),
+                       Transform = _internals.Transform = function() {
+                               this.skewY = 0;
+                       },
+
+                       /**
+                        * Parses the transform values for an element, returning an object with x, y, z, scaleX, scaleY, scaleZ, rotation, rotationX, rotationY, skewX, and skewY properties. Note: by default (for performance reasons), all skewing is combined into skewX and rotation but skewY still has a place in the transform object so that we can record how much of the skew is attributed to skewX vs skewY. Remember, a skewY of 10 looks the same as a rotation of 10 and skewX of -10.
+                        * @param {!Object} t target element
+                        * @param {Object=} cs computed style object (optional)
+                        * @param {boolean=} rec if true, the transform values will be recorded to the target element's _gsTransform object, like target._gsTransform = {x:0, y:0, z:0, scaleX:1...}
+                        * @param {boolean=} parse if true, we'll ignore any _gsTransform values that already exist on the element, and force a reparsing of the css (calculated style)
+                        * @return {object} object containing all of the transform properties/values like {x:0, y:0, z:0, scaleX:1...}
+                        */
+                       _getTransform = _internals.getTransform = function(t, cs, rec, parse) {
+                               if (t._gsTransform && rec && !parse) {
+                                       return t._gsTransform; //if the element already has a _gsTransform, use that. Note: some browsers don't accurately return the calculated style for the transform (particularly for SVG), so it's almost always safest to just use the values we've already applied rather than re-parsing things.
+                               }
+                               var tm = rec ? t._gsTransform || new Transform() : new Transform(),
+                                       invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent.
+                                       min = 0.00002,
+                                       rnd = 100000,
+                                       minAngle = 179.99,
+                                       minPI = minAngle * _DEG2RAD,
+                                       zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin  || 0 : 0,
+                                       s, m, i, n, dec, scaleX, scaleY, rotation, skewX, difX, difY, difR, difS;
+                               if (_transformProp) {
+                                       s = _getStyle(t, _transformPropCSS, cs, true);
+                               } else if (t.currentStyle) {
+                                       //for older versions of IE, we need to interpret the filter portion that is in the format: progid:DXImageTransform.Microsoft.Matrix(M11=6.123233995736766e-17, M12=-1, M21=1, M22=6.123233995736766e-17, sizingMethod='auto expand') Notice that we need to swap b and c compared to a normal matrix.
+                                       s = t.currentStyle.filter.match(_ieGetMatrixExp);
+                                       s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : "";
+                               }
+                               //split the matrix values out into an array (m for matrix)
+                               m = (s || "").match(/(?:\-|\b)[\d\-\.e]+\b/gi) || [];
+                               i = m.length;
+                               while (--i > -1) {
+                                       n = Number(m[i]);
+                                       m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example).
+                               }
+                               if (m.length === 16) {
+
+                                       //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values)
+                                       var a13 = m[8], a23 = m[9], a33 = m[10],
+                                               a14 = m[12], a24 = m[13], a34 = m[14];
+
+                                       //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari
+                                       if (tm.zOrigin) {
+                                               a34 = -tm.zOrigin;
+                                               a14 = a13*a34-m[12];
+                                               a24 = a23*a34-m[13];
+                                               a34 = a33*a34+tm.zOrigin-m[14];
+                                       }
+
+                                       //only parse from the matrix if we MUST because not only is it usually unnecessary due to the fact that we store the values in the _gsTransform object, but also because it's impossible to accurately interpret rotationX, rotationY, rotationZ, scaleX, and scaleY if all are applied, so it's much better to rely on what we store. However, we must parse the first time that an object is tweened. We also assume that if the position has changed, the user must have done some styling changes outside of CSSPlugin, thus we force a parse in that scenario.
+                                       if (!rec || parse || tm.rotationX == null) {
+                                               var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3],
+                                                       a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7],
+                                                       a43 = m[11],
+                                                       angle = Math.atan2(a32, a33),
+                                                       xFlip = (angle < -minPI || angle > minPI),
+                                                       t1, t2, t3, cos, sin, yFlip, zFlip;
+                                               tm.rotationX = angle * _RAD2DEG;
+                                               //rotationX
+                                               if (angle) {
+                                                       cos = Math.cos(-angle);
+                                                       sin = Math.sin(-angle);
+                                                       t1 = a12*cos+a13*sin;
+                                                       t2 = a22*cos+a23*sin;
+                                                       t3 = a32*cos+a33*sin;
+                                                       a13 = a12*-sin+a13*cos;
+                                                       a23 = a22*-sin+a23*cos;
+                                                       a33 = a32*-sin+a33*cos;
+                                                       a43 = a42*-sin+a43*cos;
+                                                       a12 = t1;
+                                                       a22 = t2;
+                                                       a32 = t3;
+                                               }
+                                               //rotationY
+                                               angle = Math.atan2(a13, a11);
+                                               tm.rotationY = angle * _RAD2DEG;
+                                               if (angle) {
+                                                       yFlip = (angle < -minPI || angle > minPI);
+                                                       cos = Math.cos(-angle);
+                                                       sin = Math.sin(-angle);
+                                                       t1 = a11*cos-a13*sin;
+                                                       t2 = a21*cos-a23*sin;
+                                                       t3 = a31*cos-a33*sin;
+                                                       a23 = a21*sin+a23*cos;
+                                                       a33 = a31*sin+a33*cos;
+                                                       a43 = a41*sin+a43*cos;
+                                                       a11 = t1;
+                                                       a21 = t2;
+                                                       a31 = t3;
+                                               }
+                                               //rotationZ
+                                               angle = Math.atan2(a21, a22);
+                                               tm.rotation = angle * _RAD2DEG;
+                                               if (angle) {
+                                                       zFlip = (angle < -minPI || angle > minPI);
+                                                       cos = Math.cos(-angle);
+                                                       sin = Math.sin(-angle);
+                                                       a11 = a11*cos+a12*sin;
+                                                       t2 = a21*cos+a22*sin;
+                                                       a22 = a21*-sin+a22*cos;
+                                                       a32 = a31*-sin+a32*cos;
+                                                       a21 = t2;
+                                               }
+
+                                               if (zFlip && xFlip) {
+                                                       tm.rotation = tm.rotationX = 0;
+                                               } else if (zFlip && yFlip) {
+                                                       tm.rotation = tm.rotationY = 0;
+                                               } else if (yFlip && xFlip) {
+                                                       tm.rotationY = tm.rotationX = 0;
+                                               }
+
+                                               tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
+                                               tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd;
+                                               tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd;
+                                               tm.skewX = 0;
+                                               tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0;
+                                               tm.x = a14;
+                                               tm.y = a24;
+                                               tm.z = a34;
+                                       }
+
+                               } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY)) && !(tm.x !== undefined && _getStyle(t, "display", cs) === "none")) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those.
+                                       var k = (m.length >= 6),
+                                               a = k ? m[0] : 1,
+                                               b = m[1] || 0,
+                                               c = m[2] || 0,
+                                               d = k ? m[3] : 1;
+                                       tm.x = m[4] || 0;
+                                       tm.y = m[5] || 0;
+                                       scaleX = Math.sqrt(a * a + b * b);
+                                       scaleY = Math.sqrt(d * d + c * c);
+                                       rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).
+                                       skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0;
+                                       difX = scaleX - Math.abs(tm.scaleX || 0);
+                                       difY = scaleY - Math.abs(tm.scaleY || 0);
+                                       if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
+                                               if (invX) {
+                                                       scaleX *= -1;
+                                                       skewX += (rotation <= 0) ? 180 : -180;
+                                                       rotation += (rotation <= 0) ? 180 : -180;
+                                               } else {
+                                                       scaleY *= -1;
+                                                       skewX += (skewX <= 0) ? 180 : -180;
+                                               }
+                                       }
+                                       difR = (rotation - tm.rotation) % 180; //note: matching ranges would be very small (+/-0.0001) or very close to 180.
+                                       difS = (skewX - tm.skewX) % 180;
+                                       //if there's already a recorded _gsTransform in place for the target, we should leave those values in place unless we know things changed for sure (beyond a super small amount). This gets around ambiguous interpretations, like if scaleX and scaleY are both -1, the matrix would be the same as if the rotation was 180 with normal scaleX/scaleY. If the user tweened to particular values, those must be prioritized to ensure animation is consistent.
+                                       if (tm.skewX === undefined || difX > min || difX < -min || difY > min || difY < -min || (difR > -minAngle && difR < minAngle && (difR * rnd) | 0 !== 0) || (difS > -minAngle && difS < minAngle && (difS * rnd) | 0 !== 0)) {
+                                               tm.scaleX = scaleX;
+                                               tm.scaleY = scaleY;
+                                               tm.rotation = rotation;
+                                               tm.skewX = skewX;
+                                       }
+                                       if (_supports3D) {
+                                               tm.rotationX = tm.rotationY = tm.z = 0;
+                                               tm.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0;
+                                               tm.scaleZ = 1;
+                                       }
+                               }
+                               tm.zOrigin = zOrigin;
+
+                               //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate.
+                               for (i in tm) {
+                                       if (tm[i] < min) if (tm[i] > -min) {
+                                               tm[i] = 0;
+                                       }
+                               }
+                               //DEBUG: _log("parsed rotation: "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective);
+                               if (rec) {
+                                       t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method)
+                               }
+                               return tm;
+                       },
+
+                       //for setting 2D transforms in IE6, IE7, and IE8 (must use a "filter" to emulate the behavior of modern day browser transforms)
+                       _setIETransformRatio = function(v) {
+                               var t = this.data, //refers to the element's _gsTransform object
+                                       ang = -t.rotation * _DEG2RAD,
+                                       skew = ang + t.skewX * _DEG2RAD,
+                                       rnd = 100000,
+                                       a = ((Math.cos(ang) * t.scaleX * rnd) | 0) / rnd,
+                                       b = ((Math.sin(ang) * t.scaleX * rnd) | 0) / rnd,
+                                       c = ((Math.sin(skew) * -t.scaleY * rnd) | 0) / rnd,
+                                       d = ((Math.cos(skew) * t.scaleY * rnd) | 0) / rnd,
+                                       style = this.t.style,
+                                       cs = this.t.currentStyle,
+                                       filters, val;
+                               if (!cs) {
+                                       return;
+                               }
+                               val = b; //just for swapping the variables an inverting them (reused "val" to avoid creating another variable in memory). IE's filter matrix uses a non-standard matrix configuration (angle goes the opposite way, and b and c are reversed and inverted)
+                               b = -c;
+                               c = -val;
+                               filters = cs.filter;
+                               style.filter = ""; //remove filters so that we can accurately measure offsetWidth/offsetHeight
+                               var w = this.t.offsetWidth,
+                                       h = this.t.offsetHeight,
+                                       clip = (cs.position !== "absolute"),
+                                       m = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + b + ", M21=" + c + ", M22=" + d,
+                                       ox = t.x,
+                                       oy = t.y,
+                                       dx, dy;
+
+                               //if transformOrigin is being used, adjust the offset x and y
+                               if (t.ox != null) {
+                                       dx = ((t.oxp) ? w * t.ox * 0.01 : t.ox) - w / 2;
+                                       dy = ((t.oyp) ? h * t.oy * 0.01 : t.oy) - h / 2;
+                                       ox += dx - (dx * a + dy * b);
+                                       oy += dy - (dx * c + dy * d);
+                               }
+
+                               if (!clip) {
+                                       m += ", sizingMethod='auto expand')";
+                               } else {
+                                       dx = (w / 2);
+                                       dy = (h / 2);
+                                       //translate to ensure that transformations occur around the correct origin (default is center).
+                                       m += ", Dx=" + (dx - (dx * a + dy * b) + ox) + ", Dy=" + (dy - (dx * c + dy * d) + oy) + ")";
+                               }
+                               if (filters.indexOf("DXImageTransform.Microsoft.Matrix(") !== -1) {
+                                       style.filter = filters.replace(_ieSetMatrixExp, m);
+                               } else {
+                                       style.filter = m + " " + filters; //we must always put the transform/matrix FIRST (before alpha(opacity=xx)) to avoid an IE bug that slices part of the object when rotation is applied with alpha.
+                               }
+
+                               //at the end or beginning of the tween, if the matrix is normal (1, 0, 0, 1) and opacity is 100 (or doesn't exist), remove the filter to improve browser performance.
+                               if (v === 0 || v === 1) if (a === 1) if (b === 0) if (c === 0) if (d === 1) if (!clip || m.indexOf("Dx=0, Dy=0") !== -1) if (!_opacityExp.test(filters) || parseFloat(RegExp.$1) === 100) if (filters.indexOf("gradient(" && filters.indexOf("Alpha")) === -1) {
+                                       style.removeAttribute("filter");
+                               }
+
+                               //we must set the margins AFTER applying the filter in order to avoid some bugs in IE8 that could (in rare scenarios) cause them to be ignored intermittently (vibration).
+                               if (!clip) {
+                                       var mult = (_ieVers < 8) ? 1 : -1, //in Internet Explorer 7 and before, the box model is broken, causing the browser to treat the width/height of the actual rotated filtered image as the width/height of the box itself, but Microsoft corrected that in IE8. We must use a negative offset in IE8 on the right/bottom
+                                               marg, prop, dif;
+                                       dx = t.ieOffsetX || 0;
+                                       dy = t.ieOffsetY || 0;
+                                       t.ieOffsetX = Math.round((w - ((a < 0 ? -a : a) * w + (b < 0 ? -b : b) * h)) / 2 + ox);
+                                       t.ieOffsetY = Math.round((h - ((d < 0 ? -d : d) * h + (c < 0 ? -c : c) * w)) / 2 + oy);
+                                       for (i = 0; i < 4; i++) {
+                                               prop = _margins[i];
+                                               marg = cs[prop];
+                                               //we need to get the current margin in case it is being tweened separately (we want to respect that tween's changes)
+                                               val = (marg.indexOf("px") !== -1) ? parseFloat(marg) : _convertToPixels(this.t, prop, parseFloat(marg), marg.replace(_suffixExp, "")) || 0;
+                                               if (val !== t[prop]) {
+                                                       dif = (i < 2) ? -t.ieOffsetX : -t.ieOffsetY; //if another tween is controlling a margin, we cannot only apply the difference in the ieOffsets, so we essentially zero-out the dx and dy here in that case. We record the margin(s) later so that we can keep comparing them, making this code very flexible.
+                                               } else {
+                                                       dif = (i < 2) ? dx - t.ieOffsetX : dy - t.ieOffsetY;
+                                               }
+                                               style[prop] = (t[prop] = Math.round( val - dif * ((i === 0 || i === 2) ? 1 : mult) )) + "px";
+                                       }
+                               }
+                       },
+
+                       _set3DTransformRatio = _internals.set3DTransformRatio = function(v) {
+                               var t = this.data, //refers to the element's _gsTransform object
+                                       style = this.t.style,
+                                       angle = t.rotation * _DEG2RAD,
+                                       sx = t.scaleX,
+                                       sy = t.scaleY,
+                                       sz = t.scaleZ,
+                                       perspective = t.perspective,
+                                       a11, a12, a13, a14,     a21, a22, a23, a24, a31, a32, a33, a34, a41, a42, a43,
+                                       zOrigin, rnd, cos, sin, t1, t2, t3, t4;
+                               if (v === 1 || v === 0) if (t.force3D === "auto") if (!t.rotationY && !t.rotationX && sz === 1 && !perspective && !t.z) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices
+                                       _set2DTransformRatio.call(this, v);
+                                       return;
+                               }
+                               if (_isFirefox) {
+                                       var n = 0.0001;
+                                       if (sx < n && sx > -n) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue.
+                                               sx = sz = 0.00002;
+                                       }
+                                       if (sy < n && sy > -n) {
+                                               sy = sz = 0.00002;
+                                       }
+                                       if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z).
+                                               perspective = 0;
+                                       }
+                               }
+                               if (angle || t.skewX) {
+                                       cos = Math.cos(angle);
+                                       sin = Math.sin(angle);
+                                       a11 = cos;
+                                       a21 = sin;
+                                       if (t.skewX) {
+                                               angle -= t.skewX * _DEG2RAD;
+                                               cos = Math.cos(angle);
+                                               sin = Math.sin(angle);
+                                               if (t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does
+                                                       t1 = Math.tan(t.skewX * _DEG2RAD);
+                                                       t1 = Math.sqrt(1 + t1 * t1);
+                                                       cos *= t1;
+                                                       sin *= t1;
+                                               }
+                                       }
+                                       a12 = -sin;
+                                       a22 = cos;
+
+                               } else if (!t.rotationY && !t.rotationX && sz === 1 && !perspective) { //if we're only translating and/or 2D scaling, this is faster...
+                                       style[_transformProp] = "translate3d(" + t.x + "px," + t.y + "px," + t.z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : "");
+                                       return;
+                               } else {
+                                       a11 = a22 = 1;
+                                       a12 = a21 = 0;
+                               }
+                               a33 = 1;
+                               a13 = a14 = a23 = a24 = a31 = a32 = a34 = a41 = a42 = 0;
+                               a43 = (perspective) ? -1 / perspective : 0;
+                               zOrigin = t.zOrigin;
+                               rnd = 100000;
+                               angle = t.rotationY * _DEG2RAD;
+                               if (angle) {
+                                       cos = Math.cos(angle);
+                                       sin = Math.sin(angle);
+                                       a31 = a33*-sin;
+                                       a41 = a43*-sin;
+                                       a13 = a11*sin;
+                                       a23 = a21*sin;
+                                       a33 *= cos;
+                                       a43 *= cos;
+                                       a11 *= cos;
+                                       a21 *= cos;
+                               }
+                               angle = t.rotationX * _DEG2RAD;
+                               if (angle) {
+                                       cos = Math.cos(angle);
+                                       sin = Math.sin(angle);
+                                       t1 = a12*cos+a13*sin;
+                                       t2 = a22*cos+a23*sin;
+                                       t3 = a32*cos+a33*sin;
+                                       t4 = a42*cos+a43*sin;
+                                       a13 = a12*-sin+a13*cos;
+                                       a23 = a22*-sin+a23*cos;
+                                       a33 = a32*-sin+a33*cos;
+                                       a43 = a42*-sin+a43*cos;
+                                       a12 = t1;
+                                       a22 = t2;
+                                       a32 = t3;
+                                       a42 = t4;
+                               }
+                               if (sz !== 1) {
+                                       a13*=sz;
+                                       a23*=sz;
+                                       a33*=sz;
+                                       a43*=sz;
+                               }
+                               if (sy !== 1) {
+                                       a12*=sy;
+                                       a22*=sy;
+                                       a32*=sy;
+                                       a42*=sy;
+                               }
+                               if (sx !== 1) {
+                                       a11*=sx;
+                                       a21*=sx;
+                                       a31*=sx;
+                                       a41*=sx;
+                               }
+                               if (zOrigin) {
+                                       a34 -= zOrigin;
+                                       a14 = a13*a34;
+                                       a24 = a23*a34;
+                                       a34 = a33*a34+zOrigin;
+                               }
+                               //we round the x, y, and z slightly differently to allow even larger values.
+                               a14 = (t1 = (a14 += t.x) - (a14 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a14 : a14;
+                               a24 = (t1 = (a24 += t.y) - (a24 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a24 : a24;
+                               a34 = (t1 = (a34 += t.z) - (a34 |= 0)) ? ((t1 * rnd + (t1 < 0 ? -0.5 : 0.5)) | 0) / rnd + a34 : a34;
+                               style[_transformProp] = "matrix3d(" + [ (((a11 * rnd) | 0) / rnd), (((a21 * rnd) | 0) / rnd), (((a31 * rnd) | 0) / rnd), (((a41 * rnd) | 0) / rnd), (((a12 * rnd) | 0) / rnd), (((a22 * rnd) | 0) / rnd), (((a32 * rnd) | 0) / rnd), (((a42 * rnd) | 0) / rnd), (((a13 * rnd) | 0) / rnd), (((a23 * rnd) | 0) / rnd), (((a33 * rnd) | 0) / rnd), (((a43 * rnd) | 0) / rnd), a14, a24, a34, (perspective ? (1 + (-a34 / perspective)) : 1) ].join(",") + ")";
+                       },
+
+                       _set2DTransformRatio = _internals.set2DTransformRatio = function(v) {
+                               var t = this.data, //refers to the element's _gsTransform object
+                                       targ = this.t,
+                                       style = targ.style,
+                                       ang, skew, rnd, sx, sy;
+                               if (t.rotationX || t.rotationY || t.z || t.force3D === true || (t.force3D === "auto" && v !== 1 && v !== 0)) { //if a 3D tween begins while a 2D one is running, we need to kick the rendering over to the 3D method. For example, imagine a yoyo-ing, infinitely repeating scale tween running, and then the object gets rotated in 3D space with a different tween.
+                                       this.setRatio = _set3DTransformRatio;
+                                       _set3DTransformRatio.call(this, v);
+                                       return;
+                               }
+                               if (!t.rotation && !t.skewX) {
+                                       style[_transformProp] = "matrix(" + t.scaleX + ",0,0," + t.scaleY + "," + t.x + "," + t.y + ")";
+                               } else {
+                                       ang = t.rotation * _DEG2RAD;
+                                       skew = ang - t.skewX * _DEG2RAD;
+                                       rnd = 100000;
+                                       sx = t.scaleX * rnd;
+                                       sy = t.scaleY * rnd;
+                                       //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places.
+                                       style[_transformProp] = "matrix(" + (((Math.cos(ang) * sx) | 0) / rnd) + "," + (((Math.sin(ang) * sx) | 0) / rnd) + "," + (((Math.sin(skew) * -sy) | 0) / rnd) + "," + (((Math.cos(skew) * sy) | 0) / rnd) + "," + t.x + "," + t.y + ")";
+                               }
+                       };
+
+               _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType", {parser:function(t, e, p, cssp, pt, plugin, vars) {
+                       if (cssp._transform) { return pt; } //only need to parse the transform once, and only if the browser supports it.
+                       var m1 = cssp._transform = _getTransform(t, _cs, true, vars.parseTransform),
+                               style = t.style,
+                               min = 0.000001,
+                               i = _transformProps.length,
+                               v = vars,
+                               endRotations = {},
+                               m2, skewY, copy, orig, has3D, hasChange, dr;
+                       if (typeof(v.transform) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)"
+                               copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly.
+                               copy[_transformProp] = v.transform;
+                               copy.display = "block"; //if display is "none", the browser often refuses to report the transform properties correctly.
+                               copy.position = "absolute";
+                               _doc.body.appendChild(_tempDiv);
+                               m2 = _getTransform(_tempDiv, null, false);
+                               _doc.body.removeChild(_tempDiv);
+                       } else if (typeof(v) === "object") { //for values like scaleX, scaleY, rotation, x, y, skewX, and skewY or transform:{...} (object)
+                               m2 = {scaleX:_parseVal((v.scaleX != null) ? v.scaleX : v.scale, m1.scaleX),
+                                       scaleY:_parseVal((v.scaleY != null) ? v.scaleY : v.scale, m1.scaleY),
+                                       scaleZ:_parseVal(v.scaleZ, m1.scaleZ),
+                                       x:_parseVal(v.x, m1.x),
+                                       y:_parseVal(v.y, m1.y),
+                                       z:_parseVal(v.z, m1.z),
+                                       perspective:_parseVal(v.transformPerspective, m1.perspective)};
+                               dr = v.directionalRotation;
+                               if (dr != null) {
+                                       if (typeof(dr) === "object") {
+                                               for (copy in dr) {
+                                                       v[copy] = dr[copy];
+                                               }
+                                       } else {
+                                               v.rotation = dr;
+                                       }
+                               }
+                               m2.rotation = _parseAngle(("rotation" in v) ? v.rotation : ("shortRotation" in v) ? v.shortRotation + "_short" : ("rotationZ" in v) ? v.rotationZ : m1.rotation, m1.rotation, "rotation", endRotations);
+                               if (_supports3D) {
+                                       m2.rotationX = _parseAngle(("rotationX" in v) ? v.rotationX : ("shortRotationX" in v) ? v.shortRotationX + "_short" : m1.rotationX || 0, m1.rotationX, "rotationX", endRotations);
+                                       m2.rotationY = _parseAngle(("rotationY" in v) ? v.rotationY : ("shortRotationY" in v) ? v.shortRotationY + "_short" : m1.rotationY || 0, m1.rotationY, "rotationY", endRotations);
+                               }
+                               m2.skewX = (v.skewX == null) ? m1.skewX : _parseAngle(v.skewX, m1.skewX);
+
+                               //note: for performance reasons, we combine all skewing into the skewX and rotation values, ignoring skewY but we must still record it so that we can discern how much of the overall skew is attributed to skewX vs. skewY. Otherwise, if the skewY would always act relative (tween skewY to 10deg, for example, multiple times and if we always combine things into skewX, we can't remember that skewY was 10 from last time). Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of -10 degrees.
+                               m2.skewY = (v.skewY == null) ? m1.skewY : _parseAngle(v.skewY, m1.skewY);
+                               if ((skewY = m2.skewY - m1.skewY)) {
+                                       m2.skewX += skewY;
+                                       m2.rotation += skewY;
+                               }
+                       }
+
+                       if (_supports3D && v.force3D != null) {
+                               m1.force3D = v.force3D;
+                               hasChange = true;
+                       }
+
+                       m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType;
+
+                       has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective);
+                       if (!has3D && v.scale != null) {
+                               m2.scaleZ = 1; //no need to tween scaleZ.
+                       }
+
+                       while (--i > -1) {
+                               p = _transformProps[i];
+                               orig = m2[p] - m1[p];
+                               if (orig > min || orig < -min || _forcePT[p] != null) {
+                                       hasChange = true;
+                                       pt = new CSSPropTween(m1, p, m1[p], orig, pt);
+                                       if (p in endRotations) {
+                                               pt.e = endRotations[p]; //directional rotations typically have compensated values during the tween, but we need to make sure they end at exactly what the user requested
+                                       }
+                                       pt.xs0 = 0; //ensures the value stays numeric in setRatio()
+                                       pt.plugin = plugin;
+                                       cssp._overwriteProps.push(pt.n);
+                               }
+                       }
+
+                       orig = v.transformOrigin;
+                       if (orig || (_supports3D && has3D && m1.zOrigin)) { //if anything 3D is happening and there's a transformOrigin with a z component that's non-zero, we must ensure that the transformOrigin's z-component is set to 0 so that we can manually do those calculations to get around Safari bugs. Even if the user didn't specifically define a "transformOrigin" in this particular tween (maybe they did it via css directly).
+                               if (_transformProp) {
+                                       hasChange = true;
+                                       p = _transformOriginProp;
+                                       orig = (orig || _getStyle(t, p, _cs, false, "50% 50%")) + ""; //cast as string to avoid errors
+                                       pt = new CSSPropTween(style, p, 0, 0, pt, -1, "transformOrigin");
+                                       pt.b = style[p];
+                                       pt.plugin = plugin;
+                                       if (_supports3D) {
+                                               copy = m1.zOrigin;
+                                               orig = orig.split(" ");
+                                               m1.zOrigin = ((orig.length > 2 && !(copy !== 0 && orig[2] === "0px")) ? parseFloat(orig[2]) : copy) || 0; //Safari doesn't handle the z part of transformOrigin correctly, so we'll manually handle it in the _set3DTransformRatio() method.
+                                               pt.xs0 = pt.e = orig[0] + " " + (orig[1] || "50%") + " 0px"; //we must define a z value of 0px specifically otherwise iOS 5 Safari will stick with the old one (if one was defined)!
+                                               pt = new CSSPropTween(m1, "zOrigin", 0, 0, pt, -1, pt.n); //we must create a CSSPropTween for the _gsTransform.zOrigin so that it gets reset properly at the beginning if the tween runs backward (as opposed to just setting m1.zOrigin here)
+                                               pt.b = copy;
+                                               pt.xs0 = pt.e = m1.zOrigin;
+                                       } else {
+                                               pt.xs0 = pt.e = orig;
+                                       }
+
+                               //for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp).
+                               } else {
+                                       _parsePosition(orig + "", m1);
+                               }
+                       }
+
+                       if (hasChange) {
+                               cssp._transformType = (has3D || this._transformType === 3) ? 3 : 2; //quicker than calling cssp._enableTransforms();
+                       }
+                       return pt;
+               }, prefix:true});
+
+               _registerComplexSpecialProp("boxShadow", {defaultValue:"0px 0px 0px 0px #999", prefix:true, color:true, multi:true, keyword:"inset"});
+
+               _registerComplexSpecialProp("borderRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) {
+                       e = this.format(e);
+                       var props = ["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],
+                               style = t.style,
+                               ea1, i, es2, bs2, bs, es, bn, en, w, h, esfx, bsfx, rel, hn, vn, em;
+                       w = parseFloat(t.offsetWidth);
+                       h = parseFloat(t.offsetHeight);
+                       ea1 = e.split(" ");
+                       for (i = 0; i < props.length; i++) { //if we're dealing with percentages, we must convert things separately for the horizontal and vertical axis!
+                               if (this.p.indexOf("border")) { //older browsers used a prefix
+                                       props[i] = _checkPropPrefix(props[i]);
+                               }
+                               bs = bs2 = _getStyle(t, props[i], _cs, false, "0px");
+                               if (bs.indexOf(" ") !== -1) {
+                                       bs2 = bs.split(" ");
+                                       bs = bs2[0];
+                                       bs2 = bs2[1];
+                               }
+                               es = es2 = ea1[i];
+                               bn = parseFloat(bs);
+                               bsfx = bs.substr((bn + "").length);
+                               rel = (es.charAt(1) === "=");
+                               if (rel) {
+                                       en = parseInt(es.charAt(0)+"1", 10);
+                                       es = es.substr(2);
+                                       en *= parseFloat(es);
+                                       esfx = es.substr((en + "").length - (en < 0 ? 1 : 0)) || "";
+                               } else {
+                                       en = parseFloat(es);
+                                       esfx = es.substr((en + "").length);
+                               }
+                               if (esfx === "") {
+                                       esfx = _suffixMap[p] || bsfx;
+                               }
+                               if (esfx !== bsfx) {
+                                       hn = _convertToPixels(t, "borderLeft", bn, bsfx); //horizontal number (we use a bogus "borderLeft" property just because the _convertToPixels() method searches for the keywords "Left", "Right", "Top", and "Bottom" to determine of it's a horizontal or vertical property, and we need "border" in the name so that it knows it should measure relative to the element itself, not its parent.
+                                       vn = _convertToPixels(t, "borderTop", bn, bsfx); //vertical number
+                                       if (esfx === "%") {
+                                               bs = (hn / w * 100) + "%";
+                                               bs2 = (vn / h * 100) + "%";
+                                       } else if (esfx === "em") {
+                                               em = _convertToPixels(t, "borderLeft", 1, "em");
+                                               bs = (hn / em) + "em";
+                                               bs2 = (vn / em) + "em";
+                                       } else {
+                                               bs = hn + "px";
+                                               bs2 = vn + "px";
+                                       }
+                                       if (rel) {
+                                               es = (parseFloat(bs) + en) + esfx;
+                                               es2 = (parseFloat(bs2) + en) + esfx;
+                                       }
+                               }
+                               pt = _parseComplex(style, props[i], bs + " " + bs2, es + " " + es2, false, "0px", pt);
+                       }
+                       return pt;
+               }, prefix:true, formatter:_getFormatter("0px 0px 0px 0px", false, true)});
+               _registerComplexSpecialProp("backgroundPosition", {defaultValue:"0 0", parser:function(t, e, p, cssp, pt, plugin) {
+                       var bp = "background-position",
+                               cs = (_cs || _getComputedStyle(t, null)),
+                               bs = this.format( ((cs) ? _ieVers ? cs.getPropertyValue(bp + "-x") + " " + cs.getPropertyValue(bp + "-y") : cs.getPropertyValue(bp) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"), //Internet Explorer doesn't report background-position correctly - we must query background-position-x and background-position-y and combine them (even in IE10). Before IE9, we must do the same with the currentStyle object and use camelCase
+                               es = this.format(e),
+                               ba, ea, i, pct, overlap, src;
+                       if ((bs.indexOf("%") !== -1) !== (es.indexOf("%") !== -1)) {
+                               src = _getStyle(t, "backgroundImage").replace(_urlExp, "");
+                               if (src && src !== "none") {
+                                       ba = bs.split(" ");
+                                       ea = es.split(" ");
+                                       _tempImg.setAttribute("src", src); //set the temp <img>'s src to the background-image so that we can measure its width/height
+                                       i = 2;
+                                       while (--i > -1) {
+                                               bs = ba[i];
+                                               pct = (bs.indexOf("%") !== -1);
+                                               if (pct !== (ea[i].indexOf("%") !== -1)) {
+                                                       overlap = (i === 0) ? t.offsetWidth - _tempImg.width : t.offsetHeight - _tempImg.height;
+                                                       ba[i] = pct ? (parseFloat(bs) / 100 * overlap) + "px" : (parseFloat(bs) / overlap * 100) + "%";
+                                               }
+                                       }
+                                       bs = ba.join(" ");
+                               }
+                       }
+                       return this.parseComplex(t.style, bs, es, pt, plugin);
+               }, formatter:_parsePosition});
+               _registerComplexSpecialProp("backgroundSize", {defaultValue:"0 0", formatter:_parsePosition});
+               _registerComplexSpecialProp("perspective", {defaultValue:"0px", prefix:true});
+               _registerComplexSpecialProp("perspectiveOrigin", {defaultValue:"50% 50%", prefix:true});
+               _registerComplexSpecialProp("transformStyle", {prefix:true});
+               _registerComplexSpecialProp("backfaceVisibility", {prefix:true});
+               _registerComplexSpecialProp("userSelect", {prefix:true});
+               _registerComplexSpecialProp("margin", {parser:_getEdgeParser("marginTop,marginRight,marginBottom,marginLeft")});
+               _registerComplexSpecialProp("padding", {parser:_getEdgeParser("paddingTop,paddingRight,paddingBottom,paddingLeft")});
+               _registerComplexSpecialProp("clip", {defaultValue:"rect(0px,0px,0px,0px)", parser:function(t, e, p, cssp, pt, plugin){
+                       var b, cs, delim;
+                       if (_ieVers < 9) { //IE8 and earlier don't report a "clip" value in the currentStyle - instead, the values are split apart into clipTop, clipRight, clipBottom, and clipLeft. Also, in IE7 and earlier, the values inside rect() are space-delimited, not comma-delimited.
+                               cs = t.currentStyle;
+                               delim = _ieVers < 8 ? " " : ",";
+                               b = "rect(" + cs.clipTop + delim + cs.clipRight + delim + cs.clipBottom + delim + cs.clipLeft + ")";
+                               e = this.format(e).split(",").join(delim);
+                       } else {
+                               b = this.format(_getStyle(t, this.p, _cs, false, this.dflt));
+                               e = this.format(e);
+                       }
+                       return this.parseComplex(t.style, b, e, pt, plugin);
+               }});
+               _registerComplexSpecialProp("textShadow", {defaultValue:"0px 0px 0px #999", color:true, multi:true});
+               _registerComplexSpecialProp("autoRound,strictUnits", {parser:function(t, e, p, cssp, pt) {return pt;}}); //just so that we can ignore these properties (not tween them)
+               _registerComplexSpecialProp("border", {defaultValue:"0px solid #000", parser:function(t, e, p, cssp, pt, plugin) {
+                               return this.parseComplex(t.style, this.format(_getStyle(t, "borderTopWidth", _cs, false, "0px") + " " + _getStyle(t, "borderTopStyle", _cs, false, "solid") + " " + _getStyle(t, "borderTopColor", _cs, false, "#000")), this.format(e), pt, plugin);
+                       }, color:true, formatter:function(v) {
+                               var a = v.split(" ");
+                               return a[0] + " " + (a[1] || "solid") + " " + (v.match(_colorExp) || ["#000"])[0];
+                       }});
+               _registerComplexSpecialProp("borderWidth", {parser:_getEdgeParser("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}); //Firefox doesn't pick up on borderWidth set in style sheets (only inline).
+               _registerComplexSpecialProp("float,cssFloat,styleFloat", {parser:function(t, e, p, cssp, pt, plugin) {
+                       var s = t.style,
+                               prop = ("cssFloat" in s) ? "cssFloat" : "styleFloat";
+                       return new CSSPropTween(s, prop, 0, 0, pt, -1, p, false, 0, s[prop], e);
+               }});
+
+               //opacity-related
+               var _setIEOpacityRatio = function(v) {
+                               var t = this.t, //refers to the element's style property
+                                       filters = t.filter || _getStyle(this.data, "filter"),
+                                       val = (this.s + this.c * v) | 0,
+                                       skip;
+                               if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters.
+                                       if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) {
+                                               t.removeAttribute("filter");
+                                               skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check.
+                                       } else {
+                                               t.filter = filters.replace(_alphaFilterExp, "");
+                                               skip = true;
+                                       }
+                               }
+                               if (!skip) {
+                                       if (this.xn1) {
+                                               t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame.
+                                       }
+                                       if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues
+                                               if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween)
+                                                       t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly.
+                                               }
+                                       } else {
+                                               t.filter = filters.replace(_opacityExp, "opacity=" + val);
+                                       }
+                               }
+                       };
+               _registerComplexSpecialProp("opacity,alpha,autoAlpha", {defaultValue:"1", parser:function(t, e, p, cssp, pt, plugin) {
+                       var b = parseFloat(_getStyle(t, "opacity", _cs, false, "1")),
+                               style = t.style,
+                               isAutoAlpha = (p === "autoAlpha");
+                       if (typeof(e) === "string" && e.charAt(1) === "=") {
+                               e = ((e.charAt(0) === "-") ? -1 : 1) * parseFloat(e.substr(2)) + b;
+                       }
+                       if (isAutoAlpha && b === 1 && _getStyle(t, "visibility", _cs) === "hidden" && e !== 0) { //if visibility is initially set to "hidden", we should interpret that as intent to make opacity 0 (a convenience)
+                               b = 0;
+                       }
+                       if (_supportsOpacity) {
+                               pt = new CSSPropTween(style, "opacity", b, e - b, pt);
+                       } else {
+                               pt = new CSSPropTween(style, "opacity", b * 100, (e - b) * 100, pt);
+                               pt.xn1 = isAutoAlpha ? 1 : 0; //we need to record whether or not this is an autoAlpha so that in the setRatio(), we know to duplicate the setting of the alpha in order to work around a bug in IE7 and IE8 that prevents changes to "visibility" from taking effect if the filter is changed to a different alpha(opacity) at the same time. Setting it to the SAME value first, then the new value works around the IE7/8 bug.
+                               style.zoom = 1; //helps correct an IE issue.
+                               pt.type = 2;
+                               pt.b = "alpha(opacity=" + pt.s + ")";
+                               pt.e = "alpha(opacity=" + (pt.s + pt.c) + ")";
+                               pt.data = t;
+                               pt.plugin = plugin;
+                               pt.setRatio = _setIEOpacityRatio;
+                       }
+                       if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier
+                               pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit"));
+                               pt.xs0 = "inherit";
+                               cssp._overwriteProps.push(pt.n);
+                               cssp._overwriteProps.push(p);
+                       }
+                       return pt;
+               }});
+
+
+               var _removeProp = function(s, p) {
+                               if (p) {
+                                       if (s.removeProperty) {
+                                               if (p.substr(0,2) === "ms") { //Microsoft browsers don't conform to the standard of capping the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example)
+                                                       p = "M" + p.substr(1);
+                                               }
+                                               s.removeProperty(p.replace(_capsExp, "-$1").toLowerCase());
+                                       } else { //note: old versions of IE use "removeAttribute()" instead of "removeProperty()"
+                                               s.removeAttribute(p);
+                                       }
+                               }
+                       },
+                       _setClassNameRatio = function(v) {
+                               this.t._gsClassPT = this;
+                               if (v === 1 || v === 0) {
+                                       this.t.setAttribute("class", (v === 0) ? this.b : this.e);
+                                       var mpt = this.data, //first MiniPropTween
+                                               s = this.t.style;
+                                       while (mpt) {
+                                               if (!mpt.v) {
+                                                       _removeProp(s, mpt.p);
+                                               } else {
+                                                       s[mpt.p] = mpt.v;
+                                               }
+                                               mpt = mpt._next;
+                                       }
+                                       if (v === 1 && this.t._gsClassPT === this) {
+                                               this.t._gsClassPT = null;
+                                       }
+                               } else if (this.t.getAttribute("class") !== this.e) {
+                                       this.t.setAttribute("class", this.e);
+                               }
+                       };
+               _registerComplexSpecialProp("className", {parser:function(t, e, p, cssp, pt, plugin, vars) {
+                       var b = t.getAttribute("class") || "", //don't use t.className because it doesn't work consistently on SVG elements; getAttribute("class") and setAttribute("class", value") is more reliable.
+                               cssText = t.style.cssText,
+                               difData, bs, cnpt, cnptLookup, mpt;
+                       pt = cssp._classNamePT = new CSSPropTween(t, p, 0, 0, pt, 2);
+                       pt.setRatio = _setClassNameRatio;
+                       pt.pr = -11;
+                       _hasPriority = true;
+                       pt.b = b;
+                       bs = _getAllStyles(t, _cs);
+                       //if there's a className tween already operating on the target, force it to its end so that the necessary inline styles are removed and the class name is applied before we determine the end state (we don't want inline styles interfering that were there just for class-specific values)
+                       cnpt = t._gsClassPT;
+                       if (cnpt) {
+                               cnptLookup = {};
+                               mpt = cnpt.data; //first MiniPropTween which stores the inline styles - we need to force these so that the inline styles don't contaminate things. Otherwise, there's a small chance that a tween could start and the inline values match the destination values and they never get cleaned.
+                               while (mpt) {
+                                       cnptLookup[mpt.p] = 1;
+                                       mpt = mpt._next;
+                               }
+                               cnpt.setRatio(1);
+                       }
+                       t._gsClassPT = pt;
+                       pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("\\s*\\b" + e.substr(2) + "\\b"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : "");
+                       if (cssp._tween._duration) { //if it's a zero-duration tween, there's no need to tween anything or parse the data. In fact, if we switch classes temporarily (which we must do for proper parsing) and the class has a transition applied, it could cause a quick flash to the end state and back again initially in some browsers.
+                               t.setAttribute("class", pt.e);
+                               difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup);
+                               t.setAttribute("class", b);
+                               pt.data = difData.firstMPT;
+                               t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).
+                               pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself)
+                       }
+                       return pt;
+               }});
+
+
+               var _setClearPropsRatio = function(v) {
+                       if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in).
+                               var s = this.t.style,
+                                       transformParse = _specialProps.transform.parse,
+                                       a, p, i, clearTransform;
+                               if (this.e === "all") {
+                                       s.cssText = "";
+                                       clearTransform = true;
+                               } else {
+                                       a = this.e.split(",");
+                                       i = a.length;
+                                       while (--i > -1) {
+                                               p = a[i];
+                                               if (_specialProps[p]) {
+                                                       if (_specialProps[p].parse === transformParse) {
+                                                               clearTransform = true;
+                                                       } else {
+                                                               p = (p === "transformOrigin") ? _transformOriginProp : _specialProps[p].p; //ensures that special properties use the proper browser-specific property name, like "scaleX" might be "-webkit-transform" or "boxShadow" might be "-moz-box-shadow"
+                                                       }
+                                               }
+                                               _removeProp(s, p);
+                                       }
+                               }
+                               if (clearTransform) {
+                                       _removeProp(s, _transformProp);
+                                       if (this.t._gsTransform) {
+                                               delete this.t._gsTransform;
+                                       }
+                               }
+
+                       }
+               };
+               _registerComplexSpecialProp("clearProps", {parser:function(t, e, p, cssp, pt) {
+                       pt = new CSSPropTween(t, p, 0, 0, pt, 2);
+                       pt.setRatio = _setClearPropsRatio;
+                       pt.e = e;
+                       pt.pr = -10;
+                       pt.data = cssp._tween;
+                       _hasPriority = true;
+                       return pt;
+               }});
+
+               p = "bezier,throwProps,physicsProps,physics2D".split(",");
+               i = p.length;
+               while (i--) {
+                       _registerPluginProp(p[i]);
+               }
+
+
+
+
+
+
+
+
+               p = CSSPlugin.prototype;
+               p._firstPT = null;
+
+               //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc.
+               p._onInitTween = function(target, vars, tween) {
+                       if (!target.nodeType) { //css is only for dom elements
+                               return false;
+                       }
+                       this._target = target;
+                       this._tween = tween;
+                       this._vars = vars;
+                       _autoRound = vars.autoRound;
+                       _hasPriority = false;
+                       _suffixMap = vars.suffixMap || CSSPlugin.suffixMap;
+                       _cs = _getComputedStyle(target, "");
+                       _overwriteProps = this._overwriteProps;
+                       var style = target.style,
+                               v, pt, pt2, first, last, next, zIndex, tpt, threeD;
+                       if (_reqSafariFix) if (style.zIndex === "") {
+                               v = _getStyle(target, "zIndex", _cs);
+                               if (v === "auto" || v === "") {
+                                       //corrects a bug in [non-Android] Safari that prevents it from repainting elements in their new positions if they don't have a zIndex set. We also can't just apply this inside _parseTransform() because anything that's moved in any way (like using "left" or "top" instead of transforms like "x" and "y") can be affected, so it is best to ensure that anything that's tweening has a z-index. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. Plus zIndex is less memory-intensive.
+                                       this._addLazySet(style, "zIndex", 0);
+                               }
+                       }
+
+                       if (typeof(vars) === "string") {
+                               first = style.cssText;
+                               v = _getAllStyles(target, _cs);
+                               style.cssText = first + ";" + vars;
+                               v = _cssDif(target, v, _getAllStyles(target)).difs;
+                               if (!_supportsOpacity && _opacityValExp.test(vars)) {
+                                       v.opacity = parseFloat( RegExp.$1 );
+                               }
+                               vars = v;
+                               style.cssText = first;
+                       }
+                       this._firstPT = pt = this.parse(target, vars, null);
+
+                       if (this._transformType) {
+                               threeD = (this._transformType === 3);
+                               if (!_transformProp) {
+                                       style.zoom = 1; //helps correct an IE issue.
+                               } else if (_isSafari) {
+                                       _reqSafariFix = true;
+                                       //if zIndex isn't set, iOS Safari doesn't repaint things correctly sometimes (seemingly at random).
+                                       if (style.zIndex === "") {
+                                               zIndex = _getStyle(target, "zIndex", _cs);
+                                               if (zIndex === "auto" || zIndex === "") {
+                                                       this._addLazySet(style, "zIndex", 0);
+                                               }
+                                       }
+                                       //Setting WebkitBackfaceVisibility corrects 3 bugs:
+                                       // 1) [non-Android] Safari skips rendering changes to "top" and "left" that are made on the same frame/render as a transform update.
+                                       // 2) iOS Safari sometimes neglects to repaint elements in their new positions. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly.
+                                       // 3) Safari sometimes displayed odd artifacts when tweening the transform (or WebkitTransform) property, like ghosts of the edges of the element remained. Definitely a browser bug.
+                                       //Note: we allow the user to override the auto-setting by defining WebkitBackfaceVisibility in the vars of the tween.
+                                       if (_isSafariLT6) {
+                                               this._addLazySet(style, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (threeD ? "visible" : "hidden"));
+                                       }
+                               }
+                               pt2 = pt;
+                               while (pt2 && pt2._next) {
+                                       pt2 = pt2._next;
+                               }
+                               tpt = new CSSPropTween(target, "transform", 0, 0, null, 2);
+                               this._linkCSSP(tpt, null, pt2);
+                               tpt.setRatio = (threeD && _supports3D) ? _set3DTransformRatio : _transformProp ? _set2DTransformRatio : _setIETransformRatio;
+                               tpt.data = this._transform || _getTransform(target, _cs, true);
+                               _overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here.
+                       }
+
+                       if (_hasPriority) {
+                               //reorders the linked list in order of pr (priority)
+                               while (pt) {
+                                       next = pt._next;
+                                       pt2 = first;
+                                       while (pt2 && pt2.pr > pt.pr) {
+                                               pt2 = pt2._next;
+                                       }
+                                       if ((pt._prev = pt2 ? pt2._prev : last)) {
+                                               pt._prev._next = pt;
+                                       } else {
+                                               first = pt;
+                                       }
+                                       if ((pt._next = pt2)) {
+                                               pt2._prev = pt;
+                                       } else {
+                                               last = pt;
+                                       }
+                                       pt = next;
+                               }
+                               this._firstPT = first;
+                       }
+                       return true;
+               };
+
+
+               p.parse = function(target, vars, pt, plugin) {
+                       var style = target.style,
+                               p, sp, bn, en, bs, es, bsfx, esfx, isStr, rel;
+                       for (p in vars) {
+                               es = vars[p]; //ending value string
+                               sp = _specialProps[p]; //SpecialProp lookup.
+                               if (sp) {
+                                       pt = sp.parse(target, es, p, this, pt, plugin, vars);
+
+                               } else {
+                                       bs = _getStyle(target, p, _cs) + "";
+                                       isStr = (typeof(es) === "string");
+                                       if (p === "color" || p === "fill" || p === "stroke" || p.indexOf("Color") !== -1 || (isStr && _rgbhslExp.test(es))) { //Opera uses background: to define color sometimes in addition to backgroundColor:
+                                               if (!isStr) {
+                                                       es = _parseColor(es);
+                                                       es = ((es.length > 3) ? "rgba(" : "rgb(") + es.join(",") + ")";
+                                               }
+                                               pt = _parseComplex(style, p, bs, es, true, "transparent", pt, 0, plugin);
+
+                                       } else if (isStr && (es.indexOf(" ") !== -1 || es.indexOf(",") !== -1)) {
+                                               pt = _parseComplex(style, p, bs, es, true, null, pt, 0, plugin);
+
+                                       } else {
+                                               bn = parseFloat(bs);
+                                               bsfx = (bn || bn === 0) ? bs.substr((bn + "").length) : ""; //remember, bs could be non-numeric like "normal" for fontWeight, so we should default to a blank suffix in that case.
+
+                                               if (bs === "" || bs === "auto") {
+                                                       if (p === "width" || p === "height") {
+                                                               bn = _getDimension(target, p, _cs);
+                                                               bsfx = "px";
+                                                       } else if (p === "left" || p === "top") {
+                                                               bn = _calculateOffset(target, p, _cs);
+                                                               bsfx = "px";
+                                                       } else {
+                                                               bn = (p !== "opacity") ? 0 : 1;
+                                                               bsfx = "";
+                                                       }
+                                               }
+
+                                               rel = (isStr && es.charAt(1) === "=");
+                                               if (rel) {
+                                                       en = parseInt(es.charAt(0) + "1", 10);
+                                                       es = es.substr(2);
+                                                       en *= parseFloat(es);
+                                                       esfx = es.replace(_suffixExp, "");
+                                               } else {
+                                                       en = parseFloat(es);
+                                                       esfx = isStr ? es.substr((en + "").length) || "" : "";
+                                               }
+
+                                               if (esfx === "") {
+                                                       esfx = (p in _suffixMap) ? _suffixMap[p] : bsfx; //populate the end suffix, prioritizing the map, then if none is found, use the beginning suffix.
+                                               }
+
+                                               es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix.
+
+                                               //if the beginning/ending suffixes don't match, normalize them...
+                                               if (bsfx !== esfx) if (esfx !== "") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units!
+                                                       bn = _convertToPixels(target, p, bn, bsfx);
+                                                       if (esfx === "%") {
+                                                               bn /= _convertToPixels(target, p, 100, "%") / 100;
+                                                               if (vars.strictUnits !== true) { //some browsers report only "px" values instead of allowing "%" with getComputedStyle(), so we assume that if we're tweening to a %, we should start there too unless strictUnits:true is defined. This approach is particularly useful for responsive designs that use from() tweens.
+                                                                       bs = bn + "%";
+                                                               }
+
+                                                       } else if (esfx === "em") {
+                                                               bn /= _convertToPixels(target, p, 1, "em");
+
+                                                       //otherwise convert to pixels.
+                                                       } else if (esfx !== "px") {
+                                                               en = _convertToPixels(target, p, en, esfx);
+                                                               esfx = "px"; //we don't use bsfx after this, so we don't need to set it to px too.
+                                                       }
+                                                       if (rel) if (en || en === 0) {
+                                                               es = (en + bn) + esfx; //the changes we made affect relative calculations, so adjust the end value here.
+                                                       }
+                                               }
+
+                                               if (rel) {
+                                                       en += bn;
+                                               }
+
+                                               if ((bn || bn === 0) && (en || en === 0)) { //faster than isNaN(). Also, previously we required en !== bn but that doesn't really gain much performance and it prevents _parseToProxy() from working properly if beginning and ending values match but need to get tweened by an external plugin anyway. For example, a bezier tween where the target starts at left:0 and has these points: [{left:50},{left:0}] wouldn't work properly because when parsing the last point, it'd match the first (current) one and a non-tweening CSSPropTween would be recorded when we actually need a normal tween (type:0) so that things get updated during the tween properly.
+                                                       pt = new CSSPropTween(style, p, bn, en - bn, pt, 0, p, (_autoRound !== false && (esfx === "px" || p === "zIndex")), 0, bs, es);
+                                                       pt.xs0 = esfx;
+                                                       //DEBUG: _log("tween "+p+" from "+pt.b+" ("+bn+esfx+") to "+pt.e+" with suffix: "+pt.xs0);
+                                               } else if (style[p] === undefined || !es && (es + "" === "NaN" || es == null)) {
+                                                       _log("invalid " + p + " tween value: " + vars[p]);
+                                               } else {
+                                                       pt = new CSSPropTween(style, p, en || bn || 0, 0, pt, -1, p, false, 0, bs, es);
+                                                       pt.xs0 = (es === "none" && (p === "display" || p.indexOf("Style") !== -1)) ? bs : es; //intermediate value should typically be set immediately (end value) except for "display" or things like borderTopStyle, borderBottomStyle, etc. which should use the beginning value during the tween.
+                                                       //DEBUG: _log("non-tweening value "+p+": "+pt.xs0);
+                                               }
+                                       }
+                               }
+                               if (plugin) if (pt && !pt.plugin) {
+                                       pt.plugin = plugin;
+                               }
+                       }
+                       return pt;
+               };
+
+
+               //gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1.
+               p.setRatio = function(v) {
+                       var pt = this._firstPT,
+                               min = 0.000001,
+                               val, str, i;
+
+                       //at the end of the tween, we set the values to exactly what we received in order to make sure non-tweening values (like "position" or "float" or whatever) are set and so that if the beginning/ending suffixes (units) didn't match and we normalized to px, the value that the user passed in is used here. We check to see if the tween is at its beginning in case it's a from() tween in which case the ratio will actually go from 1 to 0 over the course of the tween (backwards).
+                       if (v === 1 && (this._tween._time === this._tween._duration || this._tween._time === 0)) {
+                               while (pt) {
+                                       if (pt.type !== 2) {
+                                               pt.t[pt.p] = pt.e;
+                                       } else {
+                                               pt.setRatio(v);
+                                       }
+                                       pt = pt._next;
+                               }
+
+                       } else if (v || !(this._tween._time === this._tween._duration || this._tween._time === 0) || this._tween._rawPrevTime === -0.000001) {
+                               while (pt) {
+                                       val = pt.c * v + pt.s;
+                                       if (pt.r) {
+                                               val = Math.round(val);
+                                       } else if (val < min) if (val > -min) {
+                                               val = 0;
+                                       }
+                                       if (!pt.type) {
+                                               pt.t[pt.p] = val + pt.xs0;
+                                       } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)"
+                                               i = pt.l;
+                                               if (i === 2) {
+                                                       pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2;
+                                               } else if (i === 3) {
+                                                       pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3;
+                                               } else if (i === 4) {
+                                                       pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4;
+                                               } else if (i === 5) {
+                                                       pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4 + pt.xn4 + pt.xs5;
+                                               } else {
+                                                       str = pt.xs0 + val + pt.xs1;
+                                                       for (i = 1; i < pt.l; i++) {
+                                                               str += pt["xn"+i] + pt["xs"+(i+1)];
+                                                       }
+                                                       pt.t[pt.p] = str;
+                                               }
+
+                                       } else if (pt.type === -1) { //non-tweening value
+                                               pt.t[pt.p] = pt.xs0;
+
+                                       } else if (pt.setRatio) { //custom setRatio() for things like SpecialProps, external plugins, etc.
+                                               pt.setRatio(v);
+                                       }
+                                       pt = pt._next;
+                               }
+
+                       //if the tween is reversed all the way back to the beginning, we need to restore the original values which may have different units (like % instead of px or em or whatever).
+                       } else {
+                               while (pt) {
+                                       if (pt.type !== 2) {
+                                               pt.t[pt.p] = pt.b;
+                                       } else {
+                                               pt.setRatio(v);
+                                       }
+                                       pt = pt._next;
+                               }
+                       }
+               };
+
+               /**
+                * @private
+                * Forces rendering of the target's transforms (rotation, scale, etc.) whenever the CSSPlugin's setRatio() is called.
+                * Basically, this tells the CSSPlugin to create a CSSPropTween (type 2) after instantiation that runs last in the linked
+                * list and calls the appropriate (3D or 2D) rendering function. We separate this into its own method so that we can call
+                * it from other plugins like BezierPlugin if, for example, it needs to apply an autoRotation and this CSSPlugin
+                * doesn't have any transform-related properties of its own. You can call this method as many times as you
+                * want and it won't create duplicate CSSPropTweens.
+                *
+                * @param {boolean} threeD if true, it should apply 3D tweens (otherwise, just 2D ones are fine and typically faster)
+                */
+               p._enableTransforms = function(threeD) {
+                       this._transformType = (threeD || this._transformType === 3) ? 3 : 2;
+                       this._transform = this._transform || _getTransform(this._target, _cs, true); //ensures that the element has a _gsTransform property with the appropriate values.
+               };
+
+               var lazySet = function(v) {
+                       this.t[this.p] = this.e;
+                       this.data._linkCSSP(this, this._next, null, true); //we purposefully keep this._next even though it'd make sense to null it, but this is a performance optimization, as this happens during the while (pt) {} loop in setRatio() at the bottom of which it sets pt = pt._next, so if we null it, the linked list will be broken in that loop.
+               };
+               /** @private Gives us a way to set a value on the first render (and only the first render). **/
+               p._addLazySet = function(t, p, v) {
+                       var pt = this._firstPT = new CSSPropTween(t, p, 0, 0, this._firstPT, 2);
+                       pt.e = v;
+                       pt.setRatio = lazySet;
+                       pt.data = this;
+               };
+
+               /** @private **/
+               p._linkCSSP = function(pt, next, prev, remove) {
+                       if (pt) {
+                               if (next) {
+                                       next._prev = pt;
+                               }
+                               if (pt._next) {
+                                       pt._next._prev = pt._prev;
+                               }
+                               if (pt._prev) {
+                                       pt._prev._next = pt._next;
+                               } else if (this._firstPT === pt) {
+                                       this._firstPT = pt._next;
+                                       remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed)
+                               }
+                               if (prev) {
+                                       prev._next = pt;
+                               } else if (!remove && this._firstPT === null) {
+                                       this._firstPT = pt;
+                               }
+                               pt._next = next;
+                               pt._prev = prev;
+                       }
+                       return pt;
+               };
+
+               //we need to make sure that if alpha or autoAlpha is killed, opacity is too. And autoAlpha affects the "visibility" property.
+               p._kill = function(lookup) {
+                       var copy = lookup,
+                               pt, p, xfirst;
+                       if (lookup.autoAlpha || lookup.alpha) {
+                               copy = {};
+                               for (p in lookup) { //copy the lookup so that we're not changing the original which may be passed elsewhere.
+                                       copy[p] = lookup[p];
+                               }
+                               copy.opacity = 1;
+                               if (copy.autoAlpha) {
+                                       copy.visibility = 1;
+                               }
+                       }
+                       if (lookup.className && (pt = this._classNamePT)) { //for className tweens, we need to kill any associated CSSPropTweens too; a linked list starts at the className's "xfirst".
+                               xfirst = pt.xfirst;
+                               if (xfirst && xfirst._prev) {
+                                       this._linkCSSP(xfirst._prev, pt._next, xfirst._prev._prev); //break off the prev
+                               } else if (xfirst === this._firstPT) {
+                                       this._firstPT = pt._next;
+                               }
+                               if (pt._next) {
+                                       this._linkCSSP(pt._next, pt._next._next, xfirst._prev);
+                               }
+                               this._classNamePT = null;
+                       }
+                       return TweenPlugin.prototype._kill.call(this, copy);
+               };
+
+
+
+               //used by cascadeTo() for gathering all the style properties of each child element into an array for comparison.
+               var _getChildStyles = function(e, props, targets) {
+                               var children, i, child, type;
+                               if (e.slice) {
+                                       i = e.length;
+                                       while (--i > -1) {
+                                               _getChildStyles(e[i], props, targets);
+                                       }
+                                       return;
+                               }
+                               children = e.childNodes;
+                               i = children.length;
+                               while (--i > -1) {
+                                       child = children[i];
+                                       type = child.type;
+                                       if (child.style) {
+                                               props.push(_getAllStyles(child));
+                                               if (targets) {
+                                                       targets.push(child);
+                                               }
+                                       }
+                                       if ((type === 1 || type === 9 || type === 11) && child.childNodes.length) {
+                                               _getChildStyles(child, props, targets);
+                                       }
+                               }
+                       };
+
+               /**
+                * Typically only useful for className tweens that may affect child elements, this method creates a TweenLite
+                * and then compares the style properties of all the target's child elements at the tween's start and end, and
+                * if any are different, it also creates tweens for those and returns an array containing ALL of the resulting
+                * tweens (so that you can easily add() them to a TimelineLite, for example). The reason this functionality is
+                * wrapped into a separate static method of CSSPlugin instead of being integrated into all regular className tweens
+                * is because it creates entirely new tweens that may have completely different targets than the original tween,
+                * so if they were all lumped into the original tween instance, it would be inconsistent with the rest of the API
+                * and it would create other problems. For example:
+                *  - If I create a tween of elementA, that tween instance may suddenly change its target to include 50 other elements (unintuitive if I specifically defined the target I wanted)
+                *  - We can't just create new independent tweens because otherwise, what happens if the original/parent tween is reversed or pause or dropped into a TimelineLite for tight control? You'd expect that tween's behavior to affect all the others.
+                *  - Analyzing every style property of every child before and after the tween is an expensive operation when there are many children, so this behavior shouldn't be imposed on all className tweens by default, especially since it's probably rare that this extra functionality is needed.
+                *
+                * @param {Object} target object to be tweened
+                * @param {number} Duration in seconds (or frames for frames-based tweens)
+                * @param {Object} Object containing the end values, like {className:"newClass", ease:Linear.easeNone}
+                * @return {Array} An array of TweenLite instances
+                */
+               CSSPlugin.cascadeTo = function(target, duration, vars) {
+                       var tween = TweenLite.to(target, duration, vars),
+                               results = [tween],
+                               b = [],
+                               e = [],
+                               targets = [],
+                               _reservedProps = TweenLite._internals.reservedProps,
+                               i, difs, p;
+                       target = tween._targets || tween.target;
+                       _getChildStyles(target, b, targets);
+                       tween.render(duration, true);
+                       _getChildStyles(target, e);
+                       tween.render(0, true);
+                       tween._enabled(true);
+                       i = targets.length;
+                       while (--i > -1) {
+                               difs = _cssDif(targets[i], b[i], e[i]);
+                               if (difs.firstMPT) {
+                                       difs = difs.difs;
+                                       for (p in vars) {
+                                               if (_reservedProps[p]) {
+                                                       difs[p] = vars[p];
+                                               }
+                                       }
+                                       results.push( TweenLite.to(targets[i], duration, difs) );
+                               }
+                       }
+                       return results;
+               };
+
+               TweenPlugin.activate([CSSPlugin]);
+               return CSSPlugin;
+
+       }, true);
+
+       
+       
+       
+       
+       
+       
+       
+       
+       
+       
+/*
+ * ----------------------------------------------------------------
+ * RoundPropsPlugin
+ * ----------------------------------------------------------------
+ */
+       (function() {
+
+               var RoundPropsPlugin = window._gsDefine.plugin({
+                               propName: "roundProps",
+                               priority: -1,
+                               API: 2,
+
+                               //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
+                               init: function(target, value, tween) {
+                                       this._tween = tween;
+                                       return true;
+                               }
+
+                       }),
+                       p = RoundPropsPlugin.prototype;
+
+               p._onInitAllProps = function() {
+                       var tween = this._tween,
+                               rp = (tween.vars.roundProps instanceof Array) ? tween.vars.roundProps : tween.vars.roundProps.split(","),
+                               i = rp.length,
+                               lookup = {},
+                               rpt = tween._propLookup.roundProps,
+                               prop, pt, next;
+                       while (--i > -1) {
+                               lookup[rp[i]] = 1;
+                       }
+                       i = rp.length;
+                       while (--i > -1) {
+                               prop = rp[i];
+                               pt = tween._firstPT;
+                               while (pt) {
+                                       next = pt._next; //record here, because it may get removed
+                                       if (pt.pg) {
+                                               pt.t._roundProps(lookup, true);
+                                       } else if (pt.n === prop) {
+                                               this._add(pt.t, prop, pt.s, pt.c);
+                                               //remove from linked list
+                                               if (next) {
+                                                       next._prev = pt._prev;
+                                               }
+                                               if (pt._prev) {
+                                                       pt._prev._next = next;
+                                               } else if (tween._firstPT === pt) {
+                                                       tween._firstPT = next;
+                                               }
+                                               pt._next = pt._prev = null;
+                                               tween._propLookup[prop] = rpt;
+                                       }
+                                       pt = next;
+                               }
+                       }
+                       return false;
+               };
+
+               p._add = function(target, p, s, c) {
+                       this._addTween(target, p, s, s + c, p, true);
+                       this._overwriteProps.push(p);
+               };
+
+       }());
+
+
+
+
+
+
+
+
+
+
+/*
+ * ----------------------------------------------------------------
+ * AttrPlugin
+ * ----------------------------------------------------------------
+ */
+       window._gsDefine.plugin({
+               propName: "attr",
+               API: 2,
+               version: "0.3.2",
+
+               //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
+               init: function(target, value, tween) {
+                       var p, start, end;
+                       if (typeof(target.setAttribute) !== "function") {
+                               return false;
+                       }
+                       this._target = target;
+                       this._proxy = {};
+                       this._start = {}; // we record start and end values exactly as they are in case they're strings (not numbers) - we need to be able to revert to them cleanly.
+                       this._end = {};
+                       for (p in value) {
+                               this._start[p] = this._proxy[p] = start = target.getAttribute(p);
+                               end = this._addTween(this._proxy, p, parseFloat(start), value[p], p);
+                               this._end[p] = end ? end.s + end.c : value[p];
+                               this._overwriteProps.push(p);
+                       }
+                       return true;
+               },
+
+               //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
+               set: function(ratio) {
+                       this._super.setRatio.call(this, ratio);
+                       var props = this._overwriteProps,
+                               i = props.length,
+                               lookup = (ratio === 1) ? this._end : ratio ? this._proxy : this._start,
+                               p;
+                       while (--i > -1) {
+                               p = props[i];
+                               this._target.setAttribute(p, lookup[p] + "");
+                       }
+               }
+
+       });
+
+
+
+
+
+
+
+
+
+
+/*
+ * ----------------------------------------------------------------
+ * DirectionalRotationPlugin
+ * ----------------------------------------------------------------
+ */
+       window._gsDefine.plugin({
+               propName: "directionalRotation",
+               API: 2,
+               version: "0.2.0",
+
+               //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
+               init: function(target, value, tween) {
+                       if (typeof(value) !== "object") {
+                               value = {rotation:value};
+                       }
+                       this.finals = {};
+                       var cap = (value.useRadians === true) ? Math.PI * 2 : 360,
+                               min = 0.000001,
+                               p, v, start, end, dif, split;
+                       for (p in value) {
+                               if (p !== "useRadians") {
+                                       split = (value[p] + "").split("_");
+                                       v = split[0];
+                                       start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() );
+                                       end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0;
+                                       dif = end - start;
+                                       if (split.length) {
+                                               v = split.join("_");
+                                               if (v.indexOf("short") !== -1) {
+                                                       dif = dif % cap;
+                                                       if (dif !== dif % (cap / 2)) {
+                                                               dif = (dif < 0) ? dif + cap : dif - cap;
+                                                       }
+                                               }
+                                               if (v.indexOf("_cw") !== -1 && dif < 0) {
+                                                       dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
+                                               } else if (v.indexOf("ccw") !== -1 && dif > 0) {
+                                                       dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap;
+                                               }
+                                       }
+                                       if (dif > min || dif < -min) {
+                                               this._addTween(target, p, start, start + dif, p);
+                                               this._overwriteProps.push(p);
+                                       }
+                               }
+                       }
+                       return true;
+               },
+
+               //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
+               set: function(ratio) {
+                       var pt;
+                       if (ratio !== 1) {
+                               this._super.setRatio.call(this, ratio);
+                       } else {
+                               pt = this._firstPT;
+                               while (pt) {
+                                       if (pt.f) {
+                                               pt.t[pt.p](this.finals[pt.p]);
+                                       } else {
+                                               pt.t[pt.p] = this.finals[pt.p];
+                                       }
+                                       pt = pt._next;
+                               }
+                       }
+               }
+
+       })._autoCSS = true;
+
+
+
+
+
+
+
+       
+       
+       
+       
+/*
+ * ----------------------------------------------------------------
+ * EasePack
+ * ----------------------------------------------------------------
+ */
+       window._gsDefine("easing.Back", ["easing.Ease"], function(Ease) {
+               
+               var w = (window.GreenSockGlobals || window),
+                       gs = w.com.greensock,
+                       _2PI = Math.PI * 2,
+                       _HALF_PI = Math.PI / 2,
+                       _class = gs._class,
+                       _create = function(n, f) {
+                               var C = _class("easing." + n, function(){}, true),
+                                       p = C.prototype = new Ease();
+                               p.constructor = C;
+                               p.getRatio = f;
+                               return C;
+                       },
+                       _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist.
+                       _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) {
+                               var C = _class("easing."+name, {
+                                       easeOut:new EaseOut(),
+                                       easeIn:new EaseIn(),
+                                       easeInOut:new EaseInOut()
+                               }, true);
+                               _easeReg(C, name);
+                               return C;
+                       },
+                       EasePoint = function(time, value, next) {
+                               this.t = time;
+                               this.v = value;
+                               if (next) {
+                                       this.next = next;
+                                       next.prev = this;
+                                       this.c = next.v - value;
+                                       this.gap = next.t - time;
+                               }
+                       },
+
+                       //Back
+                       _createBack = function(n, f) {
+                               var C = _class("easing." + n, function(overshoot) {
+                                               this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158;
+                                               this._p2 = this._p1 * 1.525;
+                                       }, true),
+                                       p = C.prototype = new Ease();
+                               p.constructor = C;
+                               p.getRatio = f;
+                               p.config = function(overshoot) {
+                                       return new C(overshoot);
+                               };
+                               return C;
+                       },
+
+                       Back = _wrap("Back",
+                               _createBack("BackOut", function(p) {
+                                       return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1);
+                               }),
+                               _createBack("BackIn", function(p) {
+                                       return p * p * ((this._p1 + 1) * p - this._p1);
+                               }),
+                               _createBack("BackInOut", function(p) {
+                                       return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2);
+                               })
+                       ),
+
+
+                       //SlowMo
+                       SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) {
+                               power = (power || power === 0) ? power : 0.7;
+                               if (linearRatio == null) {
+                                       linearRatio = 0.7;
+                               } else if (linearRatio > 1) {
+                                       linearRatio = 1;
+                               }
+                               this._p = (linearRatio !== 1) ? power : 0;
+                               this._p1 = (1 - linearRatio) / 2;
+                               this._p2 = linearRatio;
+                               this._p3 = this._p1 + this._p2;
+                               this._calcEnd = (yoyoMode === true);
+                       }, true),
+                       p = SlowMo.prototype = new Ease(),
+                       SteppedEase, RoughEase, _createElastic;
+
+               p.constructor = SlowMo;
+               p.getRatio = function(p) {
+                       var r = p + (0.5 - p) * this._p;
+                       if (p < this._p1) {
+                               return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r);
+                       } else if (p > this._p3) {
+                               return this._calcEnd ? 1 - (p = (p - this._p3) / this._p1) * p : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p);
+                       }
+                       return this._calcEnd ? 1 : r;
+               };
+               SlowMo.ease = new SlowMo(0.7, 0.7);
+
+               p.config = SlowMo.config = function(linearRatio, power, yoyoMode) {
+                       return new SlowMo(linearRatio, power, yoyoMode);
+               };
+
+
+               //SteppedEase
+               SteppedEase = _class("easing.SteppedEase", function(steps) {
+                               steps = steps || 1;
+                               this._p1 = 1 / steps;
+                               this._p2 = steps + 1;
+                       }, true);
+               p = SteppedEase.prototype = new Ease();
+               p.constructor = SteppedEase;
+               p.getRatio = function(p) {
+                       if (p < 0) {
+                               p = 0;
+                       } else if (p >= 1) {
+                               p = 0.999999999;
+                       }
+                       return ((this._p2 * p) >> 0) * this._p1;
+               };
+               p.config = SteppedEase.config = function(steps) {
+                       return new SteppedEase(steps);
+               };
+
+
+               //RoughEase
+               RoughEase = _class("easing.RoughEase", function(vars) {
+                       vars = vars || {};
+                       var taper = vars.taper || "none",
+                               a = [],
+                               cnt = 0,
+                               points = (vars.points || 20) | 0,
+                               i = points,
+                               randomize = (vars.randomize !== false),
+                               clamp = (vars.clamp === true),
+                               template = (vars.template instanceof Ease) ? vars.template : null,
+                               strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4,
+                               x, y, bump, invX, obj, pnt;
+                       while (--i > -1) {
+                               x = randomize ? Math.random() : (1 / points) * i;
+                               y = template ? template.getRatio(x) : x;
+                               if (taper === "none") {
+                                       bump = strength;
+                               } else if (taper === "out") {
+                                       invX = 1 - x;
+                                       bump = invX * invX * strength;
+                               } else if (taper === "in") {
+                                       bump = x * x * strength;
+                               } else if (x < 0.5) {  //"both" (start)
+                                       invX = x * 2;
+                                       bump = invX * invX * 0.5 * strength;
+                               } else {                                //"both" (end)
+                                       invX = (1 - x) * 2;
+                                       bump = invX * invX * 0.5 * strength;
+                               }
+                               if (randomize) {
+                                       y += (Math.random() * bump) - (bump * 0.5);
+                               } else if (i % 2) {
+                                       y += bump * 0.5;
+                               } else {
+                                       y -= bump * 0.5;
+                               }
+                               if (clamp) {
+                                       if (y > 1) {
+                                               y = 1;
+                                       } else if (y < 0) {
+                                               y = 0;
+                                       }
+                               }
+                               a[cnt++] = {x:x, y:y};
+                       }
+                       a.sort(function(a, b) {
+                               return a.x - b.x;
+                       });
+
+                       pnt = new EasePoint(1, 1, null);
+                       i = points;
+                       while (--i > -1) {
+                               obj = a[i];
+                               pnt = new EasePoint(obj.x, obj.y, pnt);
+                       }
+
+                       this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next);
+               }, true);
+               p = RoughEase.prototype = new Ease();
+               p.constructor = RoughEase;
+               p.getRatio = function(p) {
+                       var pnt = this._prev;
+                       if (p > pnt.t) {
+                               while (pnt.next && p >= pnt.t) {
+                                       pnt = pnt.next;
+                               }
+                               pnt = pnt.prev;
+                       } else {
+                               while (pnt.prev && p <= pnt.t) {
+                                       pnt = pnt.prev;
+                               }
+                       }
+                       this._prev = pnt;
+                       return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c);
+               };
+               p.config = function(vars) {
+                       return new RoughEase(vars);
+               };
+               RoughEase.ease = new RoughEase();
+
+
+               //Bounce
+               _wrap("Bounce",
+                       _create("BounceOut", function(p) {
+                               if (p < 1 / 2.75) {
+                                       return 7.5625 * p * p;
+                               } else if (p < 2 / 2.75) {
+                                       return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
+                               } else if (p < 2.5 / 2.75) {
+                                       return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
+                               }
+                               return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
+                       }),
+                       _create("BounceIn", function(p) {
+                               if ((p = 1 - p) < 1 / 2.75) {
+                                       return 1 - (7.5625 * p * p);
+                               } else if (p < 2 / 2.75) {
+                                       return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75);
+                               } else if (p < 2.5 / 2.75) {
+                                       return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375);
+                               }
+                               return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375);
+                       }),
+                       _create("BounceInOut", function(p) {
+                               var invert = (p < 0.5);
+                               if (invert) {
+                                       p = 1 - (p * 2);
+                               } else {
+                                       p = (p * 2) - 1;
+                               }
+                               if (p < 1 / 2.75) {
+                                       p = 7.5625 * p * p;
+                               } else if (p < 2 / 2.75) {
+                                       p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75;
+                               } else if (p < 2.5 / 2.75) {
+                                       p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375;
+                               } else {
+                                       p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375;
+                               }
+                               return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5;
+                       })
+               );
+
+
+               //CIRC
+               _wrap("Circ",
+                       _create("CircOut", function(p) {
+                               return Math.sqrt(1 - (p = p - 1) * p);
+                       }),
+                       _create("CircIn", function(p) {
+                               return -(Math.sqrt(1 - (p * p)) - 1);
+                       }),
+                       _create("CircInOut", function(p) {
+                               return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1);
+                       })
+               );
+
+
+               //Elastic
+               _createElastic = function(n, f, def) {
+                       var C = _class("easing." + n, function(amplitude, period) {
+                                       this._p1 = amplitude || 1;
+                                       this._p2 = period || def;
+                                       this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0);
+                               }, true),
+                               p = C.prototype = new Ease();
+                       p.constructor = C;
+                       p.getRatio = f;
+                       p.config = function(amplitude, period) {
+                               return new C(amplitude, period);
+                       };
+                       return C;
+               };
+               _wrap("Elastic",
+                       _createElastic("ElasticOut", function(p) {
+                               return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * _2PI / this._p2 ) + 1;
+                       }, 0.3),
+                       _createElastic("ElasticIn", function(p) {
+                               return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2 ));
+                       }, 0.3),
+                       _createElastic("ElasticInOut", function(p) {
+                               return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * _2PI / this._p2 ) *0.5 + 1;
+                       }, 0.45)
+               );
+
+
+               //Expo
+               _wrap("Expo",
+                       _create("ExpoOut", function(p) {
+                               return 1 - Math.pow(2, -10 * p);
+                       }),
+                       _create("ExpoIn", function(p) {
+                               return Math.pow(2, 10 * (p - 1)) - 0.001;
+                       }),
+                       _create("ExpoInOut", function(p) {
+                               return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1)));
+                       })
+               );
+
+
+               //Sine
+               _wrap("Sine",
+                       _create("SineOut", function(p) {
+                               return Math.sin(p * _HALF_PI);
+                       }),
+                       _create("SineIn", function(p) {
+                               return -Math.cos(p * _HALF_PI) + 1;
+                       }),
+                       _create("SineInOut", function(p) {
+                               return -0.5 * (Math.cos(Math.PI * p) - 1);
+                       })
+               );
+
+               _class("easing.EaseLookup", {
+                               find:function(s) {
+                                       return Ease.map[s];
+                               }
+                       }, true);
+
+               //register the non-standard eases
+               _easeReg(w.SlowMo, "SlowMo", "ease,");
+               _easeReg(RoughEase, "RoughEase", "ease,");
+               _easeReg(SteppedEase, "SteppedEase", "ease,");
+
+               return Back;
+               
+       }, true);
+
+
+}); 
+
+
+
+
+
+
+
+
+
+
+
+/*
+ * ----------------------------------------------------------------
+ * Base classes like TweenLite, SimpleTimeline, Ease, Ticker, etc.
+ * ----------------------------------------------------------------
+ */
+(function(window) {
+
+               "use strict";
+               var _globals = window.GreenSockGlobals || window;
+               if (_globals.TweenLite) {
+                       return; //in case the core set of classes is already loaded, don't instantiate twice.
+               }
+               var _namespace = function(ns) {
+                               var a = ns.split("."),
+                                       p = _globals, i;
+                               for (i = 0; i < a.length; i++) {
+                                       p[a[i]] = p = p[a[i]] || {};
+                               }
+                               return p;
+                       },
+                       gs = _namespace("com.greensock"),
+                       _tinyNum = 0.0000000001,
+                       _slice = [].slice,
+                       _emptyFunc = function() {},
+                       _isArray = (function() { //works around issues in iframe environments where the Array global isn't shared, thus if the object originates in a different window/iframe, "(obj instanceof Array)" will evaluate false. We added some speed optimizations to avoid Object.prototype.toString.call() unless it's absolutely necessary because it's VERY slow (like 20x slower)
+                               var toString = Object.prototype.toString,
+                                       array = toString.call([]);
+                               return function(obj) {
+                                       return obj != null && (obj instanceof Array || (typeof(obj) === "object" && !!obj.push && toString.call(obj) === array));
+                               };
+                       }()),
+                       a, i, p, _ticker, _tickerActive,
+                       _defLookup = {},
+
+                       /**
+                        * @constructor
+                        * Defines a GreenSock class, optionally with an array of dependencies that must be instantiated first and passed into the definition.
+                        * This allows users to load GreenSock JS files in any order even if they have interdependencies (like CSSPlugin extends TweenPlugin which is
+                        * inside TweenLite.js, but if CSSPlugin is loaded first, it should wait to run its code until TweenLite.js loads and instantiates TweenPlugin
+                        * and then pass TweenPlugin to CSSPlugin's definition). This is all done automatically and internally.
+                        *
+                        * Every definition will be added to a "com.greensock" global object (typically window, but if a window.GreenSockGlobals object is found,
+                        * it will go there as of v1.7). For example, TweenLite will be found at window.com.greensock.TweenLite and since it's a global class that should be available anywhere,
+                        * it is ALSO referenced at window.TweenLite. However some classes aren't considered global, like the base com.greensock.core.Animation class, so
+                        * those will only be at the package like window.com.greensock.core.Animation. Again, if you define a GreenSockGlobals object on the window, everything
+                        * gets tucked neatly inside there instead of on the window directly. This allows you to do advanced things like load multiple versions of GreenSock
+                        * files and put them into distinct objects (imagine a banner ad uses a newer version but the main site uses an older one). In that case, you could
+                        * sandbox the banner one like:
+                        *
+                        * <script>
+                        *     var gs = window.GreenSockGlobals = {}; //the newer version we're about to load could now be referenced in a "gs" object, like gs.TweenLite.to(...). Use whatever alias you want as long as it's unique, "gs" or "banner" or whatever.
+                        * </script>
+                        * <script src="js/greensock/v1.7/TweenMax.js"></script>
+                        * <script>
+                        *     window.GreenSockGlobals = null; //reset it back to null so that the next load of TweenMax affects the window and we can reference things directly like TweenLite.to(...)
+                        * </script>
+                        * <script src="js/greensock/v1.6/TweenMax.js"></script>
+                        * <script>
+                        *     gs.TweenLite.to(...); //would use v1.7
+                        *     TweenLite.to(...); //would use v1.6
+                        * </script>
+                        *
+                        * @param {!string} ns The namespace of the class definition, leaving off "com.greensock." as that's assumed. For example, "TweenLite" or "plugins.CSSPlugin" or "easing.Back".
+                        * @param {!Array.<string>} dependencies An array of dependencies (described as their namespaces minus "com.greensock." prefix). For example ["TweenLite","plugins.TweenPlugin","core.Animation"]
+                        * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition.
+                        * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object)
+                        */
+                       Definition = function(ns, dependencies, func, global) {
+                               this.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses
+                               _defLookup[ns] = this;
+                               this.gsClass = null;
+                               this.func = func;
+                               var _classes = [];
+                               this.check = function(init) {
+                                       var i = dependencies.length,
+                                               missing = i,
+                                               cur, a, n, cl;
+                                       while (--i > -1) {
+                                               if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {
+                                                       _classes[i] = cur.gsClass;
+                                                       missing--;
+                                               } else if (init) {
+                                                       cur.sc.push(this);
+                                               }
+                                       }
+                                       if (missing === 0 && func) {
+                                               a = ("com.greensock." + ns).split(".");
+                                               n = a.pop();
+                                               cl = _namespace(a.join("."))[n] = this.gsClass = func.apply(func, _classes);
+
+                                               //exports to multiple environments
+                                               if (global) {
+                                                       _globals[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)
+                                                       if (typeof(define) === "function" && define.amd){ //AMD
+                                                               define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").join("/"), [], function() { return cl; });
+                                                       } else if (typeof(module) !== "undefined" && module.exports){ //node
+                                                               module.exports = cl;
+                                                       }
+                                               }
+                                               for (i = 0; i < this.sc.length; i++) {
+                                                       this.sc[i].check();
+                                               }
+                                       }
+                               };
+                               this.check(true);
+                       },
+
+                       //used to create Definition instances (which basically registers a class that has dependencies).
+                       _gsDefine = window._gsDefine = function(ns, dependencies, func, global) {
+                               return new Definition(ns, dependencies, func, global);
+                       },
+
+                       //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class).
+                       _class = gs._class = function(ns, func, global) {
+                               func = func || function() {};
+                               _gsDefine(ns, [], function(){ return func; }, global);
+                               return func;
+                       };
+
+               _gsDefine.globals = _globals;
+
+
+
+/*
+ * ----------------------------------------------------------------
+ * Ease
+ * ----------------------------------------------------------------
+ */
+               var _baseParams = [0, 0, 1, 1],
+                       _blankArray = [],
+                       Ease = _class("easing.Ease", function(func, extraParams, type, power) {
+                               this._func = func;
+                               this._type = type || 0;
+                               this._power = power || 0;
+                               this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams;
+                       }, true),
+                       _easeMap = Ease.map = {},
+                       _easeReg = Ease.register = function(ease, names, types, create) {
+                               var na = names.split(","),
+                                       i = na.length,
+                                       ta = (types || "easeIn,easeOut,easeInOut").split(","),
+                                       e, name, j, type;
+                               while (--i > -1) {
+                                       name = na[i];
+                                       e = create ? _class("easing."+name, null, true) : gs.easing[name] || {};
+                                       j = ta.length;
+                                       while (--j > -1) {
+                                               type = ta[j];
+                                               _easeMap[name + "." + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease();
+                                       }
+                               }
+                       };
+
+               p = Ease.prototype;
+               p._calcEnd = false;
+               p.getRatio = function(p) {
+                       if (this._func) {
+                               this._params[0] = p;
+                               return this._func.apply(null, this._params);
+                       }
+                       var t = this._type,
+                               pw = this._power,
+                               r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2;
+                       if (pw === 1) {
+                               r *= r;
+                       } else if (pw === 2) {
+                               r *= r * r;
+                       } else if (pw === 3) {
+                               r *= r * r * r;
+                       } else if (pw === 4) {
+                               r *= r * r * r * r;
+                       }
+                       return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2);
+               };
+
+               //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut)
+               a = ["Linear","Quad","Cubic","Quart","Quint,Strong"];
+               i = a.length;
+               while (--i > -1) {
+                       p = a[i]+",Power"+i;
+                       _easeReg(new Ease(null,null,1,i), p, "easeOut", true);
+                       _easeReg(new Ease(null,null,2,i), p, "easeIn" + ((i === 0) ? ",easeNone" : ""));
+                       _easeReg(new Ease(null,null,3,i), p, "easeInOut");
+               }
+               _easeMap.linear = gs.easing.Linear.easeIn;
+               _easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks
+
+
+/*
+ * ----------------------------------------------------------------
+ * EventDispatcher
+ * ----------------------------------------------------------------
+ */
+               var EventDispatcher = _class("events.EventDispatcher", function(target) {
+                       this._listeners = {};
+                       this._eventTarget = target || this;
+               });
+               p = EventDispatcher.prototype;
+
+               p.addEventListener = function(type, callback, scope, useParam, priority) {
+                       priority = priority || 0;
+                       var list = this._listeners[type],
+                               index = 0,
+                               listener, i;
+                       if (list == null) {
+                               this._listeners[type] = list = [];
+                       }
+                       i = list.length;
+                       while (--i > -1) {
+                               listener = list[i];
+                               if (listener.c === callback && listener.s === scope) {
+                                       list.splice(i, 1);
+                               } else if (index === 0 && listener.pr < priority) {
+                                       index = i + 1;
+                               }
+                       }
+                       list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority});
+                       if (this === _ticker && !_tickerActive) {
+                               _ticker.wake();
+                       }
+               };
+
+               p.removeEventListener = function(type, callback) {
+                       var list = this._listeners[type], i;
+                       if (list) {
+                               i = list.length;
+                               while (--i > -1) {
+                                       if (list[i].c === callback) {
+                                               list.splice(i, 1);
+                                               return;
+                                       }
+                               }
+                       }
+               };
+
+               p.dispatchEvent = function(type) {
+                       var list = this._listeners[type],
+                               i, t, listener;
+                       if (list) {
+                               i = list.length;
+                               t = this._eventTarget;
+                               while (--i > -1) {
+                                       listener = list[i];
+                                       if (listener.up) {
+                                               listener.c.call(listener.s || t, {type:type, target:t});
+                                       } else {
+                                               listener.c.call(listener.s || t);
+                                       }
+                               }
+                       }
+               };
+
+
+/*
+ * ----------------------------------------------------------------
+ * Ticker
+ * ----------------------------------------------------------------
+ */
+               var _reqAnimFrame = window.requestAnimationFrame,
+                       _cancelAnimFrame = window.cancelAnimationFrame,
+                       _getTime = Date.now || function() {return new Date().getTime();},
+                       _lastUpdate = _getTime();
+
+               //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill.
+               a = ["ms","moz","webkit","o"];
+               i = a.length;
+               while (--i > -1 && !_reqAnimFrame) {
+                       _reqAnimFrame = window[a[i] + "RequestAnimationFrame"];
+                       _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"];
+               }
+
+               _class("Ticker", function(fps, useRAF) {
+                       var _self = this,
+                               _startTime = _getTime(),
+                               _useRAF = (useRAF !== false && _reqAnimFrame),
+                               _lagThreshold = 500,
+                               _adjustedLag = 33,
+                               _fps, _req, _id, _gap, _nextTime,
+                               _tick = function(manual) {
+                                       var elapsed = _getTime() - _lastUpdate,
+                                               overlap, dispatch;
+                                       if (elapsed > _lagThreshold) {
+                                               _startTime += elapsed - _adjustedLag;
+                                       }
+                                       _lastUpdate += elapsed;
+                                       _self.time = (_lastUpdate - _startTime) / 1000;
+                                       overlap = _self.time - _nextTime;
+                                       if (!_fps || overlap > 0 || manual === true) {
+                                               _self.frame++;
+                                               _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap);
+                                               dispatch = true;
+                                       }
+                                       if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.
+                                               _id = _req(_tick);
+                                       }
+                                       if (dispatch) {
+                                               _self.dispatchEvent("tick");
+                                       }
+                               };
+
+                       EventDispatcher.call(_self);
+                       _self.time = _self.frame = 0;
+                       _self.tick = function() {
+                               _tick(true);
+                       };
+
+                       _self.lagSmoothing = function(threshold, adjustedLag) {
+                               _lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited
+                               _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0);
+                       };
+
+                       _self.sleep = function() {
+                               if (_id == null) {
+                                       return;
+                               }
+                               if (!_useRAF || !_cancelAnimFrame) {
+                                       clearTimeout(_id);
+                               } else {
+                                       _cancelAnimFrame(_id);
+                               }
+                               _req = _emptyFunc;
+                               _id = null;
+                               if (_self === _ticker) {
+                                       _tickerActive = false;
+                               }
+                       };
+
+                       _self.wake = function() {
+                               if (_id !== null) {
+                                       _self.sleep();
+                               } else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout().
+                                       _lastUpdate = _getTime() - _lagThreshold + 5;
+                               }
+                               _req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame;
+                               if (_self === _ticker) {
+                                       _tickerActive = true;
+                               }
+                               _tick(2);
+                       };
+
+                       _self.fps = function(value) {
+                               if (!arguments.length) {
+                                       return _fps;
+                               }
+                               _fps = value;
+                               _gap = 1 / (_fps || 60);
+                               _nextTime = this.time + _gap;
+                               _self.wake();
+                       };
+
+                       _self.useRAF = function(value) {
+                               if (!arguments.length) {
+                                       return _useRAF;
+                               }
+                               _self.sleep();
+                               _useRAF = value;
+                               _self.fps(_fps);
+                       };
+                       _self.fps(fps);
+
+                       //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition.
+                       setTimeout(function() {
+                               if (_useRAF && (!_id || _self.frame < 5)) {
+                                       _self.useRAF(false);
+                               }
+                       }, 1500);
+               });
+
+               p = gs.Ticker.prototype = new gs.events.EventDispatcher();
+               p.constructor = gs.Ticker;
+
+
+/*
+ * ----------------------------------------------------------------
+ * Animation
+ * ----------------------------------------------------------------
+ */
+               var Animation = _class("core.Animation", function(duration, vars) {
+                               this.vars = vars = vars || {};
+                               this._duration = this._totalDuration = duration || 0;
+                               this._delay = Number(vars.delay) || 0;
+                               this._timeScale = 1;
+                               this._active = (vars.immediateRender === true);
+                               this.data = vars.data;
+                               this._reversed = (vars.reversed === true);
+
+                               if (!_rootTimeline) {
+                                       return;
+                               }
+                               if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly.
+                                       _ticker.wake();
+                               }
+
+                               var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline;
+                               tl.add(this, tl._time);
+
+                               if (this.vars.paused) {
+                                       this.paused(true);
+                               }
+                       });
+
+               _ticker = Animation.ticker = new gs.Ticker();
+               p = Animation.prototype;
+               p._dirty = p._gc = p._initted = p._paused = false;
+               p._totalTime = p._time = 0;
+               p._rawPrevTime = -1;
+               p._next = p._last = p._onUpdate = p._timeline = p.timeline = null;
+               p._paused = false;
+
+
+               //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.
+               var _checkTimeout = function() {
+                               if (_tickerActive && _getTime() - _lastUpdate > 2000) {
+                                       _ticker.wake();
+                               }
+                               setTimeout(_checkTimeout, 2000);
+                       };
+               _checkTimeout();
+
+
+               p.play = function(from, suppressEvents) {
+                       if (from != null) {
+                               this.seek(from, suppressEvents);
+                       }
+                       return this.reversed(false).paused(false);
+               };
+
+               p.pause = function(atTime, suppressEvents) {
+                       if (atTime != null) {
+                               this.seek(atTime, suppressEvents);
+                       }
+                       return this.paused(true);
+               };
+
+               p.resume = function(from, suppressEvents) {
+                       if (from != null) {
+                               this.seek(from, suppressEvents);
+                       }
+                       return this.paused(false);
+               };
+
+               p.seek = function(time, suppressEvents) {
+                       return this.totalTime(Number(time), suppressEvents !== false);
+               };
+
+               p.restart = function(includeDelay, suppressEvents) {
+                       return this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true);
+               };
+
+               p.reverse = function(from, suppressEvents) {
+                       if (from != null) {
+                               this.seek((from || this.totalDuration()), suppressEvents);
+                       }
+                       return this.reversed(true).paused(false);
+               };
+
+               p.render = function(time, suppressEvents, force) {
+                       //stub - we override this method in subclasses.
+               };
+
+               p.invalidate = function() {
+                       return this;
+               };
+
+               p.isActive = function() {
+                       var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active.
+                               startTime = this._startTime,
+                               rawTime;
+                       return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime()) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));
+               };
+
+               p._enabled = function (enabled, ignoreTimeline) {
+                       if (!_tickerActive) {
+                               _ticker.wake();
+                       }
+                       this._gc = !enabled;
+                       this._active = this.isActive();
+                       if (ignoreTimeline !== true) {
+                               if (enabled && !this.timeline) {
+                                       this._timeline.add(this, this._startTime - this._delay);
+                               } else if (!enabled && this.timeline) {
+                                       this._timeline._remove(this, true);
+                               }
+                       }
+                       return false;
+               };
+
+
+               p._kill = function(vars, target) {
+                       return this._enabled(false, false);
+               };
+
+               p.kill = function(vars, target) {
+                       this._kill(vars, target);
+                       return this;
+               };
+
+               p._uncache = function(includeSelf) {
+                       var tween = includeSelf ? this : this.timeline;
+                       while (tween) {
+                               tween._dirty = true;
+                               tween = tween.timeline;
+                       }
+                       return this;
+               };
+
+               p._swapSelfInParams = function(params) {
+                       var i = params.length,
+                               copy = params.concat();
+                       while (--i > -1) {
+                               if (params[i] === "{self}") {
+                                       copy[i] = this;
+                               }
+                       }
+                       return copy;
+               };
+
+//----Animation getters/setters --------------------------------------------------------
+
+               p.eventCallback = function(type, callback, params, scope) {
+                       if ((type || "").substr(0,2) === "on") {
+                               var v = this.vars;
+                               if (arguments.length === 1) {
+                                       return v[type];
+                               }
+                               if (callback == null) {
+                                       delete v[type];
+                               } else {
+                                       v[type] = callback;
+                                       v[type + "Params"] = (_isArray(params) && params.join("").indexOf("{self}") !== -1) ? this._swapSelfInParams(params) : params;
+                                       v[type + "Scope"] = scope;
+                               }
+                               if (type === "onUpdate") {
+                                       this._onUpdate = callback;
+                               }
+                       }
+                       return this;
+               };
+
+               p.delay = function(value) {
+                       if (!arguments.length) {
+                               return this._delay;
+                       }
+                       if (this._timeline.smoothChildTiming) {
+                               this.startTime( this._startTime + value - this._delay );
+                       }
+                       this._delay = value;
+                       return this;
+               };
+
+               p.duration = function(value) {
+                       if (!arguments.length) {
+                               this._dirty = false;
+                               return this._duration;
+                       }
+                       this._duration = this._totalDuration = value;
+                       this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration.
+                       if (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) {
+                               this.totalTime(this._totalTime * (value / this._duration), true);
+                       }
+                       return this;
+               };
+
+               p.totalDuration = function(value) {
+                       this._dirty = false;
+                       return (!arguments.length) ? this._totalDuration : this.duration(value);
+               };
+
+               p.time = function(value, suppressEvents) {
+                       if (!arguments.length) {
+                               return this._time;
+                       }
+                       if (this._dirty) {
+                               this.totalDuration();
+                       }
+                       return this.totalTime((value > this._duration) ? this._duration : value, suppressEvents);
+               };
+
+               p.totalTime = function(time, suppressEvents, uncapped) {
+                       if (!_tickerActive) {
+                               _ticker.wake();
+                       }
+                       if (!arguments.length) {
+                               return this._totalTime;
+                       }
+                       if (this._timeline) {
+                               if (time < 0 && !uncapped) {
+                                       time += this.totalDuration();
+                               }
+                               if (this._timeline.smoothChildTiming) {
+                                       if (this._dirty) {
+                                               this.totalDuration();
+                                       }
+                                       var totalDuration = this._totalDuration,
+                                               tl = this._timeline;
+                                       if (time > totalDuration && !uncapped) {
+                                               time = totalDuration;
+                                       }
+                                       this._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale);
+                                       if (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.
+                                               this._uncache(false);
+                                       }
+                                       //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed.
+                                       if (tl._timeline) {
+                                               while (tl._timeline) {
+                                                       if (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) {
+                                                               tl.totalTime(tl._totalTime, true);
+                                                       }
+                                                       tl = tl._timeline;
+                                               }
+                                       }
+                               }
+                               if (this._gc) {
+                                       this._enabled(true, false);
+                               }
+                               if (this._totalTime !== time || this._duration === 0) {
+                                       this.render(time, suppressEvents, false);
+                                       if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.
+                                               _lazyRender();
+                                       }
+                               }
+                       }
+                       return this;
+               };
+
+               p.progress = p.totalProgress = function(value, suppressEvents) {
+                       return (!arguments.length) ? this._time / this.duration() : this.totalTime(this.duration() * value, suppressEvents);
+               };
+
+               p.startTime = function(value) {
+                       if (!arguments.length) {
+                               return this._startTime;
+                       }
+                       if (value !== this._startTime) {
+                               this._startTime = value;
+                               if (this.timeline) if (this.timeline._sortChildren) {
+                                       this.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct.
+                               }
+                       }
+                       return this;
+               };
+
+               p.timeScale = function(value) {
+                       if (!arguments.length) {
+                               return this._timeScale;
+                       }
+                       value = value || _tinyNum; //can't allow zero because it'll throw the math off
+                       if (this._timeline && this._timeline.smoothChildTiming) {
+                               var pauseTime = this._pauseTime,
+                                       t = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime();
+                               this._startTime = t - ((t - this._startTime) * this._timeScale / value);
+                       }
+                       this._timeScale = value;
+                       return this._uncache(false);
+               };
+
+               p.reversed = function(value) {
+                       if (!arguments.length) {
+                               return this._reversed;
+                       }
+                       if (value != this._reversed) {
+                               this._reversed = value;
+                               this.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true);
+                       }
+                       return this;
+               };
+
+               p.paused = function(value) {
+                       if (!arguments.length) {
+                               return this._paused;
+                       }
+                       if (value != this._paused) if (this._timeline) {
+                               if (!_tickerActive && !value) {
+                                       _ticker.wake();
+                               }
+                               var tl = this._timeline,
+                                       raw = tl.rawTime(),
+                                       elapsed = raw - this._pauseTime;
+                               if (!value && tl.smoothChildTiming) {
+                                       this._startTime += elapsed;
+                                       this._uncache(false);
+                               }
+                               this._pauseTime = value ? raw : null;
+                               this._paused = value;
+                               this._active = this.isActive();
+                               if (!value && elapsed !== 0 && this._initted && this.duration()) {
+                                       this.render((tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale), true, true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render.
+                               }
+                       }
+                       if (this._gc && !value) {
+                               this._enabled(true, false);
+                       }
+                       return this;
+               };
+
+
+/*
+ * ----------------------------------------------------------------
+ * SimpleTimeline
+ * ----------------------------------------------------------------
+ */
+               var SimpleTimeline = _class("core.SimpleTimeline", function(vars) {
+                       Animation.call(this, 0, vars);
+                       this.autoRemoveChildren = this.smoothChildTiming = true;
+               });
+
+               p = SimpleTimeline.prototype = new Animation();
+               p.constructor = SimpleTimeline;
+               p.kill()._gc = false;
+               p._first = p._last = null;
+               p._sortChildren = false;
+
+               p.add = p.insert = function(child, position, align, stagger) {
+                       var prevTween, st;
+                       child._startTime = Number(position || 0) + child._delay;
+                       if (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order).
+                               child._pauseTime = child._startTime + ((this.rawTime() - child._startTime) / child._timeScale);
+                       }
+                       if (child.timeline) {
+                               child.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one.
+                       }
+                       child.timeline = child._timeline = this;
+                       if (child._gc) {
+                               child._enabled(true, true);
+                       }
+                       prevTween = this._last;
+                       if (this._sortChildren) {
+                               st = child._startTime;
+                               while (prevTween && prevTween._startTime > st) {
+                                       prevTween = prevTween._prev;
+                               }
+                       }
+                       if (prevTween) {
+                               child._next = prevTween._next;
+                               prevTween._next = child;
+                       } else {
+                               child._next = this._first;
+                               this._first = child;
+                       }
+                       if (child._next) {
+                               child._next._prev = child;
+                       } else {
+                               this._last = child;
+                       }
+                       child._prev = prevTween;
+                       if (this._timeline) {
+                               this._uncache(true);
+                       }
+                       return this;
+               };
+
+               p._remove = function(tween, skipDisable) {
+                       if (tween.timeline === this) {
+                               if (!skipDisable) {
+                                       tween._enabled(false, true);
+                               }
+                               tween.timeline = null;
+
+                               if (tween._prev) {
+                                       tween._prev._next = tween._next;
+                               } else if (this._first === tween) {
+                                       this._first = tween._next;
+                               }
+                               if (tween._next) {
+                                       tween._next._prev = tween._prev;
+                               } else if (this._last === tween) {
+                                       this._last = tween._prev;
+                               }
+
+                               if (this._timeline) {
+                                       this._uncache(true);
+                               }
+                       }
+                       return this;
+               };
+
+               p.render = function(time, suppressEvents, force) {
+                       var tween = this._first,
+                               next;
+                       this._totalTime = this._time = this._rawPrevTime = time;
+                       while (tween) {
+                               next = tween._next; //record it here because the value could change after rendering...
+                               if (tween._active || (time >= tween._startTime && !tween._paused)) {
+                                       if (!tween._reversed) {
+                                               tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
+                                       } else {
+                                               tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force);
+                                       }
+                               }
+                               tween = next;
+                       }
+               };
+
+               p.rawTime = function() {
+                       if (!_tickerActive) {
+                               _ticker.wake();
+                       }
+                       return this._totalTime;
+               };
+
+/*
+ * ----------------------------------------------------------------
+ * TweenLite
+ * ----------------------------------------------------------------
+ */
+               var TweenLite = _class("TweenLite", function(target, duration, vars) {
+                               Animation.call(this, duration, vars);
+                               this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method)
+
+                               if (target == null) {
+                                       throw "Cannot tween a null target.";
+                               }
+
+                               this.target = target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target;
+
+                               var isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))),
+                                       overwrite = this.vars.overwrite,
+                                       i, targ, targets;
+
+                               this._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === "number") ? overwrite >> 0 : _overwriteLookup[overwrite];
+
+                               if ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== "number") {
+                                       this._targets = targets = _slice.call(target, 0);
+                                       this._propLookup = [];
+                                       this._siblings = [];
+                                       for (i = 0; i < targets.length; i++) {
+                                               targ = targets[i];
+                                               if (!targ) {
+                                                       targets.splice(i--, 1);
+                                                       continue;
+                                               } else if (typeof(targ) === "string") {
+                                                       targ = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings
+                                                       if (typeof(targ) === "string") {
+                                                               targets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case)
+                                                       }
+                                                       continue;
+                                               } else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that <select> elements pass all the criteria regarding length and the first child having style, so we must also check to ensure the target isn't an HTML node itself.
+                                                       targets.splice(i--, 1);
+                                                       this._targets = targets = targets.concat(_slice.call(targ, 0));
+                                                       continue;
+                                               }
+                                               this._siblings[i] = _register(targ, this, false);
+                                               if (overwrite === 1) if (this._siblings[i].length > 1) {
+                                                       _applyOverwrite(targ, this, null, 1, this._siblings[i]);
+                                               }
+                                       }
+
+                               } else {
+                                       this._propLookup = {};
+                                       this._siblings = _register(target, this, false);
+                                       if (overwrite === 1) if (this._siblings.length > 1) {
+                                               _applyOverwrite(target, this, null, 1, this._siblings);
+                                       }
+                               }
+                               if (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender !== false)) {
+                                       this._time = -_tinyNum; //forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render)
+                                       this.render(-this._delay);
+                               }
+                       }, true),
+                       _isSelector = function(v) {
+                               return (v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check "nodeType" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox.
+                       },
+                       _autoCSS = function(vars, target) {
+                               var css = {},
+                                       p;
+                               for (p in vars) {
+                                       if (!_reservedProps[p] && (!(p in target) || p === "transform" || p === "x" || p === "y" || p === "width" || p === "height" || p === "className" || p === "border") && (!_plugins[p] || (_plugins[p] && _plugins[p]._autoCSS))) { //note: <img> elements contain read-only "x" and "y" properties. We should also prioritize editing css width/height rather than the element's properties.
+                                               css[p] = vars[p];
+                                               delete vars[p];
+                                       }
+                               }
+                               vars.css = css;
+                       };
+
+               p = TweenLite.prototype = new Animation();
+               p.constructor = TweenLite;
+               p.kill()._gc = false;
+
+//----TweenLite defaults, overwrite management, and root updates ----------------------------------------------------
+
+               p.ratio = 0;
+               p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
+               p._notifyPluginsOfEnabled = p._lazy = false;
+
+               TweenLite.version = "1.12.1";
+               TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
+               TweenLite.defaultOverwrite = "auto";
+               TweenLite.ticker = _ticker;
+               TweenLite.autoSleep = true;
+               TweenLite.lagSmoothing = function(threshold, adjustedLag) {
+                       _ticker.lagSmoothing(threshold, adjustedLag);
+               };
+               TweenLite.selector = window.$ || window.jQuery || function(e) { if (window.$) { TweenLite.selector = window.$; return window.$(e); } return window.document ? window.document.getElementById((e.charAt(0) === "#") ? e.substr(1) : e) : e; };
+
+               var _lazyTweens = [],
+                       _lazyLookup = {},
+                       _internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object.
+                       _plugins = TweenLite._plugins = {},
+                       _tweenLookup = _internals.tweenLookup = {},
+                       _tweenLookupNum = 0,
+                       _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1},
+                       _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0},
+                       _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),
+                       _rootTimeline = Animation._rootTimeline = new SimpleTimeline(),
+                       _lazyRender = function() {
+                               var i = _lazyTweens.length;
+                               _lazyLookup = {};
+                               while (--i > -1) {
+                                       a = _lazyTweens[i];
+                                       if (a && a._lazy !== false) {
+                                               a.render(a._lazy, false, true);
+                                               a._lazy = false;
+                                       }
+                               }
+                               _lazyTweens.length = 0;
+                       };
+
+               _rootTimeline._startTime = _ticker.time;
+               _rootFramesTimeline._startTime = _ticker.frame;
+               _rootTimeline._active = _rootFramesTimeline._active = true;
+               setTimeout(_lazyRender, 1); //on some mobile devices, there isn't a "tick" before code runs which means any lazy renders wouldn't run before the next official "tick".
+
+               Animation._updateRoot = TweenLite.render = function() {
+                               var i, a, p;
+                               if (_lazyTweens.length) { //if code is run outside of the requestAnimationFrame loop, there may be tweens queued AFTER the engine refreshed, so we need to ensure any pending renders occur before we refresh again.
+                                       _lazyRender();
+                               }
+                               _rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false);
+                               _rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false);
+                               if (_lazyTweens.length) {
+                                       _lazyRender();
+                               }
+                               if (!(_ticker.frame % 120)) { //dump garbage every 120 frames...
+                                       for (p in _tweenLookup) {
+                                               a = _tweenLookup[p].tweens;
+                                               i = a.length;
+                                               while (--i > -1) {
+                                                       if (a[i]._gc) {
+                                                               a.splice(i, 1);
+                                                       }
+                                               }
+                                               if (a.length === 0) {
+                                                       delete _tweenLookup[p];
+                                               }
+                                       }
+                                       //if there are no more tweens in the root timelines, or if they're all paused, make the _timer sleep to reduce load on the CPU slightly
+                                       p = _rootTimeline._first;
+                                       if (!p || p._paused) if (TweenLite.autoSleep && !_rootFramesTimeline._first && _ticker._listeners.tick.length === 1) {
+                                               while (p && p._paused) {
+                                                       p = p._next;
+                                               }
+                                               if (!p) {
+                                                       _ticker.sleep();
+                                               }
+                                       }
+                               }
+                       };
+
+               _ticker.addEventListener("tick", Animation._updateRoot);
+
+               var _register = function(target, tween, scrub) {
+                               var id = target._gsTweenID, a, i;
+                               if (!_tweenLookup[id || (target._gsTweenID = id = "t" + (_tweenLookupNum++))]) {
+                                       _tweenLookup[id] = {target:target, tweens:[]};
+                               }
+                               if (tween) {
+                                       a = _tweenLookup[id].tweens;
+                                       a[(i = a.length)] = tween;
+                                       if (scrub) {
+                                               while (--i > -1) {
+                                                       if (a[i] === tween) {
+                                                               a.splice(i, 1);
+                                                       }
+                                               }
+                                       }
+                               }
+                               return _tweenLookup[id].tweens;
+                       },
+
+                       _applyOverwrite = function(target, tween, props, mode, siblings) {
+                               var i, changed, curTween, l;
+                               if (mode === 1 || mode >= 4) {
+                                       l = siblings.length;
+                                       for (i = 0; i < l; i++) {
+                                               if ((curTween = siblings[i]) !== tween) {
+                                                       if (!curTween._gc) if (curTween._enabled(false, false)) {
+                                                               changed = true;
+                                                       }
+                                               } else if (mode === 5) {
+                                                       break;
+                                               }
+                                       }
+                                       return changed;
+                               }
+                               //NOTE: Add 0.0000000001 to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example)
+                               var startTime = tween._startTime + _tinyNum,
+                                       overlaps = [],
+                                       oCount = 0,
+                                       zeroDur = (tween._duration === 0),
+                                       globalStart;
+                               i = siblings.length;
+                               while (--i > -1) {
+                                       if ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) {
+                                               //ignore
+                                       } else if (curTween._timeline !== tween._timeline) {
+                                               globalStart = globalStart || _checkOverlap(tween, 0, zeroDur);
+                                               if (_checkOverlap(curTween, globalStart, zeroDur) === 0) {
+                                                       overlaps[oCount++] = curTween;
+                                               }
+                                       } else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale > startTime) if (!((zeroDur || !curTween._initted) && startTime - curTween._startTime <= 0.0000000002)) {
+                                               overlaps[oCount++] = curTween;
+                                       }
+                               }
+
+                               i = oCount;
+                               while (--i > -1) {
+                                       curTween = overlaps[i];
+                                       if (mode === 2) if (curTween._kill(props, target)) {
+                                               changed = true;
+                                       }
+                                       if (mode !== 2 || (!curTween._firstPT && curTween._initted)) {
+                                               if (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween.
+                                                       changed = true;
+                                               }
+                                       }
+                               }
+                               return changed;
+                       },
+
+                       _checkOverlap = function(tween, reference, zeroDur) {
+                               var tl = tween._timeline,
+                                       ts = tl._timeScale,
+                                       t = tween._startTime;
+                               while (tl._timeline) {
+                                       t += tl._startTime;
+                                       ts *= tl._timeScale;
+                                       if (tl._paused) {
+                                               return -100;
+                                       }
+                                       tl = tl._timeline;
+                               }
+                               t /= ts;
+                               return (t > reference) ? t - reference : ((zeroDur && t === reference) || (!tween._initted && t - reference < 2 * _tinyNum)) ? _tinyNum : ((t += tween.totalDuration() / tween._timeScale / ts) > reference + _tinyNum) ? 0 : t - reference - _tinyNum;
+                       };
+
+
+//---- TweenLite instance methods -----------------------------------------------------------------------------
+
+               p._init = function() {
+                       var v = this.vars,
+                               op = this._overwrittenProps,
+                               dur = this._duration,
+                               immediate = !!v.immediateRender,
+                               ease = v.ease,
+                               i, initPlugins, pt, p, startVars;
+                       if (v.startAt) {
+                               if (this._startAt) {
+                                       this._startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:"+=100"}, {x:"-=100"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change.
+                                       this._startAt.kill();
+                               }
+                               startVars = {};
+                               for (p in v.startAt) { //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, 1, from, to).fromTo(e, 1, to, from);
+                                       startVars[p] = v.startAt[p];
+                               }
+                               startVars.overwrite = false;
+                               startVars.immediateRender = true;
+                               startVars.lazy = (immediate && v.lazy !== false);
+                               startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop).
+                               this._startAt = TweenLite.to(this.target, 0, startVars);
+                               if (immediate) {
+                                       if (this._time > 0) {
+                                               this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()).
+                                       } else if (dur !== 0) {
+                                               return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.
+                                       }
+                               }
+                       } else if (v.runBackwards && dur !== 0) {
+                               //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)
+                               if (this._startAt) {
+                                       this._startAt.render(-1, true);
+                                       this._startAt.kill();
+                                       this._startAt = null;
+                               } else {
+                                       pt = {};
+                                       for (p in v) { //copy props into a new object and skip any reserved props, otherwise onComplete or onUpdate or onStart could fire. We should, however, permit autoCSS to go through.
+                                               if (!_reservedProps[p] || p === "autoCSS") {
+                                                       pt[p] = v[p];
+                                               }
+                                       }
+                                       pt.overwrite = 0;
+                                       pt.data = "isFromStart"; //we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.
+                                       pt.lazy = (immediate && v.lazy !== false);
+                                       pt.immediateRender = immediate; //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)
+                                       this._startAt = TweenLite.to(this.target, 0, pt);
+                                       if (!immediate) {
+                                               this._startAt._init(); //ensures that the initial values are recorded
+                                               this._startAt._enabled(false); //no need to have the tween render on the next cycle. Disable it because we'll always manually control the renders of the _startAt tween.
+                                       } else if (this._time === 0) {
+                                               return;
+                                       }
+                               }
+                       }
+                       if (!ease) {
+                               this._ease = TweenLite.defaultEase;
+                       } else if (ease instanceof Ease) {
+                               this._ease = (v.easeParams instanceof Array) ? ease.config.apply(ease, v.easeParams) : ease;
+                       } else {
+                               this._ease = (typeof(ease) === "function") ? new Ease(ease, v.easeParams) : _easeMap[ease] || TweenLite.defaultEase;
+                       }
+                       this._easeType = this._ease._type;
+                       this._easePower = this._ease._power;
+                       this._firstPT = null;
+
+                       if (this._targets) {
+                               i = this._targets.length;
+                               while (--i > -1) {
+                                       if ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (op ? op[i] : null)) ) {
+                                               initPlugins = true;
+                                       }
+                               }
+                       } else {
+                               initPlugins = this._initProps(this.target, this._propLookup, this._siblings, op);
+                       }
+
+                       if (initPlugins) {
+                               TweenLite._onPluginEvent("_onInitAllProps", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite
+                       }
+                       if (op) if (!this._firstPT) if (typeof(this.target) !== "function") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live.
+                               this._enabled(false, false);
+                       }
+                       if (v.runBackwards) {
+                               pt = this._firstPT;
+                               while (pt) {
+                                       pt.s += pt.c;
+                                       pt.c = -pt.c;
+                                       pt = pt._next;
+                               }
+                       }
+                       this._onUpdate = v.onUpdate;
+                       this._initted = true;
+               };
+
+               p._initProps = function(target, propLookup, siblings, overwrittenProps) {
+                       var p, i, initPlugins, plugin, pt, v;
+                       if (target == null) {
+                               return false;
+                       }
+
+                       if (_lazyLookup[target._gsTweenID]) {
+                               _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)
+                       }
+
+                       if (!this.vars.css) if (target.style) if (target !== window && target.nodeType) if (_plugins.css) if (this.vars.autoCSS !== false) { //it's so common to use TweenLite/Max to animate the css of DOM elements, we assume that if the target is a DOM element, that's what is intended (a convenience so that users don't have to wrap things in css:{}, although we still recommend it for a slight performance boost and better specificity). Note: we cannot check "nodeType" on the window inside an iframe.
+                               _autoCSS(this.vars, target);
+                       }
+                       for (p in this.vars) {
+                               v = this.vars[p];
+                               if (_reservedProps[p]) {
+                                       if (v) if ((v instanceof Array) || (v.push && _isArray(v))) if (v.join("").indexOf("{self}") !== -1) {
+                                               this.vars[p] = v = this._swapSelfInParams(v, this);
+                                       }
+
+                               } else if (_plugins[p] && (plugin = new _plugins[p]())._onInitTween(target, this.vars[p], this)) {
+
+                                       //t - target            [object]
+                                       //p - property          [string]
+                                       //s - start                     [number]
+                                       //c - change            [number]
+                                       //f - isFunction        [boolean]
+                                       //n - name                      [string]
+                                       //pg - isPlugin         [boolean]
+                                       //pr - priority         [number]
+                                       this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:true, n:p, pg:true, pr:plugin._priority};
+                                       i = plugin._overwriteProps.length;
+                                       while (--i > -1) {
+                                               propLookup[plugin._overwriteProps[i]] = this._firstPT;
+                                       }
+                                       if (plugin._priority || plugin._onInitAllProps) {
+                                               initPlugins = true;
+                                       }
+                                       if (plugin._onDisable || plugin._onEnable) {
+                                               this._notifyPluginsOfEnabled = true;
+                                       }
+
+                               } else {
+                                       this._firstPT = propLookup[p] = pt = {_next:this._firstPT, t:target, p:p, f:(typeof(target[p]) === "function"), n:p, pg:false, pr:0};
+                                       pt.s = (!pt.f) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]();
+                                       pt.c = (typeof(v) === "string" && v.charAt(1) === "=") ? parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : (Number(v) - pt.s) || 0;
+                               }
+                               if (pt) if (pt._next) {
+                                       pt._next._prev = pt;
+                               }
+                       }
+
+                       if (overwrittenProps) if (this._kill(overwrittenProps, target)) { //another tween may have tried to overwrite properties of this tween before init() was called (like if two tweens start at the same time, the one created second will run first)
+                               return this._initProps(target, propLookup, siblings, overwrittenProps);
+                       }
+                       if (this._overwrite > 1) if (this._firstPT) if (siblings.length > 1) if (_applyOverwrite(target, this, propLookup, this._overwrite, siblings)) {
+                               this._kill(propLookup, target);
+                               return this._initProps(target, propLookup, siblings, overwrittenProps);
+                       }
+                       if (this._firstPT) if ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration)) { //zero duration tweens don't lazy render by default; everything else does.
+                               _lazyLookup[target._gsTweenID] = true;
+                       }
+                       return initPlugins;
+               };
+
+               p.render = function(time, suppressEvents, force) {
+                       var prevTime = this._time,
+                               duration = this._duration,
+                               prevRawPrevTime = this._rawPrevTime,
+                               isComplete, callback, pt, rawPrevTime;
+                       if (time >= duration) {
+                               this._totalTime = this._time = duration;
+                               this.ratio = this._ease._calcEnd ? this._ease.getRatio(1) : 1;
+                               if (!this._reversed ) {
+                                       isComplete = true;
+                                       callback = "onComplete";
+                               }
+                               if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
+                                       if (this._startTime === this._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent rounding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate.
+                                               time = 0;
+                                       }
+                                       if (time === 0 || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time) {
+                                               force = true;
+                                               if (prevRawPrevTime > _tinyNum) {
+                                                       callback = "onReverseComplete";
+                                               }
+                                       }
+                                       this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                               }
+
+                       } else if (time < 0.0000001) { //to work around occasional floating point math artifacts, round super small values to 0.
+                               this._totalTime = this._time = 0;
+                               this.ratio = this._ease._calcEnd ? this._ease.getRatio(0) : 0;
+                               if (prevTime !== 0 || (duration === 0 && prevRawPrevTime > 0 && prevRawPrevTime !== _tinyNum)) {
+                                       callback = "onReverseComplete";
+                                       isComplete = this._reversed;
+                               }
+                               if (time < 0) {
+                                       this._active = false;
+                                       if (duration === 0) if (this._initted || !this.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered.
+                                               if (prevRawPrevTime >= 0) {
+                                                       force = true;
+                                               }
+                                               this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
+                                       }
+                               } else if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.
+                                       force = true;
+                               }
+                       } else {
+                               this._totalTime = this._time = time;
+
+                               if (this._easeType) {
+                                       var r = time / duration, type = this._easeType, pow = this._easePower;
+                                       if (type === 1 || (type === 3 && r >= 0.5)) {
+                                               r = 1 - r;
+                                       }
+                                       if (type === 3) {
+                                               r *= 2;
+                                       }
+                                       if (pow === 1) {
+                                               r *= r;
+                                       } else if (pow === 2) {
+                                               r *= r * r;
+                                       } else if (pow === 3) {
+                                               r *= r * r * r;
+                                       } else if (pow === 4) {
+                                               r *= r * r * r * r;
+                                       }
+
+                                       if (type === 1) {
+                                               this.ratio = 1 - r;
+                                       } else if (type === 2) {
+                                               this.ratio = r;
+                                       } else if (time / duration < 0.5) {
+                                               this.ratio = r / 2;
+                                       } else {
+                                               this.ratio = 1 - (r / 2);
+                                       }
+
+                               } else {
+                                       this.ratio = this._ease.getRatio(time / duration);
+                               }
+                       }
+
+                       if (this._time === prevTime && !force) {
+                               return;
+                       } else if (!this._initted) {
+                               this._init();
+                               if (!this._initted || this._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example.
+                                       return;
+                               } else if (!force && this._firstPT && ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration))) {
+                                       this._time = this._totalTime = prevTime;
+                                       this._rawPrevTime = prevRawPrevTime;
+                                       _lazyTweens.push(this);
+                                       this._lazy = time;
+                                       return;
+                               }
+                               //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently.
+                               if (this._time && !isComplete) {
+                                       this.ratio = this._ease.getRatio(this._time / duration);
+                               } else if (isComplete && this._ease._calcEnd) {
+                                       this.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1);
+                               }
+                       }
+                       if (this._lazy !== false) { //in case a lazy render is pending, we should flush it because the new render is occuring now (imagine a lazy tween instantiating and then immediately the user calls tween.seek(tween.duration()), skipping to the end - the end render would be forced, and then if we didn't flush the lazy render, it'd fire AFTER the seek(), rendering it at the wrong time.
+                               this._lazy = false;
+                       }
+                       if (!this._active) if (!this._paused && this._time !== prevTime && time >= 0) {
+                               this._active = true;  //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done.
+                       }
+                       if (prevTime === 0) {
+                               if (this._startAt) {
+                                       if (time >= 0) {
+                                               this._startAt.render(time, suppressEvents, force);
+                                       } else if (!callback) {
+                                               callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area.
+                                       }
+                               }
+                               if (this.vars.onStart) if (this._time !== 0 || duration === 0) if (!suppressEvents) {
+                                       this.vars.onStart.apply(this.vars.onStartScope || this, this.vars.onStartParams || _blankArray);
+                               }
+                       }
+
+                       pt = this._firstPT;
+                       while (pt) {
+                               if (pt.f) {
+                                       pt.t[pt.p](pt.c * this.ratio + pt.s);
+                               } else {
+                                       pt.t[pt.p] = pt.c * this.ratio + pt.s;
+                               }
+                               pt = pt._next;
+                       }
+
+                       if (this._onUpdate) {
+                               if (time < 0) if (this._startAt && this._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values.
+                                       this._startAt.render(time, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.
+                               }
+                               if (!suppressEvents) if (this._time !== prevTime || isComplete) {
+                                       this._onUpdate.apply(this.vars.onUpdateScope || this, this.vars.onUpdateParams || _blankArray);
+                               }
+                       }
+
+                       if (callback) if (!this._gc) { //check _gc because there's a chance that kill() could be called in an onUpdate
+                               if (time < 0 && this._startAt && !this._onUpdate && this._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values.
+                                       this._startAt.render(time, suppressEvents, force);
+                               }
+                               if (isComplete) {
+                                       if (this._timeline.autoRemoveChildren) {
+                                               this._enabled(false, false);
+                                       }
+                                       this._active = false;
+                               }
+                               if (!suppressEvents && this.vars[callback]) {
+                                       this.vars[callback].apply(this.vars[callback + "Scope"] || this, this.vars[callback + "Params"] || _blankArray);
+                               }
+                               if (duration === 0 && this._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless.
+                                       this._rawPrevTime = 0;
+                               }
+                       }
+
+               };
+
+               p._kill = function(vars, target) {
+                       if (vars === "all") {
+                               vars = null;
+                       }
+                       if (vars == null) if (target == null || target === this.target) {
+                               this._lazy = false;
+                               return this._enabled(false, false);
+                       }
+                       target = (typeof(target) !== "string") ? (target || this._targets || this.target) : TweenLite.selector(target) || target;
+                       var i, overwrittenProps, p, pt, propLookup, changed, killProps, record;
+                       if ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== "number") {
+                               i = target.length;
+                               while (--i > -1) {
+                                       if (this._kill(vars, target[i])) {
+                                               changed = true;
+                                       }
+                               }
+                       } else {
+                               if (this._targets) {
+                                       i = this._targets.length;
+                                       while (--i > -1) {
+                                               if (target === this._targets[i]) {
+                                                       propLookup = this._propLookup[i] || {};
+                                                       this._overwrittenProps = this._overwrittenProps || [];
+                                                       overwrittenProps = this._overwrittenProps[i] = vars ? this._overwrittenProps[i] || {} : "all";
+                                                       break;
+                                               }
+                                       }
+                               } else if (target !== this.target) {
+                                       return false;
+                               } else {
+                                       propLookup = this._propLookup;
+                                       overwrittenProps = this._overwrittenProps = vars ? this._overwrittenProps || {} : "all";
+                               }
+
+                               if (propLookup) {
+                                       killProps = vars || propLookup;
+                                       record = (vars !== overwrittenProps && overwrittenProps !== "all" && vars !== propLookup && (typeof(vars) !== "object" || !vars._tempKill)); //_tempKill is a super-secret way to delete a particular tweening property but NOT have it remembered as an official overwritten property (like in BezierPlugin)
+                                       for (p in killProps) {
+                                               if ((pt = propLookup[p])) {
+                                                       if (pt.pg && pt.t._kill(killProps)) {
+                                                               changed = true; //some plugins need to be notified so they can perform cleanup tasks first
+                                                       }
+                                                       if (!pt.pg || pt.t._overwriteProps.length === 0) {
+                                                               if (pt._prev) {
+                                                                       pt._prev._next = pt._next;
+                                                               } else if (pt === this._firstPT) {
+                                                                       this._firstPT = pt._next;
+                                                               }
+                                                               if (pt._next) {
+                                                                       pt._next._prev = pt._prev;
+                                                               }
+                                                               pt._next = pt._prev = null;
+                                                       }
+                                                       delete propLookup[p];
+                                               }
+                                               if (record) {
+                                                       overwrittenProps[p] = 1;
+                                               }
+                                       }
+                                       if (!this._firstPT && this._initted) { //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.
+                                               this._enabled(false, false);
+                                       }
+                               }
+                       }
+                       return changed;
+               };
+
+               p.invalidate = function() {
+                       if (this._notifyPluginsOfEnabled) {
+                               TweenLite._onPluginEvent("_onDisable", this);
+                       }
+                       this._firstPT = null;
+                       this._overwrittenProps = null;
+                       this._onUpdate = null;
+                       this._startAt = null;
+                       this._initted = this._active = this._notifyPluginsOfEnabled = this._lazy = false;
+                       this._propLookup = (this._targets) ? {} : [];
+                       return this;
+               };
+
+               p._enabled = function(enabled, ignoreTimeline) {
+                       if (!_tickerActive) {
+                               _ticker.wake();
+                       }
+                       if (enabled && this._gc) {
+                               var targets = this._targets,
+                                       i;
+                               if (targets) {
+                                       i = targets.length;
+                                       while (--i > -1) {
+                                               this._siblings[i] = _register(targets[i], this, true);
+                                       }
+                               } else {
+                                       this._siblings = _register(this.target, this, true);
+                               }
+                       }
+                       Animation.prototype._enabled.call(this, enabled, ignoreTimeline);
+                       if (this._notifyPluginsOfEnabled) if (this._firstPT) {
+                               return TweenLite._onPluginEvent((enabled ? "_onEnable" : "_onDisable"), this);
+                       }
+                       return false;
+               };
+
+
+//----TweenLite static methods -----------------------------------------------------
+
+               TweenLite.to = function(target, duration, vars) {
+                       return new TweenLite(target, duration, vars);
+               };
+
+               TweenLite.from = function(target, duration, vars) {
+                       vars.runBackwards = true;
+                       vars.immediateRender = (vars.immediateRender != false);
+                       return new TweenLite(target, duration, vars);
+               };
+
+               TweenLite.fromTo = function(target, duration, fromVars, toVars) {
+                       toVars.startAt = fromVars;
+                       toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false);
+                       return new TweenLite(target, duration, toVars);
+               };
+
+               TweenLite.delayedCall = function(delay, callback, params, scope, useFrames) {
+                       return new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, onCompleteScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, onReverseCompleteScope:scope, immediateRender:false, useFrames:useFrames, overwrite:0});
+               };
+
+               TweenLite.set = function(target, vars) {
+                       return new TweenLite(target, 0, vars);
+               };
+
+               TweenLite.getTweensOf = function(target, onlyActive) {
+                       if (target == null) { return []; }
+                       target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target;
+                       var i, a, j, t;
+                       if ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== "number") {
+                               i = target.length;
+                               a = [];
+                               while (--i > -1) {
+                                       a = a.concat(TweenLite.getTweensOf(target[i], onlyActive));
+                               }
+                               i = a.length;
+                               //now get rid of any duplicates (tweens of arrays of objects could cause duplicates)
+                               while (--i > -1) {
+                                       t = a[i];
+                                       j = i;
+                                       while (--j > -1) {
+                                               if (t === a[j]) {
+                                                       a.splice(i, 1);
+                                               }
+                                       }
+                               }
+                       } else {
+                               a = _register(target).concat();
+                               i = a.length;
+                               while (--i > -1) {
+                                       if (a[i]._gc || (onlyActive && !a[i].isActive())) {
+                                               a.splice(i, 1);
+                                       }
+                               }
+                       }
+                       return a;
+               };
+
+               TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) {
+                       if (typeof(onlyActive) === "object") {
+                               vars = onlyActive; //for backwards compatibility (before "onlyActive" parameter was inserted)
+                               onlyActive = false;
+                       }
+                       var a = TweenLite.getTweensOf(target, onlyActive),
+                               i = a.length;
+                       while (--i > -1) {
+                               a[i]._kill(vars, target);
+                       }
+               };
+
+
+
+/*
+ * ----------------------------------------------------------------
+ * TweenPlugin   (could easily be split out as a separate file/class, but included for ease of use (so that people don't need to include another <script> call before loading plugins which is easy to forget)
+ * ----------------------------------------------------------------
+ */
+               var TweenPlugin = _class("plugins.TweenPlugin", function(props, priority) {
+                                       this._overwriteProps = (props || "").split(",");
+                                       this._propName = this._overwriteProps[0];
+                                       this._priority = priority || 0;
+                                       this._super = TweenPlugin.prototype;
+                               }, true);
+
+               p = TweenPlugin.prototype;
+               TweenPlugin.version = "1.10.1";
+               TweenPlugin.API = 2;
+               p._firstPT = null;
+
+               p._addTween = function(target, prop, start, end, overwriteProp, round) {
+                       var c, pt;
+                       if (end != null && (c = (typeof(end) === "number" || end.charAt(1) !== "=") ? Number(end) - start : parseInt(end.charAt(0) + "1", 10) * Number(end.substr(2)))) {
+                               this._firstPT = pt = {_next:this._firstPT, t:target, p:prop, s:start, c:c, f:(typeof(target[prop]) === "function"), n:overwriteProp || prop, r:round};
+                               if (pt._next) {
+                                       pt._next._prev = pt;
+                               }
+                               return pt;
+                       }
+               };
+
+               p.setRatio = function(v) {
+                       var pt = this._firstPT,
+                               min = 0.000001,
+                               val;
+                       while (pt) {
+                               val = pt.c * v + pt.s;
+                               if (pt.r) {
+                                       val = Math.round(val);
+                               } else if (val < min) if (val > -min) { //prevents issues with converting very small numbers to strings in the browser
+                                       val = 0;
+                               }
+                               if (pt.f) {
+                                       pt.t[pt.p](val);
+                               } else {
+                                       pt.t[pt.p] = val;
+                               }
+                               pt = pt._next;
+                       }
+               };
+
+               p._kill = function(lookup) {
+                       var a = this._overwriteProps,
+                               pt = this._firstPT,
+                               i;
+                       if (lookup[this._propName] != null) {
+                               this._overwriteProps = [];
+                       } else {
+                               i = a.length;
+                               while (--i > -1) {
+                                       if (lookup[a[i]] != null) {
+                                               a.splice(i, 1);
+                                       }
+                               }
+                       }
+                       while (pt) {
+                               if (lookup[pt.n] != null) {
+                                       if (pt._next) {
+                                               pt._next._prev = pt._prev;
+                                       }
+                                       if (pt._prev) {
+                                               pt._prev._next = pt._next;
+                                               pt._prev = null;
+                                       } else if (this._firstPT === pt) {
+                                               this._firstPT = pt._next;
+                                       }
+                               }
+                               pt = pt._next;
+                       }
+                       return false;
+               };
+
+               p._roundProps = function(lookup, value) {
+                       var pt = this._firstPT;
+                       while (pt) {
+                               if (lookup[this._propName] || (pt.n != null && lookup[ pt.n.split(this._propName + "_").join("") ])) { //some properties that are very plugin-specific add a prefix named after the _propName plus an underscore, so we need to ignore that extra stuff here.
+                                       pt.r = value;
+                               }
+                               pt = pt._next;
+                       }
+               };
+
+               TweenLite._onPluginEvent = function(type, tween) {
+                       var pt = tween._firstPT,
+                               changed, pt2, first, last, next;
+                       if (type === "_onInitAllProps") {
+                               //sorts the PropTween linked list in order of priority because some plugins need to render earlier/later than others, like MotionBlurPlugin applies its effects after all x/y/alpha tweens have rendered on each frame.
+                               while (pt) {
+                                       next = pt._next;
+                                       pt2 = first;
+                                       while (pt2 && pt2.pr > pt.pr) {
+                                               pt2 = pt2._next;
+                                       }
+                                       if ((pt._prev = pt2 ? pt2._prev : last)) {
+                                               pt._prev._next = pt;
+                                       } else {
+                                               first = pt;
+                                       }
+                                       if ((pt._next = pt2)) {
+                                               pt2._prev = pt;
+                                       } else {
+                                               last = pt;
+                                       }
+                                       pt = next;
+                               }
+                               pt = tween._firstPT = first;
+                       }
+                       while (pt) {
+                               if (pt.pg) if (typeof(pt.t[type]) === "function") if (pt.t[type]()) {
+                                       changed = true;
+                               }
+                               pt = pt._next;
+                       }
+                       return changed;
+               };
+
+               TweenPlugin.activate = function(plugins) {
+                       var i = plugins.length;
+                       while (--i > -1) {
+                               if (plugins[i].API === TweenPlugin.API) {
+                                       _plugins[(new plugins[i]())._propName] = plugins[i];
+                               }
+                       }
+                       return true;
+               };
+
+               //provides a more concise way to define plugins that have no dependencies besides TweenPlugin and TweenLite, wrapping common boilerplate stuff into one function (added in 1.9.0). You don't NEED to use this to define a plugin - the old way still works and can be useful in certain (rare) situations.
+               _gsDefine.plugin = function(config) {
+                       if (!config || !config.propName || !config.init || !config.API) { throw "illegal plugin definition."; }
+                       var propName = config.propName,
+                               priority = config.priority || 0,
+                               overwriteProps = config.overwriteProps,
+                               map = {init:"_onInitTween", set:"setRatio", kill:"_kill", round:"_roundProps", initAll:"_onInitAllProps"},
+                               Plugin = _class("plugins." + propName.charAt(0).toUpperCase() + propName.substr(1) + "Plugin",
+                                       function() {
+                                               TweenPlugin.call(this, propName, priority);
+                                               this._overwriteProps = overwriteProps || [];
+                                       }, (config.global === true)),
+                               p = Plugin.prototype = new TweenPlugin(propName),
+                               prop;
+                       p.constructor = Plugin;
+                       Plugin.API = config.API;
+                       for (prop in map) {
+                               if (typeof(config[prop]) === "function") {
+                                       p[map[prop]] = config[prop];
+                               }
+                       }
+                       Plugin.version = config.version;
+                       TweenPlugin.activate([Plugin]);
+                       return Plugin;
+               };
+
+
+               //now run through all the dependencies discovered and if any are missing, log that to the console as a warning. This is why it's best to have TweenLite load last - it can check all the dependencies for you.
+               a = window._gsQueue;
+               if (a) {
+                       for (i = 0; i < a.length; i++) {
+                               a[i]();
+                       }
+                       for (p in _defLookup) {
+                               if (!_defLookup[p].func) {
+                                       //window.console.log("GSAP encountered missing dependency: com.greensock." + p);
+                               }
+                       }
+               }
+
+               _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated
+
+})(window);
 
 angular.module('b2b.att.collapse', ['b2b.att.transition'])
 
 
 angular.module('b2b.att.collapse', ['b2b.att.transition'])
 
index 61546a0..778528b 100644 (file)
@@ -1,6 +1,6 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
-  <groupId>org.openecomp.portal</groupId>
+  <groupId>org.onap.portal</groupId>
   <artifactId>ecompportal-FE-common</artifactId>
   <version>0</version>
   <!-- This file exists only to allow easy import of this project into Eclipse. -->
   <artifactId>ecompportal-FE-common</artifactId>
   <version>0</version>
   <!-- This file exists only to allow easy import of this project into Eclipse. -->
index 708a4a6..0b23d3e 100644 (file)
 .icon-datanetwork-softwareasaservice:before,
 .icon-datanetwork-messaging2:before,
 .icon-controls-moreapplications:before,
 .icon-datanetwork-softwareasaservice:before,
 .icon-datanetwork-messaging2:before,
 .icon-controls-moreapplications:before,
+.icon-people-groupcollaboration:before,
+.icon-controls-settingsconnectedactivity:before,
+.icon-content-grid2:before,
+.icon-retail-gallery:before,
 .icon-arrows-upload:before { 
        display: inline-block; 
        font-family: "Ionicons"; 
 .icon-arrows-upload:before { 
        display: inline-block; 
        font-family: "Ionicons"; 
 .icon-datanetwork-messaging2:before { content: "\f132"; }
 
 .icon-controls-moreapplications:before { content: "\f20b"; }
 .icon-datanetwork-messaging2:before { content: "\f132"; }
 
 .icon-controls-moreapplications:before { content: "\f20b"; }
+
+.icon-people-groupcollaboration:before { content: "\f47c"; }
+
+.icon-controls-settingsconnectedactivity:before { content: "\f411"; }
+
+.icon-content-grid2:before { content: "\f440"; }
+
+.icon-retail-gallery:before  { content: "\f481"; }
\ No newline at end of file
index c9bcade..3b959f1 100644 (file)
@@ -1,5 +1,9 @@
 {
        "api": {
 {
        "api": {
+               "singleAppInfo":"http://localhost:8080/ecompportal/portalApi/singleAppInfo",
+               "singleAppInfoById":"http://localhost:8080/ecompportal/portalApi/singleAppInfoById",
+               "syncRolesFromExternalAuthSystem":"http://localhost:8080/ecompportal/portalApi/syncRoles",
+               "syncFunctionsFromExternalAuthSystem":"http://localhost:8080/ecompportal/portalApi/syncFunctions",
                "userApps": "http://localhost:8080/ecompportal/portalApi/userApps",
                "persUserApps": "http://localhost:8080/ecompportal/portalApi/persUserApps",
                "appCatalog": "http://localhost:8080/ecompportal/portalApi/appCatalog",
                "userApps": "http://localhost:8080/ecompportal/portalApi/userApps",
                "persUserApps": "http://localhost:8080/ecompportal/portalApi/persUserApps",
                "appCatalog": "http://localhost:8080/ecompportal/portalApi/appCatalog",
                "saveNotification": "http://localhost:8080/ecompportal/portalApi/saveNotification",
                "getNotificationRoles":"http://localhost:8080/ecompportal/portalApi/notificationRole",
                "getRole": "http://localhost:8080/ecompportal/portalApi/get_role",
                "saveNotification": "http://localhost:8080/ecompportal/portalApi/saveNotification",
                "getNotificationRoles":"http://localhost:8080/ecompportal/portalApi/notificationRole",
                "getRole": "http://localhost:8080/ecompportal/portalApi/get_role",
-               "getRoles": "http://localhost:8080/ecompportal/portalApi/get_roles",
+               "getRoles": "http://localhost:8080/ecompportal/portalApi/get_roles/:appId",
                "toggleRole": "http://localhost:8080/ecompportal/portalApi/role_list/toggleRole",
                "removeRole": "http://localhost:8080/ecompportal/portalApi/role_list/removeRole",
                "toggleRole": "http://localhost:8080/ecompportal/portalApi/role_list/toggleRole",
                "removeRole": "http://localhost:8080/ecompportal/portalApi/role_list/removeRole",
-               "saveRole": "http://localhost:8080/ecompportal/portalApi/role/saveRole.htm",
+               "saveRole": "http://localhost:8080/ecompportal/portalApi/role/saveRole/:appId",
                "toggleRoleRoleFunction": "http://localhost:8080/ecompportal/portalApi/role/removeRoleFunction.htm",
                "addRoleRoleFunction": "http://localhost:8080/ecompportal/portalApi/role/addRoleFunction.htm",
                "toggleRoleChildRole": "http://localhost:8080/ecompportal/portalApi/role/removeChildRole.htm",
                "addRoleChildRole": "http://localhost:8080/ecompportal/portalApi/role/addChildRole.htm",
                "toggleRoleRoleFunction": "http://localhost:8080/ecompportal/portalApi/role/removeRoleFunction.htm",
                "addRoleRoleFunction": "http://localhost:8080/ecompportal/portalApi/role/addRoleFunction.htm",
                "toggleRoleChildRole": "http://localhost:8080/ecompportal/portalApi/role/removeChildRole.htm",
                "addRoleChildRole": "http://localhost:8080/ecompportal/portalApi/role/addChildRole.htm",
-               "getRoleFunctions": "http://localhost:8080/ecompportal/portalApi/get_role_functions",
-               "saveRoleFunction": "http://localhost:8080/ecompportal/portalApi/role_function_list/saveRoleFunction.htm",
-               "removeRoleFunction": "http://localhost:8080/ecompportal/portalApi/role_function_list/removeRoleFunction.htm",
+               "getRoleFunctions": "http://localhost:8080/ecompportal/portalApi/get_role_functions/:appId",
+               "saveRoleFunction": "http://localhost:8080/ecompportal/portalApi/role_function_list/saveRoleFunction/:appId",
+               "removeRoleFunction": "http://localhost:8080/ecompportal/portalApi/role_function_list/removeRoleFunction/:appId",
                "userAppsOrderBySortPref": "http://localhost:8080/ecompportal/portalApi/userAppsOrderBySortPref",
                "userAppsOrderByName": "http://localhost:8080/ecompportal/portalApi/userAppsOrderByName",
                "saveUserAppsSortingPreference": "http://localhost:8080/ecompportal/portalApi/saveUserAppsSortingPreference",
                "userAppsOrderBySortPref": "http://localhost:8080/ecompportal/portalApi/userAppsOrderBySortPref",
                "userAppsOrderByName": "http://localhost:8080/ecompportal/portalApi/userAppsOrderByName",
                "saveUserAppsSortingPreference": "http://localhost:8080/ecompportal/portalApi/saveUserAppsSortingPreference",
@@ -92,7 +96,8 @@
                "userApplicationRoles":"http://localhost:8080/ecompportal/portalApi/userApplicationRoles",
                "ecompTitle":"http://localhost:8080/ecompportal/portalApi/ecompTitle",
                "loggedinUser" : "http://localhost:8080/ecompportal/portalApi/loggedinUser",
                "userApplicationRoles":"http://localhost:8080/ecompportal/portalApi/userApplicationRoles",
                "ecompTitle":"http://localhost:8080/ecompportal/portalApi/ecompTitle",
                "loggedinUser" : "http://localhost:8080/ecompportal/portalApi/loggedinUser",
-               "modifyLoggedinUser" : "http://localhost:8080/ecompportal/portalApi/modifyLoggedinUser"
+               "modifyLoggedinUser" : "http://localhost:8080/ecompportal/portalApi/modifyLoggedinUser",
+               "centralizedApps": "http:/localhost:8080/ecompportal/portalApi/centralizedApps"
        },
        "cookieDomain": "onap.org"
 }
        },
        "cookieDomain": "onap.org"
 }
index c3791a5..46fd772 100644 (file)
@@ -1,5 +1,9 @@
 {
        "api": {
 {
        "api": {
+               "singleAppInfo":"portalApi/singleAppInfo",
+               "singleAppInfoById":"portalApi/singleAppInfoById",
+               "syncRolesFromExternalAuthSystem":"portalApi/syncRoles",
+               "syncFunctionsFromExternalAuthSystem":"portalApi/syncFunctions",
                "userApps": "portalApi/userApps",
                "persUserApps": "portalApi/persUserApps",
                "appCatalog": "portalApi/appCatalog",
                "userApps": "portalApi/userApps",
                "persUserApps": "portalApi/persUserApps",
                "appCatalog": "portalApi/appCatalog",
                "saveNotification": "portalApi/saveNotification",
                "getNotificationRoles":"portalApi/notificationRole",
                "getRole": "portalApi/get_role",
                "saveNotification": "portalApi/saveNotification",
                "getNotificationRoles":"portalApi/notificationRole",
                "getRole": "portalApi/get_role",
-               "getRoles": "portalApi/get_roles",
+               "getRoles": "portalApi/get_roles/:appId",
                "toggleRole": "portalApi/role_list/toggleRole",
                "removeRole": "portalApi/role_list/removeRole",
                "toggleRole": "portalApi/role_list/toggleRole",
                "removeRole": "portalApi/role_list/removeRole",
-               "saveRole": "portalApi/role/saveRole.htm",
+               "saveRole": "portalApi/role/saveRole/:appId",
                "toggleRoleRoleFunction": "portalApi/role/removeRoleFunction.htm",
                "addRoleRoleFunction": "portalApi/role/addRoleFunction.htm",
                "toggleRoleChildRole": "portalApi/role/removeChildRole.htm",
                "addRoleChildRole": "portalApi/role/addChildRole.htm",
                "toggleRoleRoleFunction": "portalApi/role/removeRoleFunction.htm",
                "addRoleRoleFunction": "portalApi/role/addRoleFunction.htm",
                "toggleRoleChildRole": "portalApi/role/removeChildRole.htm",
                "addRoleChildRole": "portalApi/role/addChildRole.htm",
-               "getRoleFunctions": "portalApi/get_role_functions",
-               "saveRoleFunction": "portalApi/role_function_list/saveRoleFunction.htm",
-               "removeRoleFunction": "portalApi/role_function_list/removeRoleFunction.htm",
+               "getRoleFunctions": "portalApi/get_role_functions/:appId",
+               "saveRoleFunction": "portalApi/role_function_list/saveRoleFunction/:appId",
+               "removeRoleFunction": "portalApi/role_function_list/removeRoleFunction/:appId",
                "userAppsOrderBySortPref": "portalApi/userAppsOrderBySortPref",
                "userAppsOrderByName": "portalApi/userAppsOrderByName",
                "saveUserAppsSortingPreference": "portalApi/saveUserAppsSortingPreference",
                "userAppsOrderBySortPref": "portalApi/userAppsOrderBySortPref",
                "userAppsOrderByName": "portalApi/userAppsOrderByName",
                "saveUserAppsSortingPreference": "portalApi/saveUserAppsSortingPreference",
@@ -92,7 +96,8 @@
                "userApplicationRoles":"portalApi/userApplicationRoles",
                "ecompTitle":"portalApi/ecompTitle",
                "loggedinUser" : "portalApi/loggedinUser",
                "userApplicationRoles":"portalApi/userApplicationRoles",
                "ecompTitle":"portalApi/ecompTitle",
                "loggedinUser" : "portalApi/loggedinUser",
-               "modifyLoggedinUser" : "portalApi/modifyLoggedinUser"
+               "modifyLoggedinUser" : "portalApi/modifyLoggedinUser",
+               "centralizedApps": "portalApi/centralizedApps" 
        },
        "cookieDomain": "onap.org"
 }
        },
        "cookieDomain": "onap.org"
 }
index e65b700..e502382 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -92,6 +92,7 @@
 
 </head>
 <body ng-app="ecompApp">
 
 </head>
 <body ng-app="ecompApp">
+<base href="" id="baseHref">
 <script>
            if (!String.prototype.includes) {
                  String.prototype.includes = function(search, start) {
 <script>
            if (!String.prototype.includes) {
                  String.prototype.includes = function(search, start) {
 
            
                var base = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2)+1);
 
            
                var base = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2)+1);
-               document.write("<base href='" + base + "' />");
+               document.getElementById('baseHref').href = base;
 
                
            
 
                
            
   <script src="app/services/portal-admins/portal-admins.service.js"></script>
   <script src="app/services/recommendation/recommendation.service.js"></script>
   <script src="app/services/role/role.service.js"></script>
   <script src="app/services/portal-admins/portal-admins.service.js"></script>
   <script src="app/services/recommendation/recommendation.service.js"></script>
   <script src="app/services/role/role.service.js"></script>
+  <script src="app/services/scheduler/scheduler.service.js"></script>
   <script src="app/services/support/getAccess/get-access.service.js"></script>
   <script src="app/services/support/session/session.service.js"></script>
   <script src="app/services/userProfile/userProfile.service.js"></script>
   <script src="app/services/support/getAccess/get-access.service.js"></script>
   <script src="app/services/support/session/session.service.js"></script>
   <script src="app/services/userProfile/userProfile.service.js"></script>
   <script src="app/views/dashboard/dashboard-widget.controller.js"></script>
   <script src="app/views/dashboard/dashboard.controller.js"></script>
   <script src="app/views/dashboard/newsticker.controller.js"></script>
   <script src="app/views/dashboard/dashboard-widget.controller.js"></script>
   <script src="app/views/dashboard/dashboard.controller.js"></script>
   <script src="app/views/dashboard/newsticker.controller.js"></script>
+  <script src="app/views/errors/error.controller.js"></script>
   <script src="app/views/footer/footer.controller.js"></script>
   <script src="app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js"></script>
   <script src="app/views/functionalMenu/functionalMenu.controller.js"></script>
   <script src="app/views/footer/footer.controller.js"></script>
   <script src="app/views/functionalMenu/functionalMenu-dialog/menu-details.controller.js"></script>
   <script src="app/views/functionalMenu/functionalMenu.controller.js"></script>
   <script src="app/views/portal-admin/new-portal-admin/new-portal-admin.controller.js"></script>
   <script src="app/views/portal-admin/portal-admin-controller.js"></script>
   <script src="app/views/role/role-controller.js"></script>
   <script src="app/views/portal-admin/new-portal-admin/new-portal-admin.controller.js"></script>
   <script src="app/views/portal-admin/portal-admin-controller.js"></script>
   <script src="app/views/role/role-controller.js"></script>
+  <script src="app/views/role/role-create-edit-popup-controller.js"></script>
   <script src="app/views/role/role-function-list-controller.js"></script>
   <script src="app/views/role/role-list-controller.js"></script>
   <script src="app/views/role/rolefunctionpopupController.js"></script>
   <script src="app/views/role/rolepopupmodelController.js"></script>
   <script src="app/views/role/role-function-list-controller.js"></script>
   <script src="app/views/role/role-list-controller.js"></script>
   <script src="app/views/role/rolefunctionpopupController.js"></script>
   <script src="app/views/role/rolepopupmodelController.js"></script>
+  <script src="app/views/scheduler/scheduler.controller.js"></script>
   <script src="app/views/search/search.controller.js"></script>
   <script src="app/views/sidebar/sidebar.controller.js"></script>
   <script src="app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js"></script>
   <script src="app/views/search/search.controller.js"></script>
   <script src="app/views/sidebar/sidebar.controller.js"></script>
   <script src="app/views/support/contact-us/contact-us-manage/contact-us-manage.controller.js"></script>
index 8a1897f..173074f 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index bf7a96e..9797de4 100644 (file)
@@ -97,4 +97,8 @@ body {
 .errorContent p{
     font-size: 28px;
     margin-left: 120px;
 .errorContent p{
     font-size: 28px;
     margin-left: 120px;
+}
+
+.information-message-body{
+       word-break: break-all;
 }
\ No newline at end of file
 }
\ No newline at end of file
index 92207df..45aded9 100644 (file)
@@ -1,24 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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.
- * ================================================================================
- */
-/**
- * Created by nnaffar on 1/28/16.
+ *
+ * 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 (function () {
     class RightMenu {
  */
 (function () {
     class RightMenu {
index 0575553..d976a45 100644 (file)
@@ -1,5 +1,39 @@
-/**
- * Created by nnaffar on 1/28/16.
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 @sidebar-width: 200px;
 @transition-duration: 0.25s;
  */
 @sidebar-width: 200px;
 @transition-duration: 0.25s;
index 08054b2..f252da5 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index e6e7661..10ebfd2 100644 (file)
@@ -1,23 +1,40 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
-
 'use strict';
 (function () {
     class SearchUsersCtrl {
 'use strict';
 (function () {
     class SearchUsersCtrl {
index 605abfc..adeb439 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  .search-users-directive{
   .title {
  */
  .search-users-directive{
   .title {
index 288029d..40eabcf 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -36,7 +36,7 @@
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
 <div class="search-users-directive">
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
 <div class="search-users-directive">
-    <form name="searchUsersForm" novalidate>
+    <form name="searchUsersForm" novalidate method="post">
         <div class="title" ng-bind="searchUsers.searchTitle"></div>
         <div class="main">
            <div ng-show="searchUsers.showSearch">
         <div class="title" ng-bind="searchUsers.searchTitle"></div>
         <div class="main">
            <div ng-show="searchUsers.showSearch">
                                        </div>
                                        <div class="input-new-user-div" >
                                                  <div class="">*Login Password</div>
                                        </div>
                                        <div class="input-new-user-div" >
                                                  <div class="">*Login Password</div>
-                                                 <input  type="password" ng-model="searchUsers.newUser.loginPwd"/>
+                                                 <input  type="password" ng-model="searchUsers.newUser.loginPwd"    autocomplete="off"/>
                                        </div>
                                        <div class="input-new-user-div" >
                                                  <div class="">*Confirm Login Password</div>
                                        </div>
                                        <div class="input-new-user-div" >
                                                  <div class="">*Confirm Login Password</div>
-                                                 <input  type="password" ng-model="searchUsers.newUser.loginPwdCheck"/>
+                                                 <input  type="password" ng-model="searchUsers.newUser.loginPwdCheck"  autocomplete="off"/>
                                        </div>
                                <div ng-show="searchUsers.newUser.loginPwdCheck.length>=searchUsers.newUser.loginPwd.length&&searchUsers.newUser.loginPwdCheck.length>0&&searchUsers.newUser.loginPwd!=searchUsers.newUser.loginPwdCheck"
                                                style="color: #cf2a2a; font-size: 12px;">
                                        </div>
                                <div ng-show="searchUsers.newUser.loginPwdCheck.length>=searchUsers.newUser.loginPwd.length&&searchUsers.newUser.loginPwdCheck.length>0&&searchUsers.newUser.loginPwd!=searchUsers.newUser.loginPwdCheck"
                                                style="color: #cf2a2a; font-size: 12px;">
index 1b9cb5c..a63080a 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 2fe1d80..2f4b2d8 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 
 /*As Recommendation code belongs to internal use  Just kept an empty file in order to avoid 404 errors in the browser console */
\ No newline at end of file
  */
 
 /*As Recommendation code belongs to internal use  Just kept an empty file in order to avoid 404 errors in the browser console */
\ No newline at end of file
index eca3719..e44dc3e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index 76a778f..36e6d6e 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
                     } else {
                         if (this.debug)
                                this.$log.debug('UserProfileService::getFunctionalMenuStaticInfo Succeeded');
                     } else {
                         if (this.debug)
                                this.$log.debug('UserProfileService::getFunctionalMenuStaticInfo Succeeded');
-                        deferred.resolve(res.data);
+                        // saving the userId at session level
+                        sessionStorage.userId = res.data.userId;
+                        deferred.resolve(res.data);                        
                     }
                 }).catch( status => {
                     this.$log.error('UserProfileService::getFunctionalMenuStaticInfo caught exception: ' + JSON.stringify(status));
                     }
                 }).catch( status => {
                     this.$log.error('UserProfileService::getFunctionalMenuStaticInfo caught exception: ' + JSON.stringify(status));
index 1562375..817ef9f 100644 (file)
@@ -1,4 +1,40 @@
-//portal abs table component
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
 .c-ecomp-portal-abs-table{
     width: 100%;
     height: 600px;
 .c-ecomp-portal-abs-table{
     width: 100%;
     height: 600px;
index 689329f..1a7ef54 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 34042c1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 13fb8e7..3d221a3 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
  
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
  
   ECOMP is a trademark and service mark of AT&T Intellectual Property.
   -->
-<div class="application-details-modal">
 
 
-               <div class="b2b-modal-header">
-                       <h2 class="account-details-title" id="application-details-title">Application Details</h2>
-
-                       <div class="corner-button in">
-                               <button type="button" class="close" aria-label="Closhhhe"
-                                       ng-click="$dismiss('cancel')"></button>
-                       </div>
-               </div>
-
-               <div class="b2b-modal-body">
-    <div class="app-properties-main" scroll-top="appDetails.scrollApi">
-        <form name="appForm" novalidate autocomplete="off">
-            <!-- We can remove this script once we get to Firefox version 47
-                  autocomplete="off" won't work until v47 -->
-           <!--  <script type="text/javascript">
-                document.getElementById("appForm").reset();
-            </script> -->
-            <div id="app-left-container" class="left-container">
-                <div class="property-label checkbox-label"> 
-                                       <label for="checkbox-app-is-restricted" class="checkbox"> 
-                               <input type="checkbox" ng-model="appDetails.app.restrictedApp" id="checkbox-app-is-restricted" ng-disabled="appDetails.isEditMode" ng-checked="appDetails.app.restrictedApp"/> 
-                               <i class="skin"></i> 
-                               <span>Hyperlink only application</span> 
-                           </label> 
-                               </div>       
-                <div class="property required">
-                    <div class="property-label">Application Name</div>
-                    <input id="input-app-name"  type="text"
-                           ng-model="appDetails.app.name"
-                           maxlength="100"
-                           name="name"
-                           ng-pattern="/^[a-zA-Z0-9_\-\s\&]*$/"
-                           required/>
-
-                    <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" ng-show="appForm.name.$dirty || appDetails.isEditMode">
-                        <div ng-messages="appForm.name.$error" class="error-container">
-                            <small id="app-name-error-required" class="err-message" ng-message="required">Application name is required</small>
-                            <small id="app-name-error-alpha-num" class="err-message" ng-message="pattern">Application name must be alphanumeric</small>
-                        </div>
-                    </div>
-                </div>
-                <!--<div class="property">-->
-                <!--<div class="property-label">Description</div>-->
-                <!--<input class="input-field" type="text" ng-model="appDetails.app.description"/>-->
-                <!--</div>-->
-                <!--<div class="property">-->
-                <!--<div class="property-label">Notes</div>-->
-                <!--<input class="input-field" type="text" ng-model="appDetails.app.notes"/>-->
-                <!--</div>-->
-                <div class="property required">
-                    <div id="url-property-label" class="property-label">URL</div>
-                    <input  id="input-app-url"
-                           ng-model="appDetails.app.url"
-                           maxlength="256"
-                           name="url"
-                           type="url" placeholder="https://"
-                           ng-pattern="appDetails.ECOMP_URL_REGEX"
-                           required />
-                    <div id="app-error-url" class="error-container" ng-show="appDetails.conflictMessages.url" id="div-app-name-err-url">
-                        <small class="err-message" ng-bind="appDetails.conflictMessages.url"></small>
-                    </div>
-                    <div id="app-error-url-message" class="error-container" ng-show="appForm.url.$dirty || appDetails.isEditMode">
-                        <div ng-messages="appForm.url.$error" class="error-container">
-                            <small id="error-app-url-req" class="err-message" ng-message="required">Application URL is required</small>
-                            <!--<small id="error-app-url-invalid" class="err-message" ng-message="pattern">Application URL must be a valid URL</small>-->
-                            <small id="error-app-url-invalid" class="err-message" ng-show="appForm.url.$error.url">Application URL must be a valid URL</small>
-                        </div>
-                    </div>
-                    <!--<span class="err-message" ng-show="appForm.url.$error.url"> Not valid URL!</span>-->
-                </div>
+<div class="b2b-modal-header">
+       <h2 class="account-details-title" id="application-details-title">Application
+               Details</h2>
+       <div class="corner-button in">
+               <button type="button" class="close" id="div-confirm-close-button"
+                       aria-label="Close" ng-click="$dismiss('cancel')"></button>
+       </div>
+</div>
+<div class="b2b-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">
+                                               <label for="checkbox-app-is-restricted" class="checkbox">
+                                                       <input type="checkbox" ng-model="appDetails.app.restrictedApp"
+                                                       id="checkbox-app-is-restricted"
+                                                       ng-disabled="appDetails.isEditMode"
+                                                       ng-checked="appDetails.app.restrictedApp" /> <i class="skin"></i>
+                                                       <span>Hyperlink only application</span>
+                                               </label>
+                                       </div>
+                                       <div class="property required">
+                                               <div class="property-label">Application Name</div>
+                                               <input id="input-app-name" type="text"
+                                                       ng-model="appDetails.app.name" maxlength="100" name="name"
+                                                       ng-pattern="/^[a-zA-Z0-9_\-\s\&]*$/" required />
 
 
+                                               <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"
+                                                       ng-show="appForm.name.$dirty || appDetails.isEditMode">
+                                                       <div ng-messages="appForm.name.$error" class="error-container">
+                                                               <small id="app-name-error-required" class="err-message"
+                                                                       ng-message="required">Application name is required</small> <small
+                                                                       id="app-name-error-alpha-num" class="err-message"
+                                                                       ng-message="pattern">Application name must be
+                                                                       alphanumeric</small>
+                                                       </div>
+                                               </div>
+                                       </div>
+                                       <div class="property required">
+                                               <div id="url-property-label" class="property-label">URL</div>
+                                               <input id="input-app-url" ng-model="appDetails.app.url"
+                                                       maxlength="256" name="url" type="url" placeholder="https://"
+                                                       ng-pattern="appDetails.ECOMP_URL_REGEX" required />
+                                               <div id="app-error-url" class="error-container"
+                                                       ng-show="appDetails.conflictMessages.url"
+                                                       id="div-app-name-err-url">
+                                                       <small class="err-message"
+                                                               ng-bind="appDetails.conflictMessages.url"></small>
+                                               </div>
+                                               <div id="app-error-url-message" class="error-container"
+                                                       ng-show="appForm.url.$dirty || appDetails.isEditMode">
+                                                       <div ng-messages="appForm.url.$error" class="error-container">
+                                                               <small id="error-app-url-req" class="err-message"
+                                                                       ng-message="required">Application URL is required</small>
+                                                               <!--<small id="error-app-url-invalid" class="err-message" ng-message="pattern">Application URL must be a valid URL</small>-->
+                                                               <small id="error-app-url-invalid" class="err-message"
+                                                                       ng-show="appForm.url.$error.url">Application URL must
+                                                                       be a valid URL</small>
+                                                       </div>
+                                               </div>
+                                               <!--<span class="err-message" ng-show="appForm.url.$error.url"> Not valid URL!</span>-->
+                                       </div>
 
 
-                <div class="property" ng-show="!appDetails.app.restrictedApp">
-                    <div class="property-label">Rest API URL</div>
-                    <input  id="input-app-rest-url"
-                           ng-model="appDetails.app.restUrl"
-                           name="restUrl"
-                           type="url" placeholder="https://"
-                           ng-pattern="appDetails.ECOMP_URL_REGEX"
-                           maxlength="256"/>
-                    <div id="app-error-rest-message" class="error-container" ng-show="appForm.restUrl.$dirty || appDetails.isEditMode">
-                        <div ng-messages="appForm.restUrl.$error" class="error-container">
-                            <!--<small class="err-message" ng-message="pattern">Application REST URL must be a valid URL</small>-->
-                            <small class="err-message" ng-show="appForm.restUrl.$error.url">Application REST URL must be a valid URL</small>
-                        </div>
-                    </div>
-                </div>
 
 
-                <div class="property required" ng-show="!appDetails.app.restrictedApp">
-                    <div id="username-property-label"  class="property-label">Username</div>
-                    <input  type="text"
-                           ng-model="appDetails.app.username"
-                           name="username"
-                           maxlength="256"
-                           ng-required="!appDetails.app.restrictedApp"/>
-                    <div id="app-error-username-container" class="error-container" ng-show="appForm.username.$dirty || appDetails.isEditMode">
-                        <div ng-messages="appForm.username.$error" class="error-container">
-                            <small  id="error-appusername-reqd" class="err-message" ng-message="required">My Logins App Username is required</small>
-                        </div>
-                    </div>
-                </div>
-                <div class="property required" ng-show="!appDetails.app.restrictedApp">
-                    <div id="pwd-property-label"  class="property-label">Password</div>
-                    <input  type="password"  id="input-mylogins-password"
-                           ng-model="appDetails.app.appPassword" autocomplete="new-password"
-                           name="appPassword"
-                           maxlength="256"
-                           ng-required="!appDetails.app.restrictedApp"/>
-                    <div id="app-error-password-container" class="error-container" ng-show="appForm.appPassword.$dirty || appDetails.isEditMode">
-                        <div ng-messages="appForm.appPassword.$error" class="error-container">
-                            <small id="error-mylogins-password-reqd" class="err-message" ng-message="required">My Logins App Password is required</small>
-                        </div>
-                    </div>
+                                       <div class="property required" ng-show="!appDetails.app.restrictedApp">
+                                               <div class="property-label">Rest API URL</div>
+                                               <input id="input-app-rest-url" ng-model="appDetails.app.restUrl"
+                                                       name="restUrl" type="url" placeholder="https://"
+                                                       ng-pattern="appDetails.ECOMP_URL_REGEX" maxlength="256"
+                                                       ng-required="!appDetails.app.restrictedApp" />
+                                               <div id="app-error-rest-message" class="error-container"
+                                                       ng-show="appForm.restUrl.$dirty || appDetails.isEditMode">
+                                                       <div ng-messages="appForm.restUrl.$error" class="error-container">
+                                                               <small class="err-message" ng-show="appForm.restUrl.$error.url">Application
+                                                                       REST URL must be a valid URL</small>
+                                                       </div>
+                                               </div>
+                                       </div>
 
 
-                       <div class="property" ng-show="!appDetails.app.restrictedApp">
-                           <div id="pwd-property-label"  class="property-label">Name Space</div>
-                           <input  type="text"  id="input-mylogins-auth-namespace"
-                                  ng-model="appDetails.app.nameSpace" 
-                                  name="appAuthNameSpace"
-                                  maxlength="256"/>
-                       </div>                                    
-                </div>
-            </div>
-            <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"
-                           accept="image/*"
-                           ng-model="appDetails.originalImage"
-                           name="appImage"
-                           image-upload="appDetails.originalImage"
-                           image-upload-resize-max-height="300"
-                           image-upload-resize-max-width="360"
-                           image-upload-resize-quality="0.7"
-                           image-upload-api="appDetails.imageApi" style="height: 24px;"/>
+                                       <div class="property required"
+                                               ng-show="!appDetails.app.restrictedApp">
+                                               <div id="username-property-label" class="property-label">Username</div>
+                                               <input type="text" ng-model="appDetails.app.username"
+                                                       name="username" maxlength="256"
+                                                       ng-required="!appDetails.app.restrictedApp" />
+                                               <div id="app-error-username-container" class="error-container"
+                                                       ng-show="appForm.username.$dirty || appDetails.isEditMode">
+                                                       <div ng-messages="appForm.username.$error"
+                                                               class="error-container">
+                                                               <small id="error-appusername-reqd" class="err-message"
+                                                                       ng-message="required">My Logins App Username is
+                                                                       required</small>
+                                                       </div>
+                                               </div>
+                                       </div>
+                                       <div class="property required"
+                                               ng-show="!appDetails.app.restrictedApp">
+                                               <div id="pwd-property-label" class="property-label">Password</div>
+                                               <input type="password" id="input-mylogins-password"
+                                                       ng-model="appDetails.app.appPassword" autocomplete="new-password"
+                                                       name="appPassword" maxlength="256"
+                                                       ng-required="!appDetails.app.restrictedApp" />
+                                               <div id="app-error-password-container" class="error-container"
+                                                       ng-show="appForm.appPassword.$dirty || appDetails.isEditMode">
+                                                       <div ng-messages="appForm.appPassword.$error"
+                                                               class="error-container">
+                                                               <small id="error-mylogins-password-reqd" class="err-message"
+                                                                       ng-message="required">My Logins App Password is
+                                                                       required</small>
+                                                       </div>
+                                               </div>
 
 
-                    <div id="app-error-image-upload" class="error-container" ng-show="appForm.appImage.$dirty">
-                        <div ng-messages="appForm.appImage.$error" class="error-container">
-                            <small id="error-app-invalid-image" class="err-message" ng-message="mimeType">Uploaded file must be an image</small>
-                            <small id="error-app-invalid-image-size" class="err-message" ng-message="imageSize">Image file must be smaller than 1MB</small>
-                        </div>
-                    </div>
+                                               <div class="property" ng-show="!appDetails.app.restrictedApp">
+                                                       <div id="pwd-property-label" class="property-label">Name
+                                                               Space</div>
+                                                       <input type="text" id="input-mylogins-auth-namespace"
+                                                               ng-model="appDetails.app.nameSpace" name="appAuthNameSpace"
+                                                               maxlength="256" />
+                                               </div>
+                                       </div>
+                               </div>
+                               <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" accept="image/*"
+                                                       ng-model="appDetails.originalImage" name="appImage"
+                                                       image-upload="appDetails.originalImage"
+                                                       image-upload-resize-max-height="300"
+                                                       image-upload-resize-max-width="360"
+                                                       image-upload-resize-quality="0.7"
+                                                       image-upload-api="appDetails.imageApi" style="height: 24px;" />
 
 
-                    <div class="property-label preview">
-                        <span class="left-label">Preview</span>
-                        <span class="remove" ng-click="appDetails.removeImage()">Remove</span>
-                    </div>
-                    <img id="image-app-preview" class="image-preview" ng-src="{{appDetails.app.imageLink || appDetails.app.thumbnail || appDetails.emptyImgForPreview}}"/>
-                    <div id="property-communication-inbox" class="property" ng-show="!appDetails.app.restrictedApp">
-                        <div id="property-communication-inbox-label" class="property-label">Communication Inbox</div>
-                        <input  type="text" id="input-UEB-topicname"
-                               ng-model="appDetails.app.uebTopicName"
-                               name="uebTopicName" readonly="readonly"/>
-                    </div>
+                                               <div id="app-error-image-upload" class="error-container"
+                                                       ng-show="appForm.appImage.$dirty">
+                                                       <div ng-messages="appForm.appImage.$error"
+                                                               class="error-container">
+                                                               <small id="error-app-invalid-image" class="err-message"
+                                                                       ng-message="mimeType">Uploaded file must be an image</small> <small
+                                                                       id="error-app-invalid-image-size" class="err-message"
+                                                                       ng-message="imageSize">Image file must be smaller than
+                                                                       1MB</small>
+                                                       </div>
+                                               </div>
 
 
-                    <div id="property-communication-key" class="property" ng-show="!appDetails.app.restrictedApp">
-                        <div id="property-communication-key-label" class="property-label">Communication Key</div>
-                        <input  type="text" id="input-UEB-communication-key"
-                               ng-model="appDetails.app.uebKey"
-                               name="uebKey" readonly="readonly" />
-                    </div>
+                                               <div class="property-label preview">
+                                                       <span class="left-label">Preview</span> <span class="remove"
+                                                               ng-click="appDetails.removeImage()">Remove</span>
+                                               </div>
+                                               <img id="image-app-preview" class="image-preview"
+                                                       ng-src="{{appDetails.app.imageLink || appDetails.app.thumbnail || appDetails.emptyImgForPreview}}" />
+                                               <div id="property-communication-inbox" class="property"
+                                                       ng-show="!appDetails.app.restrictedApp">
+                                                       <div id="property-communication-inbox-label"
+                                                               class="property-label">Communication Inbox</div>
+                                                       <input type="text" id="input-UEB-topicname"
+                                                               ng-model="appDetails.app.uebTopicName" name="uebTopicName"
+                                                               readonly="readonly" />
+                                               </div>
 
 
-                    <div id="property-communication-secret" class="property" ng-show="!appDetails.app.restrictedApp">
-                        <div id="property-communication-secret-label" class="property-label">Communication Secret</div>
-                        <input  type="text" id="input-UEB-communication-secret"
-                               ng-model="appDetails.app.uebSecret"
-                               name="uebSecret" readonly="readonly" />
-                    </div>
+                                               <div id="property-communication-key" class="property"
+                                                       ng-show="!appDetails.app.restrictedApp">
+                                                       <div id="property-communication-key-label" class="property-label">Communication
+                                                               Key</div>
+                                                       <input type="text" id="input-UEB-communication-key"
+                                                               ng-model="appDetails.app.uebKey" name="uebKey"
+                                                               readonly="readonly" />
+                                               </div>
 
 
-                    <div id="property-guest-access" class="property">
-                        <label for="checkbox-app-is-open" class="checkbox"> 
-                               <input type="checkbox" ng-model="appDetails.app.isOpen" id="checkbox-app-is-open" ng-checked="appDetails.app.isOpen || appDetails.app.restrictedApp" ng-disabled="appDetails.app.restrictedApp"/> 
-                               <i class="skin"></i> 
-                               <span>Allow guest access</span> 
-                           </label> 
-                    </div>
-                    <div id="property-active" class="property">
-                     <label for="checkbox-app-is-enabled" class="checkbox"> 
-                               <input type="checkbox" ng-model="appDetails.app.isEnabled" id="checkbox-app-is-enabled"/> 
-                               <i class="skin"></i> 
-                               <span>Active</span> 
-                           </label>    
-                    </div> <br/>
-                    <div id="property-is-central-auth" class="property" ng-show="!appDetails.app.restrictedApp">
-                     <label for="checkbox-app-is-central-auth" class="checkbox"> 
-                               <input type="checkbox" ng-model="appDetails.app.isCentralAuth" id="checkbox-app-is-central-auth"/> 
-                               <i class="skin"></i> 
-                               <span>Centralized</span> 
-                           </label>    
-                    </div>
+                                               <div id="property-communication-secret" class="property"
+                                                       ng-show="!appDetails.app.restrictedApp">
+                                                       <div id="property-communication-secret-label"
+                                                               class="property-label">Communication Secret</div>
+                                                       <input type="text" id="input-UEB-communication-secret"
+                                                               ng-model="appDetails.app.uebSecret" name="uebSecret"
+                                                               readonly="readonly" />
+                                               </div>
 
 
-                </div>
+                                               <div id="property-guest-access" class="property">
+                                                       <label for="checkbox-app-is-open" class="checkbox"> <input
+                                                               type="checkbox" ng-model="appDetails.app.isOpen"
+                                                               id="checkbox-app-is-open"
+                                                               ng-checked="appDetails.app.isOpen || appDetails.app.restrictedApp"
+                                                               ng-disabled="appDetails.app.restrictedApp" /> <i class="skin"></i>
+                                                               <span>Allow guest access</span>
+                                                       </label>
+                                               </div>
+                                               <div id="property-active" class="property">
+                                                       <label for="checkbox-app-is-enabled" class="checkbox"> <input
+                                                               type="checkbox" ng-model="appDetails.app.isEnabled"
+                                                               id="checkbox-app-is-enabled" /> <i class="skin"></i> <span>Active</span>
+                                                       </label>
+                                               </div>
+                                               <br />
+                                               <div id="property-is-central-auth" class="property"
+                                                       ng-show="!appDetails.app.restrictedApp">
+                                                       <label for="checkbox-app-is-central-auth" class="checkbox">
+                                                               <input type="checkbox" ng-model="appDetails.app.isCentralAuth"
+                                                               id="checkbox-app-is-central-auth" /> <i class="skin"></i> <span>Centralized</span>
+                                                       </label>
+                                               </div>
 
 
-            </div>
-        </form>
-    </div>
-       </div>
-               
-                       <br>
-                       <div class="b2b-modal-footer">
-                               <div class="dialog-control">
-                               <span class="ecomp-save-spinner" ng-show="appDetails.isSaving"></span> 
-                               <button id="button-save-app" class="btn btn-alt btn-small" ng-class="{disabled: appForm.$invalid}" ng-click="appDetails.saveChanges()">Save</button>    
-                                               <button id="button-notification-cancel" class="btn btn-alt btn-small" ng-click="$dismiss('cancel')"role="button" tabindex="0">Cancel</button>
-                                               
-                                               
                                        </div>
                                        </div>
-                       </div>
-                       
-                       
-                       
 
 
+                               </div>
+                       </form>
+               </div>
+       </div>
 </div>
 </div>
-
-
-<script type="application/javascript">
-    $(document).ready(function(){
-        $(".ngdialog-content").css("top","-150px")
-    });
-</script>
\ No newline at end of file
+<div class="b2b-modal-footer">
+       <div align="right">
+               <span class="ecomp-save-spinner" ng-show="appDetails.isSaving"></span>
+               <button id="button-save-app" class="btn btn-alt btn-small"
+                       ng-class="{disabled: appForm.$invalid}"
+                       ng-click="appDetails.saveChanges()">Save</button>
+               <button id="button-notification-cancel" class="btn btn-alt btn-small"
+                       ng-click="$dismiss('cancel')" role="button" tabindex="0">Cancel</button>
+       </div>
+</div>
\ No newline at end of file
index d1c2b09..5eb9dbb 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
                     templateUrl: 'app/views/applications/application-details-dialog/application-details.modal.html',
                     controller: 'AppDetailsModalCtrl as appDetails',
                     sizeClass: 'modal-large', 
                     templateUrl: 'app/views/applications/application-details-dialog/application-details.modal.html',
                     controller: 'AppDetailsModalCtrl as appDetails',
                     sizeClass: 'modal-large', 
+                       windowClass:"modal-docked",
                     resolve: {
                                        items: function () {
                                  return data;
                     resolve: {
                                        items: function () {
                                  return data;
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 8414ee2..e354e41 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 5cda74a..53da9eb 100644 (file)
@@ -1,3 +1,40 @@
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
 <div class="gridster-box-content"
        ng-style="{'cursor':'pointer',
                        'background-image': 'url('+(item.imageLink)+')',
 <div class="gridster-box-content"
        ng-style="{'cursor':'pointer',
                        'background-image': 'url('+(item.imageLink)+')',
index aae5519..ed17504 100644 (file)
@@ -1 +1,38 @@
-<!-- This is a dummy placeholder  -->
\ No newline at end of file
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+You do not have access to any application or function in ONAP.
index d21c829..e58c993 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 0004b02..923430c 100644 (file)
@@ -1,4 +1,41 @@
-.w-ecomp-footer {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .w-ecomp-footer {
     z-index: 101;
     background-color: #222;
     position: absolute;
     z-index: 101;
     background-color: #222;
     position: absolute;
index b422071..a9fd704 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index ff2be60..9a9dad3 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 0ff46e4..8843006 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index ed658f7..cbde436 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index dba442c..d961035 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 (function ($) {
        if (!$.fn.tree) {
  */
 (function ($) {
        if (!$.fn.tree) {
index 8c7ee40..80f0a36 100644 (file)
@@ -1,3 +1,40 @@
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
 <button href="javascript:void(0)" id="allLogout" ng-click="editProfile()" class="btn btn-alt btn-small">
        Profile
 </button>
\ No newline at end of file
 <button href="javascript:void(0)" id="allLogout" ng-click="editProfile()" class="btn btn-alt btn-small">
        Profile
 </button>
\ No newline at end of file
index 0ab0560..15e2022 100644 (file)
@@ -1 +1,38 @@
+<!--
+  ============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============================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
 <img src="assets/images/onap-logo.png" alt="Onap Logo" class="onap-title-logo" >
 <img src="assets/images/onap-logo.png" alt="Onap Logo" class="onap-title-logo" >
index 4720e75..c1357fa 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 3f857a2..7afa59c 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index b103f30..8c83468 100644 (file)
@@ -1,4 +1,41 @@
-.profile-detail-modal {
+/*-
+ * ============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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+ .profile-detail-modal {
   height: 430px;
   margin-left: 20px;
   
   height: 430px;
   margin-left: 20px;
   
index 0c15206..9841bfb 100644 (file)
@@ -1,20 +1,38 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /*As Recommendation code belongs to internal use  Just kept an empty file in order to avoid 404 errors in the browser console */
\ No newline at end of file
  */
 /*As Recommendation code belongs to internal use  Just kept an empty file in order to avoid 404 errors in the browser console */
\ No newline at end of file
index 4ab34e5..67dae35 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 3cb22bf..a520d00 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 (function () {
  */
 'use strict';
 (function () {
index 32cc3a1..626aa15 100644 (file)
@@ -1,19 +1,37 @@
 /*-
 /*-
- * ================================================================================
- * ECOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
  */
index 2b65eee..570b029 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
diff --git a/ecomp-portal-FE-os/client/src/views/support/contact-us/contact-us-table-header.html b/ecomp-portal-FE-os/client/src/views/support/contact-us/contact-us-table-header.html
new file mode 100644 (file)
index 0000000..ac835b8
--- /dev/null
@@ -0,0 +1,3 @@
+<th id="th-functionalItem-0" b2b-table-header sortable="false">Category</th>
+<th id="th-functionalItem-1" b2b-table-header sortable="false">ONAP Functions</th>
+<th id="th-functionalItem-2" b2b-table-header sortable="false">ONAP Applications</th>
\ No newline at end of file
index f832747..dccf0d7 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index b02f9c7..1d1aa7d 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index b0ebcfb..c61f74e 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 4e2b10b..b8e816c 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 'use strict';
 
  */
 'use strict';
 
index e8c4d4a..f0e04aa 100644 (file)
@@ -2,11 +2,11 @@
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
   ============LICENSE_START==========================================
   ONAP Portal
   ===================================================================
-  Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+  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”);
+  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
  
   you may not use this software except in compliance with the License.
   You may obtain a copy of the License at
  
@@ -19,7 +19,7 @@
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
   limitations under the License.
  
   Unless otherwise specified, all documentation contained herein is licensed
-  under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
+  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
  
   you may not use this documentation except in compliance with the License.
   You may obtain a copy of the License at
  
index 7d03fb9..4542aff 100644 (file)
@@ -1,21 +1,39 @@
 /*-
 /*-
- * ================================================================================
- * eCOMP Portal
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
+ * ============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
  * 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,
  * 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 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============================================
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  */
 /**
  * Created by nnaffar on 1/10/16.
  */
 /**
  * Created by nnaffar on 1/10/16.
index 4b59658..acf85b9 100644 (file)
@@ -5,11 +5,11 @@
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>1.3.0</version>
+               <version>2.2</version>
        </parent>
 
        </parent>
 
-       <artifactId>ecompportal-FE-os</artifactId>
-
+       <artifactId>portal-FE-os</artifactId>
+       
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <skipnode>false</skipnode>
        <properties>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <skipnode>false</skipnode>
index f151f08..92ae7aa 100644 (file)
@@ -3,3 +3,6 @@
 /.settings/
 /bin/
 target/
 /.settings/
 /bin/
 target/
+/common-widgets/events-widget.zip
+/common-widgets/news-widget.zip
+/common-widgets/resources-widget.zip
\ No newline at end of file
index 232f933..7b1167d 100644 (file)
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-       <modelVersion>4.0.0</modelVersion>
+               <modelVersion>4.0.0</modelVersion>
 
         <parent>
                 <groupId>org.onap.portal</groupId>
                 <artifactId>widget-ms-parent</artifactId>
 
         <parent>
                 <groupId>org.onap.portal</groupId>
                 <artifactId>widget-ms-parent</artifactId>
-                <version>1.3.0</version>
+                <version>2.2</version>
         </parent>
 
        <artifactId>common-widgets</artifactId>
         </parent>
 
        <artifactId>common-widgets</artifactId>
@@ -78,5 +78,4 @@
                         </plugin>
                </plugins>
        </build>
                         </plugin>
                </plugins>
        </build>
-
 </project>
 </project>
diff --git a/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/js/controller.js
new file mode 100644 (file)
index 0000000..934095c
--- /dev/null
@@ -0,0 +1,604 @@
+function SchedulerCtrl($rootScope , $scope,$state,widgetsCatalogService,$log,schedulerService,$filter,confirmBoxService,userProfileService,conf,$interval,$compile) {
+                       /****define fields****/
+                       var pollpromise;
+                       /*Assign the data that's passed to scheduler UI*/
+                       $scope.hasParentData = true;
+                       $rootScope.schedulerID = '';
+                       $scope.orgUserId="";
+                       $scope.policys = [];
+                       $scope.selectedPolicy={policyName:"",policyConfig:""};
+                       $scope.scheduler = {};
+                       $scope.schedulingInfo = {};
+                       $scope.timeSlots = [];
+                       $scope.changeManagement = {};
+            $rootScope.schedulerForm = {
+               checkboxSelection : 'false',
+                       fromDate:'',
+                       toDate:'',
+                       duration:'',
+                       fallbackDuration:'',
+                       concurrencyLimit:''
+            };
+            
+            $scope.vnfNames = [];
+            $scope.vnfTypes = [];
+            $scope.schedulerObj = {};
+                       
+                       var tomorrow = new Date();
+                       tomorrow.setDate(tomorrow.getDate() + 1);
+            $scope.minDate = tomorrow.toISOString().substring(0, 10);
+
+               
+                       /*form validation*/
+                       $scope.durationEmpty=false;
+                       $scope.concurrencyLimitEmpty = false;
+                       $scope.fallBackDurationEmpty=false;
+                       $scope.fromDateEmpty = false;
+                       $scope.toDateEmpty=false;
+
+                       /*interval values for getting time slots*/
+                       var hasvaluereturnd = true; 
+                       var hasthresholdreached = false; 
+                       var thresholdvalue =10; // interval threshold value                             
+                       
+                       $scope.timeUnit= [
+                               {text: 'HOURS'},
+                               {text: 'MINUTES'},
+                               {text: 'SECONDS'}
+                       ];
+               
+
+                       /***** Functions for modal popup ******/ 
+                       $scope.radioSelections=function (){
+                               if( $rootScope.schedulerForm.checkboxSelection=="true"){
+                                       $rootScope.schedulerForm.fromDate='';
+                                       $rootScope.schedulerForm.toDate=''
+                               }
+                       }
+                       
+                       /*Dropdown update: everytime values in dropdown chagnes, update the selected value*/
+                       $scope.$watch('selectedPolicy.policyName', (newVal, oldVal) => {
+                   for (var i = 0; i < $scope.policys.length; i++) 
+                       if ($scope.policys[i].policyName == newVal) 
+                           $scope.selectedPolicy = angular.copy($scope.policys[i]);;            
+               });
+                       
+                       $scope.$watch('selectedTimeUint.text', (newVal, oldVal) => {
+                   for (var i = 0; i < $scope.timeUnit.length; i++) 
+                       if ($scope.timeUnit[i].text == newVal) 
+                               $scope.selectedTimeUint = angular.copy($scope.timeUnit[i]);;
+               });
+                       
+                       /**
+                        * This function is to validate and check if the input is a valid date. 
+                        * There are two checkers in this function:
+                        * Check 1: the input is a valid date object,return true, return false otherwise.
+                        * Check 2: check if the input has the format of MM/DD/YYYY or M/D/YYYY and is a valid date value. 
+                        * @param  dateInput
+                        * @return true/false
+                        */     
+                       $scope.isDateValid = function(dateInput) {
+                               /*Check 1: see if the input is able to convert into date object*/
+                               if ( Object.prototype.toString.call(dateInput) === "[object Date]" ) 
+                                       return true;
+                               /*Check 2: see if the input is the date format MM/DD/YYYY */
+                               var isDateStrFormat = false;
+                               try{
+                                       /*check the format of MM/DD/YYYY or M/D/YYYY */
+                                       var startDateformat = dateInput.split('/');
+                                       if (startDateformat.length != 3) 
+                                               return false; 
+                                       var day = startDateformat[1];
+                                       var month = parseInt(startDateformat[0])-1;
+                                       var year = startDateformat[2];
+                                       if (year.length != 4) 
+                                               return false;
+                                       /*check the input value and see if it's a valid date*/
+                                       var composedDate = new Date(year, month, day);
+                                       if(composedDate.getDate() == day && composedDate.getMonth() == month && composedDate.getFullYear() == year)
+                                               isDateStrFormat = true
+                                       else
+                                               isDateStrFormat =false;
+                               }catch(err){
+                                       return false;
+                               }
+                               return isDateStrFormat;
+                       };
+
+                       /**
+                        * This function is to check whether the input date is greater than current date or not.  
+                        * @param  date
+                        * @return true/false
+                        */                     
+                       $scope.isStartDateValidFromToday = function (date) {
+                               if(!$scope.isDateValid(date))
+                                       return false;
+                               var startDate = new Date(date);
+                var currentDate = new Date();
+                if(startDate<=currentDate)
+                                       return false;
+                               return true;
+            };
+                       
+                       /**
+                        * This function is to check whether the input to date is greater than input from date.  
+                        * @param  fromDate , toDate
+                        * @return true/false
+                        */     
+                       $scope.isToDateGreaterFromDate = function (fromDate,toDate) {
+                               if(!$scope.isDateValid(fromDate) || !$scope.isDateValid(toDate))
+                                       return false;   
+                var fromDateObj = new Date(fromDate);
+                var toDateObj = new Date(toDate);
+                if(toDateObj<=fromDateObj)
+                       return false;        
+                return true;
+            };
+                       
+                       /**
+                        * This function is to get error message from the input json response object.  
+                        * @param  response , method
+                        * @return errorMsg
+                        */                             
+                       $scope.parseErrorMsg = function(response, method){
+                               var errorMsg = '';
+                               if(response.entity){
+                                       try{
+                                               var entityJson = JSON.parse(response.entity);
+                                               if(entityJson){
+                                                       errorMsg = entityJson.requestError.text;
+                                               }       
+                                       }catch(err){
+                                               $log.error('SchedulerCtrl::' + method +'  error: ' + err);
+                                       }
+                               }
+                               return errorMsg;
+                       }
+                       /***** Scheduler UI functions *****/
+
+                       /* This function is to send scheduler task approval to scheduler microservice.  */      
+                       $scope.submit = function () {
+                               $rootScope.showSpinner =true;
+                               
+                               var approvalDateTime = new Date($scope.timeSlots[0].startTime);
+                               $scope.schedulingInfo={
+                                       scheduleId: $rootScope.schedulerID,
+                                       approvalDateTime:approvalDateTime.toISOString(),
+                                       approvalUserId:$scope.orgUserId,
+                                       approvalStatus:$scope.schedulerObjConst.approvalSubmitStatus,
+                                       approvalType: $scope.schedulerObjConst.approvalType
+                               }
+                               var approvalObj= JSON.stringify($scope.schedulingInfo)
+                               schedulerService.postSubmitForApprovedTimeslots(approvalObj).then(response => {
+                                       if(response.status>=200 && response.status<=204){
+                                               confirmBoxService.showInformation("Successfully Sent for Approval").then(isConfirmed => {});
+                                       }else{
+                                               var errorMsg = $scope.parseErrorMsg(response, 'postSubmitForApprovedTimeslots');                
+                                               confirmBoxService.showInformation("Failed to Send for Approval "+ errorMsg).then(isConfirmed => {
+                                                       $scope.closeModal();
+                                               });
+                                       }
+                               }).catch(err => {
+                                       $log.error('SchedulerCtrl::postSubmitForApprovedTimeslots error: ' + err);
+                                       var errorMsg = '';
+                                       if(err.data)
+                                               errorMsg = $scope.parseErrorMsg(err.data, 'postSubmitForApprovedTimeslots');    
+                                       else
+                                               errorMsg = err;
+                                       confirmBoxService.showInformation("There was a problem sending Schedule request. " + errorMsg).then(isConfirmed => {
+                                               $scope.closeModal();
+                                       });
+                               }).finally(() => {
+                                       $rootScope.showSpinner = false;
+                               });
+                       };
+
+                       /* This function is to send scheduler task rejection to scheduler microservice.  */     
+                       $scope.reject = function () {
+                               $rootScope.showSpinner =true;
+                               var approvalDateTime = new Date($scope.timeSlots[0].startTime);
+                               $scope.schedulingInfo={
+                                       scheduleId: $rootScope.schedulerID,
+                                       approvalDateTime:approvalDateTime.toISOString(),
+                                       approvalUserId:$scope.orgUserId,
+                                       approvalStatus: $scope.schedulerObjConst.approvalRejectStatus,
+                                       approvalType: $scope.schedulerObjConst.approvalType
+                               }
+                               var approvalObj= JSON.stringify($scope.schedulingInfo)
+                               schedulerService.postSubmitForApprovedTimeslots(approvalObj).then(response => {
+                                       if(response.status>=200 && response.status<=299){
+                                               confirmBoxService.showInformation("Successfully Sent for Reject").then(isConfirmed => {});
+                                       }else{
+                                               var errorMsg = $scope.parseErrorMsg(response, 'postSubmitForApprovedTimeslots');                
+                                               confirmBoxService.showInformation("Failed to Send for Reject "+ errorMsg).then(isConfirmed => {});
+                                       }
+                               }).catch(err => {
+                                       $log.error('SchedulerCtrl::postSubmitForApprovedTimeslots error: ' + err);
+                                       var errorMsg = '';
+                                       if(err.data)
+                                               errorMsg = $scope.parseErrorMsg(err.data, 'postSubmitForApprovedTimeslots');    
+                                       else
+                                               errorMsg = err;
+                                       confirmBoxService.showInformation("There was a problem rejecting Schedule request. " + errorMsg).then(isConfirmed => {
+                                               $scope.closeModal();
+                                       });
+                               }).finally(() => {
+                                       $rootScope.showSpinner = false;
+                               });
+                       };
+
+                       /* This function is to send policy config and receive scheduler Id.  */ 
+                       function sendSchedulerReq(){
+                               $scope.timeSlots=[];
+                               $scope.timeSlots.length=0;
+                               $scope.schedulerObj.userId=$scope.orgUserId;   
+                               $scope.schedulerObj.domainData[0].WorkflowName=$scope.vnfObject.workflow;
+                               $scope.schedulerObj.schedulingInfo.normalDurationInSeconds=convertToSecs($rootScope.schedulerForm.duration)
+                               $scope.schedulerObj.schedulingInfo.additionalDurationInSeconds=convertToSecs($rootScope.schedulerForm.fallbackDuration)
+                               $scope.schedulerObj.schedulingInfo.concurrencyLimit=parseInt($rootScope.schedulerForm.concurrencyLimit)
+                               
+                               $scope.schedulerObj.schedulingInfo['vnfDetails'][0].groupId=$scope.schedulerObjConst.groupId;                           
+                               $scope.schedulerObj.schedulingInfo['vnfDetails'][0].node=getVnfData($scope.vnfObject.vnfNames); 
+                               for(var i=0;i<$scope.policys.length;i++){
+                                       if($scope.policys[i].policyName == $scope.selectedPolicy.policyName){
+                                               try{                                            
+                                                       var config = $scope.policys[i].config;
+                                                       var configJson = JSON.parse(config);
+                                                       $scope.selectedPolicy.policyConfig = configJson.policyName;
+                                               }catch(err){
+                                                       confirmBoxService.showInformation("There was a problem setting Policy config. Please try again later. " + err).then(isConfirmed => {
+                                                               $scope.closeModal();
+                                                       });
+                                                       return;
+                                               }                                                               
+                                       }                                                       
+                               }
+                               $scope.schedulerObj.schedulingInfo.policyId=$scope.selectedPolicy.policyConfig;                                                                 
+                               var changeWindow=[{
+                                       startTime:$filter('date')(new Date($rootScope.schedulerForm.fromDate), "yyyy-MM-ddTHH:mmZ", "UTC"),
+                                       endTime:$filter('date')(new Date($rootScope.schedulerForm.toDate), "yyyy-MM-ddTHH:mmZ", "UTC")
+                               }];
+                               $scope.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow=changeWindow;
+                               
+                               if($rootScope.schedulerForm.checkboxSelection=="true"){               //When Scheduled now we remove the changeWindow
+                                       delete $scope.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow;
+                               }
+                               var requestScheduler=  JSON.stringify($scope.schedulerObj)
+                               $rootScope.showSpinner = true;
+                               schedulerService.getStatusSchedulerId(requestScheduler).then(response => {
+                                       
+                                       var errorMsg = '';
+                                       if(response && response.entity!=null){
+                                               var errorMsg = $scope.parseErrorMsg(response, 'getStatusSchedulerId');          
+                                               confirmBoxService.showInformation("There was a problem retrieving scheduler ID. Please try again later. " + errorMsg).then(isConfirmed => {
+                                                       $scope.closeModal();
+                                               });
+
+                                       }else{
+                                               if(response && response.uuid){
+                                                       $rootScope.schedulerID = response.uuid;
+                                                       var scheduledID= JSON.stringify({scheduleId:$rootScope.schedulerID});                    
+                                                       $scope.seviceCallToGetTimeSlots();
+                                               }else{
+                                                       confirmBoxService.showInformation("There was a problem retrieving scheduler ID. Please try again later. " + response).then(isConfirmed => {
+
+                                                       });
+                                               }
+                                               
+                                               
+                                       }
+                               }).catch(err => {
+                                       $rootScope.showSpinner = false; 
+                    $log.error('SchedulerCtrl::getStatusSchedulerId error: ' + err);
+                                       var errorMsg = '';
+                                       if(err.data)
+                                               errorMsg = $scope.parseErrorMsg(err.data, 'getStatusSchedulerId');      
+                                       else
+                                               errorMsg = err;
+                                       confirmBoxService.showInformation("There was a problem retrieving scheduler ID. Please try again later." + errorMsg).then(isConfirmed => {
+                                               $scope.closeModal();
+                                       });
+                }).finally(() => {
+                                       $rootScope.showSpinner = false;
+                               });
+                       }
+
+                       /* This function is to get time slots from SNIRO  */    
+                       $scope.seviceCallToGetTimeSlots = function(){
+                               $rootScope.showTimeslotSpinner = true;
+                               schedulerService.getTimeslotsForScheduler($rootScope.schedulerID).then(response => {    
+                                       if($rootScope.schedulerForm.checkboxSelection=="false"){
+                                               if(response.entity && JSON.parse(response.entity).schedule){ //received the timeslots
+                                                       var entityJson = JSON.parse(response.entity);
+                                                       var scheduleColl=JSON.parse(entityJson.schedule);
+                                                       if(scheduleColl.length>0){
+                                                               $scope.timeSlots =scheduleColl;
+                                                               hasvaluereturnd = false;
+                                                               $rootScope.showTimeslotSpinner = false; 
+                                                               $scope.stopPoll();
+                                                               confirmBoxService.showInformation(entityJson.scheduleId +" Successfully Returned TimeSlots.").then(isConfirmed => {});
+                                                       }else
+                                                               confirmBoxService.showInformation("No time slot available").then(isConfirmed => {
+                                                                       $scope.closeModal();
+                                                               });
+                                               }else{ // do polling 
+                                                       if($scope.timeSlots.length==0 && hasthresholdreached==false){
+                                                               var polltime=$scope.schedulerObjConst.getTimeslotRate*1000;
+                                                               pollpromise= poll(polltime, function () {
+                                                                       if($scope.timeSlots.length==0){
+                                                                               hasvaluereturnd = true;                          
+                                                                               $scope.seviceCallToGetTimeSlots()
+                                                                       }else
+                                                                               hasvaluereturnd = false;                
+                                                               });
+                                                       } else {
+                                                               if($rootScope.showTimeslotSpinner === true){
+                                                                       $rootScope.showTimeslotSpinner = false;
+                                                                       hasthresholdreached = false;
+                                                                       confirmBoxService.showInformation("Failed to get time slot - Timeout error. Please try again later").then(isConfirmed => { 
+                                                                               $scope.closeModal();
+                                                                       });
+                                                               }
+                                                       }
+                                               }
+                                       }else{
+                                               if(response.entity){
+                                                       $rootScope.showTimeslotSpinner = false; 
+                                                       if($rootScope.schedulerForm.checkboxSelection=="false")
+                                                               confirmBoxService.showInformation("Schedule ID :" + response.entity.scheduleId +" is ready to schedule.").then(isConfirmed => {});      
+                                                       else{
+                                                               var entityObj = JSON.parse(response.entity);
+                                                               confirmBoxService.showInformation("ID :" + entityObj.scheduleId +" is successfully sent for Approval").then(isConfirmed => {
+                                                                       $scope.closeModal();
+                                                               });     
+                                                       }               
+                                               }
+                                       }
+                               }).catch(err => {
+                                       $log.error('SchedulerCtrl::seviceCallToGetTimeSlots error: ' + err);
+                                       $rootScope.showTimeslotSpinner = false; 
+                                       confirmBoxService.showInformation("There was a problem retrieving time slows. Please try again later.").then(isConfirmed => {
+                                               $scope.closeModal();
+                                       });
+                               })
+                       }
+                       
+                       
+                       $scope.closeModal = function(){         
+                               setTimeout(function(){ $rootScope.closeModal(); }, 500);
+                       }
+                       
+                       /* This function is to get policy list from policy microservice */      
+                       $scope.getPolicy = function(){
+                            schedulerService.getPolicyInfo().then(res =>{
+                                if(res==null || res=='' || res.status==null || !(res.status>=200 && res.status<=299)){
+                           $log.error('SchedulerWidgetCtrl::getPolicyInfo caught error', res);
+                                               var errorMsg = $scope.parseErrorMsg(res, 'getPolicy');          
+                                               confirmBoxService.showInformation('There was a problem retrieving ploicy. Please try again later. ' + errorMsg).then(isConfirmed => {
+                                                       $scope.closeModal();
+                                               });
+                                }else
+                                       $scope.policys = res.entity;
+                            });
+                       }
+                       
+                       $scope.removeXMLExtension = function(str){
+                               return str.replace(".xml","");
+                       };
+                       /* Find Button */
+                       $scope.schedule = function () {         
+                               if($scope.formValidation())
+                                       sendSchedulerReq();
+                       };
+                       
+                       /*************utility functions**************/
+                       
+                       function convertToSecs(number){
+                               var totalSecs;
+                               if($scope.selectedTimeUint.text === 'HOURS'){
+                                       totalSecs=number * 3600;
+                               } else if($scope.selectedOption === 'MINUTES') {
+                                       totalSecs=number * 60;
+                               } else {
+                                       totalSecs=number;
+                               }
+                               return totalSecs;
+                       }
+
+                       function poll(interval, callback) {
+                               return $interval(function () {
+                                       if (hasvaluereturnd)   //check flag before start new call
+                                               callback(hasvaluereturnd);                              
+                                       thresholdvalue = thresholdvalue - 1;  //Decrease threshold value 
+                                       if (thresholdvalue == 0) 
+                                               $scope.stopPoll(); // Stop $interval if it reaches to threshold                         
+                               }, interval)
+                       }
+
+                       // stop interval.
+                       $scope.stopPoll = function () {
+                               $interval.cancel(pollpromise);
+                               thresholdvalue = 0;     //reset all flags. 
+                               hasvaluereturnd = false;
+                               hasthresholdreached=true;
+                               $rootScope.showSpinner = false;
+                       }
+
+                       function getVnfData(arrColl){
+                               var vnfcolletion=[];
+                               for(var i=0;i<arrColl.length;i++)
+                                       vnfcolletion.push(arrColl[i].name);                             
+                               return vnfcolletion
+                       }
+
+                       function extractChangeManagementCallbackDataStr(changeManagement) {
+                               var result = {};
+                               result.requestType = changeManagement.workflow;
+                               result.requestDetails = [];
+                               _.forEach(changeManagement.vnfNames, function (vnfName) {
+                                       if (vnfName && vnfName.version) {
+                                               if (vnfName.selectedFile) {
+                                                       vnfName.version.requestParameters.userParams = vnfName.selectedFile;
+                                               }
+                                               result.requestDetails.push(vnfName.version)
+                                       }
+                               });
+                               return JSON.stringify(result);
+                       }
+
+                       
+                       $scope.constructScheduleInfo = function(){
+                   var callbackData = extractChangeManagementCallbackDataStr($scope.vnfObject);
+                               $scope.schedulerObj = {
+                               domain: $scope.schedulerObjConst.domain,
+                               scheduleId: '',
+                               scheduleName: $scope.schedulerObjConst.scheduleName,
+                               userId: '',
+                               domainData: [{
+                                       'WorkflowName':  $scope.schedulerObjConst.WorkflowName,
+                                       'CallbackUrl': $scope.schedulerObjConst.CallbackUrl,
+                                       'CallbackData': callbackData
+                               }],
+                               schedulingInfo: {
+                                       normalDurationInSeconds: '',
+                                       additionalDurationInSeconds: '',
+                                       concurrencyLimit: '',
+                                       policyId: '',
+                                       vnfDetails: [
+                                               {
+                                                       groupId: "",
+                                                       node: [],
+                                                       changeWindow: [{
+                                                               startTime: '',
+                                                               endTime: ''
+                                                       }]
+                                               }
+                                       ]
+                               },
+                           }
+                       }
+                       
+                       $scope.formValidation = function(){
+                               $scope.durationEmpty=false;
+                               $scope.concurrencyLimitEmpty = false;
+                               $scope.fallBackDurationEmpty=false;
+                               $scope.fromDateGreater=false;
+                               $scope.fromDateEmpty=false;
+                               $scope.toDateEmpty=false;
+                               if($rootScope.schedulerForm.duration=='')
+                                       $scope.durationEmpty=true;
+                               if($rootScope.schedulerForm.fallbackDuration=='')
+                                       $scope.fallBackDurationEmpty=true;      
+                               if($rootScope.schedulerForm.concurrencyLimit=='')
+                                       $scope.concurrencyLimitEmpty = true;
+                               if(!($rootScope.schedulerForm.fromDate instanceof Date))
+                                       $scope.fromDateEmpty=true;
+                               if(!($rootScope.schedulerForm.toDate  instanceof Date ))
+                                       $scope.toDateEmpty=true;
+                               var fromDateObj = new Date($rootScope.schedulerForm.fromDate);
+                               var toDateObj = new Date($rootScope.schedulerForm.toDate);                              
+                               if(fromDateObj>toDateObj)
+                                       $scope.fromDateGreater = true;                                  
+                               if($scope.durationEmpty||$scope.fallBackDurationEmpty ||$scope.concurrencyLimitEmpty || (($scope.fromDateEmpty || $scope.toDateEmpty) &&  $rootScope.schedulerForm.checkboxSelection=='false' ) ||$scope.fromDateGreater)
+                                       return false;
+                               if($rootScope.schedulerForm.checkboxSelection == false && (!isDateValid($rootScope.schedulerForm.toDate) || !isDateValid($rootScope.schedulerForm.fromDate)))
+                                       return false;
+                               if($scope.selectedPolicy.policyName=='' || $scope.selectedPolicy.policyName=='Select Policy'){
+                                       confirmBoxService.showInformation("Policy is required").then(isConfirmed => {});
+                                       return false;
+                               }
+                               return true;            
+                       }
+                       
+                       $scope.getScheduleConstant =function(){
+                               schedulerService.getSchedulerConstants().then(res =>{
+                                       if(res==null || res=='' || res.status==null || res.status!="OK"){
+                                               $log.error('SchedulerWidgetCtrl::getSchedulerConstants caught error', res);             
+                                               confirmBoxService.showInformation('There is a problem about the Scheduler UI. Please try again later.').then(isConfirmed => {
+                                                       $scope.closeModal();
+                                               });
+                                       }else{
+                                               var response = res.response;
+                                               $scope.schedulerObjConst= {
+                                                       domain: response.domainName,
+                                                       scheduleName : response.scheduleName,
+                                                       WorkflowName : response.workflowName,
+                                                       CallbackUrl : response.callbackUrl,
+                                                       approvalType : response.approvalType,
+                                                       approvalSubmitStatus : response.approvalSubmitStatus,
+                                                       approvalRejectStatus : response.approvalRejectStatus,
+                                                       getTimeslotRate : response.intervalRate,
+                                                       policyName : response.policyName,
+                                                       groupId : response.groupId
+                                               }
+                                               $scope.constructScheduleInfo();
+                                               $scope.getPolicy() // get policy items for the dropdown in the scheduler UI     
+                                       }
+                               });     
+                       }
+                       
+                       /*This function is to get the current logged in user id*/
+                       $scope.getUserId = function(){
+                               $rootScope.showSpinner = true;
+                               userProfileService.getUserProfile()
+                               .then(profile=> {
+                                       $scope.orgUserId = profile.orgUserId;
+                               }).finally(() => {
+                                       $rootScope.showSpinner = false;
+                               });
+                       }
+                       
+                       $scope.activateThis = function(ele){
+                               $compile(ele.contents())($scope);
+                               $scope.$apply();
+            };
+                       
+                       /** listening calls from parents **/
+                       $scope.$on("submit", function(events,data){
+                               $scope.submit();
+                       });
+
+                       $scope.$on("reject", function(events,data){
+                               $scope.reject();
+                       });
+                       
+                       $scope.$on("schedule", function(events,data){
+                               $scope.schedule();
+                       });
+
+                       /** init **/
+            
+            var init = function () {                           
+                               $rootScope.showSpinner = false;
+                               $scope.selectedTimeUint=$scope.timeUnit[0];
+
+                               if($scope.$parent.parentData){  
+                                       $scope.hasParentData = true;
+                                       $scope.message = $scope.$parent.parentData;                             
+                                       $scope.vnfObject = $scope.message.data;
+                                       $scope.schedulerObj = $scope.message.data;
+                                       $scope.getUserId();
+                                       $scope.getScheduleConstant(); //get Scheduler constants from properties file                    
+                               }else{
+                                       //second approach to get data
+                                       var isModal = $( "#scheduler-body" ).hasClass( "b2b-modal-body" );
+                                       if(isModal){
+                                               $scope.message = schedulerService.getWidgetData();
+                                               if($scope.message){
+                                                       $scope.hasParentData = true;
+                                                       $scope.vnfObject = $scope.message.data;
+                                                       $scope.schedulerObj = $scope.message.data;
+                                                       $scope.getUserId();
+                                                       $scope.getScheduleConstant(); //get Scheduler constants from properties file
+                                               }                                                               
+                                       }else{
+                                               $scope.hasParentData = false;
+                                       }
+                               }
+                       };
+                       
+                       init();
+                       
+                       
+}
+
diff --git a/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/markup/markup.html
new file mode 100644 (file)
index 0000000..1a94190
--- /dev/null
@@ -0,0 +1,178 @@
+<div id="widget-scheduler" ng-controller="SchedulerCtrl" class="widget-scheduler-main" >
+               <div id="widget-scheduler" class="widget-scheduler-main">
+               <span class="ecomp-spinner" ng-show="showTimeslotSpinner"></span>
+               <span class="ecomp-spinner" ng-show="showSpinner"></span>
+               <div ng-if="!hasParentData">
+                       <div class="activity-error-container" style="background: rgb(255, 255, 255); overflow: hidden !important; width: 100%;">
+                               <div class="activity-error-block">
+                                       <i class="icon-information full-linear-icon-information" style="margin-left: 125px; font-size: 90px"></i> <br>
+                                       <div class="activity-error-msg1">No prerequisite data available</div>
+                               </div>
+                       </div>
+               </div>
+               <div ng-if="hasParentData" ng-hide="showSpinner || showTimeslotSpinner">
+                       <div class="row-nowrap">
+                               <br>
+                               <div class="scheduler-radio" role="radio">
+                                       <label for="nowRadio" class="radio"> <input
+                                               type="radio" ng-model="schedulerForm.checkboxSelection" id="nowRadio"
+                                               name="nowRadio"  value="true">
+                                               <i class="skin"></i> <span>Now</span>
+                                       </label>
+                               </div>
+                       </div>
+                               <div class="scheduler-radio" role="radio">
+                                       <label for="rangeRadio" class="radio"> <input
+                                               type="radio" ng-model="schedulerForm.checkboxSelection" id="rangeRadio"
+                                               name="rangeRadio" value="false">
+                                               <i class="skin"></i> <span>Range</span>
+                                       </label>
+                               </div>
+                       
+                       <br>
+                       <div class="row-nowrap">
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="textinputID-2a">From Date</label>
+                                               <div class="datepicker-container">
+                                                       <input id="startDate"  min="minDate"
+                                                               ng-disabled="(schedulerForm.checkboxSelection=='true')? true:false"
+                                                               name="startDate" type="text" class="span12"
+                                                               ng-model="schedulerForm.fromDate" b2b-datepicker> 
+                                                               <span   class="error"
+                                                               ng-show="fromDateEmpty && schedulerForm.fromDate=='' && schedulerForm.checkboxSelection=='false'">A     required date is missing</span>
+                                                               <span class="error" ng-show="!isDateValid(schedulerForm.fromDate) && schedulerForm.fromDate!=''">Please enter valid date in MM/DD/YYYY format!</span>
+                                                               <span class="error" ng-show="isDateValid(schedulerForm.fromDate) && !isStartDateValidFromToday(schedulerForm.fromDate) && schedulerForm.fromDate!=''">Input date must be greater than today!</span>
+                                               </div>
+                                       </div>
+                                       
+                               </div>
+                       </div>
+                       <br>
+                       <div class="row-nowrap">
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="textinputID-2a">To Date</label>
+                                               <div class="datepicker-container">
+                                                       <input id="startDate"  min="minDate" ng-disabled="(schedulerForm.checkboxSelection=='true')? true:false" name="endDate" type="text" class="span12"
+                                                               ng-model="schedulerForm.toDate" b2b-datepicker> 
+                                                               <span class="error" ng-show="(fromDateGreater || (!isToDateGreaterFromDate(schedulerForm.fromDate,schedulerForm.toDate) && schedulerForm.toDate!=''))">To date must be greater than From date.</span> 
+                                                               <span class="error" ng-show="toDateEmpty && schedulerForm.toDate=='' && schedulerForm.checkboxSelection=='false'">A required date is missing</span>
+                                                               <span class="error" ng-show="!isDateValid(schedulerForm.toDate) && schedulerForm.toDate!=''">Please enter valid date in MM/DD/YYYY format!</span>
+                                                               <span class="error" ng-show="isDateValid(schedulerForm.toDate) && !isStartDateValidFromToday(schedulerForm.toDate) && schedulerForm.toDate!=''">Input date must be greater than today!</span>
+                                               </div>
+                                       </div>
+                               </div>
+                       </div>
+                       <br>
+                       <div class="row-nowrap">
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="dropdown1">Please Select Option For Duration
+                                                       and FallBack</label> <select id="dropdown1" name="dropdown1" b2b-dropdown
+                                                       placeholder-text="" ng-model="selectedTimeUint.text">
+                                                       <option b2b-dropdown-list option-repeat="d in timeUnit"
+                                                               value="{{d.text}}">{{d.text}}</option>
+                                               </select>
+                                       </div>
+                               </div>
+                       </div>
+                       <br>
+                       <div class="row-nowrap">
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="textinputID-2a">Duration</label>
+                                               <div class="field-group">
+                                                       <input id="textinputID-2a" class="span12" type="number"
+                                                               data-ng-model="schedulerForm.duration"> <span
+                                                               class="error"
+                                                               ng-show="durationEmpty && schedulerForm.duration==''">Required!</span>
+                                               </div>
+                                       </div>
+                               </div>
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="fallBackDuration">FallBack Duration</label>
+                                               <div class="field-group">
+                                                       <input id="fallBackDuration" class="span12" type="number"
+                                                               data-ng-model="schedulerForm.fallbackDuration"> <span
+                                                               class="error"
+                                                               ng-show="fallBackDurationEmpty && schedulerForm.fallbackDuration==''">Required!</span>
+                                               </div>
+                                       </div>
+                               </div>
+                       </div>
+                       <br>
+                       <div class="row-nowrap">
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="concurrency">Concurrency Limit</label>
+                                               <div class="field-group">
+                                                       <input id="concurrency" class="span12" type="number"
+                                                               data-ng-model="schedulerForm.concurrencyLimit" min="1" max="30">
+                                                       <span class="error"
+                                                               ng-show="concurrencyLimitEmpty && schedulerForm.concurrencyLimit==''">Required!</span>
+                                               </div>
+                                       </div>
+                               </div>
+                       </div>
+                       <br>
+                       <div class="row-nowrap">
+                               <div class="span12">
+                                       <div class="form-row">
+                                               <label for="policy">Policy</label> <select name="policy"
+                                                       b2b-dropdown placeholder-text="Select Policy"
+                                                       ng-model="selectedPolicy.policyName" id="policy">
+                                                       <option b2b-dropdown-list option-repeat="p in policys"
+                                                               value="{{p.policyName}}">{{p.policyName}}</option>
+                                               </select>
+                                       </div>
+                               </div>
+                       </div>
+                       <br>
+                       <div>
+                               <button type="button" id="find" name="Find" ng-show="(schedulerForm.checkboxSelection=='true')? false:true"
+                                       class="btn btn-alt btn-small" ng-click="schedule()">Find</button>                               
+                               <div b2b-table table-data="timeSlots"  ng-hide="timeSlots.length==0"    class="b2b-table-div">
+                                       <table>
+                                               <thead b2b-table-row type="header">
+                                                       <tr>
+                                                               <th b2b-table-header key="firstName" sortable="true" id="start-time" default-sort="a">Start Time</th>
+                                                               <th b2b-table-header key="lastName" sortable="true" id="end-time">Finish Time</th>                                                      
+                                                       </tr>
+                                               </thead>
+                                               <tbody b2b-table-row type="body"        row-repeat="rowData in timeSlots" class="table-users-div">
+                                                       <tr ng-click="users.openAddNewUserModal(rowData)">
+                                                               <td b2b-table-body id="rowheader_t1_{{$index}}-startTime" headers="start-time" ng-bind="rowData.startTime"></td>
+                                                               <td b2b-table-body  id="rowheader_t1_{{$index}}-endTime"  headers="end-time" ng-bind="rowData.finishTime"></td>
+                                                                                                       
+                                                       </tr>
+                                               </tbody>
+                                       </table>
+                               </div>
+                       </div>
+                       
+                       <div class="b2b-modal-footer">
+                               <div class="cta-button-group in">
+                                       <div ng-show="(schedulerForm.checkboxSelection=='true')? false:true">
+                                               <button class="btn btn-alt btn-small" id="div-confirm-ok-button"
+                                                       type="button" ng-click="reject()" ng-disabled="schedulerID=='' || showSpinner || showTimeslotSpinner">Reject</button>
+                                               <button class="btn btn-alt btn-small" id="div-confirm-ok-button"
+                                               type="button" name="submit" ng-click="submit()" ng-disabled="schedulerID=='' || showSpinner || showTimeslotSpinner">Schedule</button>
+                                               
+                                       </div>
+                                       <div ng-show="(schedulerForm.checkboxSelection=='true')? true:false">
+                                               <button class="btn btn-alt btn-small" id="div-confirm-ok-button"
+                                               type="button" name="submit" ng-click="schedule()" ng-disabled="showSpinner || showTimeslotSpinner">Schedule</button>
+                                       </div>
+                                       <div>
+                                               <button class="btn btn-alt btn-small" 
+                                               type="button" ng-click="closeModal()">Cancel</button>           
+                                       </div>
+                               </div>
+                       </div>
+               </div>
+       </div> 
+       
+       
+</div>
diff --git a/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css b/ecomp-portal-widget-ms/common-widgets/portal-common-scheduler-widget/styles/styles.css
new file mode 100644 (file)
index 0000000..67c8ab4
--- /dev/null
@@ -0,0 +1,47 @@
+
+.portal-widget-panel-container {
+       margin-left:150px;
+       width:1500px;
+}
+
+
+.portal-widget-panel-fixed-panel {
+  min-height: 300px;
+  max-height: 1300px;
+  overflow: auto;
+}
+
+.portal-widget-panel-double-middle {
+  min-height: 660px;
+  max-height: 660px;
+  overflow: auto;
+}
+
+.portal-widget-panel-row {
+    margin-right: 0px;
+    margin-left:  0px;
+    width: 2800px;
+}
+
+/*Increases the width of the card/panel */
+.portal-widget-panel-panel-default {
+       width:450px
+}
+
+/*Controls the spacing between the cards */
+.portal-widget-panel-col-sm-3 {
+       width:20.5%
+}
+
+.portal-widget-panel-top {
+    top: 15px;
+       left: 15px;
+}
+
+#-css-ready {
+color: #bada55 !important;
+}
+
+.scheduler-radio{
+       margin:5px;
+}
\ No newline at end of file
index a16fc64..0fa5de7 100644 (file)
@@ -6,30 +6,32 @@
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
        <parent>
                <groupId>org.onap.portal</groupId>
                <artifactId>onap-portal-parent</artifactId>
-               <version>1.3.0</version>
+               <version>2.2</version>
        </parent>
 
        <artifactId>widget-ms-parent</artifactId>
        <packaging>pom</packaging>
 
        </parent>
 
        <artifactId>widget-ms-parent</artifactId>
        <packaging>pom</packaging>
 
-       <modules>
-               <module>common-widgets</module>
-               <!-- The widget-ms module uses Spring; it cannot name this parent. -->
-               <module>widget-ms</module>
-       </modules>
+        <modules>
+                <!-- Child modules do NOT name this parent. -->
+                <!-- Defined for build convenience only! -->
+                <!-- This POM names only ONAP projects -->      
+                <module>common-widgets</module>
+                <module>widget-ms</module>     
+        </modules>
 
 
-       <build>
-               <plugins>
-                       <!-- No deployment step for this project -->
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-deploy-plugin</artifactId>
-                               <version>2.8</version>
-                               <configuration>
-                                       <skip>true</skip>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
+     <build>
+        <plugins>
+               <!-- No deployment step for this project -->
+               <plugin>
+                       <groupId>org.apache.maven.plugins</groupId>
+                       <artifactId>maven-deploy-plugin</artifactId>
+                       <version>2.8</version>
+                       <configuration>
+                               <skip>true</skip>
+                       </configuration>
+               </plugin>
+        </plugins>
+     </build>
 
 </project>
 
 </project>
index 67350d2..3e80679 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-       <modelVersion>4.0.0</modelVersion>
+               <modelVersion>4.0.0</modelVersion>
 
        <!-- This project must name Spring as parent; cannot name Portal -->
        <parent>
 
        <!-- This project must name Spring as parent; cannot name Portal -->
        <parent>
@@ -13,7 +13,7 @@
 
        <groupId>org.onap.portal</groupId>
        <artifactId>widget-ms</artifactId>
 
        <groupId>org.onap.portal</groupId>
        <artifactId>widget-ms</artifactId>
-       <version>1.3.0</version>
+       <version>2.2</version>
        <packaging>jar</packaging>
        <name>widget-microservice</name>
 
        <packaging>jar</packaging>
        <name>widget-microservice</name>
 
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/MicroserviceApplication.java
new file mode 100644 (file)
index 0000000..fbaf2ea
--- /dev/null
@@ -0,0 +1,19 @@
+       package org.onap.portalapp.widget;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.web.client.RestTemplate;
+
+@SpringBootApplication
+@ComponentScan(basePackages = "org.onap.portalapp.widget")
+public class MicroserviceApplication {
+       @Bean
+       public RestTemplate getRestTemplate(){
+               return new RestTemplate();
+       }
+       public static void main(String[] args) {
+               SpringApplication.run(MicroserviceApplication.class, args);
+       }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/constant/WidgetConstant.java
new file mode 100644 (file)
index 0000000..e4c519f
--- /dev/null
@@ -0,0 +1,11 @@
+package org.onap.portalapp.widget.constant;
+
+public final class WidgetConstant {
+       
+       public static final String WIDGET_MARKUP_LOCATION = "markup/markup.html";
+       public static final String WIDGET_CONTROLLER_LOCATION = "js/controller.js";
+       public static final String WIDGET_STYLE_LOCATION = "styles/styles.css";
+       public static final String VALIDATION_MESSAGE_ZIP = "Please upload a zip file"; 
+       public static final String VALIDATION_MESSAGE_FILES = "Please check your files (should contains js, styles and markup folder)"; 
+}
+
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
new file mode 100644 (file)
index 0000000..acdde23
--- /dev/null
@@ -0,0 +1,79 @@
+package org.onap.portalapp.widget.controller;
+
+import java.io.UnsupportedEncodingException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.widget.service.StorageService;
+import org.slf4j.Logger;
+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.ResponseBody;
+
+@Controller
+public class DatabaseFileUploadController {
+       
+       @Autowired
+       private StorageService storageService;
+       
+       private static final Logger logger = LoggerFactory.getLogger(DatabaseFileUploadController.class); 
+
+       @ResponseBody
+       @RequestMapping(value = "/microservices/markup/{widgetId}", method = RequestMethod.GET)
+       public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){
+               String markup = null;
+               try{
+                       logger.debug("DatabaseFileUploadController.getWidgetMarkup: getting markup.html for widget with widgetId = {}" , widgetId);
+                       markup = storageService.getWidgetMarkup(widgetId);
+               }catch(Exception e){
+                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetMarkup in widget microservices. Details:" + e.getMessage());
+               }
+               return markup;
+       }
+
+       @ResponseBody
+       @RequestMapping(value = "/microservices/{widgetId}/controller.js", method = RequestMethod.GET)
+       public String getWidgetController(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){
+               String controller = null;
+               try{
+                       logger.debug("DatabaseFileUploadController.getWidgetController: getting controller.js for widget with widgetId = {}" , widgetId);
+                       controller = storageService.getWidgetController(widgetId); 
+               }catch(Exception e){
+                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetController in widget microservices. Details:" + e.getMessage());
+               }
+               return controller;
+       }
+
+       @ResponseBody
+       @RequestMapping(value = "/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
+       public String getWidgetFramework(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("widgetId") long widgetId){
+               String framework = null;
+               try{
+                       logger.debug("DatabaseFileUploadController.getWidgetFramework: getting framework.js for widget with widgetId = {}" , widgetId);
+                       framework = storageService.getWidgetFramework(widgetId);
+               }catch(Exception e){
+                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetFramework in widget microservices. Details:" + e.getMessage());
+               }
+               return framework;
+       }
+       
+       @ResponseBody
+       @RequestMapping(value = "/microservices/{widgetId}/styles.css", method = RequestMethod.GET)
+       public String getWidgetCSS(HttpServletRequest request, HttpServletResponse response,
+                       @PathVariable("widgetId") long widgetId){
+               String css = null;
+               try {
+                       logger.debug("DatabaseFileUploadController.getWidgetCSS: getting styles.css for widget with widgetId = {}" , widgetId);
+                       css = storageService.getWidgetCSS(widgetId);
+               } catch (UnsupportedEncodingException e) {
+                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetCSS in widget microservices. Details:" + e.getMessage());
+               } 
+               return css;     
+       }
+}
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
new file mode 100644 (file)
index 0000000..6814f75
--- /dev/null
@@ -0,0 +1,35 @@
+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.RestController;
+
+@RestController
+public class HealthController {
+
+       @RequestMapping(value = { "/health" }, method = RequestMethod.GET, produces = "application/json")
+       public HealthStatus getWidgetCatalog(HttpServletRequest request, HttpServletResponse response) {
+               return new HealthStatus("ok");
+       }
+       
+       class HealthStatus {
+               private String status;
+               
+               public HealthStatus(String status){
+                       this.status = status;
+               }
+
+               public String getStatus() {
+                       return status;
+               }
+
+               public void setStatus(String status) {
+                       this.status = status;
+               }
+               
+               
+       }
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..31f9b95
--- /dev/null
@@ -0,0 +1,261 @@
+package org.onap.portalapp.widget.controller;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.utils.AuthorizationUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+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.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.client.RestTemplate;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@Controller
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class WidgetsCatalogController {
+
+       @Value("${server.port}")
+       String port;
+       @Value("${server.contextPath}")
+       String context;
+       
+       @Value("${security.user.name}")
+       String security_user;
+       @Value("${security.user.password}")
+       String security_pass;
+       
+       @Autowired
+       WidgetCatalogService widgetCatalogService;
+
+       @Autowired
+       StorageService storageService;
+       
+       @Autowired
+       RestTemplate restTemplate;
+
+       AuthorizationUtil util = new AuthorizationUtil();
+       
+       private static final Logger logger = LoggerFactory.getLogger(WidgetsCatalogController.class);
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog" }, method = RequestMethod.GET, produces = "application/json")
+       public List<WidgetCatalog> getWidgetCatalog(HttpServletRequest request, HttpServletResponse response
+                       ,@RequestHeader(value="Authorization") String auth) throws IOException{
+               
+               List<WidgetCatalog> widgetCatalog = null;
+               if(!util.authorization(auth, security_user, security_pass)){ 
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetCatalog in widget microserivce. Please check your username and password.");
+                       return widgetCatalog;
+               }
+               try {
+                       widgetCatalog = widgetCatalogService.getWidgetCatalog();
+                       logger.debug("WidgetsCatalogController.getWidgetCatalog: getting widget list {}", widgetCatalog);
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetCatalog in widget microservices. Details:" + e.getMessage());
+               }
+               return widgetCatalog;
+       }
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET, 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;
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getUserWidgetCatalog in widget microserivce. Please check your username and password.");
+                       return widgetCatalog;
+               }
+               try {
+                       widgetCatalog = widgetCatalogService.getUserWidgetCatalog(loginName);
+                       logger.debug("WidgetsCatalogController.getUserWidgetCatalog: getting widget list {}", widgetCatalog);
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.getUserWidgetCatalog in widget microservices. Details:" + e.getMessage());
+               }
+               return widgetCatalog;
+       }
+
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
+       public void updateWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
+                       @RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId,
+                       @RequestHeader(value="Authorization") String auth) throws IOException {
+
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.updateWidgetCatalog in widget microserivce. Please check your username and password.");
+                       return;
+               }
+               try {
+                       widgetCatalogService.updateWidgetCatalog(widgetId, newWidgetCatalog);
+                       logger.debug("WidgetsCatalogController.updateWidgetCatalog: updating widget {}", newWidgetCatalog);
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.updateWidgetCatalog in widget microservices. Details:" + e.getMessage());
+                       e.printStackTrace();
+               }
+       }
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog" }, method = RequestMethod.POST, 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 {   
+       
+               ValidationRespond respond = null;
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.saveWidgetCatalog in widget microserivce. Please check your username and password.");
+                       return new ValidationRespond(false, "Basic Authentication Error, please check your username and password.");
+               }       
+               try {
+                       //check the zip file structure first
+                       respond = storageService.checkZipFile(file);
+                       
+                       if(respond.isValid()){ 
+                               //save the widget catalog
+                               WidgetCatalog newWidget = new ObjectMapper().readValue(widget, WidgetCatalog.class);
+                               
+                               long widgetId = widgetCatalogService.saveWidgetCatalog(newWidget);
+                               logger.debug("WidgetsCatalogController.saveWidgetCatalog: saving widget={}", newWidget);
+                               //save the widget zip file ;
+                               storageService.save(file, newWidget, widgetId);
+                       }
+                       
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:", e);
+               }
+               return respond;
+       }
+
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST, 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 {  
+               System.out.println("microserivces updating with files" + widgetId);
+               ValidationRespond respond = null;
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.saveWidgetCatalog in widget microserivce. Please check your username and password.");
+                       return new ValidationRespond(false, "Basic Authentication Error, please check your username and password.");
+               }       
+               try {
+                       //check the zip file structure first
+                       respond = storageService.checkZipFile(file);
+                       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);
+                       }
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:" + e.getMessage());
+                       e.printStackTrace();
+               }
+               return respond;
+       }
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = {
+                       RequestMethod.DELETE }, 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)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.deleteOnboardingWidget in widget microserivce. Please check your username and password.");
+                       return;
+               }
+               try {
+                       logger.debug("WidgetsCatalogController.deleteOnboardingWidget: deleting widget {}", widgetId);
+                       //WidgetCatalog widget = widgetCatalogService.getWidgetCatalog(widgetId);
+                       widgetCatalogService.deleteWidgetCatalog(widgetId);
+                       storageService.deleteWidgetFile(widgetId);
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.deleteOnboardingWidget in widget microservices. Details:" + e.getMessage());
+               }
+       }
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog/parameters/{widgetId}" }, method = RequestMethod.GET, produces = "application/json")
+       public Long getServiceIdByWidget(HttpServletRequest request, HttpServletResponse response, 
+                       @PathVariable("widgetId") Long widgetId, @RequestHeader(value="Authorization") String auth) throws IOException {
+               
+               Long serviceId = null;
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getServiceIdByWidget in widget microserivce. Please check your username and password.");
+                       return serviceId;
+               }
+               try{
+                       logger.debug("WidgetsCatalogController.getServiceIdByWidget: getting service Id for widget {}", widgetId);
+                       serviceId = widgetCatalogService.getServiceIdByWidget(widgetId);
+               }catch(Exception e){
+                       logger.error("Exception occurred while performing WidgetsCatalogController.getServiceIdByWidget in widget microservices. Details:" + e.getMessage());
+               }
+               return serviceId;
+       }
+
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/widgetCatalog/service/{serviceId}" }, method = RequestMethod.GET, 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<WidgetCatalog>();
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetByServiceId in widget microserivce. Please check your username and password.");
+                       return null;
+               }       
+               try{
+                       logger.debug("WidgetsCatalogController.getWidgetByServiceId: getting service Id for widget {}", serviceId);
+                       list = widgetCatalogService.getWidgetsByServiceId(serviceId);
+               }catch(Exception e){
+                       logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetByServiceId in widget microservices. Details:" + e.getMessage());
+               }
+               return list;
+       }
+       
+       
+       @ResponseBody
+       @RequestMapping(value = { "/microservices/download/{widgetId}" }, method = RequestMethod.GET, produces = "application/json")
+       public byte[] getWidgetZipFile(HttpServletRequest request, HttpServletResponse response, 
+                       @PathVariable("widgetId") long widgetId, @RequestHeader(value="Authorization") String auth) throws Exception {
+               byte[] byteFile = null;
+               if(!util.authorization(auth, security_user, security_pass)){
+                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetZipFile in widget microserivce. Please check your username and password.");
+                       return byteFile;
+               }
+               try {
+                       byteFile = storageService.getWidgetCatalogContent(widgetId);
+                       logger.debug("WidgetsCatalogController.getWidgetZipFile: getting widget zip file for widget with id {}", widgetId);
+               } catch (Exception e) {
+                       logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetZipFile in widget microservices. Details:" + e.getMessage());
+               }
+               return byteFile;
+       }
+
+       
+}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/dao/WidgetDataSource.java
new file mode 100644 (file)
index 0000000..a60b898
--- /dev/null
@@ -0,0 +1,34 @@
+package org.onap.portalapp.widget.dao;
+
+import javax.sql.DataSource;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.jdbc.datasource.DriverManagerDataSource;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WidgetDataSource{
+
+       @Value("${spring.database.driver.classname}")
+       private String dbDriverClassName;
+
+       @Value("${spring.datasource.url}")
+       private String dbUrl;
+
+       @Value("${spring.datasource.username}")
+       private String dbUsername;
+
+       @Value("${spring.datasource.password}")
+       private String dbPassword;
+
+       @Bean
+       public DataSource dataSource() {
+               DriverManagerDataSource dataSource = new DriverManagerDataSource();
+               dataSource.setDriverClassName(dbDriverClassName);
+               dataSource.setUrl(dbUrl);
+               dataSource.setUsername(dbUsername);
+               dataSource.setPassword(dbPassword);
+               return dataSource;
+       }
+}
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..d950d03
--- /dev/null
@@ -0,0 +1,47 @@
+package org.onap.portalapp.widget.domain;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "FN_APP")
+public class App implements Serializable{
+       
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name = "APP_ID")
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       private Long appId;
+       
+       @Column(name = "APP_Name")
+       private String appName;
+
+       public Long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(Long appId) {
+               this.appId = appId;
+       }
+
+       public String getAppName() {
+               return appName;
+       }
+
+       public void setAppName(String appName) {
+               this.appName = appName;
+       }
+
+       @Override
+       public String toString() {
+               return "App [appId=" + appId + ", appName=" + appName + "]";
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..e0b0f72
--- /dev/null
@@ -0,0 +1,126 @@
+package org.onap.portalapp.widget.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * TODO: moved all microservice-related code (domain, controller, service)
+ * from ecomp portal Backend to widget microservice
+ */
+@Entity
+@Table(name="EP_MICROSERVICE")
+public class MicroserviceData {
+       
+       @Id
+       @Column(name = "id")
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       private Long id;
+
+       @Column(name = "name")
+       private String name;
+
+       @Column(name = "description")
+       private String desc;
+       
+       @Column(name = "appId")
+       private long appId;
+
+       @Column(name = "endpoint_url")
+       private String url;
+
+       @Column(name = "security_type")
+       private String securityType;
+
+       @Column(name = "username")
+       private String username;
+
+       @Column(name = "password")
+       private String password;
+       
+       @Column(name = "active")
+       private String active;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public String getDesc() {
+               return desc;
+       }
+
+       public void setDesc(String desc) {
+               this.desc = desc;
+       }
+
+       public long getAppId() {
+               return appId;
+       }
+
+       public void setAppId(long appId) {
+               this.appId = appId;
+       }
+
+       public String getUrl() {
+               return url;
+       }
+
+       public void setUrl(String url) {
+               this.url = url;
+       }
+
+       public String getSecurityType() {
+               return securityType;
+       }
+
+       public void setSecurityType(String securityType) {
+               this.securityType = securityType;
+       }
+
+       public String getUsername() {
+               return username;
+       }
+
+       public void setUsername(String username) {
+               this.username = username;
+       }
+
+       public String getPassword() {
+               return password;
+       }
+
+       public void setPassword(String password) {
+               this.password = password;
+       }
+
+       public String getActive() {
+               return active;
+       }
+
+       public void setActive(String active) {
+               this.active = active;
+       }
+
+       @Override
+       public String toString() {
+               return "MicroserviceData [name=" + name + ", desc=" + desc + ", appId=" + appId + ", url=" + url
+                               + ", securityType=" + securityType + ", username=" + username + ", password=" + password + ", active="
+                               + active + "]";
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..64e2296
--- /dev/null
@@ -0,0 +1,70 @@
+package org.onap.portalapp.widget.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * TODO: moved all microservice-related code (domain, controller, service)
+ * from ecomp portal Backend to widget microservice
+ */
+@Entity
+@Table(name="EP_MICROSERVICE_PARAMETER")
+public class MicroserviceParameter {
+       
+       @Id
+       @Column(name = "id")
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       private Long id;
+
+       @Column(name = "service_id")
+       private long serviceId;
+
+       @Column(name = "para_key")
+       private String para_key;
+
+       @Column(name = "para_value")
+       private String para_value;
+
+       public Long getId() {
+               return id;
+       }
+
+       public void setId(Long id) {
+               this.id = id;
+       }
+
+       public long getServiceId() {
+               return serviceId;
+       }
+
+       public void setServiceId(long serviceId) {
+               this.serviceId = serviceId;
+       }
+
+       public String getPara_key() {
+               return para_key;
+       }
+
+       public void setPara_key(String para_key) {
+               this.para_key = para_key;
+       }
+
+       public String getPara_value() {
+               return para_value;
+       }
+
+       public void setPara_value(String para_value) {
+               this.para_value = para_value;
+       }
+
+       @Override
+       public String toString() {
+               return "MicroserviceParameter [serviceId=" + serviceId + ", para_key=" + para_key + ", para_value=" + para_value
+                               + "]";
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..807067b
--- /dev/null
@@ -0,0 +1,95 @@
+package org.onap.portalapp.widget.domain;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+@Entity
+@Table(name = "FN_ROLE")
+public class RoleApp implements Serializable{
+       private static final long serialVersionUID = 1L;
+
+       @Id
+       @Column(name = "ROLE_ID")
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       private Long roleId;
+       
+       
+       @Column(name = "ROLE_Name")
+       private String roleName;
+       
+       @ManyToOne(fetch = FetchType.EAGER)
+       @JoinColumn(name="APP_ID")
+       private App app;
+       
+       @JsonIgnore
+       @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
+       private Set<WidgetCatalog> widgets;
+
+       /*@PreRemove
+       private void removeGroupsFromUsers() {
+           for (WidgetCatalog w : widgets) {
+               w.getWidgetRoles().remove(this);
+           }
+       }*/
+       
+       /*@ManyToOne
+       @JoinColumn(name = "WIDGET_ID", nullable = false)
+       WidgetCatalog widgetCatalog;*/
+
+       //@JsonIgnore
+       //@ManyToMany(mappedBy = "widgetRoles")
+       //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
+       //private Set<WidgetCatalog> widgets  = new HashSet<WidgetCatalog>();
+       
+       public Long getRoleId() {
+               return roleId;
+       }
+
+       public void setRoleId(Long roleId) {
+               this.roleId = roleId;
+       }
+
+       public String getRoleName() {
+               return roleName;
+       }
+
+       public void setRoleName(String roleName) {
+               this.roleName = roleName;
+       }
+
+       public App getApp() {
+               return app;
+       }
+
+       public void setApp(App app) {
+               this.app = app;
+       }
+       
+       public Set<WidgetCatalog> getWidgets() {
+               return widgets;
+       }
+
+       public void setWidgets(Set<WidgetCatalog> widgets) {
+               this.widgets = widgets;
+       }
+
+       @Override
+       public String toString() {
+               return "RoleApp [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
+       }
+       
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/ValidationRespond.java
new file mode 100644 (file)
index 0000000..287e8c6
--- /dev/null
@@ -0,0 +1,34 @@
+package org.onap.portalapp.widget.domain;
+
+public class ValidationRespond {
+       private boolean valid;
+       private String error;
+       
+       public ValidationRespond(boolean valid, String error){
+               this.valid = valid;
+               this.error = error;
+       }
+
+       public boolean isValid() {
+               return valid;
+       }
+
+       public void setValid(boolean valid) {
+               this.valid = valid;
+       }
+
+       public String getError() {
+               return error;
+       }
+
+       public void setError(String error) {
+               this.error = error;
+       }
+
+       @Override
+       public String toString() {
+               return "ValidationRespond [valid=" + valid + ", error=" + error + "]";
+       }
+       
+       
+}
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
new file mode 100644 (file)
index 0000000..9d153e2
--- /dev/null
@@ -0,0 +1,134 @@
+package org.onap.portalapp.widget.domain;
+
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+
+
+@Entity
+@Table(name="EP_WIDGET_CATALOG")
+public class WidgetCatalog{
+       
+       @Id
+       @Column(name = "widget_id")
+       @GeneratedValue(strategy=GenerationType.AUTO)
+       private long id;
+       
+       @Column(name = "wdg_name")
+       private String name;
+       
+       @Column(name = "wdg_desc")
+       private String desc;    
+       
+       @Column(name = "wdg_file_loc")
+       private String fileLocation;
+       
+       @Column(name = "all_user_flag")
+       private String allowAllUser;
+       
+       @Column(name = "service_id")
+       private Long serviceId;
+       
+       @Transient
+       private String sortOrder;
+
+       @Transient
+       private String statusCode;
+
+       @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
+       @JoinTable(name = "ep_widget_catalog_role", 
+                       joinColumns = {@JoinColumn(name = "WIDGET_ID")},
+                       inverseJoinColumns = {@JoinColumn(name = "ROLE_ID")}
+       )
+       private Set<RoleApp> widgetRoles;
+
+       public long getId() {
+               return id;
+       }
+
+       public void setId(long id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public String getDesc() {
+               return desc;
+       }
+
+       public void setDesc(String desc) {
+               this.desc = desc;
+       }
+
+       public String getFileLocation() {
+               return fileLocation;
+       }
+
+       public void setFileLocation(String fileLocation) {
+               this.fileLocation = fileLocation;
+       }
+
+       public Set<RoleApp> getWidgetRoles() {
+               return widgetRoles;
+       }
+
+       public void setWidgetRoles(Set<RoleApp> widgetRoles) {
+               this.widgetRoles = widgetRoles;
+       }
+       
+       public String getAllowAllUser() {
+               return allowAllUser;
+       }
+
+       public void setAllowAllUser(String allowAllUser) {
+               this.allowAllUser = allowAllUser;
+       }
+
+       public String getSortOrder() {
+               return sortOrder;
+       }
+
+       public void setSortOrder(String sortOrder) {
+               this.sortOrder = sortOrder;
+       }
+
+       public String getStatusCode() {
+               return statusCode;
+       }
+
+       public void setStatusCode(String statusCode) {
+               this.statusCode = statusCode;
+       }
+
+       public Long getServiceId() {
+               return serviceId;
+       }
+
+       public void setServiceId(Long serviceId) {
+               this.serviceId = serviceId;
+       }
+
+       @Override
+       public String toString() {
+               return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation
+                               + ", allowAllUser=" + allowAllUser + ", serviceId=" + serviceId + ", sortOrder=" + sortOrder
+                               + ", statusCode=" + statusCode + ", widgetRoles=" + widgetRoles + "]";
+       }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/WidgetFile.java
new file mode 100644 (file)
index 0000000..e9c6ffc
--- /dev/null
@@ -0,0 +1,96 @@
+package org.onap.portalapp.widget.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "ep_widget_catalog_files")
+public class WidgetFile {
+       @Id
+       @Column (name = "file_id")
+       private int id;
+       
+       @Column(name = "widget_name")
+       private String name;
+       
+       @Column(name = "widget_id")
+       private long widgetId;
+       
+       @Column(name = "markup_html")
+       private byte[] markup;
+       
+       @Column(name = "controller_js")
+       private  byte[] controller;
+       
+       @Column(name = "framework_js")
+       private  byte[] framework;
+
+       @Column(name = "widget_css")
+       private  byte[] css;
+
+       public int getId() {
+               return id;
+       }
+
+       public void setId(int id) {
+               this.id = id;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+
+       public byte[] getMarkup() {
+               return markup;
+       }
+
+       public void setMarkup(byte[] markup) {
+               this.markup = markup;
+       }
+
+       public byte[] getController() {
+               return controller;
+       }
+
+       public void setController(byte[] controller) {
+               this.controller = controller;
+       }
+
+       public byte[] getFramework() {
+               return framework;
+       }
+
+       public void setFramework(byte[] framework) {
+               this.framework = framework;
+       }
+
+       public byte[] getCss() {
+               return css;
+       }
+
+       public void setCss(byte[] css) {
+               this.css = css;
+       }
+
+       public long getWidgetId() {
+               return widgetId;
+       }
+
+       public void setWidgetId(long widgetId) {
+               this.widgetId = widgetId;
+       }
+
+       @Override
+       public String toString() {
+               return "WidgetFile [name=" + name + ", widgetId=" + widgetId + "]";
+       }
+       
+       
+    
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageException.java
new file mode 100644 (file)
index 0000000..41dd6b4
--- /dev/null
@@ -0,0 +1,15 @@
+package org.onap.portalapp.widget.excetpion;
+
+public class StorageException extends RuntimeException {
+
+       
+       private static final long serialVersionUID = 4142203582273176386L;
+
+       public StorageException(String message) {
+        super(message);
+    }
+
+    public StorageException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/excetpion/StorageFileNotFoundException.java
new file mode 100644 (file)
index 0000000..6ca46fa
--- /dev/null
@@ -0,0 +1,14 @@
+package org.onap.portalapp.widget.excetpion;
+
+public class StorageFileNotFoundException extends StorageException {
+
+       private static final long serialVersionUID = -930114778119283188L;
+
+       public StorageFileNotFoundException(String message) {
+        super(message);
+    }
+
+    public StorageFileNotFoundException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/filters/CorsConfiguration.java
new file mode 100644 (file)
index 0000000..5338359
--- /dev/null
@@ -0,0 +1,15 @@
+package org.onap.portalapp.widget.filters;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.http.HttpMethod;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+
+@Configuration
+public class CorsConfiguration extends WebSecurityConfigurerAdapter {
+       @Override
+       protected void configure(HttpSecurity http) throws Exception {
+               http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/microservices/widgetCatalog/").permitAll();
+               http.csrf().disable();
+       }       
+}
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
new file mode 100644 (file)
index 0000000..b52631f
--- /dev/null
@@ -0,0 +1,44 @@
+package org.onap.portalapp.widget.hibernate;
+
+import java.util.Properties;
+
+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.jpa.JpaTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
+
+/**
+ * Provides a Hibernate session factory.
+ */
+@org.springframework.context.annotation.Configuration
+public class HibernateConfiguration {
+
+       @Autowired
+       private DataSource dataSource;
+
+       @Bean
+       public LocalSessionFactoryBean sessionFactory() {
+
+               LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
+               sessionFactory.setDataSource(dataSource);
+               sessionFactory.setHibernateProperties(hibernateProperties());
+               sessionFactory.setPackagesToScan(new String[] { "org.onap.portalapp.widget.domain" });
+               return sessionFactory;
+       }
+
+       private Properties hibernateProperties() {
+        Properties properties = new Properties();
+        properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
+        properties.put("hibernate.show_sql", "false");
+        return properties;        
+    }
+
+       @Bean
+    public PlatformTransactionManager transactionManager() {
+        return new JpaTransactionManager();
+    }
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/listener/WidgetEventListener.java
new file mode 100644 (file)
index 0000000..de29875
--- /dev/null
@@ -0,0 +1,36 @@
+package org.onap.portalapp.widget.listener;
+
+import org.onap.portalapp.widget.service.InitializationService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.context.event.ApplicationReadyEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.stereotype.Component;
+
+@Component
+public class WidgetEventListener implements ApplicationListener<ApplicationReadyEvent>{
+
+       private static final Logger logger = LoggerFactory.getLogger(WidgetEventListener.class);
+       
+       @Autowired
+       InitializationService initializationService;
+       
+       @Value("${initialization.default.widgets}")
+       String init_default_widget;
+       
+       @Override
+       public void onApplicationEvent(ApplicationReadyEvent event) {
+               
+               logger.debug("Listening event " + event.toString());
+               try {
+                       if(Boolean.parseBoolean(init_default_widget))
+                               initializationService.initialize();
+               } catch (Exception e) {
+                       logger.error("onApplicationEvent: InitializationService#initialize failed", e);
+               }
+               
+       }
+       
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/InitializationService.java
new file mode 100644 (file)
index 0000000..54b6d4f
--- /dev/null
@@ -0,0 +1,7 @@
+package org.onap.portalapp.widget.service;
+
+public interface InitializationService {
+       
+       void initialize();
+       
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/MicroserviceService.java
new file mode 100644 (file)
index 0000000..5cd342f
--- /dev/null
@@ -0,0 +1,17 @@
+package org.onap.portalapp.widget.service;
+
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.MicroserviceParameter;
+
+/**
+ * TODO: moved all microservice-related code (domain, controller, service)
+ * from ecomp portal Backend to widget microservice
+ */
+public interface MicroserviceService {
+       
+       Long saveMicroserivce(MicroserviceData newService);
+       
+       void saveMicroserviceParameter(MicroserviceParameter newParameter);
+       
+       Long getMicroserviceIdByName(String newServiceName);
+}
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
new file mode 100644 (file)
index 0000000..fbd0f96
--- /dev/null
@@ -0,0 +1,34 @@
+package org.onap.portalapp.widget.service;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.domain.WidgetFile;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface StorageService {
+
+    void deleteWidgetFile(long widgetId);
+    
+    WidgetFile getWidgetFile(long widgetId);
+     
+    String getWidgetMarkup(long widgetId) throws UnsupportedEncodingException;
+    
+    String getWidgetController(long widgetId) throws UnsupportedEncodingException;
+    
+    String getWidgetFramework(long widgetId) throws UnsupportedEncodingException;
+    
+    String getWidgetCSS(long widgetId) throws UnsupportedEncodingException;
+    
+    ValidationRespond checkZipFile(MultipartFile file);
+    
+    void save(MultipartFile file, WidgetCatalog newWidget, long widgetId);
+    
+    void initSave(File file, WidgetCatalog newWidget, long widgetId);
+    
+    void update(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/WidgetCatalogService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/WidgetCatalogService.java
new file mode 100644 (file)
index 0000000..8885764
--- /dev/null
@@ -0,0 +1,28 @@
+package org.onap.portalapp.widget.service;
+
+import java.util.List;
+
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+
+public interface WidgetCatalogService {
+       
+       List<WidgetCatalog> getWidgetCatalog();
+       
+       List<WidgetCatalog> getUserWidgetCatalog(String loginName);
+
+       WidgetCatalog getWidgetCatalog(Long widgetCatalogId);
+       
+       void deleteWidgetCatalog(long WidgetCatalogId);
+       
+       long saveWidgetCatalog(WidgetCatalog newWidgetCatalog);
+
+       void updateWidgetCatalog(Long widgetCatalogId, WidgetCatalog newWidgetCatalog); 
+       
+       Long getServiceIdByWidget(Long widgetCatalogId);
+       
+       boolean getWidgetIdByName(String newWidgetName);
+       
+       List<WidgetCatalog> getWidgetsByServiceId(Long serviceId);
+       
+
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/InitializationServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/service/impl/InitializationServiceImpl.java
new file mode 100644 (file)
index 0000000..cbc0c9d
--- /dev/null
@@ -0,0 +1,137 @@
+package org.onap.portalapp.widget.service.impl;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashSet;
+
+import javax.transaction.Transactional;
+
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.MicroserviceParameter;
+import org.onap.portalapp.widget.domain.RoleApp;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.InitializationService;
+import org.onap.portalapp.widget.service.MicroserviceService;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+/**
+ * Uploads widget zip archives to Portal.
+ */
+@Service("initService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class InitializationServiceImpl implements InitializationService {
+
+       private static final String BASIC_AUTH = "Basic Authentication";
+       private static final String PARAMETER_KEY = "resourceType";
+       private static final Logger logger = LoggerFactory.getLogger(InitializationServiceImpl.class);
+
+       @Autowired
+       WidgetCatalogService widgetCatalogService;
+
+       @Autowired
+       StorageService storageService;
+
+       @Autowired
+       MicroserviceService microserviceService;
+
+       @Value("${account.user.name}")
+       String account_user;
+
+       @Value("${account.user.password}")
+       String account_password;
+
+       @Value("${initialization.widgetData.url}")
+       String widgetData_url;
+
+       @Override
+       public void initialize() {
+               initCommonWidget("News");
+               initCommonWidget("Events");
+               initCommonWidget("Resources");
+               initCommonWidget("Portal-Common-Scheduler");
+       }
+
+       private void initCommonWidget(String name) {
+
+               final String newServiceName = name + " Microservice";
+
+               Long serviceId = microserviceService.getMicroserviceIdByName(newServiceName);
+
+               if (serviceId == null) {
+                       MicroserviceData newService = new MicroserviceData();
+                       newService.setName(newServiceName);
+                       newService.setDesc(name);
+                       newService.setAppId(1);
+                       newService.setUrl(widgetData_url);
+                       newService.setSecurityType(BASIC_AUTH);
+                       newService.setUsername(account_user);
+                       newService.setPassword(account_password);
+                       newService.setActive("Y");
+                       serviceId = microserviceService.saveMicroserivce(newService);
+
+                       MicroserviceParameter parameter = new MicroserviceParameter();
+                       parameter.setServiceId(serviceId);
+                       parameter.setPara_key(PARAMETER_KEY);
+                       String parameter_value = null;
+                       switch (name.toLowerCase()) {
+                       case "Portal-Common-Scheduler":
+                               parameter_value = "NEWS";
+                               break;
+                       case "news":
+                               parameter_value = "NEWS";
+                               break;
+                       case "events":
+                               parameter_value = "EVENTS";
+                               break;
+                       case "resources":
+                               parameter_value = "IMPORTANTRESOURCES";
+                               break;
+                       }
+                       parameter.setPara_value(parameter_value);
+                       microserviceService.saveMicroserviceParameter(parameter);
+               }
+
+               if (!widgetCatalogService.getWidgetIdByName(name)) {
+                       WidgetCatalog newWidget = new WidgetCatalog();
+                       newWidget.setName(name);
+                       newWidget.setDesc(name);
+                       newWidget.setAllowAllUser("1");
+                       String fileLocation = name.toLowerCase() + "-widget.zip";
+                       newWidget.setFileLocation(fileLocation);
+                       newWidget.setServiceId(serviceId);
+                       newWidget.setWidgetRoles(new HashSet<RoleApp>());
+                       long widgetId = widgetCatalogService.saveWidgetCatalog(newWidget);
+
+                       File tmpZipFile = new File("/tmp/" + fileLocation);
+                       InputStream fileInputStream = null;
+                       OutputStream outputStream = null;
+                       try {
+                               fileInputStream = this.getClass().getClassLoader().getResourceAsStream(fileLocation);
+                               outputStream = new FileOutputStream(tmpZipFile);
+                               int read = 0;
+                               byte[] bytes = new byte[4096];
+                               while ((read = fileInputStream.read(bytes)) != -1) {
+                                       outputStream.write(bytes, 0, read);
+                               }
+                               outputStream.close();
+                               fileInputStream.close();
+                       } catch (Exception e) {
+                               logger.error(
+                                               "Exception occurred while performing InitializationServiceImpl.initCommonWidget in widget microservices. Details:", e);
+                       }
+                       storageService.initSave(tmpZipFile, newWidget, widgetId);
+                       tmpZipFile.delete();
+               }
+       }
+}
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
new file mode 100644 (file)
index 0000000..da680b4
--- /dev/null
@@ -0,0 +1,86 @@
+package org.onap.portalapp.widget.service.impl;
+
+import java.util.List;
+
+import javax.transaction.Transactional;
+
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.MicroserviceParameter;
+import org.onap.portalapp.widget.service.MicroserviceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+/**
+ * TODO: moved all microservice-related code (domain, controller, service)
+ * from ecomp portal Backend to widget microservice
+ */
+@Service("microserviceService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class MicroserviceServiceImpl implements MicroserviceService{
+
+       private static final Logger logger = LoggerFactory.getLogger(MicroserviceServiceImpl.class);
+       
+       @Autowired
+       private SessionFactory sessionFactory;
+       
+       @Override
+       public Long saveMicroserivce(MicroserviceData newService) {
+               try{
+                       logger.debug("MicroserviceServiceImpl.saveMicroserivce: microservice={}", newService);
+                       Session session = sessionFactory.openSession();
+                       Transaction tx = session.beginTransaction();            
+                       session.save(newService);
+                       tx.commit();
+                       session.flush();
+                       session.close();
+               }
+               catch(Exception e){
+                       logger.error("Exception occurred while performing MicroserviceServiceImpl.saveMicroserivce in widget microservices. Details:" + e.getMessage());
+               }
+               return newService.getId();
+       }
+
+       @Override
+       public void saveMicroserviceParameter(MicroserviceParameter newParameter) {
+               try{
+                       logger.debug("MicroserviceServiceImpl.saveMicroserviceData: microservice={}", newParameter);
+                       Session session = sessionFactory.openSession();
+                       Transaction tx = session.beginTransaction();            
+                       session.save(newParameter);
+                       tx.commit();
+                       session.flush();
+                       session.close();
+               }
+               catch(Exception e){
+                       logger.error("Exception occurred while performing MicroserviceServiceImpl.saveMicroserviceData in widget microservices. Details:" + e.getMessage());
+               }
+       }
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       public Long getMicroserviceIdByName(String newServiceName) {
+               
+               Session session = sessionFactory.openSession();
+               Criteria criteria = session.createCriteria(MicroserviceData.class)
+                               .add(Restrictions.eq("name", newServiceName))
+                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
+               
+               List<MicroserviceData> services = criteria.list();
+               logger.debug("MicroserviceServiceImpl.getMicroserviceByName: result={}", services);
+               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
new file mode 100644 (file)
index 0000000..c263394
--- /dev/null
@@ -0,0 +1,493 @@
+package org.onap.portalapp.widget.service.impl;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.widget.constant.WidgetConstant;
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.domain.WidgetFile;
+import org.onap.portalapp.widget.excetpion.StorageException;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.onap.portalapp.widget.utils.UnzipUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+@Service
+public class StorageServiceImpl implements StorageService {
+
+       private static final Logger logger = LoggerFactory.getLogger(StorageServiceImpl.class);
+
+       @Autowired
+       private SessionFactory sessionFactory;
+
+       @Autowired
+       WidgetCatalogService widgetCatalogService;
+
+       @Override
+       @Transactional
+       public void deleteWidgetFile(long widgetId) {
+               WidgetFile widgetFile = getWidgetFile(widgetId);
+               logger.debug("StorageServiceImpl.deleteWidgetFile: deleting widget file {}", widgetId);
+               if (widgetFile == null) {
+                       logger.debug(
+                                       "StorageServiceImpl.deleteWidgetFile: No widget file found in database while performing StorageServiceImpl.deleteWidgetFile.");
+                       return;
+               }
+               Session session = sessionFactory.getCurrentSession();
+               Transaction tx = session.beginTransaction();
+               session.delete(widgetFile);
+               tx.commit();
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public WidgetFile getWidgetFile(long widgetId) {
+               logger.debug("StorageServiceImpl.getWidgetFile: getting widget file {}", widgetId);
+               WidgetFile widgetFile = null;
+               Session session = sessionFactory.openSession();
+               Criteria criteria = session.createCriteria(WidgetFile.class);
+               criteria.add(Restrictions.eq("widgetId", widgetId));
+               List<WidgetFile> widgetFiles = criteria.list();
+               session.flush();
+               session.close();
+               if (widgetFiles.size() > 0)
+                       widgetFile = widgetFiles.get(0);
+               return widgetFile;
+       }
+
+       @Override
+       public ValidationRespond checkZipFile(MultipartFile file) {
+               StringBuilder error_msg = new StringBuilder();
+               UnzipUtil unzipper = new UnzipUtil();
+               Map<String, byte[]> map;
+               File convFile;
+               boolean isValid = true;
+               if (!file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.')).equals(".zip")) {
+                       isValid = false;
+                       error_msg.append(WidgetConstant.VALIDATION_MESSAGE_ZIP);
+                       logger.error("StorageServiceImpl.checkZipFile: invalid file format");
+               }
+               try {
+                       if (file.isEmpty()) {
+                               logger.error(
+                                               "StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
+                               throw new StorageException(
+                                               "StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
+                       }
+                       String fileLocation = file.getOriginalFilename();
+                       logger.debug("StorageServiceImpl.checkZipFile: store the widget to:" + fileLocation);
+                       convFile = new File(fileLocation);
+                       FileOutputStream fos = new FileOutputStream(convFile);
+                       fos.write(file.getBytes());
+                       fos.close();
+                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
+                       convFile.delete();
+               } catch (IOException e) {
+                       logger.error("StorageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);
+                       throw new StorageException(
+                                       "torageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);
+               }
+
+               for (byte[] b : map.values()) {
+                       if (isValid && b == null) {
+                               isValid = false;
+                               error_msg.append(WidgetConstant.VALIDATION_MESSAGE_FILES);
+                               break;
+                       }
+               }
+               return new ValidationRespond(isValid, error_msg.toString());
+       }
+
+       @Override
+       @Transactional
+       public void save(MultipartFile file, WidgetCatalog newWidget, long widgetId) {
+
+               UnzipUtil unzipper = new UnzipUtil();
+               Map<String, byte[]> map;
+               File convFile;
+               try {
+                       if (file.isEmpty()) {
+                               logger.error("Failed to store empty file " + file.getOriginalFilename());
+                               throw new StorageException("Failed to store empty file " + file.getOriginalFilename());
+                       }
+                       String fileLocation = file.getOriginalFilename();
+                       logger.debug("StorageServiceImpl.save: store the widget to:" + fileLocation);
+                       convFile = new File(fileLocation);
+                       FileOutputStream fos = new FileOutputStream(convFile);
+                       fos.write(file.getBytes());
+                       fos.close();
+                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
+                       convFile.delete();
+               } catch (IOException e) {
+                       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);
+       }
+
+       @Override
+       @Transactional
+       public void initSave(File file, WidgetCatalog newWidget, long widgetId) {
+
+               UnzipUtil unzipper = new UnzipUtil();
+               Map<String, byte[]> map;
+
+               try {
+                       String fileLocation = file.getPath();
+                       logger.debug("StorageServiceImpl.save: store the widget to:" + fileLocation);
+                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
+               } catch (IOException e) {
+                       logger.error("StorageServiceImpl.save: Failed to store file " + file.getName(), e);
+                       throw new StorageException("Failed to store file " + file.getName(), e);
+               }
+               
+               saveHelper(newWidget, widgetId, map);
+       }
+
+       /**
+        * Helper method for saving widget files (controller.js, framework.js,
+        * markup.html and style.css) to ep_widget_catalog_files table in database
+        * 
+        * @param newWidget
+        * @param widgetId
+        * @param map
+        */
+       private void saveHelper(WidgetCatalog newWidget, long widgetId, Map<String, byte[]> map) {
+
+               logger.debug("Going to save widget " + newWidget);
+               WidgetFile widgetFile = new WidgetFile();
+               widgetFile.setName(newWidget.getName());
+               widgetFile.setWidgetId(widgetId);
+
+               InputStream fileInputStream = this.getClass().getClassLoader().getResourceAsStream("framework-template.js");
+
+               String sb = null;
+               try {
+                       byte[] bytes = new byte[fileInputStream.available()];
+                       fileInputStream.read(bytes);
+                       sb = new String(bytes, "UTF-8");
+               } catch (IOException e) {
+                       logger.error("StorageServiceImpl.save: Failed to load framework-template.js file ", e);
+                       e.printStackTrace();
+               } finally {
+                       if (fileInputStream != null) {
+                               try {
+                                       fileInputStream.close();
+                               } catch (IOException e) {
+                                       logger.error("StorageServiceImpl.update: Failed to close the fileInputStream ", e);
+                               }
+                       }
+               }
+
+               String namespace = "Portal" + widgetId + "Widget";
+               String controllerName = "Portal" + widgetId + "Ctrl";
+               String cssName = "portal" + widgetId + "-css-ready";
+               String colorArg1 = "color: #fff";
+               String framework = sb.replaceAll("ARGUMENT1", namespace).replaceAll("ARGUMENT2", controllerName)
+                               .replaceAll("ARGUMENT3", cssName).replaceAll("CSS_ARG1", colorArg1)
+                               .replaceAll("MICROSERVICE_ID", newWidget.getServiceId().toString())
+                               .replaceAll("WIDGET_ID", Long.toString(widgetId));
+
+               widgetFile.setFramework(framework.getBytes());
+
+               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);
+               String functionHeader = javascript.substring(javascript.indexOf("function"), javascript.indexOf(")") + 1);
+               String functionName = functionHeader.substring(functionHeader.indexOf(" "), functionHeader.indexOf("(")).trim();
+               javascript = javascript.replaceFirst(functionName, controllerName);
+               String functionParam = functionHeader.substring(functionHeader.indexOf("(") + 1, functionHeader.indexOf(")"));
+               List<String> paramList = Arrays.asList(functionParam.split(","));
+
+               int left_bracket_index = javascript.indexOf("{") + 1;
+               String widgetData = namespace + "=" + namespace + "||{};" + "var res = " + namespace + ".widgetData;";
+               javascript = javascript.substring(0, left_bracket_index) + widgetData
+                               + javascript.substring(left_bracket_index);
+
+               StringBuilder injectStr = new StringBuilder().append("[");
+               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 = namespace + ".controller = " + javascript + ";" + namespace + ".controller.$inject = "
+                               + injectStr.toString();
+
+               String html = new String(map.get(WidgetConstant.WIDGET_MARKUP_LOCATION)).replaceFirst(functionName,
+                               controllerName);
+               ;
+
+               Pattern cssPattern = Pattern.compile("#.*-css-ready");
+               Matcher cssMatcher = cssPattern.matcher(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION)));
+               if (cssMatcher.find()) {
+                       widgetFile.setCss(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION))
+                                       .replace(cssMatcher.group(0), "#" + cssName).getBytes());
+               }
+
+               widgetFile.setMarkup(html.getBytes());
+               widgetFile.setController(javascript.getBytes());
+               Session session = sessionFactory.openSession();
+               session.save(widgetFile);
+               session.flush();
+               session.close();
+               // sessionFactory.getCurrentSession().save(widgetFile);
+               logger.debug(
+                               "StorageServiceImpl.save: saved fraemwork.js controller.js, markup.html and style.css files to the database for widget {}",
+                               widgetId);
+
+       }
+
+       @Override
+       public void update(MultipartFile file, WidgetCatalog newWidget, long widgetId) {
+               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);
+                       FileOutputStream fos = new FileOutputStream(convFile);
+                       fos.write(file.getBytes());
+                       fos.close();
+                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
+                       convFile.delete();
+               } 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);
+               }
+               WidgetFile widgetFile = getWidgetFile(widgetId);
+
+               InputStream fileInputStream = this.getClass().getClassLoader().getResourceAsStream("framework-template.js");
+               String sb = null;
+               try {
+                       byte[] bytes = new byte[fileInputStream.available()];
+                       fileInputStream.read(bytes);
+                       sb = new String(bytes, "UTF-8");
+               } catch (IOException e) {
+                       logger.error("StorageServiceImpl.save: Failed to load framework-template.js file ", e);
+                       e.printStackTrace();
+               } finally {
+                       if (fileInputStream != null) {
+                               try {
+                                       fileInputStream.close();
+                               } catch (IOException e) {
+                                       logger.error("StorageServiceImpl.update: Failed to close the fileInputStream ", e);
+                                       e.printStackTrace();
+                               }
+                       }
+               }
+
+               String namespace = "Portal" + widgetId + "Widget";
+               String controllerName = "Portal" + widgetId + "Ctrl";
+               String cssName = "portal" + widgetId + "-css-ready";
+               String colorArg1 = "color: #fff";
+               String framework = sb.replaceAll("ARGUMENT1", namespace).replaceAll("ARGUMENT2", controllerName)
+                               .replaceAll("ARGUMENT3", cssName).replaceAll("CSS_ARG1", colorArg1)
+                               .replaceAll("MICROSERVICE_ID", newWidget.getServiceId().toString())
+                               .replaceAll("WIDGET_ID", Long.toString(widgetId));
+               widgetFile.setFramework(framework.getBytes());
+
+               String javascript = new String(map.get(WidgetConstant.WIDGET_CONTROLLER_LOCATION));
+               String functionHeader = javascript.substring(javascript.indexOf("function"), javascript.indexOf(")") + 1);
+               String functionName = functionHeader.substring(functionHeader.indexOf(" "), functionHeader.indexOf("(")).trim();
+               javascript = javascript.replaceFirst(functionName, controllerName);
+               String functionParam = functionHeader.substring(functionHeader.indexOf("(") + 1, functionHeader.indexOf(")"));
+               List<String> paramList = Arrays.asList(functionParam.split(","));
+
+               int left_bracket_index = javascript.indexOf("{") + 1;
+               String widgetData = namespace + "=" + namespace + "||{};" + "var res = " + namespace + ".widgetData;";
+               javascript = javascript.substring(0, left_bracket_index) + widgetData
+                               + javascript.substring(left_bracket_index);
+
+               StringBuilder injectStr = new StringBuilder().append("[");
+               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 = namespace + ".controller = " + javascript + ";" + namespace + ".controller.$inject = "
+                               + injectStr.toString();
+
+               String html = new String(map.get(WidgetConstant.WIDGET_MARKUP_LOCATION)).replaceFirst(functionName,
+                               controllerName);
+               ;
+
+               Pattern cssPattern = Pattern.compile("#.*-css-ready");
+               Matcher cssMatcher = cssPattern.matcher(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION)));
+               if (cssMatcher.find()) {
+                       widgetFile.setCss(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION))
+                                       .replace(cssMatcher.group(0), "#" + cssName).getBytes());
+               }
+
+               widgetFile.setMarkup(html.getBytes());
+               widgetFile.setController(javascript.getBytes());
+               // widgetFile.setCss(map.get(WidgetConstant.WIDGET_STYLE_LOCATION));
+               Session session = sessionFactory.openSession();
+               Transaction tx = session.beginTransaction();
+               session.update(widgetFile);
+               tx.commit();
+               session.flush();
+               session.close();
+               logger.debug(
+                               "StorageServiceImpl.save: updated fraemwork.js controller.js, markup.html and style.css files to the database for widget {}",
+                               widgetId);
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public String getWidgetMarkup(long widgetId) throws UnsupportedEncodingException {
+               String markup = null;
+               Session session = sessionFactory.getCurrentSession();
+               Criteria criteria = session.createCriteria(WidgetFile.class);
+               criteria.add(Restrictions.eq("widgetId", widgetId));
+               List<WidgetFile> widgetFile = criteria.list();
+               logger.debug("StorageServiceImpl.getWidgetMarkup: getting widget markup result={}", widgetFile);
+
+               if (widgetFile.size() > 0)
+                       markup = new String(widgetFile.get(0).getMarkup(), "UTF-8");
+               return markup;
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public String getWidgetController(long widgetId) throws UnsupportedEncodingException {
+               String controller = null;
+               Session session = sessionFactory.getCurrentSession();
+               Criteria criteria = session.createCriteria(WidgetFile.class);
+               criteria.add(Restrictions.eq("widgetId", widgetId));
+               List<WidgetFile> widgetFile = criteria.list();
+               logger.debug("StorageServiceImpl.getWidgetController: getting widget controller result={}", widgetFile);
+
+               if (widgetFile.size() > 0)
+                       controller = new String(widgetFile.get(0).getController(), "UTF-8");
+               return controller;
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public String getWidgetFramework(long widgetId) throws UnsupportedEncodingException {
+               String framework = null;
+               Session session = sessionFactory.getCurrentSession();
+               Criteria criteria = session.createCriteria(WidgetFile.class);
+               criteria.add(Restrictions.eq("widgetId", widgetId));
+               List<WidgetFile> widgetFile = criteria.list();
+               logger.debug("StorageServiceImpl.getWidgetFramework: getting widget framework result={}", widgetFile);
+
+               if (widgetFile.size() > 0)
+                       framework = new String(widgetFile.get(0).getFramework(), "UTF-8");
+               return framework;
+       }
+
+       @Override
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public String getWidgetCSS(long widgetId) throws UnsupportedEncodingException {
+               String css = null;
+               Session session = sessionFactory.getCurrentSession();
+               Criteria criteria = session.createCriteria(WidgetFile.class);
+               criteria.add(Restrictions.eq("widgetId", widgetId));
+               List<WidgetFile> widgetFile = criteria.list();
+               logger.debug("StorageServiceImpl.getWidgetCSS: getting widget css result={}", widgetFile);
+
+               if (widgetFile.size() > 0)
+                       css = new String(widgetFile.get(0).getCss(), "UTF-8");
+               return css;
+       }
+
+       @Override
+       @Transactional
+       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");
+               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(), "");
+
+               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();
+               out.write(data, 0, data.length);
+               out.closeEntry();
+               out.close();
+               byte[] result = Files.readAllBytes(Paths.get(f.getPath()));
+               f.delete();
+               return result;
+       }
+
+}
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
new file mode 100644 (file)
index 0000000..8dd8628
--- /dev/null
@@ -0,0 +1,243 @@
+package org.onap.portalapp.widget.service.impl;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.transaction.Transactional;
+
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.criterion.Restrictions;
+import org.onap.portalapp.widget.domain.MicroserviceData;
+import org.onap.portalapp.widget.domain.RoleApp;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.EnableAspectJAutoProxy;
+import org.springframework.stereotype.Service;
+
+@Service("widgetCatalogService")
+@Transactional
+@org.springframework.context.annotation.Configuration
+@EnableAspectJAutoProxy
+public class WidgetCatalogServiceImpl implements WidgetCatalogService {
+
+       private static final Logger logger = LoggerFactory.getLogger(WidgetCatalogServiceImpl.class);
+       
+       @Autowired
+       private SessionFactory sessionFactory;
+       
+       @SuppressWarnings("unchecked")
+       @Override
+       @Transactional
+       public List<WidgetCatalog> getWidgetCatalog(){          
+               Session session = sessionFactory.getCurrentSession();
+               Criteria criteria = session.createCriteria(WidgetCatalog.class)
+                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
+               List<WidgetCatalog> widgets = criteria.list();
+               logger.debug("WidgetCatalogServiceImpl.getWidgetCatalog: result={}", widgets);
+               return widgets;
+       }
+       
+       @SuppressWarnings("unchecked")
+       @Transactional
+       public List<WidgetCatalog> getUserWidgetCatalog(String loginName){
+               Session session = sessionFactory.getCurrentSession();
+               StringBuilder sql = new StringBuilder()
+                               
+
+                               .append("  select userWidgets.widget_id, userWidgets.wdg_name, userWidgets.wdg_desc, b.x, b.status_cd, b.y, b.height, b.width  from                                        ") 
+                               .append("  (                                                                                                                                                               ")
+                               .append("  select distinct w.widget_id, w.wdg_name, w.wdg_desc from                                                                                                                                                        ")                    
+                               .append("  ep_widget_catalog w,                                                                                                                                            ")
+                               .append("  ep_widget_catalog_role wr,                                                                                                                                              ")
+                               .append("  fn_user_role ur,                                                                                                                                                                                                                                                                                ")
+                               .append("  fn_app app,                                                                                                                                                                                                                                                                             ")
+                               .append("  fn_user u                                                                                                                                                               ")
+                               .append("  where                                                                                                                                                   ")
+                               .append("  w.widget_id = wr.WIDGET_ID and                                                                                                                                                                                                                                                  ")
+                               .append("  ur.app_id = app.app_id and                                                                                                                                                                                                                                              ")
+                               .append("  app.enabled = 'Y' and                                                                                                                                                                                                                                                   ")
+                               .append("  wr.role_id = ur.role_id and                                                                                                                                                                                                                                             ")                                                                                                            
+                               .append("  ur.user_id = u.user_id and                                                                                                                                                                                                                                              ")                                                                                                              
+                               .append("  u.login_id = '" + loginName + "' and (w.all_user_flag = 'N' or w.all_user_flag is null)                                                                 ")                   
+                               .append("                                                                                                                                                              ") 
+                               .append("       union all                                                                                                                                              ") 
+                               .append("                                                                                                                                                              ") 
+                               .append("                                                                                                                                                              ") 
+                               .append("  select distinct w.widget_id, w.wdg_name, w.wdg_desc from                                                                                                                        ") 
+                               .append("       ep_widget_catalog w                                                                                                                                    ") 
+                               .append("       where w.all_user_flag = 'Y'                                                                                                                            ") 
+                               .append("                                                                                                                                                              ") 
+                               .append("        ) userWidgets                                                                                                                                         ") 
+                               .append("                                                                                                                                                              ") 
+                               .append("  left join                                                                                                                                               ") 
+                               .append("                                                                                                                                                              ") 
+                               .append("  (                                                                                                                                                       ") 
+                               .append("               select case when pers.user_id is null then sel.user_id else pers.user_id end as 'user_id', case when sel.widget_id is null then                    ") 
+                               .append("                       pers.widget_id else sel.widget_id end as  'widget_id', pers.x, sel.status_cd, pers.y, pers.height, pers.width                                  ") 
+                               .append("                               from (select * from ep_pers_user_widget_placement where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) pers ") 
+                               .append("                                       left outer join                                                                                                                        ") 
+                               .append("                               (select * from ep_pers_user_widget_sel where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) sel             ") 
+                               .append("               on (pers.user_id = sel.user_id and pers.widget_id = sel.widget_id)                                                                                 ") 
+                               .append("                                                                                                                                                                      ") 
+                               .append("               union                                                                                                                                              ") 
+                               .append("                                                                                                                                                                      ") 
+                               .append("                select case when pers.user_id is null then sel.user_id else pers.user_id end as 'user_id',  case when sel.widget_id is null                       ") 
+                               .append("                       then pers.widget_id else sel.widget_id end as  'widget_id', pers.x, sel.status_cd, pers.y, pers.height, pers.width                             ") 
+                               .append("                               from (select * from ep_pers_user_widget_placement where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) pers ") 
+                               .append("                                       right outer join                                                                                                                       ") 
+                               .append("                               (select * from ep_pers_user_widget_sel where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) sel             ") 
+                               .append("               on (pers.user_id = sel.user_id and pers.widget_id = sel.widget_id)                                                                                 ") 
+                               .append("                                                                                                                                                                  ") 
+                               .append("                order by user_id, widget_id                                                                                                                       ") 
+                               .append(" )b                                                                                                                                                       ") 
+                               .append("  on                                                                                                                                                      ") 
+                               .append("  (userWidgets.widget_id = b.widget_id) order by b.x;                                                                                                     ");  
+                               
+                               
+                               
+               Query query = session.createSQLQuery(sql.toString());
+               List<WidgetCatalog> widgets = query.list();
+               logger.debug("WidgetCatalogServiceImpl.getUserWidgetCatalog: result size={}", widgets);
+               return widgets;         
+       }
+
+       @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
+       public void deleteWidgetCatalog(long widgetCatalogId) {
+               logger.debug("WidgetCatalogServiceImpl.deleteWidgetCatalog: deleting the widget with widgetId={}", widgetCatalogId);
+               WidgetCatalog widget = getWidgetCatalog(widgetCatalogId);
+               if (widget == null){
+                       logger.error("No widget found in database while performing WidgetCatalogServiceImpl.deleteWidgetCatalog.");
+                       return;
+               }
+               Session session = sessionFactory.getCurrentSession();
+               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);
+               query.executeUpdate();
+               query = session.createSQLQuery("delete from ep_widget_catalog_files where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId);
+               query.executeUpdate();
+               query = session.createSQLQuery("delete from ep_widget_catalog_parameter where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId);
+               query.executeUpdate();
+               session.delete(widget);
+               tx.commit();
+       }
+       
+       @Override
+       public long saveWidgetCatalog(WidgetCatalog newWidgetCatalog) {
+               
+               try{
+                       if(newWidgetCatalog.getAllowAllUser().equals("1"))
+                               newWidgetCatalog.setAllowAllUser("Y");
+                       else
+                               newWidgetCatalog.setAllowAllUser("N");
+                       
+                       logger.debug("WidgetCatalogServiceImpl.saveWidgetCatalog: widget={}", newWidgetCatalog);
+                       Session session = sessionFactory.openSession();
+                       Transaction tx = session.beginTransaction();            
+                       session.save(newWidgetCatalog);
+                       tx.commit();
+                       session.flush();
+                       session.close();
+                       updateAppId(newWidgetCatalog.getId(), newWidgetCatalog.getWidgetRoles());
+               }
+               catch(Exception e){
+                       logger.error("Exception occurred while performing WidgetCatalogServiceImpl.saveWidgetCatalog in widget microservices. Details:" + e.getMessage());
+               }
+               return newWidgetCatalog.getId();
+       }
+
+       @Override
+       public void updateWidgetCatalog(Long widgetCatalogId, WidgetCatalog newWidgetCatalog) {
+               logger.debug("WidgetCatalogServiceImpl.updateWidgetCatalog: widget={}", newWidgetCatalog);
+               WidgetCatalog oldWidget = getWidgetCatalog(widgetCatalogId);
+               try{
+                       if (newWidgetCatalog.getAllowAllUser().equals("1")) 
+                               newWidgetCatalog.setAllowAllUser("Y");
+                       else 
+                               newWidgetCatalog.setAllowAllUser("N");
+                       
+                       newWidgetCatalog.setId(widgetCatalogId);
+                       newWidgetCatalog.setServiceId(oldWidget.getServiceId());
+                       Session session = sessionFactory.openSession();
+                       Transaction tx = session.beginTransaction();
+                       session.update(newWidgetCatalog);
+                       tx.commit();
+                       session.flush();
+                       session.close();
+                       updateAppId(newWidgetCatalog.getId(), newWidgetCatalog.getWidgetRoles());
+               }catch(Exception e){
+                       logger.error("Exception occurred while performing WidgetCatalogServiceImpl.updateWidgetCatalog in widget microservices. Details:" + e.getMessage());
+               }
+               
+       }       
+       
+       @Override
+       public Long getServiceIdByWidget(Long widgetCatalogId) {
+               Session session = sessionFactory.getCurrentSession();
+               WidgetCatalog widget = (WidgetCatalog) session.get(WidgetCatalog.class, widgetCatalogId);
+               logger.debug("WidgetCatalogServiceImpl.getServiceIdByWidget: result={}", widget);
+               return widget.getServiceId();
+       }
+       
+       @Override
+       public List<WidgetCatalog> getWidgetsByServiceId(Long serviceId) {
+               Session session = sessionFactory.getCurrentSession();
+               Criteria criteria = session.createCriteria(WidgetCatalog.class)
+                               .add(Restrictions.eq("serviceId", serviceId))
+                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
+               List<WidgetCatalog> widgets = criteria.list();
+               logger.debug("WidgetCatalogServiceImpl.getWidgetCatalog: result={}", widgets);
+               return widgets;
+       }
+       
+       
+       
+       
+       
+       private void updateAppId(long widgetId, Set<RoleApp> roles){
+               Session session = sessionFactory.openSession();
+               for(RoleApp role: roles){
+                       String sql = "UPDATE ep_widget_catalog_role SET app_id = " + role.getApp().getAppId() + " WHERE widget_id = " + widgetId + " AND ROLE_ID = " + role.getRoleId() ;
+                       Query query = session.createSQLQuery(sql);
+                       query.executeUpdate();
+               }
+               session.flush();
+               session.close();
+       }
+
+       @Override
+       public boolean getWidgetIdByName(String newWidgetName) {
+               Session session = sessionFactory.openSession();
+               Criteria criteria = session.createCriteria(WidgetCatalog.class)
+                               .add(Restrictions.eq("name", newWidgetName))
+                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
+               
+               List<MicroserviceData> widgets = criteria.list();
+               logger.debug("WidgetCatalogServiceImpl.getWidgetIdByName: result={}", widgets);
+               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/AuthorizationUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/utils/AuthorizationUtil.java
new file mode 100644 (file)
index 0000000..1c89890
--- /dev/null
@@ -0,0 +1,19 @@
+package org.onap.portalapp.widget.utils;
+
+import java.nio.charset.Charset;
+import java.util.Base64;
+
+public class AuthorizationUtil {
+
+       public boolean authorization(String auth, String security_user, String security_pass){
+               if (auth != null && auth.startsWith("Basic")) {         
+               String base64Credentials = auth.substring("Basic".length()).trim();
+               String credentials = new String(Base64.getDecoder().decode(base64Credentials),
+                       Charset.forName("UTF-8"));
+               final String[] values = credentials.split(":",2);
+               if(security_user.equals(values[0]) && security_pass.equals(values[1]))
+                       return true;
+               }
+               return 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
new file mode 100644 (file)
index 0000000..d699e5d
--- /dev/null
@@ -0,0 +1,110 @@
+package org.onap.portalapp.widget.utils;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Stack;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import org.onap.portalapp.widget.constant.WidgetConstant;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class UnzipUtil {
+
+       /**
+        * Size of the buffer to read/write data
+        */
+       private static final int BUFFER_SIZE = 4096;
+       private static final Logger logger = LoggerFactory.getLogger(UnzipUtil.class);
+
+       /**
+        * Extracts a zip file specified by the zipFilePath to a directory specified by
+        * destDirectory (will be created if does not exists)
+        * 
+        * @param zipFilePath
+        *            path
+        * @param destDirectory
+        *            directory
+        * @param widgetName
+        *            name
+        * @return Map of contents
+        * @throws IOException
+        *             On error
+        */
+       public Map<String, byte[]> unzip_db(String zipFilePath, String destDirectory, String widgetName)
+                       throws IOException {
+
+               logger.debug("UnzipUtil.unzip_db: unzip widget file {}", widgetName);
+               File destDir = new File(destDirectory);
+               if (!destDir.exists())
+                       destDir.mkdir();
+               ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
+               ZipEntry entry = zipIn.getNextEntry();
+               Map<String, byte[]> map = new HashMap<>();
+
+               String[] requiredKeys = { WidgetConstant.WIDGET_CONTROLLER_LOCATION, WidgetConstant.WIDGET_MARKUP_LOCATION,
+                               WidgetConstant.WIDGET_STYLE_LOCATION };
+               for (String k : requiredKeys)
+                       map.put(k, null);
+
+               // iterates over entries in the zip file
+               Stack<File> stack = new Stack<>();
+               while (entry != null) {
+                       String filePath = destDirectory + File.separator + widgetName + File.separator
+                                       + entry.getName().substring(entry.getName().indexOf("/") + 1);
+                       final String entryShortName = entry.getName().substring(entry.getName().indexOf("/") + 1);
+                       logger.debug("UnzipUtil.unzip_db: file path {}, short name {}", filePath, entryShortName);
+                       if (!entry.isDirectory()) {
+                               // if the entry is a file, extracts it
+                               logger.debug("UnzipUtil.unzip_db: unzip and save widget file {}", filePath);
+                               stack.push(new File(filePath));
+                               extractFile(zipIn, filePath);
+                       } else {
+                               // if the entry is a directory, make the directory
+                               logger.debug("UnzipUtil.unzip_db: unzip and create widget folder {}", filePath);
+                               File dir = new File(filePath);
+                               stack.push(new File(filePath));
+                               dir.mkdir();
+                       }
+                       // Is this one we need?
+                       if (map.containsKey(entryShortName))
+                               map.put(entryShortName, Files.readAllBytes(Paths.get(filePath)));
+                       zipIn.closeEntry();
+                       entry = zipIn.getNextEntry();
+               }
+               zipIn.close();
+               while (!stack.isEmpty())
+                       stack.pop().delete();
+
+               for (String k : requiredKeys)
+                       if (!map.containsKey(k))
+                               logger.warn("UnzipUtil.unzip_db: no zip archive entry found for required key {}", k);
+
+               return map;
+       }
+
+       /**
+        * Extracts a zip entry (file entry)
+        * 
+        * @param zipIn
+        * @param filePath
+        * @throws IOException
+        */
+       private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
+               BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
+               byte[] bytesIn = new byte[BUFFER_SIZE];
+               int read = 0;
+               while ((read = zipIn.read(bytesIn)) != -1) {
+                       bos.write(bytesIn, 0, read);
+               }
+               bos.close();
+       }
+}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/MicroserviceApplication.java
deleted file mode 100644 (file)
index 446f48f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.client.RestTemplate;
-
-@SpringBootApplication
-@ComponentScan(basePackages = "org.openecomp.portalapp.widget")
-public class MicroserviceApplication {
-       @Bean
-       public RestTemplate getRestTemplate() {
-               return new RestTemplate();
-       }
-
-       public static void main(String[] args) {
-               SpringApplication.run(MicroserviceApplication.class, args);
-       }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/constant/WidgetConstant.java
deleted file mode 100644 (file)
index c54f100..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.constant;
-
-public final class WidgetConstant {
-       
-       public static final String WIDGET_MARKUP_LOCATION = "markup/markup.html";
-       public static final String WIDGET_CONTROLLER_LOCATION = "js/controller.js";
-       public static final String WIDGET_STYLE_LOCATION = "styles/styles.css";
-       public static final String VALIDATION_MESSAGE_ZIP = "Please upload a zip file"; 
-       public static final String VALIDATION_MESSAGE_FILES = "Please check your files (should contains js, styles and markup folder)"; 
-}
-
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/DatabaseFileUploadController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/DatabaseFileUploadController.java
deleted file mode 100644 (file)
index 02cc941..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.controller;
-
-import java.io.UnsupportedEncodingException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.slf4j.Logger;
-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.ResponseBody;
-
-@Controller
-public class DatabaseFileUploadController {
-       
-       @Autowired
-       private StorageService storageService;
-       
-       private static final Logger logger = LoggerFactory.getLogger(DatabaseFileUploadController.class); 
-
-       @ResponseBody
-       @RequestMapping(value = "/microservices/markup/{widgetId}", method = RequestMethod.GET)
-       public String getWidgetMarkup(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){
-               String markup = null;
-               try{
-                       logger.debug("DatabaseFileUploadController.getWidgetMarkup: getting markup.html for widget with widgetId = {}" , widgetId);
-                       markup = storageService.getWidgetMarkup(widgetId);
-               }catch(Exception e){
-                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetMarkup in widget microservices. Details:" + e.getMessage());
-               }
-               return markup;
-       }
-
-       @ResponseBody
-       @RequestMapping(value = "/microservices/{widgetId}/controller.js", method = RequestMethod.GET)
-       public String getWidgetController(HttpServletRequest request, HttpServletResponse response, @PathVariable("widgetId") long widgetId){
-               String controller = null;
-               try{
-                       logger.debug("DatabaseFileUploadController.getWidgetController: getting controller.js for widget with widgetId = {}" , widgetId);
-                       controller = storageService.getWidgetController(widgetId); 
-               }catch(Exception e){
-                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetController in widget microservices. Details:" + e.getMessage());
-               }
-               return controller;
-       }
-
-       @ResponseBody
-       @RequestMapping(value = "/microservices/{widgetId}/framework.js", method = RequestMethod.GET)
-       public String getWidgetFramework(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("widgetId") long widgetId){
-               String framework = null;
-               try{
-                       logger.debug("DatabaseFileUploadController.getWidgetFramework: getting framework.js for widget with widgetId = {}" , widgetId);
-                       framework = storageService.getWidgetFramework(widgetId);
-               }catch(Exception e){
-                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetFramework in widget microservices. Details:" + e.getMessage());
-               }
-               return framework;
-       }
-       
-       @ResponseBody
-       @RequestMapping(value = "/microservices/{widgetId}/styles.css", method = RequestMethod.GET)
-       public String getWidgetCSS(HttpServletRequest request, HttpServletResponse response,
-                       @PathVariable("widgetId") long widgetId){
-               String css = null;
-               try {
-                       logger.debug("DatabaseFileUploadController.getWidgetCSS: getting styles.css for widget with widgetId = {}" , widgetId);
-                       css = storageService.getWidgetCSS(widgetId);
-               } catch (UnsupportedEncodingException e) {
-                       logger.error("Exception occurred while performing DatabaseFileUploadController.getWidgetCSS in widget microservices. Details:" + e.getMessage());
-               } 
-               return css;     
-       }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/HealthController.java
deleted file mode 100644 (file)
index dfe5c2d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.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.RestController;
-
-@RestController
-public class HealthController {
-
-       @RequestMapping(value = { "/health" }, method = RequestMethod.GET, produces = "application/json")
-       public HealthStatus getWidgetCatalog(HttpServletRequest request, HttpServletResponse response) {
-               return new HealthStatus("ok");
-       }
-       
-       class HealthStatus {
-               private String status;
-               
-               public HealthStatus(String status){
-                       this.status = status;
-               }
-
-               public String getStatus() {
-                       return status;
-               }
-
-               public void setStatus(String status) {
-                       this.status = status;
-               }
-               
-               
-       }
-}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/WidgetsCatalogController.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/controller/WidgetsCatalogController.java
deleted file mode 100644 (file)
index 60d9277..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.controller;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.openecomp.portalapp.widget.utils.AuthorizationUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-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.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.client.RestTemplate;
-import org.springframework.web.multipart.MultipartFile;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-@Controller
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class WidgetsCatalogController {
-
-       @Value("${server.port}")
-       String port;
-       @Value("${server.contextPath}")
-       String context;
-       
-       @Value("${security.user.name}")
-       String security_user;
-       @Value("${security.user.password}")
-       String security_pass;
-       
-       @Autowired
-       WidgetCatalogService widgetCatalogService;
-
-       @Autowired
-       StorageService storageService;
-       
-       @Autowired
-       RestTemplate restTemplate;
-
-       AuthorizationUtil util = new AuthorizationUtil();
-       
-       private static final Logger logger = LoggerFactory.getLogger(WidgetsCatalogController.class);
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog" }, method = RequestMethod.GET, produces = "application/json")
-       public List<WidgetCatalog> getWidgetCatalog(HttpServletRequest request, HttpServletResponse response
-                       ,@RequestHeader(value="Authorization") String auth) throws IOException{
-               
-               List<WidgetCatalog> widgetCatalog = null;
-               if(!util.authorization(auth, security_user, security_pass)){ 
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetCatalog in widget microserivce. Please check your username and password.");
-                       return widgetCatalog;
-               }
-               try {
-                       widgetCatalog = widgetCatalogService.getWidgetCatalog();
-                       logger.debug("WidgetsCatalogController.getWidgetCatalog: getting widget list {}", widgetCatalog);
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetCatalog in widget microservices. Details:" + e.getMessage());
-               }
-               return widgetCatalog;
-       }
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{loginName}" }, method = RequestMethod.GET, 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;
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getUserWidgetCatalog in widget microserivce. Please check your username and password.");
-                       return widgetCatalog;
-               }
-               try {
-                       widgetCatalog = widgetCatalogService.getUserWidgetCatalog(loginName);
-                       logger.debug("WidgetsCatalogController.getUserWidgetCatalog: getting widget list {}", widgetCatalog);
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.getUserWidgetCatalog in widget microservices. Details:" + e.getMessage());
-               }
-               return widgetCatalog;
-       }
-
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.PUT, produces = "application/json")
-       public void updateWidgetCatalog(HttpServletRequest request, HttpServletResponse response,
-                       @RequestBody WidgetCatalog newWidgetCatalog, @PathVariable("widgetId") long widgetId,
-                       @RequestHeader(value="Authorization") String auth) throws IOException {
-
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.updateWidgetCatalog in widget microserivce. Please check your username and password.");
-                       return;
-               }
-               try {
-                       widgetCatalogService.updateWidgetCatalog(widgetId, newWidgetCatalog);
-                       logger.debug("WidgetsCatalogController.updateWidgetCatalog: updating widget {}", newWidgetCatalog);
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.updateWidgetCatalog in widget microservices. Details:" + e.getMessage());
-                       e.printStackTrace();
-               }
-       }
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog" }, method = RequestMethod.POST, 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 {   
-       
-               ValidationRespond respond = null;
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.saveWidgetCatalog in widget microserivce. Please check your username and password.");
-                       return new ValidationRespond(false, "Basic Authentication Error, please check your username and password.");
-               }       
-               try {
-                       //check the zip file structure first
-                       respond = storageService.checkZipFile(file);
-                       
-                       if(respond.isValid()){ 
-                               //save the widget catalog
-                               WidgetCatalog newWidget = new ObjectMapper().readValue(widget, WidgetCatalog.class);
-                               
-                               long widgetId = widgetCatalogService.saveWidgetCatalog(newWidget);
-                               logger.debug("WidgetsCatalogController.saveWidgetCatalog: saving widget={}", newWidget);
-                               //save the widget zip file ;
-                               storageService.save(file, newWidget, widgetId);
-                       }
-                       
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:", e);
-               }
-               return respond;
-       }
-
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = RequestMethod.POST, 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 {  
-               System.out.println("microserivces updating with files" + widgetId);
-               ValidationRespond respond = null;
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.saveWidgetCatalog in widget microserivce. Please check your username and password.");
-                       return new ValidationRespond(false, "Basic Authentication Error, please check your username and password.");
-               }       
-               try {
-                       //check the zip file structure first
-                       respond = storageService.checkZipFile(file);
-                       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);
-                       }
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.saveWidgetCatalog in widget microservices. Details:" + e.getMessage());
-                       e.printStackTrace();
-               }
-               return respond;
-       }
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/{widgetId}" }, method = {
-                       RequestMethod.DELETE }, 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)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.deleteOnboardingWidget in widget microserivce. Please check your username and password.");
-                       return;
-               }
-               try {
-                       logger.debug("WidgetsCatalogController.deleteOnboardingWidget: deleting widget {}", widgetId);
-                       //WidgetCatalog widget = widgetCatalogService.getWidgetCatalog(widgetId);
-                       widgetCatalogService.deleteWidgetCatalog(widgetId);
-                       storageService.deleteWidgetFile(widgetId);
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.deleteOnboardingWidget in widget microservices. Details:" + e.getMessage());
-               }
-       }
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/parameters/{widgetId}" }, method = RequestMethod.GET, produces = "application/json")
-       public Long getServiceIdByWidget(HttpServletRequest request, HttpServletResponse response, 
-                       @PathVariable("widgetId") Long widgetId, @RequestHeader(value="Authorization") String auth) throws IOException {
-               
-               Long serviceId = null;
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getServiceIdByWidget in widget microserivce. Please check your username and password.");
-                       return serviceId;
-               }
-               try{
-                       logger.debug("WidgetsCatalogController.getServiceIdByWidget: getting service Id for widget {}", widgetId);
-                       serviceId = widgetCatalogService.getServiceIdByWidget(widgetId);
-               }catch(Exception e){
-                       logger.error("Exception occurred while performing WidgetsCatalogController.getServiceIdByWidget in widget microservices. Details:" + e.getMessage());
-               }
-               return serviceId;
-       }
-
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/widgetCatalog/service/{serviceId}" }, method = RequestMethod.GET, 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<WidgetCatalog>();
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetByServiceId in widget microserivce. Please check your username and password.");
-                       return null;
-               }       
-               try{
-                       logger.debug("WidgetsCatalogController.getWidgetByServiceId: getting service Id for widget {}", serviceId);
-                       list = widgetCatalogService.getWidgetsByServiceId(serviceId);
-               }catch(Exception e){
-                       logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetByServiceId in widget microservices. Details:" + e.getMessage());
-               }
-               return list;
-       }
-       
-       
-       @ResponseBody
-       @RequestMapping(value = { "/microservices/download/{widgetId}" }, method = RequestMethod.GET, produces = "application/json")
-       public byte[] getWidgetZipFile(HttpServletRequest request, HttpServletResponse response, 
-                       @PathVariable("widgetId") long widgetId, @RequestHeader(value="Authorization") String auth) throws Exception {
-               byte[] byteFile = null;
-               if(!util.authorization(auth, security_user, security_pass)){
-                       response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
-                       logger.error("Basic Authentication Error while performing WidgetsCatalogController.getWidgetZipFile in widget microserivce. Please check your username and password.");
-                       return byteFile;
-               }
-               try {
-                       byteFile = storageService.getWidgetCatalogContent(widgetId);
-                       logger.debug("WidgetsCatalogController.getWidgetZipFile: getting widget zip file for widget with id {}", widgetId);
-               } catch (Exception e) {
-                       logger.error("Exception occurred while performing WidgetsCatalogController.getWidgetZipFile in widget microservices. Details:" + e.getMessage());
-               }
-               return byteFile;
-       }
-
-       
-}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/dao/WidgetDataSource.java
deleted file mode 100644 (file)
index 8b5692b..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.dao;
-
-import javax.sql.DataSource;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.jdbc.datasource.DriverManagerDataSource;
-import org.springframework.stereotype.Component;
-
-@Component
-public class WidgetDataSource{
-
-       @Value("${spring.database.driver.classname}")
-       private String dbDriverClassName;
-
-       @Value("${spring.datasource.url}")
-       private String dbUrl;
-
-       @Value("${spring.datasource.username}")
-       private String dbUsername;
-
-       @Value("${spring.datasource.password}")
-       private String dbPassword;
-
-       @Bean
-       public DataSource dataSource() {
-               DriverManagerDataSource dataSource = new DriverManagerDataSource();
-               dataSource.setDriverClassName(dbDriverClassName);
-               dataSource.setUrl(dbUrl);
-               dataSource.setUsername(dbUsername);
-               dataSource.setPassword(dbPassword);
-               return dataSource;
-       }
-}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/App.java
deleted file mode 100644 (file)
index 40ef252..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import java.io.Serializable;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "FN_APP")
-public class App implements Serializable{
-       
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name = "APP_ID")
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       private Long appId;
-       
-       @Column(name = "APP_Name")
-       private String appName;
-
-       public Long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(Long appId) {
-               this.appId = appId;
-       }
-
-       public String getAppName() {
-               return appName;
-       }
-
-       public void setAppName(String appName) {
-               this.appName = appName;
-       }
-
-       @Override
-       public String toString() {
-               return "App [appId=" + appId + ", appName=" + appName + "]";
-       }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceData.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceData.java
deleted file mode 100644 (file)
index 02df499..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * TODO: moved all microservice-related code (domain, controller, service)
- * from ecomp portal Backend to widget microservice
- */
-@Entity
-@Table(name="EP_MICROSERVICE")
-public class MicroserviceData {
-       
-       @Id
-       @Column(name = "id")
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       private Long id;
-
-       @Column(name = "name")
-       private String name;
-
-       @Column(name = "description")
-       private String desc;
-       
-       @Column(name = "appId")
-       private long appId;
-
-       @Column(name = "endpoint_url")
-       private String url;
-
-       @Column(name = "security_type")
-       private String securityType;
-
-       @Column(name = "username")
-       private String username;
-
-       @Column(name = "password")
-       private String password;
-       
-       @Column(name = "active")
-       private String active;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getDesc() {
-               return desc;
-       }
-
-       public void setDesc(String desc) {
-               this.desc = desc;
-       }
-
-       public long getAppId() {
-               return appId;
-       }
-
-       public void setAppId(long appId) {
-               this.appId = appId;
-       }
-
-       public String getUrl() {
-               return url;
-       }
-
-       public void setUrl(String url) {
-               this.url = url;
-       }
-
-       public String getSecurityType() {
-               return securityType;
-       }
-
-       public void setSecurityType(String securityType) {
-               this.securityType = securityType;
-       }
-
-       public String getUsername() {
-               return username;
-       }
-
-       public void setUsername(String username) {
-               this.username = username;
-       }
-
-       public String getPassword() {
-               return password;
-       }
-
-       public void setPassword(String password) {
-               this.password = password;
-       }
-
-       public String getActive() {
-               return active;
-       }
-
-       public void setActive(String active) {
-               this.active = active;
-       }
-
-       @Override
-       public String toString() {
-               return "MicroserviceData [name=" + name + ", desc=" + desc + ", appId=" + appId + ", url=" + url
-                               + ", securityType=" + securityType + ", username=" + username + ", password=" + password + ", active="
-                               + active + "]";
-       }
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/MicroserviceParameter.java
deleted file mode 100644 (file)
index 87cabb7..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-/**
- * TODO: moved all microservice-related code (domain, controller, service)
- * from ecomp portal Backend to widget microservice
- */
-@Entity
-@Table(name="EP_MICROSERVICE_PARAMETER")
-public class MicroserviceParameter {
-       
-       @Id
-       @Column(name = "id")
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       private Long id;
-
-       @Column(name = "service_id")
-       private long serviceId;
-
-       @Column(name = "para_key")
-       private String para_key;
-
-       @Column(name = "para_value")
-       private String para_value;
-
-       public Long getId() {
-               return id;
-       }
-
-       public void setId(Long id) {
-               this.id = id;
-       }
-
-       public long getServiceId() {
-               return serviceId;
-       }
-
-       public void setServiceId(long serviceId) {
-               this.serviceId = serviceId;
-       }
-
-       public String getPara_key() {
-               return para_key;
-       }
-
-       public void setPara_key(String para_key) {
-               this.para_key = para_key;
-       }
-
-       public String getPara_value() {
-               return para_value;
-       }
-
-       public void setPara_value(String para_value) {
-               this.para_value = para_value;
-       }
-
-       @Override
-       public String toString() {
-               return "MicroserviceParameter [serviceId=" + serviceId + ", para_key=" + para_key + ", para_value=" + para_value
-                               + "]";
-       }
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/RoleApp.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/RoleApp.java
deleted file mode 100644 (file)
index 8ff7cc3..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import java.io.Serializable;
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
-import javax.persistence.Table;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
-@Entity
-@Table(name = "FN_ROLE")
-public class RoleApp implements Serializable{
-       private static final long serialVersionUID = 1L;
-
-       @Id
-       @Column(name = "ROLE_ID")
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       private Long roleId;
-       
-       
-       @Column(name = "ROLE_Name")
-       private String roleName;
-       
-       @ManyToOne(fetch = FetchType.EAGER)
-       @JoinColumn(name="APP_ID")
-       private App app;
-       
-       @JsonIgnore
-       @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
-       private Set<WidgetCatalog> widgets;
-
-       /*@PreRemove
-       private void removeGroupsFromUsers() {
-           for (WidgetCatalog w : widgets) {
-               w.getWidgetRoles().remove(this);
-           }
-       }*/
-       
-       /*@ManyToOne
-       @JoinColumn(name = "WIDGET_ID", nullable = false)
-       WidgetCatalog widgetCatalog;*/
-
-       //@JsonIgnore
-       //@ManyToMany(mappedBy = "widgetRoles")
-       //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
-       //private Set<WidgetCatalog> widgets  = new HashSet<WidgetCatalog>();
-       
-       public Long getRoleId() {
-               return roleId;
-       }
-
-       public void setRoleId(Long roleId) {
-               this.roleId = roleId;
-       }
-
-       public String getRoleName() {
-               return roleName;
-       }
-
-       public void setRoleName(String roleName) {
-               this.roleName = roleName;
-       }
-
-       public App getApp() {
-               return app;
-       }
-
-       public void setApp(App app) {
-               this.app = app;
-       }
-       
-       public Set<WidgetCatalog> getWidgets() {
-               return widgets;
-       }
-
-       public void setWidgets(Set<WidgetCatalog> widgets) {
-               this.widgets = widgets;
-       }
-
-       @Override
-       public String toString() {
-               return "RoleApp [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
-       }
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/ValidationRespond.java
deleted file mode 100644 (file)
index 94196f1..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-public class ValidationRespond {
-       private boolean valid;
-       private String error;
-       
-       public ValidationRespond(boolean valid, String error){
-               this.valid = valid;
-               this.error = error;
-       }
-
-       public boolean isValid() {
-               return valid;
-       }
-
-       public void setValid(boolean valid) {
-               this.valid = valid;
-       }
-
-       public String getError() {
-               return error;
-       }
-
-       public void setError(String error) {
-               this.error = error;
-       }
-
-       @Override
-       public String toString() {
-               return "ValidationRespond [valid=" + valid + ", error=" + error + "]";
-       }
-       
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetCatalog.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetCatalog.java
deleted file mode 100644 (file)
index d54748a..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import java.util.Set;
-
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-
-@Entity
-@Table(name="EP_WIDGET_CATALOG")
-public class WidgetCatalog{
-       
-       @Id
-       @Column(name = "widget_id")
-       @GeneratedValue(strategy=GenerationType.AUTO)
-       private long id;
-       
-       @Column(name = "wdg_name")
-       private String name;
-       
-       @Column(name = "wdg_desc")
-       private String desc;    
-       
-       @Column(name = "wdg_file_loc")
-       private String fileLocation;
-       
-       @Column(name = "all_user_flag")
-       private String allowAllUser;
-       
-       @Column(name = "service_id")
-       private Long serviceId;
-       
-       @Transient
-       private String sortOrder;
-
-       @Transient
-       private String statusCode;
-
-       @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
-       @JoinTable(name = "ep_widget_catalog_role", 
-                       joinColumns = {@JoinColumn(name = "WIDGET_ID")},
-                       inverseJoinColumns = {@JoinColumn(name = "ROLE_ID")}
-       )
-       private Set<RoleApp> widgetRoles;
-
-       public long getId() {
-               return id;
-       }
-
-       public void setId(long id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public String getDesc() {
-               return desc;
-       }
-
-       public void setDesc(String desc) {
-               this.desc = desc;
-       }
-
-       public String getFileLocation() {
-               return fileLocation;
-       }
-
-       public void setFileLocation(String fileLocation) {
-               this.fileLocation = fileLocation;
-       }
-
-       public Set<RoleApp> getWidgetRoles() {
-               return widgetRoles;
-       }
-
-       public void setWidgetRoles(Set<RoleApp> widgetRoles) {
-               this.widgetRoles = widgetRoles;
-       }
-       
-       public String getAllowAllUser() {
-               return allowAllUser;
-       }
-
-       public void setAllowAllUser(String allowAllUser) {
-               this.allowAllUser = allowAllUser;
-       }
-
-       public String getSortOrder() {
-               return sortOrder;
-       }
-
-       public void setSortOrder(String sortOrder) {
-               this.sortOrder = sortOrder;
-       }
-
-       public String getStatusCode() {
-               return statusCode;
-       }
-
-       public void setStatusCode(String statusCode) {
-               this.statusCode = statusCode;
-       }
-
-       public Long getServiceId() {
-               return serviceId;
-       }
-
-       public void setServiceId(Long serviceId) {
-               this.serviceId = serviceId;
-       }
-
-       @Override
-       public String toString() {
-               return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation
-                               + ", allowAllUser=" + allowAllUser + ", serviceId=" + serviceId + ", sortOrder=" + sortOrder
-                               + ", statusCode=" + statusCode + ", widgetRoles=" + widgetRoles + "]";
-       }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/domain/WidgetFile.java
deleted file mode 100644 (file)
index b405c82..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.domain;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "ep_widget_catalog_files")
-public class WidgetFile {
-       @Id
-       @Column (name = "file_id")
-       private int id;
-       
-       @Column(name = "widget_name")
-       private String name;
-       
-       @Column(name = "widget_id")
-       private long widgetId;
-       
-       @Column(name = "markup_html")
-       private byte[] markup;
-       
-       @Column(name = "controller_js")
-       private  byte[] controller;
-       
-       @Column(name = "framework_js")
-       private  byte[] framework;
-
-       @Column(name = "widget_css")
-       private  byte[] css;
-
-       public int getId() {
-               return id;
-       }
-
-       public void setId(int id) {
-               this.id = id;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public void setName(String name) {
-               this.name = name;
-       }
-
-       public byte[] getMarkup() {
-               return markup;
-       }
-
-       public void setMarkup(byte[] markup) {
-               this.markup = markup;
-       }
-
-       public byte[] getController() {
-               return controller;
-       }
-
-       public void setController(byte[] controller) {
-               this.controller = controller;
-       }
-
-       public byte[] getFramework() {
-               return framework;
-       }
-
-       public void setFramework(byte[] framework) {
-               this.framework = framework;
-       }
-
-       public byte[] getCss() {
-               return css;
-       }
-
-       public void setCss(byte[] css) {
-               this.css = css;
-       }
-
-       public long getWidgetId() {
-               return widgetId;
-       }
-
-       public void setWidgetId(long widgetId) {
-               this.widgetId = widgetId;
-       }
-
-       @Override
-       public String toString() {
-               return "WidgetFile [name=" + name + ", widgetId=" + widgetId + "]";
-       }
-       
-       
-    
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageException.java
deleted file mode 100644 (file)
index 80a4f21..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.excetpion;
-
-public class StorageException extends RuntimeException {
-
-       
-       private static final long serialVersionUID = 4142203582273176386L;
-
-       public StorageException(String message) {
-        super(message);
-    }
-
-    public StorageException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/excetpion/StorageFileNotFoundException.java
deleted file mode 100644 (file)
index fc3afe4..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.excetpion;
-
-public class StorageFileNotFoundException extends StorageException {
-
-       private static final long serialVersionUID = -930114778119283188L;
-
-       public StorageFileNotFoundException(String message) {
-        super(message);
-    }
-
-    public StorageFileNotFoundException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}
\ No newline at end of file
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/filters/CorsConfiguration.java
deleted file mode 100644 (file)
index 9d1dd8f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.filters;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpMethod;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-
-@Configuration
-public class CorsConfiguration extends WebSecurityConfigurerAdapter {
-       @Override
-       protected void configure(HttpSecurity http) throws Exception {
-               http.authorizeRequests().antMatchers(HttpMethod.OPTIONS, "/microservices/widgetCatalog/").permitAll();
-               http.csrf().disable();
-       }       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/hibernate/HibernateConfiguration.java
deleted file mode 100644 (file)
index c132a85..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.hibernate;
-
-import java.util.Properties;
-
-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.jpa.JpaTransactionManager;
-import org.springframework.transaction.PlatformTransactionManager;
-
-/**
- * Provides a Hibernate session factory.
- */
-@org.springframework.context.annotation.Configuration
-public class HibernateConfiguration {
-
-       @Autowired
-       private DataSource dataSource;
-
-       @Bean
-       public LocalSessionFactoryBean sessionFactory() {
-
-               LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
-               sessionFactory.setDataSource(dataSource);
-               sessionFactory.setHibernateProperties(hibernateProperties());
-               sessionFactory.setPackagesToScan(new String[] { "org.openecomp.portalapp.widget.domain" });
-               return sessionFactory;
-       }
-
-       private Properties hibernateProperties() {
-        Properties properties = new Properties();
-        properties.put("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
-        properties.put("hibernate.show_sql", "false");
-        return properties;        
-    }
-
-       @Bean
-    public PlatformTransactionManager transactionManager() {
-        return new JpaTransactionManager();
-    }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/listener/WidgetEventListener.java
deleted file mode 100644 (file)
index 04b1dbc..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.listener;
-
-import org.openecomp.portalapp.widget.service.InitializationService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.event.ApplicationReadyEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.stereotype.Component;
-
-@Component
-public class WidgetEventListener implements ApplicationListener<ApplicationReadyEvent>{
-
-       private static final Logger logger = LoggerFactory.getLogger(WidgetEventListener.class);
-       
-       @Autowired
-       InitializationService initializationService;
-       
-       @Value("${initialization.default.widgets}")
-       String init_default_widget;
-       
-       @Override
-       public void onApplicationEvent(ApplicationReadyEvent event) {
-               
-               logger.debug("Listening event " + event.toString());
-               try {
-                       if(Boolean.parseBoolean(init_default_widget))
-                               initializationService.initialize();
-               } catch (Exception e) {
-                       logger.error("onApplicationEvent: InitializationService#initialize failed", e);
-               }
-               
-       }
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/InitializationService.java
deleted file mode 100644 (file)
index a6e9fcb..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-public interface InitializationService {
-       
-       void initialize();
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/MicroserviceService.java
deleted file mode 100644 (file)
index 377ed53..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.MicroserviceParameter;
-
-/**
- * TODO: moved all microservice-related code (domain, controller, service)
- * from ecomp portal Backend to widget microservice
- */
-public interface MicroserviceService {
-       
-       Long saveMicroserivce(MicroserviceData newService);
-       
-       void saveMicroserviceParameter(MicroserviceParameter newParameter);
-       
-       Long getMicroserviceIdByName(String newServiceName);
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/StorageService.java
deleted file mode 100644 (file)
index 7d1fab9..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-import java.io.File;
-import java.io.UnsupportedEncodingException;
-
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.domain.WidgetFile;
-import org.springframework.web.multipart.MultipartFile;
-
-public interface StorageService {
-
-    void deleteWidgetFile(long widgetId);
-    
-    WidgetFile getWidgetFile(long widgetId);
-     
-    String getWidgetMarkup(long widgetId) throws UnsupportedEncodingException;
-    
-    String getWidgetController(long widgetId) throws UnsupportedEncodingException;
-    
-    String getWidgetFramework(long widgetId) throws UnsupportedEncodingException;
-    
-    String getWidgetCSS(long widgetId) throws UnsupportedEncodingException;
-    
-    ValidationRespond checkZipFile(MultipartFile file);
-    
-    void save(MultipartFile file, WidgetCatalog newWidget, long widgetId);
-    
-    void initSave(File file, WidgetCatalog newWidget, long widgetId);
-    
-    void update(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/openecomp/portalapp/widget/service/WidgetCatalogService.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/WidgetCatalogService.java
deleted file mode 100644 (file)
index c8670ba..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service;
-
-import java.util.List;
-
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-
-public interface WidgetCatalogService {
-       
-       List<WidgetCatalog> getWidgetCatalog();
-       
-       List<WidgetCatalog> getUserWidgetCatalog(String loginName);
-
-       WidgetCatalog getWidgetCatalog(Long widgetCatalogId);
-       
-       void deleteWidgetCatalog(long WidgetCatalogId);
-       
-       long saveWidgetCatalog(WidgetCatalog newWidgetCatalog);
-
-       void updateWidgetCatalog(Long widgetCatalogId, WidgetCatalog newWidgetCatalog); 
-       
-       Long getServiceIdByWidget(Long widgetCatalogId);
-       
-       boolean getWidgetIdByName(String newWidgetName);
-       
-       List<WidgetCatalog> getWidgetsByServiceId(Long serviceId);
-       
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/InitializationServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/InitializationServiceImpl.java
deleted file mode 100644 (file)
index 4b0c04f..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.HashSet;
-
-import javax.transaction.Transactional;
-
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.MicroserviceParameter;
-import org.openecomp.portalapp.widget.domain.RoleApp;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.InitializationService;
-import org.openecomp.portalapp.widget.service.MicroserviceService;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-/**
- * Uploads widget zip archives to Portal.
- */
-@Service("initService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class InitializationServiceImpl implements InitializationService {
-
-       private static final String BASIC_AUTH = "Basic Authentication";
-       private static final String PARAMETER_KEY = "resourceType";
-       private static final Logger logger = LoggerFactory.getLogger(InitializationServiceImpl.class);
-
-       @Autowired
-       WidgetCatalogService widgetCatalogService;
-
-       @Autowired
-       StorageService storageService;
-
-       @Autowired
-       MicroserviceService microserviceService;
-
-       @Value("${account.user.name}")
-       String account_user;
-
-       @Value("${account.user.password}")
-       String account_password;
-
-       @Value("${initialization.widgetData.url}")
-       String widgetData_url;
-
-       @Override
-       public void initialize() {
-               initCommonWidget("News");
-               initCommonWidget("Events");
-               initCommonWidget("Resources");
-       }
-
-       private void initCommonWidget(String name) {
-
-               final String newServiceName = name + " Microservice";
-
-               Long serviceId = microserviceService.getMicroserviceIdByName(newServiceName);
-
-               if (serviceId == null) {
-                       MicroserviceData newService = new MicroserviceData();
-                       newService.setName(newServiceName);
-                       newService.setDesc(name);
-                       newService.setAppId(1);
-                       newService.setUrl(widgetData_url);
-                       newService.setSecurityType(BASIC_AUTH);
-                       newService.setUsername(account_user);
-                       newService.setPassword(account_password);
-                       newService.setActive("Y");
-                       serviceId = microserviceService.saveMicroserivce(newService);
-
-                       MicroserviceParameter parameter = new MicroserviceParameter();
-                       parameter.setServiceId(serviceId);
-                       parameter.setPara_key(PARAMETER_KEY);
-                       String parameter_value = null;
-                       switch (name.toLowerCase()) {
-                       case "news":
-                               parameter_value = "NEWS";
-                               break;
-                       case "events":
-                               parameter_value = "EVENTS";
-                               break;
-                       case "resources":
-                               parameter_value = "IMPORTANTRESOURCES";
-                               break;
-                       }
-                       parameter.setPara_value(parameter_value);
-                       microserviceService.saveMicroserviceParameter(parameter);
-               }
-
-               if (!widgetCatalogService.getWidgetIdByName(name)) {
-                       WidgetCatalog newWidget = new WidgetCatalog();
-                       newWidget.setName(name);
-                       newWidget.setDesc(name);
-                       newWidget.setAllowAllUser("1");
-                       String fileLocation = name.toLowerCase() + "-widget.zip";
-                       newWidget.setFileLocation(fileLocation);
-                       newWidget.setServiceId(serviceId);
-                       newWidget.setWidgetRoles(new HashSet<RoleApp>());
-                       long widgetId = widgetCatalogService.saveWidgetCatalog(newWidget);
-
-                       File tmpZipFile = new File("/tmp/" + fileLocation);
-                       InputStream fileInputStream = null;
-                       OutputStream outputStream = null;
-                       try {
-                               fileInputStream = this.getClass().getClassLoader().getResourceAsStream(fileLocation);
-                               outputStream = new FileOutputStream(tmpZipFile);
-                               int read = 0;
-                               byte[] bytes = new byte[4096];
-                               while ((read = fileInputStream.read(bytes)) != -1) {
-                                       outputStream.write(bytes, 0, read);
-                               }
-                               outputStream.close();
-                               fileInputStream.close();
-                       } catch (Exception e) {
-                               logger.error(
-                                               "Exception occurred while performing InitializationServiceImpl.initCommonWidget in widget microservices. Details:", e);
-                       }
-                       storageService.initSave(tmpZipFile, newWidget, widgetId);
-                       tmpZipFile.delete();
-               }
-       }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/MicroserviceServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/MicroserviceServiceImpl.java
deleted file mode 100644 (file)
index bb1e5f6..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
-
-import java.util.List;
-
-import javax.transaction.Transactional;
-
-import org.hibernate.Criteria;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.MicroserviceParameter;
-import org.openecomp.portalapp.widget.service.MicroserviceService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-/**
- * TODO: moved all microservice-related code (domain, controller, service)
- * from ecomp portal Backend to widget microservice
- */
-@Service("microserviceService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class MicroserviceServiceImpl implements MicroserviceService{
-
-       private static final Logger logger = LoggerFactory.getLogger(MicroserviceServiceImpl.class);
-       
-       @Autowired
-       private SessionFactory sessionFactory;
-       
-       @Override
-       public Long saveMicroserivce(MicroserviceData newService) {
-               try{
-                       logger.debug("MicroserviceServiceImpl.saveMicroserivce: microservice={}", newService);
-                       Session session = sessionFactory.openSession();
-                       Transaction tx = session.beginTransaction();            
-                       session.save(newService);
-                       tx.commit();
-                       session.flush();
-                       session.close();
-               }
-               catch(Exception e){
-                       logger.error("Exception occurred while performing MicroserviceServiceImpl.saveMicroserivce in widget microservices. Details:" + e.getMessage());
-               }
-               return newService.getId();
-       }
-
-       @Override
-       public void saveMicroserviceParameter(MicroserviceParameter newParameter) {
-               try{
-                       logger.debug("MicroserviceServiceImpl.saveMicroserviceData: microservice={}", newParameter);
-                       Session session = sessionFactory.openSession();
-                       Transaction tx = session.beginTransaction();            
-                       session.save(newParameter);
-                       tx.commit();
-                       session.flush();
-                       session.close();
-               }
-               catch(Exception e){
-                       logger.error("Exception occurred while performing MicroserviceServiceImpl.saveMicroserviceData in widget microservices. Details:" + e.getMessage());
-               }
-       }
-       
-       @SuppressWarnings("unchecked")
-       @Override
-       public Long getMicroserviceIdByName(String newServiceName) {
-               
-               Session session = sessionFactory.openSession();
-               Criteria criteria = session.createCriteria(MicroserviceData.class)
-                               .add(Restrictions.eq("name", newServiceName))
-                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
-               
-               List<MicroserviceData> services = criteria.list();
-               logger.debug("MicroserviceServiceImpl.getMicroserviceByName: result={}", services);
-               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/openecomp/portalapp/widget/service/impl/StorageServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/StorageServiceImpl.java
deleted file mode 100644 (file)
index 2f7206e..0000000
+++ /dev/null
@@ -1,530 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.hibernate.Criteria;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.widget.constant.WidgetConstant;
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.domain.WidgetFile;
-import org.openecomp.portalapp.widget.excetpion.StorageException;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.openecomp.portalapp.widget.utils.UnzipUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.multipart.MultipartFile;
-
-@Service
-public class StorageServiceImpl implements StorageService {
-
-       private static final Logger logger = LoggerFactory.getLogger(StorageServiceImpl.class);
-
-       @Autowired
-       private SessionFactory sessionFactory;
-
-       @Autowired
-       WidgetCatalogService widgetCatalogService;
-
-       @Override
-       @Transactional
-       public void deleteWidgetFile(long widgetId) {
-               WidgetFile widgetFile = getWidgetFile(widgetId);
-               logger.debug("StorageServiceImpl.deleteWidgetFile: deleting widget file {}", widgetId);
-               if (widgetFile == null) {
-                       logger.debug(
-                                       "StorageServiceImpl.deleteWidgetFile: No widget file found in database while performing StorageServiceImpl.deleteWidgetFile.");
-                       return;
-               }
-               Session session = sessionFactory.getCurrentSession();
-               Transaction tx = session.beginTransaction();
-               session.delete(widgetFile);
-               tx.commit();
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public WidgetFile getWidgetFile(long widgetId) {
-               logger.debug("StorageServiceImpl.getWidgetFile: getting widget file {}", widgetId);
-               WidgetFile widgetFile = null;
-               Session session = sessionFactory.openSession();
-               Criteria criteria = session.createCriteria(WidgetFile.class);
-               criteria.add(Restrictions.eq("widgetId", widgetId));
-               List<WidgetFile> widgetFiles = criteria.list();
-               session.flush();
-               session.close();
-               if (widgetFiles.size() > 0)
-                       widgetFile = widgetFiles.get(0);
-               return widgetFile;
-       }
-
-       @Override
-       public ValidationRespond checkZipFile(MultipartFile file) {
-               StringBuilder error_msg = new StringBuilder();
-               UnzipUtil unzipper = new UnzipUtil();
-               Map<String, byte[]> map;
-               File convFile;
-               boolean isValid = true;
-               if (!file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf('.')).equals(".zip")) {
-                       isValid = false;
-                       error_msg.append(WidgetConstant.VALIDATION_MESSAGE_ZIP);
-                       logger.error("StorageServiceImpl.checkZipFile: invalid file format");
-               }
-               try {
-                       if (file.isEmpty()) {
-                               logger.error(
-                                               "StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
-                               throw new StorageException(
-                                               "StorageServiceImpl.checkZipFile: Failed to store empty file " + file.getOriginalFilename());
-                       }
-                       String fileLocation = file.getOriginalFilename();
-                       logger.debug("StorageServiceImpl.checkZipFile: store the widget to:" + fileLocation);
-                       convFile = new File(fileLocation);
-                       FileOutputStream fos = new FileOutputStream(convFile);
-                       fos.write(file.getBytes());
-                       fos.close();
-                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
-                       convFile.delete();
-               } catch (IOException e) {
-                       logger.error("StorageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);
-                       throw new StorageException(
-                                       "torageServiceImpl.checkZipFile: Failed to store file " + file.getOriginalFilename(), e);
-               }
-
-               for (byte[] b : map.values()) {
-                       if (isValid && b == null) {
-                               isValid = false;
-                               error_msg.append(WidgetConstant.VALIDATION_MESSAGE_FILES);
-                               break;
-                       }
-               }
-               return new ValidationRespond(isValid, error_msg.toString());
-       }
-
-       @Override
-       @Transactional
-       public void save(MultipartFile file, WidgetCatalog newWidget, long widgetId) {
-
-               UnzipUtil unzipper = new UnzipUtil();
-               Map<String, byte[]> map;
-               File convFile;
-               try {
-                       if (file.isEmpty()) {
-                               logger.error("Failed to store empty file " + file.getOriginalFilename());
-                               throw new StorageException("Failed to store empty file " + file.getOriginalFilename());
-                       }
-                       String fileLocation = file.getOriginalFilename();
-                       logger.debug("StorageServiceImpl.save: store the widget to:" + fileLocation);
-                       convFile = new File(fileLocation);
-                       FileOutputStream fos = new FileOutputStream(convFile);
-                       fos.write(file.getBytes());
-                       fos.close();
-                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
-                       convFile.delete();
-               } catch (IOException e) {
-                       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);
-       }
-
-       @Override
-       @Transactional
-       public void initSave(File file, WidgetCatalog newWidget, long widgetId) {
-
-               UnzipUtil unzipper = new UnzipUtil();
-               Map<String, byte[]> map;
-
-               try {
-                       String fileLocation = file.getPath();
-                       logger.debug("StorageServiceImpl.save: store the widget to:" + fileLocation);
-                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
-               } catch (IOException e) {
-                       logger.error("StorageServiceImpl.save: Failed to store file " + file.getName(), e);
-                       throw new StorageException("Failed to store file " + file.getName(), e);
-               }
-               
-               saveHelper(newWidget, widgetId, map);
-       }
-
-       /**
-        * Helper method for saving widget files (controller.js, framework.js,
-        * markup.html and style.css) to ep_widget_catalog_files table in database
-        * 
-        * @param newWidget
-        * @param widgetId
-        * @param map
-        */
-       private void saveHelper(WidgetCatalog newWidget, long widgetId, Map<String, byte[]> map) {
-
-               logger.debug("Going to save widget " + newWidget);
-               WidgetFile widgetFile = new WidgetFile();
-               widgetFile.setName(newWidget.getName());
-               widgetFile.setWidgetId(widgetId);
-
-               InputStream fileInputStream = this.getClass().getClassLoader().getResourceAsStream("framework-template.js");
-
-               String sb = null;
-               try {
-                       byte[] bytes = new byte[fileInputStream.available()];
-                       fileInputStream.read(bytes);
-                       sb = new String(bytes, "UTF-8");
-               } catch (IOException e) {
-                       logger.error("StorageServiceImpl.save: Failed to load framework-template.js file ", e);
-                       e.printStackTrace();
-               } finally {
-                       if (fileInputStream != null) {
-                               try {
-                                       fileInputStream.close();
-                               } catch (IOException e) {
-                                       logger.error("StorageServiceImpl.update: Failed to close the fileInputStream ", e);
-                               }
-                       }
-               }
-
-               String namespace = "Portal" + widgetId + "Widget";
-               String controllerName = "Portal" + widgetId + "Ctrl";
-               String cssName = "portal" + widgetId + "-css-ready";
-               String colorArg1 = "color: #fff";
-               String framework = sb.replaceAll("ARGUMENT1", namespace).replaceAll("ARGUMENT2", controllerName)
-                               .replaceAll("ARGUMENT3", cssName).replaceAll("CSS_ARG1", colorArg1)
-                               .replaceAll("MICROSERVICE_ID", newWidget.getServiceId().toString())
-                               .replaceAll("WIDGET_ID", Long.toString(widgetId));
-
-               widgetFile.setFramework(framework.getBytes());
-
-               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);
-               String functionHeader = javascript.substring(javascript.indexOf("function"), javascript.indexOf(")") + 1);
-               String functionName = functionHeader.substring(functionHeader.indexOf(" "), functionHeader.indexOf("(")).trim();
-               javascript = javascript.replaceFirst(functionName, controllerName);
-               String functionParam = functionHeader.substring(functionHeader.indexOf("(") + 1, functionHeader.indexOf(")"));
-               List<String> paramList = Arrays.asList(functionParam.split(","));
-
-               int left_bracket_index = javascript.indexOf("{") + 1;
-               String widgetData = namespace + "=" + namespace + "||{};" + "var res = " + namespace + ".widgetData;";
-               javascript = javascript.substring(0, left_bracket_index) + widgetData
-                               + javascript.substring(left_bracket_index);
-
-               StringBuilder injectStr = new StringBuilder().append("[");
-               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 = namespace + ".controller = " + javascript + ";" + namespace + ".controller.$inject = "
-                               + injectStr.toString();
-
-               String html = new String(map.get(WidgetConstant.WIDGET_MARKUP_LOCATION)).replaceFirst(functionName,
-                               controllerName);
-               ;
-
-               Pattern cssPattern = Pattern.compile("#.*-css-ready");
-               Matcher cssMatcher = cssPattern.matcher(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION)));
-               if (cssMatcher.find()) {
-                       widgetFile.setCss(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION))
-                                       .replace(cssMatcher.group(0), "#" + cssName).getBytes());
-               }
-
-               widgetFile.setMarkup(html.getBytes());
-               widgetFile.setController(javascript.getBytes());
-               Session session = sessionFactory.openSession();
-               session.save(widgetFile);
-               session.flush();
-               session.close();
-               // sessionFactory.getCurrentSession().save(widgetFile);
-               logger.debug(
-                               "StorageServiceImpl.save: saved fraemwork.js controller.js, markup.html and style.css files to the database for widget {}",
-                               widgetId);
-
-       }
-
-       @Override
-       public void update(MultipartFile file, WidgetCatalog newWidget, long widgetId) {
-               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);
-                       FileOutputStream fos = new FileOutputStream(convFile);
-                       fos.write(file.getBytes());
-                       fos.close();
-                       map = unzipper.unzip_db(fileLocation, ".", "tempWidgets");
-                       convFile.delete();
-               } 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);
-               }
-               WidgetFile widgetFile = getWidgetFile(widgetId);
-
-               InputStream fileInputStream = this.getClass().getClassLoader().getResourceAsStream("framework-template.js");
-               String sb = null;
-               try {
-                       byte[] bytes = new byte[fileInputStream.available()];
-                       fileInputStream.read(bytes);
-                       sb = new String(bytes, "UTF-8");
-               } catch (IOException e) {
-                       logger.error("StorageServiceImpl.save: Failed to load framework-template.js file ", e);
-                       e.printStackTrace();
-               } finally {
-                       if (fileInputStream != null) {
-                               try {
-                                       fileInputStream.close();
-                               } catch (IOException e) {
-                                       logger.error("StorageServiceImpl.update: Failed to close the fileInputStream ", e);
-                                       e.printStackTrace();
-                               }
-                       }
-               }
-
-               String namespace = "Portal" + widgetId + "Widget";
-               String controllerName = "Portal" + widgetId + "Ctrl";
-               String cssName = "portal" + widgetId + "-css-ready";
-               String colorArg1 = "color: #fff";
-               String framework = sb.replaceAll("ARGUMENT1", namespace).replaceAll("ARGUMENT2", controllerName)
-                               .replaceAll("ARGUMENT3", cssName).replaceAll("CSS_ARG1", colorArg1)
-                               .replaceAll("MICROSERVICE_ID", newWidget.getServiceId().toString())
-                               .replaceAll("WIDGET_ID", Long.toString(widgetId));
-               widgetFile.setFramework(framework.getBytes());
-
-               String javascript = new String(map.get(WidgetConstant.WIDGET_CONTROLLER_LOCATION));
-               String functionHeader = javascript.substring(javascript.indexOf("function"), javascript.indexOf(")") + 1);
-               String functionName = functionHeader.substring(functionHeader.indexOf(" "), functionHeader.indexOf("(")).trim();
-               javascript = javascript.replaceFirst(functionName, controllerName);
-               String functionParam = functionHeader.substring(functionHeader.indexOf("(") + 1, functionHeader.indexOf(")"));
-               List<String> paramList = Arrays.asList(functionParam.split(","));
-
-               int left_bracket_index = javascript.indexOf("{") + 1;
-               String widgetData = namespace + "=" + namespace + "||{};" + "var res = " + namespace + ".widgetData;";
-               javascript = javascript.substring(0, left_bracket_index) + widgetData
-                               + javascript.substring(left_bracket_index);
-
-               StringBuilder injectStr = new StringBuilder().append("[");
-               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 = namespace + ".controller = " + javascript + ";" + namespace + ".controller.$inject = "
-                               + injectStr.toString();
-
-               String html = new String(map.get(WidgetConstant.WIDGET_MARKUP_LOCATION)).replaceFirst(functionName,
-                               controllerName);
-               ;
-
-               Pattern cssPattern = Pattern.compile("#.*-css-ready");
-               Matcher cssMatcher = cssPattern.matcher(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION)));
-               if (cssMatcher.find()) {
-                       widgetFile.setCss(new String(map.get(WidgetConstant.WIDGET_STYLE_LOCATION))
-                                       .replace(cssMatcher.group(0), "#" + cssName).getBytes());
-               }
-
-               widgetFile.setMarkup(html.getBytes());
-               widgetFile.setController(javascript.getBytes());
-               // widgetFile.setCss(map.get(WidgetConstant.WIDGET_STYLE_LOCATION));
-               Session session = sessionFactory.openSession();
-               Transaction tx = session.beginTransaction();
-               session.update(widgetFile);
-               tx.commit();
-               session.flush();
-               session.close();
-               logger.debug(
-                               "StorageServiceImpl.save: updated fraemwork.js controller.js, markup.html and style.css files to the database for widget {}",
-                               widgetId);
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public String getWidgetMarkup(long widgetId) throws UnsupportedEncodingException {
-               String markup = null;
-               Session session = sessionFactory.getCurrentSession();
-               Criteria criteria = session.createCriteria(WidgetFile.class);
-               criteria.add(Restrictions.eq("widgetId", widgetId));
-               List<WidgetFile> widgetFile = criteria.list();
-               logger.debug("StorageServiceImpl.getWidgetMarkup: getting widget markup result={}", widgetFile);
-
-               if (widgetFile.size() > 0)
-                       markup = new String(widgetFile.get(0).getMarkup(), "UTF-8");
-               return markup;
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public String getWidgetController(long widgetId) throws UnsupportedEncodingException {
-               String controller = null;
-               Session session = sessionFactory.getCurrentSession();
-               Criteria criteria = session.createCriteria(WidgetFile.class);
-               criteria.add(Restrictions.eq("widgetId", widgetId));
-               List<WidgetFile> widgetFile = criteria.list();
-               logger.debug("StorageServiceImpl.getWidgetController: getting widget controller result={}", widgetFile);
-
-               if (widgetFile.size() > 0)
-                       controller = new String(widgetFile.get(0).getController(), "UTF-8");
-               return controller;
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public String getWidgetFramework(long widgetId) throws UnsupportedEncodingException {
-               String framework = null;
-               Session session = sessionFactory.getCurrentSession();
-               Criteria criteria = session.createCriteria(WidgetFile.class);
-               criteria.add(Restrictions.eq("widgetId", widgetId));
-               List<WidgetFile> widgetFile = criteria.list();
-               logger.debug("StorageServiceImpl.getWidgetFramework: getting widget framework result={}", widgetFile);
-
-               if (widgetFile.size() > 0)
-                       framework = new String(widgetFile.get(0).getFramework(), "UTF-8");
-               return framework;
-       }
-
-       @Override
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public String getWidgetCSS(long widgetId) throws UnsupportedEncodingException {
-               String css = null;
-               Session session = sessionFactory.getCurrentSession();
-               Criteria criteria = session.createCriteria(WidgetFile.class);
-               criteria.add(Restrictions.eq("widgetId", widgetId));
-               List<WidgetFile> widgetFile = criteria.list();
-               logger.debug("StorageServiceImpl.getWidgetCSS: getting widget css result={}", widgetFile);
-
-               if (widgetFile.size() > 0)
-                       css = new String(widgetFile.get(0).getCss(), "UTF-8");
-               return css;
-       }
-
-       @Override
-       @Transactional
-       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");
-               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(), "");
-
-               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();
-               out.write(data, 0, data.length);
-               out.closeEntry();
-               out.close();
-               byte[] result = Files.readAllBytes(Paths.get(f.getPath()));
-               f.delete();
-               return result;
-       }
-
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/service/impl/WidgetCatalogServiceImpl.java
deleted file mode 100644 (file)
index 3becc77..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.service.impl;
-
-import java.util.List;
-import java.util.Set;
-
-import javax.transaction.Transactional;
-
-import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.criterion.Restrictions;
-import org.openecomp.portalapp.widget.domain.MicroserviceData;
-import org.openecomp.portalapp.widget.domain.RoleApp;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-import org.springframework.stereotype.Service;
-
-@Service("widgetCatalogService")
-@Transactional
-@org.springframework.context.annotation.Configuration
-@EnableAspectJAutoProxy
-public class WidgetCatalogServiceImpl implements WidgetCatalogService {
-
-       private static final Logger logger = LoggerFactory.getLogger(WidgetCatalogServiceImpl.class);
-       
-       @Autowired
-       private SessionFactory sessionFactory;
-       
-       @SuppressWarnings("unchecked")
-       @Override
-       @Transactional
-       public List<WidgetCatalog> getWidgetCatalog(){          
-               Session session = sessionFactory.getCurrentSession();
-               Criteria criteria = session.createCriteria(WidgetCatalog.class)
-                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
-               List<WidgetCatalog> widgets = criteria.list();
-               logger.debug("WidgetCatalogServiceImpl.getWidgetCatalog: result={}", widgets);
-               return widgets;
-       }
-       
-       @SuppressWarnings("unchecked")
-       @Transactional
-       public List<WidgetCatalog> getUserWidgetCatalog(String loginName){
-               Session session = sessionFactory.getCurrentSession();
-               StringBuilder sql = new StringBuilder()
-                               
-
-                               .append("  select userWidgets.widget_id, userWidgets.wdg_name, userWidgets.wdg_desc, b.x, b.status_cd, b.y, b.height, b.width  from                                        ") 
-                               .append("  (                                                                                                                                                               ")
-                               .append("  select distinct w.widget_id, w.wdg_name, w.wdg_desc from                                                                                                                                                        ")                    
-                               .append("  ep_widget_catalog w,                                                                                                                                            ")
-                               .append("  ep_widget_catalog_role wr,                                                                                                                                              ")
-                               .append("  fn_user_role ur,                                                                                                                                                                                                                                                                                ")
-                               .append("  fn_app app,                                                                                                                                                                                                                                                                             ")
-                               .append("  fn_user u                                                                                                                                                               ")
-                               .append("  where                                                                                                                                                   ")
-                               .append("  w.widget_id = wr.WIDGET_ID and                                                                                                                                                                                                                                                  ")
-                               .append("  ur.app_id = app.app_id and                                                                                                                                                                                                                                              ")
-                               .append("  app.enabled = 'Y' and                                                                                                                                                                                                                                                   ")
-                               .append("  wr.role_id = ur.role_id and                                                                                                                                                                                                                                             ")                                                                                                            
-                               .append("  ur.user_id = u.user_id and                                                                                                                                                                                                                                              ")                                                                                                              
-                               .append("  u.login_id = '" + loginName + "' and (w.all_user_flag = 'N' or w.all_user_flag is null)                                                                 ")                   
-                               .append("                                                                                                                                                              ") 
-                               .append("       union all                                                                                                                                              ") 
-                               .append("                                                                                                                                                              ") 
-                               .append("                                                                                                                                                              ") 
-                               .append("  select distinct w.widget_id, w.wdg_name, w.wdg_desc from                                                                                                                        ") 
-                               .append("       ep_widget_catalog w                                                                                                                                    ") 
-                               .append("       where w.all_user_flag = 'Y'                                                                                                                            ") 
-                               .append("                                                                                                                                                              ") 
-                               .append("        ) userWidgets                                                                                                                                         ") 
-                               .append("                                                                                                                                                              ") 
-                               .append("  left join                                                                                                                                               ") 
-                               .append("                                                                                                                                                              ") 
-                               .append("  (                                                                                                                                                       ") 
-                               .append("               select case when pers.user_id is null then sel.user_id else pers.user_id end as 'user_id', case when sel.widget_id is null then                    ") 
-                               .append("                       pers.widget_id else sel.widget_id end as  'widget_id', pers.x, sel.status_cd, pers.y, pers.height, pers.width                                  ") 
-                               .append("                               from (select * from ep_pers_user_widget_placement where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) pers ") 
-                               .append("                                       left outer join                                                                                                                        ") 
-                               .append("                               (select * from ep_pers_user_widget_sel where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) sel             ") 
-                               .append("               on (pers.user_id = sel.user_id and pers.widget_id = sel.widget_id)                                                                                 ") 
-                               .append("                                                                                                                                                                      ") 
-                               .append("               union                                                                                                                                              ") 
-                               .append("                                                                                                                                                                      ") 
-                               .append("                select case when pers.user_id is null then sel.user_id else pers.user_id end as 'user_id',  case when sel.widget_id is null                       ") 
-                               .append("                       then pers.widget_id else sel.widget_id end as  'widget_id', pers.x, sel.status_cd, pers.y, pers.height, pers.width                             ") 
-                               .append("                               from (select * from ep_pers_user_widget_placement where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) pers ") 
-                               .append("                                       right outer join                                                                                                                       ") 
-                               .append("                               (select * from ep_pers_user_widget_sel where user_id = (select user_id from fn_user where login_id = '" + loginName + "')) sel             ") 
-                               .append("               on (pers.user_id = sel.user_id and pers.widget_id = sel.widget_id)                                                                                 ") 
-                               .append("                                                                                                                                                                  ") 
-                               .append("                order by user_id, widget_id                                                                                                                       ") 
-                               .append(" )b                                                                                                                                                       ") 
-                               .append("  on                                                                                                                                                      ") 
-                               .append("  (userWidgets.widget_id = b.widget_id) order by b.x;                                                                                                     ");  
-                               
-                               
-                               
-               Query query = session.createSQLQuery(sql.toString());
-               List<WidgetCatalog> widgets = query.list();
-               logger.debug("WidgetCatalogServiceImpl.getUserWidgetCatalog: result size={}", widgets);
-               return widgets;         
-       }
-
-       @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
-       public void deleteWidgetCatalog(long widgetCatalogId) {
-               logger.debug("WidgetCatalogServiceImpl.deleteWidgetCatalog: deleting the widget with widgetId={}", widgetCatalogId);
-               WidgetCatalog widget = getWidgetCatalog(widgetCatalogId);
-               if (widget == null){
-                       logger.error("No widget found in database while performing WidgetCatalogServiceImpl.deleteWidgetCatalog.");
-                       return;
-               }
-               Session session = sessionFactory.getCurrentSession();
-               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);
-               query.executeUpdate();
-               query = session.createSQLQuery("delete from ep_widget_catalog_files where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId);
-               query.executeUpdate();
-               query = session.createSQLQuery("delete from ep_widget_catalog_parameter where widget_id = :widgetId ").setParameter("widgetId", widgetCatalogId);
-               query.executeUpdate();
-               session.delete(widget);
-               tx.commit();
-       }
-       
-       @Override
-       public long saveWidgetCatalog(WidgetCatalog newWidgetCatalog) {
-               
-               try{
-                       if(newWidgetCatalog.getAllowAllUser().equals("1"))
-                               newWidgetCatalog.setAllowAllUser("Y");
-                       else
-                               newWidgetCatalog.setAllowAllUser("N");
-                       
-                       logger.debug("WidgetCatalogServiceImpl.saveWidgetCatalog: widget={}", newWidgetCatalog);
-                       Session session = sessionFactory.openSession();
-                       Transaction tx = session.beginTransaction();            
-                       session.save(newWidgetCatalog);
-                       tx.commit();
-                       session.flush();
-                       session.close();
-                       updateAppId(newWidgetCatalog.getId(), newWidgetCatalog.getWidgetRoles());
-               }
-               catch(Exception e){
-                       logger.error("Exception occurred while performing WidgetCatalogServiceImpl.saveWidgetCatalog in widget microservices. Details:" + e.getMessage());
-               }
-               return newWidgetCatalog.getId();
-       }
-
-       @Override
-       public void updateWidgetCatalog(Long widgetCatalogId, WidgetCatalog newWidgetCatalog) {
-               logger.debug("WidgetCatalogServiceImpl.updateWidgetCatalog: widget={}", newWidgetCatalog);
-               WidgetCatalog oldWidget = getWidgetCatalog(widgetCatalogId);
-               try{
-                       if (newWidgetCatalog.getAllowAllUser().equals("1")) 
-                               newWidgetCatalog.setAllowAllUser("Y");
-                       else 
-                               newWidgetCatalog.setAllowAllUser("N");
-                       
-                       newWidgetCatalog.setId(widgetCatalogId);
-                       newWidgetCatalog.setServiceId(oldWidget.getServiceId());
-                       Session session = sessionFactory.openSession();
-                       Transaction tx = session.beginTransaction();
-                       session.update(newWidgetCatalog);
-                       tx.commit();
-                       session.flush();
-                       session.close();
-                       updateAppId(newWidgetCatalog.getId(), newWidgetCatalog.getWidgetRoles());
-               }catch(Exception e){
-                       logger.error("Exception occurred while performing WidgetCatalogServiceImpl.updateWidgetCatalog in widget microservices. Details:" + e.getMessage());
-               }
-               
-       }       
-       
-       @Override
-       public Long getServiceIdByWidget(Long widgetCatalogId) {
-               Session session = sessionFactory.getCurrentSession();
-               WidgetCatalog widget = (WidgetCatalog) session.get(WidgetCatalog.class, widgetCatalogId);
-               logger.debug("WidgetCatalogServiceImpl.getServiceIdByWidget: result={}", widget);
-               return widget.getServiceId();
-       }
-       
-       @Override
-       public List<WidgetCatalog> getWidgetsByServiceId(Long serviceId) {
-               Session session = sessionFactory.getCurrentSession();
-               Criteria criteria = session.createCriteria(WidgetCatalog.class)
-                               .add(Restrictions.eq("serviceId", serviceId))
-                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
-               List<WidgetCatalog> widgets = criteria.list();
-               logger.debug("WidgetCatalogServiceImpl.getWidgetCatalog: result={}", widgets);
-               return widgets;
-       }
-       
-       
-       
-       
-       
-       private void updateAppId(long widgetId, Set<RoleApp> roles){
-               Session session = sessionFactory.openSession();
-               for(RoleApp role: roles){
-                       String sql = "UPDATE ep_widget_catalog_role SET app_id = " + role.getApp().getAppId() + " WHERE widget_id = " + widgetId + " AND ROLE_ID = " + role.getRoleId() ;
-                       Query query = session.createSQLQuery(sql);
-                       query.executeUpdate();
-               }
-               session.flush();
-               session.close();
-       }
-
-       @Override
-       public boolean getWidgetIdByName(String newWidgetName) {
-               Session session = sessionFactory.openSession();
-               Criteria criteria = session.createCriteria(WidgetCatalog.class)
-                               .add(Restrictions.eq("name", newWidgetName))
-                               .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
-               
-               List<MicroserviceData> widgets = criteria.list();
-               logger.debug("WidgetCatalogServiceImpl.getWidgetIdByName: result={}", widgets);
-               session.flush();
-               session.close();
-               
-               return (widgets.size() > 0) ? true : false;
-       }
-
-       
-}
-
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/AuthorizationUtil.java
deleted file mode 100644 (file)
index 2711c3d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.utils;
-
-import java.nio.charset.Charset;
-import java.util.Base64;
-
-public class AuthorizationUtil {
-
-       public boolean authorization(String auth, String security_user, String security_pass){
-               if (auth != null && auth.startsWith("Basic")) {         
-               String base64Credentials = auth.substring("Basic".length()).trim();
-               String credentials = new String(Base64.getDecoder().decode(base64Credentials),
-                       Charset.forName("UTF-8"));
-               final String[] values = credentials.split(":",2);
-               if(security_user.equals(values[0]) && security_pass.equals(values[1]))
-                       return true;
-               }
-               return false;
-       }
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/UnzipUtil.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/openecomp/portalapp/widget/utils/UnzipUtil.java
deleted file mode 100644 (file)
index edf35d5..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.utils;
-
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Stack;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.openecomp.portalapp.widget.constant.WidgetConstant;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class UnzipUtil {
-
-       /**
-        * Size of the buffer to read/write data
-        */
-       private static final int BUFFER_SIZE = 4096;
-       private static final Logger logger = LoggerFactory.getLogger(UnzipUtil.class);
-
-       /**
-        * Extracts a zip file specified by the zipFilePath to a directory specified by
-        * destDirectory (will be created if does not exists)
-        * 
-        * @param zipFilePath
-        *            path
-        * @param destDirectory
-        *            directory
-        * @param widgetName
-        *            name
-        * @return Map of contents
-        * @throws IOException
-        *             On error
-        */
-       public Map<String, byte[]> unzip_db(String zipFilePath, String destDirectory, String widgetName)
-                       throws IOException {
-
-               logger.debug("UnzipUtil.unzip_db: unzip widget file {}", widgetName);
-               File destDir = new File(destDirectory);
-               if (!destDir.exists())
-                       destDir.mkdir();
-               ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath));
-               ZipEntry entry = zipIn.getNextEntry();
-               Map<String, byte[]> map = new HashMap<>();
-
-               String[] requiredKeys = { WidgetConstant.WIDGET_CONTROLLER_LOCATION, WidgetConstant.WIDGET_MARKUP_LOCATION,
-                               WidgetConstant.WIDGET_STYLE_LOCATION };
-               for (String k : requiredKeys)
-                       map.put(k, null);
-
-               // iterates over entries in the zip file
-               Stack<File> stack = new Stack<>();
-               while (entry != null) {
-                       String filePath = destDirectory + File.separator + widgetName + File.separator
-                                       + entry.getName().substring(entry.getName().indexOf("/") + 1);
-                       final String entryShortName = entry.getName().substring(entry.getName().indexOf("/") + 1);
-                       logger.debug("UnzipUtil.unzip_db: file path {}, short name {}", filePath, entryShortName);
-                       if (!entry.isDirectory()) {
-                               // if the entry is a file, extracts it
-                               logger.debug("UnzipUtil.unzip_db: unzip and save widget file {}", filePath);
-                               stack.push(new File(filePath));
-                               extractFile(zipIn, filePath);
-                       } else {
-                               // if the entry is a directory, make the directory
-                               logger.debug("UnzipUtil.unzip_db: unzip and create widget folder {}", filePath);
-                               File dir = new File(filePath);
-                               stack.push(new File(filePath));
-                               dir.mkdir();
-                       }
-                       // Is this one we need?
-                       if (map.containsKey(entryShortName))
-                               map.put(entryShortName, Files.readAllBytes(Paths.get(filePath)));
-                       zipIn.closeEntry();
-                       entry = zipIn.getNextEntry();
-               }
-               zipIn.close();
-               while (!stack.isEmpty())
-                       stack.pop().delete();
-
-               for (String k : requiredKeys)
-                       if (!map.containsKey(k))
-                               logger.warn("UnzipUtil.unzip_db: no zip archive entry found for required key {}", k);
-
-               return map;
-       }
-
-       /**
-        * Extracts a zip entry (file entry)
-        * 
-        * @param zipIn
-        * @param filePath
-        * @throws IOException
-        */
-       private void extractFile(ZipInputStream zipIn, String filePath) throws IOException {
-               BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
-               byte[] bytesIn = new byte[BUFFER_SIZE];
-               int read = 0;
-               while ((read = zipIn.read(bytesIn)) != -1) {
-                       bos.write(bytesIn, 0, read);
-               }
-               bos.close();
-       }
-}
\ No newline at end of file
index 204a659..e19367f 100644 (file)
                </rollingPolicy>
        </appender> 
        
                </rollingPolicy>
        </appender> 
        
-       <logger name="org.openecomp.portalapp.widget" level="debug" additivity="false">
+       <logger name="org.onap.portalapp.widget" level="debug" additivity="false">
                <appender-ref ref="ERROR" />
                <appender-ref ref="DEBUG" />
                <appender-ref ref="APPLICATION" />
                <appender-ref ref="ERROR" />
                <appender-ref ref="DEBUG" />
                <appender-ref ref="APPLICATION" />
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetFileControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/controller/WidgetFileControllerTest.java
new file mode 100644 (file)
index 0000000..db6ddc3
--- /dev/null
@@ -0,0 +1,74 @@
+package org.onap.portalapp.widget.test.controller;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.times;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.portalapp.widget.controller.DatabaseFileUploadController;
+import org.onap.portalapp.widget.service.impl.StorageServiceImpl;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.setup.MockMvcBuilders;
+
+
+@RunWith(MockitoJUnitRunner.class)
+public class WidgetFileControllerTest {
+       private MockMvc mockMvc;
+       
+       @Mock
+       private StorageServiceImpl storageService;
+       
+       @InjectMocks
+       private DatabaseFileUploadController controller;
+       
+       @Before
+       public void setUp() {
+               MockitoAnnotations.initMocks(this);
+               mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
+       }
+       
+       @Test
+       public void getWidgetMarkup_NoError() throws Exception{
+               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
+               Long widgetId = new Long(1);
+               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/markup/" + widgetId)).andReturn();;
+               Mockito.verify(storageService, times(1)).getWidgetMarkup(storageServiceArg.capture());
+               assertEquals(storageServiceArg.getValue(), widgetId);
+       }
+       
+       @Test
+       public void getWidgetController_NoError() throws Exception{
+               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
+               Long widgetId = new Long(1);
+               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/" + widgetId + "/controller.js")).andReturn();;
+               Mockito.verify(storageService, times(1)).getWidgetController(storageServiceArg.capture());
+               assertEquals(storageServiceArg.getValue(), widgetId);
+       }
+       
+       @Test
+       public void getWidgetFramework_NoError() throws Exception{
+               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
+               Long widgetId = new Long(1);
+               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/" + widgetId + "/framework.js")).andReturn();;
+               Mockito.verify(storageService, times(1)).getWidgetFramework(storageServiceArg.capture());
+               assertEquals(storageServiceArg.getValue(), widgetId);
+       }
+       
+       @Test
+       public void getWidgetCSS_NoError() throws Exception{
+               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
+               Long widgetId = new Long(1);
+               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/" + widgetId + "/styles.css")).andReturn();;
+               Mockito.verify(storageService, times(1)).getWidgetCSS(storageServiceArg.capture());
+               assertEquals(storageServiceArg.getValue(), widgetId);
+       }
+       
+}
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
new file mode 100644 (file)
index 0000000..cf3d6ce
--- /dev/null
@@ -0,0 +1,195 @@
+package org.onap.portalapp.widget.test.controller;
+
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.times;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.codec.binary.Base64;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.portalapp.widget.controller.WidgetsCatalogController;
+import org.onap.portalapp.widget.domain.ValidationRespond;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.StorageService;
+import org.onap.portalapp.widget.service.WidgetCatalogService;
+import org.springframework.http.MediaType;
+import org.springframework.test.util.ReflectionTestUtils;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+import org.springframework.test.web.servlet.setup.MockMvcBuilders;
+import org.springframework.web.multipart.MultipartFile;
+
+@RunWith(MockitoJUnitRunner.class)
+public class WidgetsCatalogControllerTest {
+
+       private MockMvc mockMvc;
+       
+       @Mock
+       private WidgetCatalogService widgetService;
+       
+       @Mock
+       private StorageService storageService;
+       
+       @InjectMocks
+       private WidgetsCatalogController controller;
+       
+       @Before
+       public void setUp() {
+               MockitoAnnotations.initMocks(this);
+               mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
+       }
+       
+       @Test
+       public void getWidgetCatalog_ValidAuthorization_NoError() throws Exception {    
+               List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
+               WidgetCatalog widget = new WidgetCatalog();
+               widget.setId(1);
+               widget.setName("junit");
+               list.add(widget);
+               Mockito.when(widgetService.getWidgetCatalog()).thenReturn(list);
+               
+               String security_user = "user";
+               String security_pass = "password";
+               
+               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
+               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
+               
+               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
+               mockMvc.perform(get("/microservices/widgetCatalog/").header("Authorization", basic_auth))
+               .andExpect(status().isOk())
+               .andExpect(jsonPath("$[0].id", is(1)))
+               .andExpect(jsonPath("$[0].name", is("junit")));
+       }
+         
+       @Test
+       public void getWidgetCatalog_InValidAuthorization_Unauthorized() throws Exception {     
+
+               String security_user = "user";
+               String security_pass = "password";
+               String wrong_pass = "wrong";
+               
+               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
+               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
+               
+               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + wrong_pass).getBytes()));
+               mockMvc.perform(get("/microservices/widgetCatalog/").header("Authorization", basic_auth))
+               .andExpect(status().isUnauthorized());
+       }
+       
+       @Test
+       public void getWidgetCatalog_NoAuthorization_BadRequest() throws Exception {    
+               List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
+               WidgetCatalog widget = new WidgetCatalog();
+               list.add(widget);
+               Mockito.when(widgetService.getWidgetCatalog()).thenReturn(list);
+               
+               mockMvc.perform(get("/microservices/widgetCatalog/"))
+               .andExpect(status().isBadRequest());
+       }
+       
+       
+       @Test
+       public void saveWidgetCatalog_ValidAuthorization_NoError() throws Exception {   
+               ValidationRespond respond = new ValidationRespond(true, null);
+               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
+               
+               String security_user = "user";
+               String security_pass = "password";
+               
+               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
+               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
+               
+               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
+               mockMvc.perform(MockMvcRequestBuilders.fileUpload("/microservices/widgetCatalog/").file("file", null)
+                               .param("widget", "{}")
+                               .header("Authorization", basic_auth)
+                               .contentType(MediaType.MULTIPART_FORM_DATA))
+               .andExpect(jsonPath("$.valid", is(true)));
+               
+               Mockito.verify(widgetService, times(1)).saveWidgetCatalog(any(WidgetCatalog.class));
+       }
+       
+       
+       @Test
+       public void updateWidgetCatalog_ValidAuthorization_NoError() throws Exception { 
+               String security_user = "user"; 
+               String security_pass = "password";
+               Long widgetId = new Long(1);
+               ArgumentCaptor<Long> widgetServiceArg = ArgumentCaptor.forClass(Long.class);
+               
+               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
+               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
+               
+               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
+               mockMvc.perform(put("/microservices/widgetCatalog/" + widgetId).contentType(MediaType.APPLICATION_JSON).content("{}").header("Authorization", basic_auth));
+               
+               Mockito.verify(widgetService, times(1)).updateWidgetCatalog(widgetServiceArg.capture(), any(WidgetCatalog.class));
+               assertEquals(widgetServiceArg.getValue(), widgetId);
+       }
+       
+       
+       @Test
+       public void updateWidgetCatalogwithFiles_ValidAuthorization_NoError() throws Exception {
+               ValidationRespond respond = new ValidationRespond(true, null);
+               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
+               
+               String security_user = "user";
+               String security_pass = "password";
+               Long widgetId = new Long(1);
+               ArgumentCaptor<Long> widgetServiceArg = ArgumentCaptor.forClass(Long.class);
+               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
+               
+               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
+               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
+               
+               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
+               mockMvc.perform(MockMvcRequestBuilders.fileUpload("/microservices/widgetCatalog/" + widgetId).file("file", null)
+                               .param("widget", "{}")
+                               .header("Authorization", basic_auth)
+                               .contentType(MediaType.MULTIPART_FORM_DATA))
+               .andExpect(jsonPath("$.valid", is(true)));
+               
+               Mockito.verify(widgetService, times(1)).updateWidgetCatalog(widgetServiceArg.capture(), any(WidgetCatalog.class));
+               assertEquals(widgetServiceArg.getValue(), widgetId);
+       }
+       
+       @Test
+       public void deleteOnboardingWidget_ValidAuthorization_NoError() throws Exception {
+               
+               String security_user = "user";
+               String security_pass = "password";
+               Long widgetId = new Long(1);
+               
+               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
+               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
+               
+               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
+               mockMvc.perform(MockMvcRequestBuilders.delete("/microservices/widgetCatalog/" + widgetId)
+                               .header("Authorization", basic_auth));
+               ArgumentCaptor<Long> widgetServiceArg = ArgumentCaptor.forClass(Long.class);
+               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
+               
+               Mockito.verify(widgetService, times(1)).deleteWidgetCatalog(widgetServiceArg.capture());
+               assertEquals(widgetServiceArg.getValue(), widgetId);
+               Mockito.verify(storageService, times(1)).deleteWidgetFile(storageServiceArg.capture());
+               assertEquals(storageServiceArg.getValue(), widgetId);
+       }
+       
+       
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/service/WidgetCatalogServiceTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/onap/portalapp/widget/test/service/WidgetCatalogServiceTest.java
new file mode 100644 (file)
index 0000000..9076884
--- /dev/null
@@ -0,0 +1,124 @@
+package org.onap.portalapp.widget.test.service;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.MockitoAnnotations;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.portalapp.widget.domain.RoleApp;
+import org.onap.portalapp.widget.domain.WidgetCatalog;
+import org.onap.portalapp.widget.service.impl.WidgetCatalogServiceImpl;
+
+
+@RunWith(MockitoJUnitRunner.class)
+public class WidgetCatalogServiceTest {
+       
+       @Mock
+       private SessionFactory mockedSessionFactory;
+
+       @InjectMocks
+       private WidgetCatalogServiceImpl widgetCatalogService;
+
+       @Before
+       public void setUp() {
+               MockitoAnnotations.initMocks(this);
+       }
+       
+       @Test
+       public void getWidgetCatalog_NoError() throws Exception{
+               Session mockedSession = Mockito.mock(Session.class);
+               Criteria mockedCriteria = Mockito.mock(Criteria.class);
+               
+               List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
+               WidgetCatalog widget = new WidgetCatalog();
+               widget.setId(1);
+               widget.setName("junit");
+               list.add(widget);
+               
+               Mockito.when(mockedSessionFactory.getCurrentSession()).thenReturn(mockedSession);
+               Mockito.when(mockedSession.createCriteria(WidgetCatalog.class)).thenReturn(mockedCriteria);
+               Mockito.when(mockedCriteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)).thenReturn(mockedCriteria);
+               Mockito.when(mockedCriteria.list()).thenReturn(list);
+               
+               List<WidgetCatalog> result = widgetCatalogService.getWidgetCatalog();
+               assertNotNull(result);
+               assertEquals(result, list);
+       }
+       
+       
+       @Test
+       public void saveWidgetCatalog_NoError() throws Exception{
+               Set<RoleApp> set = new HashSet<RoleApp>();
+               WidgetCatalog widget = new WidgetCatalog();
+               widget.setId(1);
+               widget.setName("junit");
+               widget.setAllowAllUser("1");
+               widget.setWidgetRoles(set);
+               
+               Session mockedSession = Mockito.mock(Session.class);
+               Transaction mockedTransaction = Mockito.mock(Transaction.class);
+               Mockito.when(mockedSessionFactory.openSession()).thenReturn(mockedSession);
+               Mockito.when(mockedSession.beginTransaction()).thenReturn(mockedTransaction);
+               long widgetId = widgetCatalogService.saveWidgetCatalog(widget);
+               assertNotNull(widgetId);
+               assertEquals(widgetId, 1);
+       }
+       
+       @Rule public ExpectedException thrown = ExpectedException.none();
+       
+       
+       @Test
+       public void deleteWidgetCatalog_NoError() throws Exception{
+               long widgetId =1 ;
+               WidgetCatalog widget = new WidgetCatalog();
+               widget.setId(1);
+               widget.setName("junit");
+
+               Session mockedSession = Mockito.mock(Session.class, RETURNS_DEEP_STUBS);
+               Transaction mockedTransaction = Mockito.mock(Transaction.class);
+               
+               Mockito.when(mockedSessionFactory.getCurrentSession()).thenReturn(mockedSession);
+               Mockito.when(mockedSession.beginTransaction()).thenReturn(mockedTransaction);
+               Mockito.when(mockedSession.get(WidgetCatalog.class, widgetId)).thenReturn(widget);
+               
+               widgetCatalogService.deleteWidgetCatalog(widgetId);
+       }
+       
+       @Test
+       public void updateWidgetCatalog_NoError() throws Exception{
+               long widgetId =1 ;
+               WidgetCatalog widget = new WidgetCatalog();
+               widget.setId(1);
+               widget.setName("junit");
+
+               Session mockedSession = Mockito.mock(Session.class, RETURNS_DEEP_STUBS);
+               Transaction mockedTransaction = Mockito.mock(Transaction.class);
+               
+               Mockito.when(mockedSessionFactory.getCurrentSession()).thenReturn(mockedSession);
+               Mockito.when(mockedSession.beginTransaction()).thenReturn(mockedTransaction);
+               Mockito.when(mockedSession.get(WidgetCatalog.class, widgetId)).thenReturn(widget);
+               
+               widgetCatalogService.deleteWidgetCatalog(widgetId);
+       }
+       
+       
+}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetFileControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetFileControllerTest.java
deleted file mode 100644 (file)
index 0ff2c57..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.test.controller;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.times;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.widget.controller.DatabaseFileUploadController;
-import org.openecomp.portalapp.widget.service.impl.StorageServiceImpl;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-
-
-@RunWith(MockitoJUnitRunner.class)
-public class WidgetFileControllerTest {
-       private MockMvc mockMvc;
-       
-       @Mock
-       private StorageServiceImpl storageService;
-       
-       @InjectMocks
-       private DatabaseFileUploadController controller;
-       
-       @Before
-       public void setUp() {
-               MockitoAnnotations.initMocks(this);
-               mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
-       }
-       
-       @Test
-       public void getWidgetMarkup_NoError() throws Exception{
-               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
-               Long widgetId = new Long(1);
-               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/markup/" + widgetId)).andReturn();;
-               Mockito.verify(storageService, times(1)).getWidgetMarkup(storageServiceArg.capture());
-               assertEquals(storageServiceArg.getValue(), widgetId);
-       }
-       
-       @Test
-       public void getWidgetController_NoError() throws Exception{
-               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
-               Long widgetId = new Long(1);
-               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/" + widgetId + "/controller.js")).andReturn();;
-               Mockito.verify(storageService, times(1)).getWidgetController(storageServiceArg.capture());
-               assertEquals(storageServiceArg.getValue(), widgetId);
-       }
-       
-       @Test
-       public void getWidgetFramework_NoError() throws Exception{
-               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
-               Long widgetId = new Long(1);
-               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/" + widgetId + "/framework.js")).andReturn();;
-               Mockito.verify(storageService, times(1)).getWidgetFramework(storageServiceArg.capture());
-               assertEquals(storageServiceArg.getValue(), widgetId);
-       }
-       
-       @Test
-       public void getWidgetCSS_NoError() throws Exception{
-               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
-               Long widgetId = new Long(1);
-               mockMvc.perform(MockMvcRequestBuilders.get("/microservices/" + widgetId + "/styles.css")).andReturn();;
-               Mockito.verify(storageService, times(1)).getWidgetCSS(storageServiceArg.capture());
-               assertEquals(storageServiceArg.getValue(), widgetId);
-       }
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/controller/WidgetsCatalogControllerTest.java
deleted file mode 100644 (file)
index 3d728c9..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.test.controller;
-
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.times;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.codec.binary.Base64;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.widget.controller.WidgetsCatalogController;
-import org.openecomp.portalapp.widget.domain.ValidationRespond;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.StorageService;
-import org.openecomp.portalapp.widget.service.WidgetCatalogService;
-import org.springframework.http.MediaType;
-import org.springframework.test.util.ReflectionTestUtils;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.multipart.MultipartFile;
-
-@RunWith(MockitoJUnitRunner.class)
-public class WidgetsCatalogControllerTest {
-
-       private MockMvc mockMvc;
-       
-       @Mock
-       private WidgetCatalogService widgetService;
-       
-       @Mock
-       private StorageService storageService;
-       
-       @InjectMocks
-       private WidgetsCatalogController controller;
-       
-       @Before
-       public void setUp() {
-               MockitoAnnotations.initMocks(this);
-               mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
-       }
-       
-       @Test
-       public void getWidgetCatalog_ValidAuthorization_NoError() throws Exception {    
-               List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
-               WidgetCatalog widget = new WidgetCatalog();
-               widget.setId(1);
-               widget.setName("junit");
-               list.add(widget);
-               Mockito.when(widgetService.getWidgetCatalog()).thenReturn(list);
-               
-               String security_user = "user";
-               String security_pass = "password";
-               
-               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
-               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
-               
-               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
-               mockMvc.perform(get("/microservices/widgetCatalog/").header("Authorization", basic_auth))
-               .andExpect(status().isOk())
-               .andExpect(jsonPath("$[0].id", is(1)))
-               .andExpect(jsonPath("$[0].name", is("junit")));
-       }
-         
-       @Test
-       public void getWidgetCatalog_InValidAuthorization_Unauthorized() throws Exception {     
-
-               String security_user = "user";
-               String security_pass = "password";
-               String wrong_pass = "wrong";
-               
-               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
-               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
-               
-               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + wrong_pass).getBytes()));
-               mockMvc.perform(get("/microservices/widgetCatalog/").header("Authorization", basic_auth))
-               .andExpect(status().isUnauthorized());
-       }
-       
-       @Test
-       public void getWidgetCatalog_NoAuthorization_BadRequest() throws Exception {    
-               List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
-               WidgetCatalog widget = new WidgetCatalog();
-               list.add(widget);
-               Mockito.when(widgetService.getWidgetCatalog()).thenReturn(list);
-               
-               mockMvc.perform(get("/microservices/widgetCatalog/"))
-               .andExpect(status().isBadRequest());
-       }
-       
-       
-       @Test
-       public void saveWidgetCatalog_ValidAuthorization_NoError() throws Exception {   
-               ValidationRespond respond = new ValidationRespond(true, null);
-               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
-               
-               String security_user = "user";
-               String security_pass = "password";
-               
-               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
-               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
-               
-               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
-               mockMvc.perform(MockMvcRequestBuilders.fileUpload("/microservices/widgetCatalog/").file("file", null)
-                               .param("widget", "{}")
-                               .header("Authorization", basic_auth)
-                               .contentType(MediaType.MULTIPART_FORM_DATA))
-               .andExpect(jsonPath("$.valid", is(true)));
-               
-               Mockito.verify(widgetService, times(1)).saveWidgetCatalog(any(WidgetCatalog.class));
-       }
-       
-       
-       @Test
-       public void updateWidgetCatalog_ValidAuthorization_NoError() throws Exception { 
-               String security_user = "user"; 
-               String security_pass = "password";
-               Long widgetId = new Long(1);
-               ArgumentCaptor<Long> widgetServiceArg = ArgumentCaptor.forClass(Long.class);
-               
-               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
-               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
-               
-               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
-               mockMvc.perform(put("/microservices/widgetCatalog/" + widgetId).contentType(MediaType.APPLICATION_JSON).content("{}").header("Authorization", basic_auth));
-               
-               Mockito.verify(widgetService, times(1)).updateWidgetCatalog(widgetServiceArg.capture(), any(WidgetCatalog.class));
-               assertEquals(widgetServiceArg.getValue(), widgetId);
-       }
-       
-       
-       @Test
-       public void updateWidgetCatalogwithFiles_ValidAuthorization_NoError() throws Exception {
-               ValidationRespond respond = new ValidationRespond(true, null);
-               Mockito.when(storageService.checkZipFile(any(MultipartFile.class))).thenReturn(respond);
-               
-               String security_user = "user";
-               String security_pass = "password";
-               Long widgetId = new Long(1);
-               ArgumentCaptor<Long> widgetServiceArg = ArgumentCaptor.forClass(Long.class);
-               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
-               
-               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
-               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
-               
-               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
-               mockMvc.perform(MockMvcRequestBuilders.fileUpload("/microservices/widgetCatalog/" + widgetId).file("file", null)
-                               .param("widget", "{}")
-                               .header("Authorization", basic_auth)
-                               .contentType(MediaType.MULTIPART_FORM_DATA))
-               .andExpect(jsonPath("$.valid", is(true)));
-               
-               Mockito.verify(widgetService, times(1)).updateWidgetCatalog(widgetServiceArg.capture(), any(WidgetCatalog.class));
-               assertEquals(widgetServiceArg.getValue(), widgetId);
-       }
-       
-       @Test
-       public void deleteOnboardingWidget_ValidAuthorization_NoError() throws Exception {
-               
-               String security_user = "user";
-               String security_pass = "password";
-               Long widgetId = new Long(1);
-               
-               ReflectionTestUtils.setField(controller, "security_user", security_user, String.class);
-               ReflectionTestUtils.setField(controller, "security_pass", security_pass, String.class);
-               
-               String basic_auth = "Basic " + new String(Base64.encodeBase64((security_user + ":" + security_pass).getBytes()));
-               mockMvc.perform(MockMvcRequestBuilders.delete("/microservices/widgetCatalog/" + widgetId)
-                               .header("Authorization", basic_auth));
-               ArgumentCaptor<Long> widgetServiceArg = ArgumentCaptor.forClass(Long.class);
-               ArgumentCaptor<Long> storageServiceArg = ArgumentCaptor.forClass(Long.class);
-               
-               Mockito.verify(widgetService, times(1)).deleteWidgetCatalog(widgetServiceArg.capture());
-               assertEquals(widgetServiceArg.getValue(), widgetId);
-               Mockito.verify(storageService, times(1)).deleteWidgetFile(storageServiceArg.capture());
-               assertEquals(storageServiceArg.getValue(), widgetId);
-       }
-       
-       
-}
diff --git a/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/service/WidgetCatalogServiceTest.java b/ecomp-portal-widget-ms/widget-ms/src/test/java/org/openecomp/portalapp/widget/test/service/WidgetCatalogServiceTest.java
deleted file mode 100644 (file)
index 92bcf80..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*-
- * ============LICENSE_START==========================================
- * ONAP Portal
- * ===================================================================
- * Copyright © 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============================================
- *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- */
-package org.openecomp.portalapp.widget.test.service;
-
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.hibernate.Criteria;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.openecomp.portalapp.widget.domain.RoleApp;
-import org.openecomp.portalapp.widget.domain.WidgetCatalog;
-import org.openecomp.portalapp.widget.service.impl.WidgetCatalogServiceImpl;
-
-
-@RunWith(MockitoJUnitRunner.class)
-public class WidgetCatalogServiceTest {
-       
-       @Mock
-       private SessionFactory mockedSessionFactory;
-
-       @InjectMocks
-       private WidgetCatalogServiceImpl widgetCatalogService;
-
-       @Before
-       public void setUp() {
-               MockitoAnnotations.initMocks(this);
-       }
-       
-       @Test
-       public void getWidgetCatalog_NoError() throws Exception{
-               Session mockedSession = Mockito.mock(Session.class);
-               Criteria mockedCriteria = Mockito.mock(Criteria.class);
-               
-               List<WidgetCatalog> list = new ArrayList<WidgetCatalog>();
-               WidgetCatalog widget = new WidgetCatalog();
-               widget.setId(1);
-               widget.setName("junit");
-               list.add(widget);
-               
-               Mockito.when(mockedSessionFactory.getCurrentSession()).thenReturn(mockedSession);
-               Mockito.when(mockedSession.createCriteria(WidgetCatalog.class)).thenReturn(mockedCriteria);
-               Mockito.when(mockedCriteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)).thenReturn(mockedCriteria);
-               Mockito.when(mockedCriteria.list()).thenReturn(list);
-               
-               List<WidgetCatalog> result = widgetCatalogService.getWidgetCatalog();
-               assertNotNull(result);
-               assertEquals(result, list);
-       }
-       
-       
-       @Test
-       public void saveWidgetCatalog_NoError() throws Exception{
-               Set<RoleApp> set = new HashSet<RoleApp>();
-               WidgetCatalog widget = new WidgetCatalog();
-               widget.setId(1);
-               widget.setName("junit");
-               widget.setAllowAllUser("1");
-               widget.setWidgetRoles(set);
-               
-               Session mockedSession = Mockito.mock(Session.class);
-               Transaction mockedTransaction = Mockito.mock(Transaction.class);
-               Mockito.when(mockedSessionFactory.openSession()).thenReturn(mockedSession);
-               Mockito.when(mockedSession.beginTransaction()).thenReturn(mockedTransaction);
-               long widgetId = widgetCatalogService.saveWidgetCatalog(widget);
-               assertNotNull(widgetId);
-               assertEquals(widgetId, 1);
-       }
-       
-       @Rule public ExpectedException thrown = ExpectedException.none();
-       
-       
-       @Test
-       public void deleteWidgetCatalog_NoError() throws Exception{
-               long widgetId =1 ;
-               WidgetCatalog widget = new WidgetCatalog();
-               widget.setId(1);
-               widget.setName("junit");
-
-               Session mockedSession = Mockito.mock(Session.class, RETURNS_DEEP_STUBS);
-               Transaction mockedTransaction = Mockito.mock(Transaction.class);
-               
-               Mockito.when(mockedSessionFactory.getCurrentSession()).thenReturn(mockedSession);
-               Mockito.when(mockedSession.beginTransaction()).thenReturn(mockedTransaction);
-               Mockito.when(mockedSession.get(WidgetCatalog.class, widgetId)).thenReturn(widget);
-               
-               widgetCatalogService.deleteWidgetCatalog(widgetId);
-       }
-       
-       @Test
-       public void updateWidgetCatalog_NoError() throws Exception{
-               long widgetId =1 ;
-               WidgetCatalog widget = new WidgetCatalog();
-               widget.setId(1);
-               widget.setName("junit");
-
-               Session mockedSession = Mockito.mock(Session.class, RETURNS_DEEP_STUBS);
-               Transaction mockedTransaction = Mockito.mock(Transaction.class);
-               
-               Mockito.when(mockedSessionFactory.getCurrentSession()).thenReturn(mockedSession);
-               Mockito.when(mockedSession.beginTransaction()).thenReturn(mockedTransaction);
-               Mockito.when(mockedSession.get(WidgetCatalog.class, widgetId)).thenReturn(widget);
-               
-               widgetCatalogService.deleteWidgetCatalog(widgetId);
-       }
-       
-       
-}
diff --git a/pom.xml b/pom.xml
index b70ce3e..0bc0828 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,6 @@
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
 
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
 
-
        <parent>
                <groupId>org.onap.oparent</groupId>
                <artifactId>oparent</artifactId>
        <parent>
                <groupId>org.onap.oparent</groupId>
                <artifactId>oparent</artifactId>
                <relativePath />
        </parent>
 
                <relativePath />
        </parent>
 
-
        <groupId>org.onap.portal</groupId>
        <artifactId>onap-portal-parent</artifactId>
        <groupId>org.onap.portal</groupId>
        <artifactId>onap-portal-parent</artifactId>
-       <version>1.3.0</version>
+       <version>2.2</version>
        <packaging>pom</packaging>
        <name>portal</name>
 
        <packaging>pom</packaging>
        <name>portal</name>
 
@@ -27,9 +25,9 @@
        </modules>
 
        <properties>
        </modules>
 
        <properties>
-               <!-- Jenkins SHOULD invoke mvn with argument -Dbuild.number=${BUILD_NUMBER} -->
+               <!-- Jenkins should invoke mvn with argument -Dbuild.number=${BUILD_NUMBER} -->
                <build.number>0</build.number>
                <build.number>0</build.number>
-               <epsdk.version>1.3.1</epsdk.version>
+               <epsdk.version>2.1.0</epsdk.version>
                <springframework.version>4.2.0.RELEASE</springframework.version>
                <hibernate.version>4.3.11.Final</hibernate.version>
                <fasterxml.version>2.7.4</fasterxml.version>
                <springframework.version>4.2.0.RELEASE</springframework.version>
                <hibernate.version>4.3.11.Final</hibernate.version>
                <fasterxml.version>2.7.4</fasterxml.version>
                        <url>dav:https://nexus.onap.org/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</url>
                </site>
        </distributionManagement>
                        <url>dav:https://nexus.onap.org/content/sites/site/${project.groupId}/${project.artifactId}/${project.version}</url>
                </site>
        </distributionManagement>
-
 </project>
 </project>
index a254b21..c45e658 100644 (file)
@@ -2,8 +2,8 @@
 # Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
 # because they are used in Jenkins, whose plug-in doesn't support
 
 # Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
 # because they are used in Jenkins, whose plug-in doesn't support
 
-major=1
-minor=3
+major=2
+minor=2
 patch=0
 
 base_version=${major}.${minor}.${patch}
 patch=0
 
 base_version=${major}.${minor}.${patch}